diff mbox series

[v3,5/5] riscv: Copy the reserved-memory nodes to final DT

Message ID 20200317211946.28062-6-atish.patra@wdc.com
State New
Headers show
Series DT related fixes for RISC-V UEFI | expand

Commit Message

Atish Patra March 17, 2020, 9:19 p.m. UTC
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 at wdc.com>
---
 arch/riscv/lib/bootm.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Bin Meng March 19, 2020, 2:32 p.m. UTC | #1
On Wed, Mar 18, 2020 at 5:19 AM Atish Patra <atish.patra at wdc.com> wrote:
>
> 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 at wdc.com>
> ---
>  arch/riscv/lib/bootm.c | 5 +++++
>  1 file changed, 5 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

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;
 }