From patchwork Tue Mar 17 21:19:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 243750 List-Id: U-Boot discussion From: atish.patra at wdc.com (Atish Patra) Date: Tue, 17 Mar 2020 14:19:46 -0700 Subject: [PATCH v3 5/5] riscv: Copy the reserved-memory nodes to final DT In-Reply-To: <20200317211946.28062-1-atish.patra@wdc.com> References: <20200317211946.28062-1-atish.patra@wdc.com> Message-ID: <20200317211946.28062-6-atish.patra@wdc.com> 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 Reviewed-by: Bin Meng --- 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; }