diff options
| author | Bin Meng <[email protected]> | 2020-03-17 07:59:40 -0700 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2020-03-18 09:19:44 +0530 |
| commit | fcb1dedb2d4d2f2d77a165b1078244caf13363be (patch) | |
| tree | dc52d9af343ed4560c95b34ed6ac9114b1f6a758 /include/sbi_utils | |
| parent | dce88467af77ed60e7b31ab3a9423fe640b8553c (diff) | |
lib: utils: Add a fdt_reserved_memory_fixup() helper
Add a helper routine to insert a child node of the reserved memory
node in the device tree that describes the protected memory region
done by OpenSBI via PMP.
Signed-off-by: Bin Meng <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'include/sbi_utils')
| -rw-r--r-- | include/sbi_utils/fdt/fdt_helper.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h new file mode 100644 index 00000000..a6c30735 --- /dev/null +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: BSD-2-Clause +/* + * fdt_helper.h - Flat Device Tree manipulation helper routines + * Implement helper routines on top of libfdt for OpenSBI usage + * + * Copyright (C) 2020 Bin Meng <[email protected]> + */ + +#ifndef __FDT_HELPER_H__ +#define __FDT_HELPER_H__ + +/** + * Fix up the reserved memory node in the device tree + * + * This routine inserts a child node of the reserved memory node in the device + * tree that describes the protected memory region done by OpenSBI via PMP. + * + * It is recommended that platform codes call this helper in their final_init() + * + * @param fdt: device tree blob + * @return zero on success and -ve on failure + */ +int fdt_reserved_memory_fixup(void *fdt); + +#endif /* __FDT_HELPER_H__ */ |
