Skip to contentSkip to conversation

arm: add a weak function reset_cpu

PATCH New Peng Fan 2 participants 6 messages Jan 4, 2016 – Jan 7, 2016 Arm (32-bit)

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/2 arm: add a weak function reset_cpu

This commit 4bdcbe60a142b08eefccb0e326a37ba81d3389e8 removes reset_cpu which breaks SPL build when DEBUG macro defined.

Introudce a weak function reset_cpu to avoid build failure when building SPL for i.MX with DEBUG enabled.
"
arch/arm/lib/built-in.o: In function `do_reset':
~/uboot/arch/arm/lib/reset.c:45: undefined reference to `reset_cpu' scripts/Makefile.spl:244: recipe for target 'spl/u-boot-spl' failed "

Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/lib/reset.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/lib/reset.c +4 -0
index 9a95f08..4dd0131 100644
@@ -27,6 +27,10 @@ __weak void reset_misc(void)
 {
 }
 
+__weak void reset_cpu(ulong addr)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");
Signature · 1 line
2.6.2
author
#1 lore raw

PATCH 2/2 imx: mx6ul: disable VIDEO for SPL

With DEBUG macro enabled, SPL build failure:
"
arch/arm/cpu/armv7/built-in.o: In function `reset_misc':
~/uboot/arch/arm/cpu/armv7/mx6/soc.c:406: undefined reference to `lcdif_power_down' scripts/Makefile.spl:244: recipe for target 'spl/u-boot-spl' failed
"
Wrap VIDEO settings with ifndef CONFIG_SPL_BUILD

Cc Stefano Babic <[email protected]>
---
 include/configs/mx6ul_14x14_evk.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/mx6ul_14x14_evk.h +2 -0
index 5779632..a4f624c 100644
@@ -243,6 +243,7 @@
 
 #define CONFIG_IMX_THERMAL
 
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_VIDEO
 #ifdef CONFIG_VIDEO
 #define CONFIG_CFB_CONSOLE
@@ -259,5 +260,6 @@
 #define CONFIG_VIDEO_BMP_LOGO
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 #endif
+#endif
 
 #endif
Signature · 1 line
2.6.2
#2 lore raw

PATCH 2/2 imx: mx6ul: disable VIDEO for SPL

Quoted 28 lines · Peng Fan

With DEBUG macro enabled, SPL build failure:
"
arch/arm/cpu/armv7/built-in.o: In function `reset_misc':
~/uboot/arch/arm/cpu/armv7/mx6/soc.c:406: undefined reference to `lcdif_power_down' scripts/Makefile.spl:244: recipe for target 'spl/u-boot-spl' failed
"
Wrap VIDEO settings with ifndef CONFIG_SPL_BUILD

Cc Stefano Babic <[email protected]>
---
 include/configs/mx6ul_14x14_evk.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/mx6ul_14x14_evk.h +1 -0
index 5779632..a4f624c 100644
@@ -243,6 +243,7 @@
 
 #define CONFIG_IMX_THERMAL
 
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_VIDEO
 #ifdef CONFIG_VIDEO
 #define CONFIG_CFB_CONSOLE

include/configs/mx6ul_14x14_evk.h line 265

Quoted 6 lines
include/configs/mx6ul_14x14_evk.h +1 -0
@@ -259,5 +260,6 @@
 #define CONFIG_VIDEO_BMP_LOGO
 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
 #endif
+#endif
 
 #endif

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 2/2 imx: mx6ul: disable VIDEO for SPL

In reply to Peng Fan
Quoted 11 lines · Peng Fan

With DEBUG macro enabled, SPL build failure:
"
arch/arm/cpu/armv7/built-in.o: In function `reset_misc':
~/uboot/arch/arm/cpu/armv7/mx6/soc.c:406: undefined reference to `lcdif_power_down' scripts/Makefile.spl:244: recipe for target 'spl/u-boot-spl' failed
"
Wrap VIDEO settings with ifndef CONFIG_SPL_BUILD

Cc Stefano Babic <[email protected]>

---

Applied (fix) to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#4 lore raw

PATCH 1/2 arm: add a weak function reset_cpu

In reply to Peng Fan

Hi Peng,

Quoted 10 lines · Peng Fan

This commit 4bdcbe60a142b08eefccb0e326a37ba81d3389e8 removes reset_cpu which breaks SPL build when DEBUG macro defined.

Introudce a weak function reset_cpu to avoid build failure when building SPL for i.MX with DEBUG enabled.
"
arch/arm/lib/built-in.o: In function `do_reset':
~/uboot/arch/arm/lib/reset.c:45: undefined reference to `reset_cpu' scripts/Makefile.spl:244: recipe for target 'spl/u-boot-spl' failed "

I do not like to add a weak function just to fix the build, if this is not strictly necessary. IMHO the build fails because we moved reset_cpu() inside the watchdog driver to make it available for all CPUs. Is imx_watchdog not built together with SPL ?

Quoted 15 lines
Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/lib/reset.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/lib/reset.c +0 -0
index 9a95f08..4dd0131 100644

arch/arm/lib/reset.c __weak void reset_misc(void) · line 36

Quoted 10 lines
arch/arm/lib/reset.c +4 -0
@@ -27,6 +27,10 @@ __weak void reset_misc(void)
 {
 }
 
+__weak void reset_cpu(ulong addr)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
author
#5 lore raw

PATCH 1/2 arm: add a weak function reset_cpu

Hi Stefano,

Quoted 14 lines · Stefano Babic

Hi Peng,

Quoted 10 lines · Peng Fan

This commit 4bdcbe60a142b08eefccb0e326a37ba81d3389e8 removes reset_cpu which breaks SPL build when DEBUG macro defined.

Introudce a weak function reset_cpu to avoid build failure when building SPL for i.MX with DEBUG enabled.
"
arch/arm/lib/built-in.o: In function `do_reset':
~/uboot/arch/arm/lib/reset.c:45: undefined reference to `reset_cpu' scripts/Makefile.spl:244: recipe for target 'spl/u-boot-spl' failed "

Quoted 4 lines

I do not like to add a weak function just to fix the build, if this is not strictly necessary. IMHO the build fails because we moved reset_cpu() inside the watchdog driver to make it available for all CPUs. Is imx_watchdog not built together with SPL ?

Will switch to enable "#define CONFIG_SPL_WATCHDOG_SUPPORT" in imx6_spl.h to fix this issue.

Thanks,
Peng.

Quoted 36 lines
Quoted 16 lines
Cc Albert Aribaud <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/lib/reset.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/lib/reset.c +0 -0
index 9a95f08..4dd0131 100644

arch/arm/lib/reset.c __weak void reset_misc(void) · line 36

Quoted 10 lines
arch/arm/lib/reset.c +4 -0
@@ -27,6 +27,10 @@ __weak void reset_misc(void)
 {
 }
 
+__weak void reset_cpu(ulong addr)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	puts ("resetting ...\n");

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================