All of lore.kernel.org
 help / color / mirror / Atom feed
From: Urja Rannikko <urjaman@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/4] rockchip: spl-boot-order: do not attempt to access fdt if OF_PLATDATA
Date: Wed, 13 May 2020 19:15:22 +0000	[thread overview]
Message-ID: <20200513191523.3141-4-urjaman@gmail.com> (raw)
In-Reply-To: <20200513191523.3141-1-urjaman@gmail.com>

gd->fdt_blob is null if using OF_PLATDATA in SPL, which causes a hang
after f0921f5098 ("fdt: Sync up to the latest libfdt").
We use the same test that is used in spl_common_init on whether to call
fdtdec_setup to unconditionally avoid linking in the fdt-using code
when not necessary and thus reduce SPL size.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
---
 arch/arm/mach-rockchip/spl-boot-order.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-rockchip/spl-boot-order.c b/arch/arm/mach-rockchip/spl-boot-order.c
index c147d5821e..d23829a789 100644
--- a/arch/arm/mach-rockchip/spl-boot-order.c
+++ b/arch/arm/mach-rockchip/spl-boot-order.c
@@ -98,6 +98,12 @@ __weak const char *board_spl_was_booted_from(void)
 
 void board_boot_order(u32 *spl_boot_list)
 {
+	/* In case of no fdt (or only platdata), use spl_boot_device() */
+	if (!CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_PLATDATA)) {
+		spl_boot_list[0] = spl_boot_device();
+		return;
+	}
+
 	const void *blob = gd->fdt_blob;
 	int chosen_node = fdt_path_offset(blob, "/chosen");
 	int idx = 0;
-- 
2.26.2

  parent reply	other threads:[~2020-05-13 19:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 19:15 [PATCH 0/4] Making veyrons boot, 2020 edition Urja Rannikko
2020-05-13 19:15 ` [PATCH 1/4] rockchip: spl: veyron speedy boots from SPI Urja Rannikko
2020-05-15  1:57   ` Kever Yang
2020-05-13 19:15 ` [PATCH 2/4] rockchip: veyron: move board_early_init_f to _r (after reloc) Urja Rannikko
2020-05-15  1:57   ` Kever Yang
2020-05-13 19:15 ` Urja Rannikko [this message]
2020-05-15  1:57   ` [PATCH 3/4] rockchip: spl-boot-order: do not attempt to access fdt if OF_PLATDATA Kever Yang
2020-05-13 19:15 ` [PATCH 4/4] defconfig: veyron: no need for CONFIG_SPL_PINCTRL_FULL Urja Rannikko
2020-05-15  1:58   ` Kever Yang

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=20200513191523.3141-4-urjaman@gmail.com \
    --to=urjaman@gmail.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.