Hi Peng, On Fri, 28 Feb 2025 12:10:01 +0800 Peng Fan <peng....@oss.nxp.com> wrote:
> On Mon, Feb 17, 2025 at 04:36:03PM +0100, blemouzy...@gmail.com wrote: > >From: Benjamin Lemouzy <blemo...@centralp.fr> > > > >Fix build error "undefined reference to `is_warm_boot'" when > >ls1021atsn and ls1021atwr boards are built with CONFIG_SPL=y and > >CONFIG_DEEP_SLEEP=n. > > > >Signed-off-by: Benjamin Lemouzy <blemo...@centralp.fr> > >--- > > board/freescale/ls1021atsn/ls1021atsn.c | 4 ++++ > > board/freescale/ls1021atwr/ls1021atwr.c | 4 ++++ > > 2 files changed, 8 insertions(+) > > > >diff --git a/board/freescale/ls1021atsn/ls1021atsn.c > >b/board/freescale/ls1021atsn/ls1021atsn.c > >index d1acccec11..6d64df7cc4 100644 > >--- a/board/freescale/ls1021atsn/ls1021atsn.c > >+++ b/board/freescale/ls1021atsn/ls1021atsn.c > >@@ -159,7 +159,9 @@ int board_early_init_f(void) > > #ifdef CONFIG_XPL_BUILD > > void board_init_f(ulong dummy) > > { > >+#if defined(CONFIG_DEEP_SLEEP) > > void (*second_uboot)(void); > >+#endif > > > > /* Clear the BSS */ > > memset(__bss_start, 0, __bss_end - __bss_start); > >@@ -181,6 +183,7 @@ void board_init_f(ulong dummy) > > enable_layerscape_ns_access(); > > #endif > > > >+#if defined(CONFIG_DEEP_SLEEP) > > /* > > * if it is woken up from deep sleep, then jump to second > > * stage U-Boot and continue executing without recopying > >@@ -191,6 +194,7 @@ void board_init_f(ulong dummy) > > second_uboot = (void (*)(void))CONFIG_TEXT_BASE; > > second_uboot(); > > } > >+#endif > > Please use 'if (CONFIG_IS_ENABLED(DEEP_SLEEP) {}' > Then no need guard 'void (*second_uboot)(void)' with if defined. I was torn between using the new syntax and keeping coherency with the rest of the file: I will always use new syntax now! I saw you submitted the V2: thanks for that (and the review). Benjamin > > > > > board_init_r(NULL, 0); > > } > >diff --git a/board/freescale/ls1021atwr/ls1021atwr.c > >b/board/freescale/ls1021atwr/ls1021atwr.c > >index cc9665c041..937e766069 100644 > >--- a/board/freescale/ls1021atwr/ls1021atwr.c > >+++ b/board/freescale/ls1021atwr/ls1021atwr.c > >@@ -410,7 +410,9 @@ int board_early_init_f(void) > > #ifdef CONFIG_XPL_BUILD > > void board_init_f(ulong dummy) > > { > >+#if defined(CONFIG_DEEP_SLEEP) > > void (*second_uboot)(void); > >+#endif > > > > /* Clear the BSS */ > > memset(__bss_start, 0, __bss_end - __bss_start); > >@@ -432,6 +434,7 @@ void board_init_f(ulong dummy) > > enable_layerscape_ns_access(); > > #endif > > > >+#if defined(CONFIG_DEEP_SLEEP) > > /* > > * if it is woken up from deep sleep, then jump to second > > * stage uboot and continue executing without recopying > >@@ -442,6 +445,7 @@ void board_init_f(ulong dummy) > > second_uboot = (void (*)(void))CONFIG_TEXT_BASE; > > second_uboot(); > > } > >+#endif > > Ditto. > > Thanks, > Peng > > > > board_init_r(NULL, 0); > > } > >-- > >2.43.0 > >