summaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-04-21 11:15:03 -0700
committerAndes <uboot@andestech.com>2020-04-23 10:14:16 +0800
commit73d756fd224666e6fa029920f3aaf9cbfab71cb5 (patch)
treed8dea2c299993682270d8e3f7f72152ed13ccb56 /arch/riscv
parent0cb27856d12ff1350996f93015972203b24387cc (diff)
downloadu-boot-73d756fd224666e6fa029920f3aaf9cbfab71cb5.tar.gz
u-boot-73d756fd224666e6fa029920f3aaf9cbfab71cb5.tar.bz2
u-boot-73d756fd224666e6fa029920f3aaf9cbfab71cb5.zip
riscv: Copy the reserved-memory nodes to final DT
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.patra@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/lib/bootm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 87cadad501..8ff8db6bf5 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -28,8 +28,8 @@ __weak void board_quiesce_devices(void)
int arch_fixup_fdt(void *blob)
{
-#ifdef CONFIG_EFI_LOADER
int err;
+#ifdef CONFIG_EFI_LOADER
u32 size;
int chosen_offset;
@@ -50,6 +50,12 @@ int arch_fixup_fdt(void *blob)
/* Overwrite the boot-hartid as U-Boot is the last stage BL */
fdt_setprop_u32(blob, chosen_offset, "boot-hartid", gd->arch.boot_hart);
#endif
+
+ /* 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;
}