[U-Boot] [PATCH 3/4 v5] watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup

Stefan Roese sr at denx.de
Thu Apr 25 07:17:02 UTC 2019


With the generic watchdog driver now implemented, this patch removes
some legacy stuff from the MPC8xx watchdog driver and its Kconfig
integration. CONFIG_MPC8xx_WATCHDOG is completely removed and
hw_watchdog_reset() is made static, as the watchdog will now get
serviced via the DM infrastructure if enabled via CONFIG_WATCHDOG.

Signed-off-by: Stefan Roese <sr at denx.de>
Cc: Christophe Leroy <christophe.leroy at c-s.fr>
---
v5:
- No change

v4:
- New patch

arch/powerpc/Kconfig            | 2 +-
 arch/powerpc/cpu/mpc8xx/Kconfig | 6 +++---
 drivers/watchdog/Kconfig        | 1 -
 drivers/watchdog/Makefile       | 2 +-
 drivers/watchdog/mpc8xx_wdt.c   | 4 +---
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c727d9162c..0b1629ba62 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -35,7 +35,7 @@ config MPC8xx
 	bool "MPC8xx"
 	select BOARD_EARLY_INIT_F
 	imply CMD_REGINFO
-	imply MPC8xx_WATCHDOG
+	imply WDT_MPC8xx
 
 endchoice
 
diff --git a/arch/powerpc/cpu/mpc8xx/Kconfig b/arch/powerpc/cpu/mpc8xx/Kconfig
index b0e90a0f20..3e8ea38529 100644
--- a/arch/powerpc/cpu/mpc8xx/Kconfig
+++ b/arch/powerpc/cpu/mpc8xx/Kconfig
@@ -25,9 +25,9 @@ config MPC885
 
 endchoice
 
-config MPC8xx_WATCHDOG
-	bool "Watchdog"
-	select HW_WATCHDOG
+#config MPC8xx_WATCHDOG
+#	bool "Watchdog"
+#	select HW_WATCHDOG
 
 config 8xx_GCLK_FREQ
 	int "CPU GCLK Frequency"
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index aa8e725573..3bce0aa0b8 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -151,7 +151,6 @@ config WDT_MT7621
 config WDT_MPC8xx
 	bool "MPC8xx watchdog timer support"
 	depends on WDT && MPC8xx
-	select CONFIG_MPC8xx_WATCHDOG
 	help
 	   Select this to enable mpc8xx watchdog timer
 
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index d901240ad1..40b2f4bc66 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -24,6 +24,6 @@ obj-$(CONFIG_WDT_BCM6345) += bcm6345_wdt.o
 obj-$(CONFIG_BCM2835_WDT)       += bcm2835_wdt.o
 obj-$(CONFIG_WDT_ORION) += orion_wdt.o
 obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
-obj-$(CONFIG_MPC8xx_WATCHDOG) += mpc8xx_wdt.o
+obj-$(CONFIG_WDT_MPC8xx) += mpc8xx_wdt.o
 obj-$(CONFIG_WDT_MT7621) += mt7621_wdt.o
 obj-$(CONFIG_WDT_MTK) += mtk_wdt.o
diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c
index c24c2a9da6..675b62d8b3 100644
--- a/drivers/watchdog/mpc8xx_wdt.c
+++ b/drivers/watchdog/mpc8xx_wdt.c
@@ -10,7 +10,7 @@
 #include <asm/cpm_8xx.h>
 #include <asm/io.h>
 
-void hw_watchdog_reset(void)
+static void hw_watchdog_reset(void)
 {
 	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
 
@@ -18,7 +18,6 @@ void hw_watchdog_reset(void)
 	out_be16(&immap->im_siu_conf.sc_swsr, 0xaa39);	/* write magic2 */
 }
 
-#ifdef CONFIG_WDT_MPC8xx
 static int mpc8xx_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
 {
 	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
@@ -66,4 +65,3 @@ U_BOOT_DRIVER(wdt_mpc8xx) = {
 	.of_match = mpc8xx_wdt_ids,
 	.ops = &mpc8xx_wdt_ops,
 };
-#endif /* CONFIG_WDT_MPC8xx */
-- 
2.21.0



More information about the U-Boot mailing list