]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
watchdog: designware: Make this depend on WDT
authorTom Rini <trini@konsulko.com>
Wed, 15 Jun 2022 16:03:46 +0000 (12:03 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 5 Jul 2022 21:03:01 +0000 (17:03 -0400)
As this driver can dynamically determine the values set in
CONFIG_DW_WDT_BASE when using WDT, so make this depend on WDT rather
than migrate CONFIG_DW_WDT_BASE to Kconfig.

Cc: Chee Tien Fong <tien.fong.chee@intel.com>
Cc: Chin-Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinh.nguyen@intel.com>
Cc: Holger Brunck <holger.brunck@hitachienergy.com>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Cc: Stefan Roese <sr@denx.de>
Cc: hee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/watchdog/Kconfig
drivers/watchdog/designware_wdt.c
include/configs/socfpga_common.h
include/configs/socfpga_soc64_common.h

index c3eb8a8aec1beec6c98f4a2a29e15c83a00095ac..532ada89c1b263f86dbb1361d03f8747e213ee0e 100644 (file)
@@ -64,8 +64,8 @@ config ULP_WATCHDOG
 
 config DESIGNWARE_WATCHDOG
        bool "Designware watchdog timer support"
-       select HW_WATCHDOG if !WDT
-       default y if WDT && ROCKCHIP_RK3399
+       depends on WDT
+       default y if ROCKCHIP_RK3399
        help
          Enable this to support Designware Watchdog Timer IP, present e.g.
          on Altera SoCFPGA SoCs.
index cfec29bd158c7a9a976536177793a990f60e005b..cad756aeaf20bb8007a5e82ace4d50a7d02f0336 100644 (file)
@@ -60,26 +60,6 @@ static void designware_wdt_reset_common(void __iomem *base)
                writel(DW_WDT_CRR_RESTART_VAL, base + DW_WDT_CRR);
 }
 
-#if !CONFIG_IS_ENABLED(WDT)
-void hw_watchdog_reset(void)
-{
-       designware_wdt_reset_common((void __iomem *)CONFIG_DW_WDT_BASE);
-}
-
-void hw_watchdog_init(void)
-{
-       /* reset to disable the watchdog */
-       hw_watchdog_reset();
-       /* set timer in miliseconds */
-       designware_wdt_settimeout((void __iomem *)CONFIG_DW_WDT_BASE,
-                                 CONFIG_DW_WDT_CLOCK_KHZ,
-                                 CONFIG_WATCHDOG_TIMEOUT_MSECS);
-       /* enable the watchdog */
-       designware_wdt_enable((void __iomem *)CONFIG_DW_WDT_BASE);
-       /* reset the watchdog */
-       hw_watchdog_reset();
-}
-#else
 static int designware_wdt_reset(struct udevice *dev)
 {
        struct designware_wdt_priv *priv = dev_get_priv(dev);
@@ -195,4 +175,3 @@ U_BOOT_DRIVER(designware_wdt) = {
        .ops = &designware_wdt_ops,
        .flags = DM_FLAG_PRE_RELOC,
 };
-#endif
index d1efba29fc409006657c22ad5c85b2b85ac2711d..4a7da76e51e611b840adf4114e959d0aa343aaa4 100644 (file)
@@ -66,7 +66,6 @@
 /*
  * L4 Watchdog
  */
-#define CONFIG_DW_WDT_BASE             SOCFPGA_L4WD0_ADDRESS
 #define CONFIG_DW_WDT_CLOCK_KHZ                25000
 
 /*
index c1037ab595fafee0b5a539a277085ce738965c9e..a3e8d54929193d9fff1f9333977b5fca62683c4d 100644 (file)
@@ -92,7 +92,6 @@
 /*
  * L4 Watchdog
  */
-#define CONFIG_DW_WDT_BASE             SOCFPGA_L4WD0_ADDRESS
 #ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 #ifndef __ASSEMBLY__
 unsigned int cm_get_l4_sys_free_clk_hz(void);