The DT used by U-Boot may be different from the DT being passed to
the OS if the DT is loaded from external media such as network or
mmc. In that case, the reserved-memory node needs to be copied to
the DT passed to the OS.

Signed-off-by: Atish Patra <atish.pa...@wdc.com>
---
 arch/riscv/lib/bootm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 5e907e96701c..1ca8370849a0 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -118,6 +118,11 @@ int arch_fixup_fdt(void *blob)
        fdt_setprop_u32(blob, chosen_offset, "boot-hartid",
                           gd->arch.boot_hart);
 
+       /* Copy the reserved-memory node to the DT used by OS */
+       err = riscv_fdt_copy_resv_mem_node(gd->fdt_blob, blob);
+       if (err < 0)
+               return err;
+
        return 0;
 }
 
-- 
2.25.1

Reply via email to