Skip to contentSkip to conversation

board: freescale: fix LS1021a build

PATCH New Peng Fan (OSS) 1 participant 1 message Feb 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 board: freescale: fix LS1021a build

From: Benjamin Lemouzy <[email protected]>

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.

---

V2:
Use CONFIG_IS_ENABLED

 board/freescale/ls1021atsn/ls1021atsn.c | 15 ++++++++-------
 board/freescale/ls1021atwr/ls1021atwr.c | 15 ++++++++-------
 2 files changed, 16 insertions(+), 14 deletions(-)
board/freescale/ls1021atsn/ls1021atsn.c +8 -7
index d1acccec110..c92430c0896 100644
@@ -166,10 +166,9 @@ void board_init_f(ulong dummy)
 
 	get_clocks();
 
-#if defined(CONFIG_DEEP_SLEEP)
-	if (is_warm_boot())
-		fsl_dp_disable_console();
-#endif
+	if (CONFIG_IS_ENABLED(DEEP_SLEEP))
+		if (is_warm_boot())
+			fsl_dp_disable_console();
 
 	preloader_console_init();
 
@@ -187,9 +186,11 @@ void board_init_f(ulong dummy)
 	 * it from SD since it has already been reserved in memory
 	 * in last boot.
 	 */
-	if (is_warm_boot()) {
-		second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
-		second_uboot();
+	if (CONFIG_IS_ENABLED(DEEP_SLEEP)) {
+		if (is_warm_boot()) {
+			second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
+			second_uboot();
+		}
 	}
 
 	board_init_r(NULL, 0);
board/freescale/ls1021atwr/ls1021atwr.c +8 -7
index cc9665c0410..0758e5eae25 100644
@@ -417,10 +417,9 @@ void board_init_f(ulong dummy)
 
 	get_clocks();
 
-#if defined(CONFIG_DEEP_SLEEP)
-	if (is_warm_boot())
-		fsl_dp_disable_console();
-#endif
+	if (CONFIG_IS_ENABLED(DEEP_SLEEP))
+		if (is_warm_boot())
+			fsl_dp_disable_console();
 
 	preloader_console_init();
 
@@ -438,9 +437,11 @@ void board_init_f(ulong dummy)
 	 * it from SD since it has already been reserved in memeory
 	 * in last boot.
 	 */
-	if (is_warm_boot()) {
-		second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
-		second_uboot();
+	if (CONFIG_IS_ENABLED(DEEP_SLEEP)) {
+		if (is_warm_boot()) {
+			second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
+			second_uboot();
+		}
 	}
 
 	board_init_r(NULL, 0);
Signature · 1 line
2.35.3