* [PATCH] board: freescale: fix LS1021a build
@ 2025-02-17 15:36 blemouzy.ml
2025-02-28 4:10 ` Peng Fan
0 siblings, 1 reply; 3+ messages in thread
From: blemouzy.ml @ 2025-02-17 15:36 UTC (permalink / raw)
To: u-boot; +Cc: alison.wang, sjg, trini, olteanv, Benjamin Lemouzy
From: Benjamin Lemouzy <blemouzy@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 <blemouzy@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
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
board_init_r(NULL, 0);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] board: freescale: fix LS1021a build
2025-02-17 15:36 [PATCH] board: freescale: fix LS1021a build blemouzy.ml
@ 2025-02-28 4:10 ` Peng Fan
2025-02-28 8:16 ` Benjamin Lemouzy
0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan @ 2025-02-28 4:10 UTC (permalink / raw)
To: blemouzy.ml; +Cc: u-boot, alison.wang, sjg, trini, olteanv, Benjamin Lemouzy
On Mon, Feb 17, 2025 at 04:36:03PM +0100, blemouzy.ml@gmail.com wrote:
>From: Benjamin Lemouzy <blemouzy@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 <blemouzy@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.
>
> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] board: freescale: fix LS1021a build
2025-02-28 4:10 ` Peng Fan
@ 2025-02-28 8:16 ` Benjamin Lemouzy
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Lemouzy @ 2025-02-28 8:16 UTC (permalink / raw)
To: Peng Fan; +Cc: u-boot, alison.wang, sjg, trini, olteanv, Benjamin Lemouzy
Hi Peng,
On Fri, 28 Feb 2025 12:10:01 +0800
Peng Fan <peng.fan@oss.nxp.com> wrote:
> On Mon, Feb 17, 2025 at 04:36:03PM +0100, blemouzy.ml@gmail.com wrote:
> >From: Benjamin Lemouzy <blemouzy@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 <blemouzy@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
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-28 8:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-17 15:36 [PATCH] board: freescale: fix LS1021a build blemouzy.ml
2025-02-28 4:10 ` Peng Fan
2025-02-28 8:16 ` Benjamin Lemouzy
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.