[U-Boot] [PATCH 3/7] powerpc/8xx: cleaning up watchdog
Christophe Leroy
christophe.leroy at c-s.fr
Fri Jan 26 14:06:50 UTC 2018
In preparation of migration to DM watchdog, clean up a bit.
The 8xx watchdog really is a HW watchdog, so declare it as is
then it goes through Kconfig
Signed-off-by: Christophe Leroy <christophe.leroy at c-s.fr>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/cpu/mpc8xx/cpu.c | 20 +++++---------------
arch/powerpc/cpu/mpc8xx/cpu_init.c | 4 +---
include/configs/MCR3000.h | 2 --
include/watchdog.h | 5 -----
5 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 3a2653ff0d..b20837b473 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -34,6 +34,7 @@ config 8xx
bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
+ imply HW_WATCHDOG
endchoice
diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 1e0ea28a91..1883440db3 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -273,26 +273,16 @@ unsigned long get_tbclk(void)
/* ------------------------------------------------------------------------- */
-#if defined(CONFIG_WATCHDOG)
-void watchdog_reset(void)
+#if defined(CONFIG_HW_WATCHDOG)
+void hw_watchdog_reset(void)
{
+ immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
int re_enable = disable_interrupts();
- reset_8xx_watchdog((immap_t __iomem *)CONFIG_SYS_IMMR);
- if (re_enable)
- enable_interrupts();
-}
-#endif /* CONFIG_WATCHDOG */
-
-#if defined(CONFIG_WATCHDOG)
-
-void reset_8xx_watchdog(immap_t __iomem *immr)
-{
- /*
- * All other boards use the MPC8xx Internal Watchdog
- */
out_be16(&immr->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
out_be16(&immr->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
+ if (re_enable)
+ enable_interrupts();
}
#endif /* CONFIG_WATCHDOG */
diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c b/arch/powerpc/cpu/mpc8xx/cpu_init.c
index dc601a1297..aa5bf0d965 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
@@ -28,9 +28,7 @@ void cpu_init_f(immap_t __iomem *immr)
out_be32(&immr->im_siu_conf.sc_sypcr, CONFIG_SYS_SYPCR);
-#if defined(CONFIG_WATCHDOG)
- reset_8xx_watchdog(immr);
-#endif /* CONFIG_WATCHDOG */
+ WATCHDOG_RESET();
/* SIUMCR - contains debug pin configuration (11-6) */
setbits_be32(&immr->im_siu_conf.sc_siumcr, CONFIG_SYS_SIUMCR);
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index 8393dc49c8..f5aeb6f1ff 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -60,8 +60,6 @@
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
-#define CONFIG_WATCHDOG 1 /* watchdog enabled */
-
/* Miscellaneous configurable options */
#define CONFIG_SYS_LONGHELP
diff --git a/include/watchdog.h b/include/watchdog.h
index 64b59f107a..52f4c506b0 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -72,11 +72,6 @@ int init_func_watchdog_reset(void);
* Prototypes from $(CPU)/cpu.c.
*/
-/* MPC 8xx */
-#if defined(CONFIG_8xx) && !defined(__ASSEMBLY__)
- void reset_8xx_watchdog(immap_t __iomem *immr);
-#endif
-
#if defined(CONFIG_HW_WATCHDOG) && !defined(__ASSEMBLY__)
void hw_watchdog_init(void);
#endif
--
2.13.3
More information about the U-Boot
mailing list