Skip to contentSkip to conversation

sunxi: Avoid duplicate reset_cpu with SYSRESET enabled

PATCH In review Samuel Holland 2 participants 2 messages Aug 22, 2021 – Oct 27, 2021

Subsystems (3)
lore
Share & tools
lore

Samuel Holland

author maintainer
#0 lore raw

PATCH 1/1 sunxi: Avoid duplicate reset_cpu with SYSRESET enabled

The sysreset uclass unconditionally provides a definition of the reset_cpu() function. So does the sunxi board code. Omit our definition when SYSRESET is enabled. This allows the build to succeed, even though sysreset may not yet be functional due to a lack of back-end drivers.

---

 arch/arm/mach-sunxi/board.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-sunxi/board.c +2 -0
index d9b04f75fc4..f867a28c30c 100644
@@ -347,6 +347,7 @@ void board_init_f(ulong dummy)
 }
 #endif
 
+#if !CONFIG_IS_ENABLED(SYSRESET)
 void reset_cpu(void)
 {
 #if defined(CONFIG_SUNXI_GEN_SUN4I) || defined(CONFIG_MACH_SUN8I_R40)
@@ -377,6 +378,7 @@ void reset_cpu(void)
 	while (1) { }
 #endif
 }
+#endif
 
 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) && !defined(CONFIG_ARM64)
 void enable_caches(void)
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Samuel Holland

The sysreset uclass unconditionally provides a definition of the reset_cpu() function. So does the sunxi board code. Omit our definition when SYSRESET is enabled. This allows the build to succeed, even though sysreset may not yet be functional due to a lack of back-end drivers.

Quoted 26 lines

---

  arch/arm/mach-sunxi/board.c | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-sunxi/board.c +2 -0
index d9b04f75fc4..f867a28c30c 100644
@@ -347,6 +347,7 @@ void board_init_f(ulong dummy)
  }
  #endif
 
+#if !CONFIG_IS_ENABLED(SYSRESET)
  void reset_cpu(void)
  {
  #if defined(CONFIG_SUNXI_GEN_SUN4I) || defined(CONFIG_MACH_SUN8I_R40)
@@ -377,6 +378,7 @@ void reset_cpu(void)
  	while (1) { }
  #endif
  }
+#endif
 
  #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) && !defined(CONFIG_ARM64)
  void enable_caches(void)