Skip to contentSkip to conversation

powerpc: mpc85xx: Fix compilation with CONFIG_WDT

PATCH In review Pali Rohár 1 participant 2 messages Apr 28, 2022 – Jun 4, 2022 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: mpc85xx: Fix compilation with CONFIG_WDT

When CONFIG_WDT is enabled then non-DM watchdog code cannot be used due to conflicting functions like watchdog_reset(). So disable compilation of mpc85xx watchdog_reset() function when CONFIG_WDT is enabled.

---
 arch/powerpc/cpu/mpc85xx/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/cpu/mpc85xx/cpu.c +2 -0
index 261f79e40585..226a26ba320a 100644
@@ -348,6 +348,7 @@ __weak unsigned long get_tbclk(void)
 }
 
 
+#ifndef CONFIG_WDT
 #if defined(CONFIG_WATCHDOG)
 #define WATCHDOG_MASK (TCR_WP(63) | TCR_WRC(3) | TCR_WIE)
 void
@@ -376,6 +377,7 @@ watchdog_reset(void)
 		enable_interrupts();
 }
 #endif	/* CONFIG_WATCHDOG */
+#endif
 
 /*
  * Initializes on-chip MMC controllers.
Signature · 1 line
2.20.1
#1 lore raw

PING

Quoted 32 lines · On Thursday 28 April 2022 13:31:43 Pali Rohár wrote:

When CONFIG_WDT is enabled then non-DM watchdog code cannot be used due to conflicting functions like watchdog_reset(). So disable compilation of mpc85xx watchdog_reset() function when CONFIG_WDT is enabled.

---
 arch/powerpc/cpu/mpc85xx/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/cpu/mpc85xx/cpu.c +2 -0
index 261f79e40585..226a26ba320a 100644
@@ -348,6 +348,7 @@ __weak unsigned long get_tbclk(void)
 }
 
 
+#ifndef CONFIG_WDT
 #if defined(CONFIG_WATCHDOG)
 #define WATCHDOG_MASK (TCR_WP(63) | TCR_WRC(3) | TCR_WIE)
 void
@@ -376,6 +377,7 @@ watchdog_reset(void)
 		enable_interrupts();
 }
 #endif	/* CONFIG_WATCHDOG */
+#endif
 
 /*
  * Initializes on-chip MMC controllers.
Signature · 1 line
2.20.1