All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atish Patra <atish.patra@wdc.com>
To: u-boot@lists.denx.de
Subject: [PATCH v5 5/6] riscv: Copy the reserved-memory nodes to final DT
Date: Mon,  6 Apr 2020 13:44:52 -0700	[thread overview]
Message-ID: <20200406204453.231945-6-atish.patra@wdc.com> (raw)
In-Reply-To: <20200406204453.231945-1-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 <atish.patra@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
 arch/riscv/lib/bootm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 87cadad5016d..8ff8db6bf533 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;
 }
 
-- 
2.25.1

  parent reply	other threads:[~2020-04-06 20:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 20:44 [PATCH v5 0/6] RISC-V DT related fixes for reserved memory & UEFI Atish Patra
2020-04-06 20:44 ` [PATCH v5 3/6] riscv: Provide a mechanism to fix DT for reserved memory Atish Patra
2020-04-06 20:44 ` Atish Patra [this message]
2020-04-06 20:44 ` [PATCH v5 6/6] riscv: Move all fdt fixups together Atish Patra
2020-04-06 21:01 ` [PATCH v5 0/6] RISC-V DT related fixes for reserved memory & UEFI Ard Biesheuvel
2020-04-07  6:41   ` Heinrich Schuchardt
2020-04-07  6:51     ` Ard Biesheuvel
2020-04-07 17:35       ` Atish Patra
2020-04-13 22:02         ` Atish Patra
2020-04-13 22:41           ` Bin Meng
2020-04-14 23:18             ` Atish Patra
     [not found]               ` <752D002CFF5D0F4FA35C0100F1D73F3FA46F743A@ATCPCS16.andestech.com>
2020-04-17  0:51                 ` Rick Chen
2020-04-17  1:10                   ` Bin Meng
2020-04-17  1:12                     ` Rick Chen
2020-04-17  2:12                       ` Bin Meng
2020-04-17  2:14                         ` Bin Meng
2020-04-17  2:26                           ` Bin Meng
2020-04-18  6:13                             ` Atish Patra
     [not found] ` <20200406204453.231945-2-atish.patra@wdc.com>
2020-04-13 23:04   ` [PATCH v5 1/6] riscv: Add boot hartid to Device tree Heinrich Schuchardt
2020-04-13 23:08     ` Bin Meng
2020-04-14 10:56       ` Auer, Lukas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200406204453.231945-6-atish.patra@wdc.com \
    --to=atish.patra@wdc.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.