From a68256074f4239008c6d5c936bc0f8857f3d1b8a Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Thu, 20 Feb 2020 07:39:51 +0000 Subject: [PATCH 1/2] watchdog: mpc8xx: Revert the 8xx watchdog back to CONFIG_HW_WATCHDOG Commit f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup") switched the watchdog to CONFIG_WATCHDOG. But this is not compatible with the 8xx because it starts the watchdog HW timer at reset and must be serviced from the very beginning including while U-boot is executed in the firmware before relocation in RAM. Select CONFIG_HW_WATCHDOG and make hw_watchdog_reset() visible. Meanwhile, finalise the cleanup of arch/powerpc/cpu/mpc8xx/Kconfig by removing the lines put in comment in that commit, and also remove again the selection of CONFIG_MPC8xx_WATCHDOG which was removed by that commit and brought back by mistake by commit b3134ffbd944 ("watchdog: Kconfig: Sort entry alphabetically") Note that there was an 'imply WATCHDOG' in the original commit but it disappeared in the Kconfig alphabetical sorting, so no need to remove it here. Fixes: f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup") Fixes: b3134ffbd944 ("watchdog: Kconfig: Sort entry alphabetically") Signed-off-by: Christophe Leroy Cc: Stefan Roese Cc: Patrice Chotard Reviewed-by: Stefan Roese --- arch/powerpc/cpu/mpc8xx/Kconfig | 4 ---- drivers/watchdog/Kconfig | 2 +- drivers/watchdog/mpc8xx_wdt.c | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/Kconfig b/arch/powerpc/cpu/mpc8xx/Kconfig index 3e8ea38529..f112317376 100644 --- a/arch/powerpc/cpu/mpc8xx/Kconfig +++ b/arch/powerpc/cpu/mpc8xx/Kconfig @@ -25,10 +25,6 @@ config MPC885 endchoice -#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 36fbdce552..fbb561b995 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -118,7 +118,7 @@ config WDT_CORTINA config WDT_MPC8xx bool "MPC8xx watchdog timer support" depends on WDT && MPC8xx - select CONFIG_MPC8xx_WATCHDOG + select HW_WATCHDOG help Select this to enable mpc8xx watchdog timer diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c index 675b62d8b3..30758aeed4 100644 --- a/drivers/watchdog/mpc8xx_wdt.c +++ b/drivers/watchdog/mpc8xx_wdt.c @@ -10,7 +10,7 @@ #include #include -static void hw_watchdog_reset(void) +void hw_watchdog_reset(void) { immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; From 7e00e907f51fd9335127c323d6a0eacdbb7e7013 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Wed, 26 Feb 2020 16:17:52 +0000 Subject: [PATCH 2/2] watchdog: Don't select CONFIG_WATCHDOG and CONFIG_HW_WATCHDOG at the same time Commit 06985289d452 ("watchdog: Implement generic watchdog_reset() version") introduced an automatic selection of CONFIG_WATCHDOG by CONFIG_WDT. But for boards selecting CONFIG_HW_WATCHDOG, like boards have a powerpc 8xx, CONFIG_WATCHDOG shall not be selected as they are mutually exclusive. Make CONFIG_WATCHDOG dependent on !CONFIG_HW_WATCHDOG Fixes: 06985289d452 ("watchdog: Implement generic watchdog_reset() version") Cc: Stefan Roese Signed-off-by: Christophe Leroy Reviewed-by: Stefan Roese --- drivers/watchdog/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index fbb561b995..d24c1e4835 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -2,6 +2,7 @@ menu "Watchdog Timer Support" config WATCHDOG bool "Enable U-Boot watchdog reset" + depends on !HW_WATCHDOG help This option enables U-Boot watchdog support where U-Boot is using watchdog_reset function to service watchdog device in U-Boot. Enable