diff mbox series

[U-Boot,v2,10/38] spl: Set up the bloblist in board_init_r()

Message ID 20190925141147.191166-11-sjg@chromium.org
State Accepted
Commit 3cd71981531a767e5109368fede61931944bdb5c
Delegated to: Bin Meng
Headers show
Series x86: Various modifications to prepare for FSP2 | expand

Commit Message

Simon Glass Sept. 25, 2019, 2:11 p.m. UTC
At present the bloblist is set up in spl_common_init() which can be called
from spl_early_init(), i.e. before SDRAM is ready. This prevents the
bloblist from being located in SDRAM, which is useful on some platforms
where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region).

It doesn't serve much purpose to have the bloblist available early, since
very little is known about the platform then, and the handoff info is
written when SPL is about to jump to U-Boot.

Move the code to board_init_r() to avoid any restrictions.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 common/spl/spl.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

Comments

Bin Meng Oct. 2, 2019, 1:58 p.m. UTC | #1
On Wed, Sep 25, 2019 at 10:12 PM Simon Glass <sjg@chromium.org> wrote:
>
> At present the bloblist is set up in spl_common_init() which can be called
> from spl_early_init(), i.e. before SDRAM is ready. This prevents the
> bloblist from being located in SDRAM, which is useful on some platforms
> where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region).
>
> It doesn't serve much purpose to have the bloblist available early, since
> very little is known about the platform then, and the handoff info is
> written when SPL is about to jump to U-Boot.
>
> Move the code to board_init_r() to avoid any restrictions.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2: None
>
>  common/spl/spl.c | 35 ++++++++++++++++++-----------------
>  1 file changed, 18 insertions(+), 17 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Oct. 3, 2019, 7:38 a.m. UTC | #2
On Wed, Oct 2, 2019 at 9:58 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Sep 25, 2019 at 10:12 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > At present the bloblist is set up in spl_common_init() which can be called
> > from spl_early_init(), i.e. before SDRAM is ready. This prevents the
> > bloblist from being located in SDRAM, which is useful on some platforms
> > where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region).
> >
> > It doesn't serve much purpose to have the bloblist available early, since
> > very little is known about the platform then, and the handoff info is
> > written when SPL is about to jump to U-Boot.
> >
> > Move the code to board_init_r() to avoid any restrictions.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> > Changes in v2: None
> >
> >  common/spl/spl.c | 35 ++++++++++++++++++-----------------
> >  1 file changed, 18 insertions(+), 17 deletions(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86/next, thanks!
diff mbox series

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 730cd6b3084..5fdd6d0d032 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -410,23 +410,6 @@  static int spl_common_init(bool setup_malloc)
 		return ret;
 	}
 #endif
-	if (CONFIG_IS_ENABLED(BLOBLIST)) {
-		ret = bloblist_init();
-		if (ret) {
-			debug("%s: Failed to set up bloblist: ret=%d\n",
-			      __func__, ret);
-			return ret;
-		}
-	}
-	if (CONFIG_IS_ENABLED(HANDOFF)) {
-		int ret;
-
-		ret = setup_spl_handoff();
-		if (ret) {
-			puts(SPL_TPL_PROMPT "Cannot set up SPL handoff\n");
-			hang();
-		}
-	}
 	if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
 		ret = fdtdec_setup();
 		if (ret) {
@@ -604,6 +587,24 @@  void board_init_r(gd_t *dummy1, ulong dummy2)
 	 */
 	timer_init();
 #endif
+	if (CONFIG_IS_ENABLED(BLOBLIST)) {
+		ret = bloblist_init();
+		if (ret) {
+			debug("%s: Failed to set up bloblist: ret=%d\n",
+			      __func__, ret);
+			puts(SPL_TPL_PROMPT "Cannot set up bloblist\n");
+			hang();
+		}
+	}
+	if (CONFIG_IS_ENABLED(HANDOFF)) {
+		int ret;
+
+		ret = setup_spl_handoff();
+		if (ret) {
+			puts(SPL_TPL_PROMPT "Cannot set up SPL handoff\n");
+			hang();
+		}
+	}
 
 #if CONFIG_IS_ENABLED(BOARD_INIT)
 	spl_board_init();