diff --git a/src/dtb.cpp b/src/dtb.cpp index 4d1ef758e..1ef881d5d 100644 --- a/src/dtb.cpp +++ b/src/dtb.cpp @@ -139,6 +139,20 @@ void dtb_init(const machine_config &c, unsigned char *dtb_start, uint64_t dtb_le fdt.end_node(); } + { // reserved memory + fdt.begin_node("reserved-memory"); + fdt.prop_u32("#address-cells", 2); + fdt.prop_u32("#size-cells", 2); + fdt.prop_empty("ranges"); + { // reserve 256KB for firmware M-mode code (such as OpenSBI) + fdt.begin_node_num("fw_resv", PMA_RAM_START); + fdt.prop_u64_list<2>("reg", {PMA_RAM_START, 0x40000}); + fdt.prop_empty("no-map"); + fdt.end_node(); + } + fdt.end_node(); + } + // drives int drive_index = 0; for (const auto &f : c.flash_drive) {