All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/7] spl: fix assignment of board info to global data
Date: Thu, 28 Sep 2017 08:42:10 -0700	[thread overview]
Message-ID: <1506613337-19467-2-git-send-email-york.sun@nxp.com> (raw)
In-Reply-To: <1506613337-19467-1-git-send-email-york.sun@nxp.com>

Commit 15eb1d43bf47 ("spl: reorder the assignment of board info to
global data") intended to move assignment of board info earlier,
into board_init_r(). However, function preload_console_init() is
called either from spl_board_init() or from board_init_f(). For the
latter case, the board info assignment is much earlier than proposed
board_init_r(). Create a new function to fill gd->bd and call this
function when needed.

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Lokesh Vutla <lokeshvutla@ti.com>
CC: Ravi Babu <ravibabu@ti.com>
CC: Lukasz Majewski <lukma@denx.de>
CC: Tom Rini <trini@konsulko.com>

---

Changes in v3:
Create new function to fill gd->bd for spl.
Use git commit description style when mentioning previous commit.

Changes in v2:
New patch to fix spl after rebasing to latest master.

 arch/arm/cpu/armv8/fsl-layerscape/spl.c |  1 +
 common/spl/spl.c                        | 10 +++++++++-
 include/spl.h                           |  1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 2776240..2534b4b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -80,6 +80,7 @@ void board_init_f(ulong dummy)
 	get_clocks();
 
 	preloader_console_init();
+	spl_set_bd();
 
 #ifdef CONFIG_SPL_I2C_SUPPORT
 	i2c_init_all();
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4afbe97..aaddddd 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -258,6 +258,12 @@ static int spl_common_init(bool setup_malloc)
 	return 0;
 }
 
+void spl_set_bd(void)
+{
+	if (!gd->bd)
+		gd->bd = &bdata;
+}
+
 int spl_early_init(void)
 {
 	int ret;
@@ -365,7 +371,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	struct spl_image_info spl_image;
 
 	debug(">>spl:board_init_r()\n");
-	gd->bd = &bdata;
+
+	spl_set_bd();
+
 #ifdef CONFIG_SPL_OS_BOOT
 	dram_init_banksize();
 #endif
diff --git a/include/spl.h b/include/spl.h
index ce4cf0a..b14a29c 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -68,6 +68,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 void preloader_console_init(void);
 u32 spl_boot_device(void);
 u32 spl_boot_mode(const u32 boot_device);
+void spl_set_bd(void);
 
 /**
  * spl_set_header_raw_uboot() - Set up a standard SPL image structure
-- 
2.7.4

  reply	other threads:[~2017-09-28 15:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 15:42 [U-Boot] [PATCH v3 0/7] Enable falcon boot for LS1043ARDB York Sun
2017-09-28 15:42 ` York Sun [this message]
2017-10-03 15:08   ` [U-Boot] [PATCH v3 1/7] spl: fix assignment of board info to global data York Sun
2017-10-09  4:44   ` Simon Glass
2017-10-13 18:34   ` York Sun
2017-09-28 15:42 ` [U-Boot] [PATCH v3 2/7] cmd: spl: fix compiling error when CONFIG_CMD_SPL_WRITE_SIZE not defined York Sun
2017-09-28 15:42 ` [U-Boot] [PATCH v3 3/7] armv8: fsl-layerscape: Avoid running dram_init_banksize again York Sun
2017-09-28 15:42 ` [U-Boot] [PATCH v3 4/7] armv8: ls1043ardb: Use static DDR setting for SPL boot York Sun
2017-09-29  7:44   ` Łukasz Majewski
2017-09-29 15:07     ` York Sun
2017-09-29 16:06       ` Łukasz Majewski
2017-09-29 17:05         ` York Sun
2017-09-28 15:42 ` [U-Boot] [PATCH v3 5/7] armv8: layerscape: Enable falcon boot York Sun
2017-09-29  8:02   ` Łukasz Majewski
2017-09-29 15:19     ` York Sun
2017-09-28 15:42 ` [U-Boot] [PATCH v3 6/7] armv8: ls1043ardb: Enable spl_board_init() function York Sun
2017-09-28 15:42 ` [U-Boot] [PATCH v3 7/7] armv8: ls1043ardb_sdcard: prepare falcon boot York Sun

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=1506613337-19467-2-git-send-email-york.sun@nxp.com \
    --to=york.sun@nxp.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.