From: York Sun Date: Thu, 14 Sep 2017 12:01:33 -0700 Subject: [U-Boot] [PATCH v2 1/7] spl: fix assignment of board info to global data In-Reply-To: <1505415699-3401-1-git-send-email-york.sun@nxp.com> References: <1505415699-3401-1-git-send-email-york.sun@nxp.com> Message-ID: <1505415699-3401-2-git-send-email-york.sun@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This partially reverts commit 15eb1d43bf470b85e9031c2fce7e0ce7b27dd321 which 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 board_init_r(). Moving such assignment to board_init_r() would be moving it later. Signed-off-by: York Sun CC: Lokesh Vutla CC: Ravi Babu CC: Lukasz Majewski CC: Tom Rini --- Changes in v2: New patch to fix spl after rebasing to latest master. common/spl/spl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index ce9819e..98b0ca0 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -365,7 +365,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2) struct spl_image_info spl_image; debug(">>spl:board_init_r()\n"); - gd->bd = &bdata; + + if (!gd->bd) + gd->bd = &bdata; + #ifdef CONFIG_SPL_OS_BOOT dram_init_banksize(); #endif @@ -450,6 +453,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) */ void preloader_console_init(void) { + if (!gd->bd) + gd->bd = &bdata; + gd->baudrate = CONFIG_BAUDRATE; serial_init(); /* serial communications setup */ -- 2.7.4