Skip to contentSkip to conversation

watchdog: designware: Migrate CONFIG_DESIGNWARE_WATCHDOG to Kconfig

PATCH Superseded Marek Vasut 4 participants 20 messages Oct 2, 2019 – Oct 3, 2019 Watchdog device drivers

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 watchdog: designware: Migrate CONFIG_DESIGNWARE_WATCHDOG to Kconfig

Migrate CONFIG_DESIGNWARE_WATCHDOG to Kconfig and update the headers accordingly, no functional change. The S10 enables the WDT only in SPL, but does not enable it in U-Boot itself, hence disable it in the config again.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 configs/socfpga_stratix10_defconfig       | 1 +
 configs/socfpga_vining_fpga_defconfig     | 1 +
 drivers/watchdog/Kconfig                  | 7 +++++++
 include/configs/socfpga_common.h          | 3 ---
 include/configs/socfpga_stratix10_socdk.h | 8 ++++----
 scripts/config_whitelist.txt              | 1 -
 6 files changed, 13 insertions(+), 8 deletions(-)
configs/socfpga_stratix10_defconfig +1 -0
index ad83f50032..462082b67b 100644
@@ -56,3 +56,4 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
+CONFIG_DESIGNWARE_WATCHDOG=y
configs/socfpga_vining_fpga_defconfig +1 -0
index 96f806ab5f..03c43fa8b9 100644
@@ -91,3 +91,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_DESIGNWARE_WATCHDOG=y
drivers/watchdog/Kconfig +7 -0
index a66a9bcbe2..6fd9b0a177 100644
@@ -36,6 +36,13 @@ config ULP_WATCHDOG
 	help
 	  Say Y here to enable i.MX7ULP watchdog driver.
 
+config DESIGNWARE_WATCHDOG
+	bool "Designware watchdog timer support"
+	select HW_WATCHDOG
+	help
+	   Enable this to support Designware Watchdog Timer IP, present e.g.
+	   on Altera SoCFPGA SoCs.
+
 config WDT
 	bool "Enable driver model for watchdog timer drivers"
 	depends on DM
include/configs/socfpga_common.h +0 -3
index b11fe021a7..32b9131be0 100644
@@ -104,12 +104,9 @@
 /*
  * L4 Watchdog
  */
-#ifdef CONFIG_HW_WATCHDOG
-#define CONFIG_DESIGNWARE_WATCHDOG
 #define CONFIG_DW_WDT_BASE		SOCFPGA_L4WD0_ADDRESS
 #define CONFIG_DW_WDT_CLOCK_KHZ		25000
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS	30000
-#endif
 
 /*
  * MMC Driver
include/configs/socfpga_stratix10_socdk.h +4 -4
index 7b55dd14da..17f6e14790 100644
@@ -160,16 +160,16 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 /*
  * L4 Watchdog
  */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_HW_WATCHDOG
-#define CONFIG_DESIGNWARE_WATCHDOG
+#ifndef CONFIG_SPL_BUILD
+#undef CONFIG_HW_WATCHDOG
+#undef CONFIG_DESIGNWARE_WATCHDOG
+#endif
 #define CONFIG_DW_WDT_BASE		SOCFPGA_L4WD0_ADDRESS
 #ifndef __ASSEMBLY__
 unsigned int cm_get_l4_sys_free_clk_hz(void);
 #define CONFIG_DW_WDT_CLOCK_KHZ		(cm_get_l4_sys_free_clk_hz() / 1000)
 #endif
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS	3000
-#endif
 
 /*
  * SPL memory layout
scripts/config_whitelist.txt +0 -1
index b18eab1707..839eda8c0f 100644
@@ -320,7 +320,6 @@ CONFIG_DEFAULT_IMMR
 CONFIG_DEF_HWCONFIG
 CONFIG_DELAY_ENVIRONMENT
 CONFIG_DESIGNWARE_ETH
-CONFIG_DESIGNWARE_WATCHDOG
 CONFIG_DEVELOP
 CONFIG_DEVICE_TREE_LIST
 CONFIG_DFU_ALT
Signature · 1 line
2.23.0
#1 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)
configs/socfpga_stratix10_defconfig +1 -0
index 462082b67b..cc5f49a536 100644
@@ -56,4 +56,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
+CONFIG_WDT=y
 CONFIG_DESIGNWARE_WATCHDOG=y
configs/socfpga_vining_fpga_defconfig +1 -0
index 03c43fa8b9..def7a3eca7 100644
@@ -91,4 +91,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_WDT=y
 CONFIG_DESIGNWARE_WATCHDOG=y
drivers/watchdog/Kconfig +7 -7
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
 	help
 	  Say Y here to enable i.MX7ULP watchdog driver.
 
-config DESIGNWARE_WATCHDOG
-	bool "Designware watchdog timer support"
-	select HW_WATCHDOG
-	help
-	   Enable this to support Designware Watchdog Timer IP, present e.g.
-	   on Altera SoCFPGA SoCs.
-
 config WDT
 	bool "Enable driver model for watchdog timer drivers"
 	depends on DM
@@ -54,6 +47,13 @@ config WDT
 	  What exactly happens when the timer expires is up to a particular
 	  device/driver.
 
+config DESIGNWARE_WATCHDOG
+	bool "Designware watchdog timer support"
+	depends on WDT
+	help
+	   Enable this to support Designware Watchdog Timer IP, present e.g.
+	   on Altera SoCFPGA SoCs.
+
 config WDT_ARMADA_37XX
 	bool "Marvell Armada 37xx watchdog timer support"
 	depends on WDT && ARMADA_3700
drivers/watchdog/designware_wdt.c +68 -29

132 lines not on this page · raw message

Signature · 1 line
2.23.0
#2 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 44 lines · Marek Vasut

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)
configs/socfpga_stratix10_defconfig +1 -0
index 462082b67b..cc5f49a536 100644
@@ -56,4 +56,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
+CONFIG_WDT=y
 CONFIG_DESIGNWARE_WATCHDOG=y
configs/socfpga_vining_fpga_defconfig +1 -0
index 03c43fa8b9..def7a3eca7 100644
@@ -91,4 +91,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_WDT=y
 CONFIG_DESIGNWARE_WATCHDOG=y
drivers/watchdog/Kconfig +0 -0
index 6fd9b0a177..ec34993664 100644

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 6 lines
drivers/watchdog/Kconfig +0 -3
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

Quoted 96 lines
drivers/watchdog/Kconfig +7 -4
-       help
-          Enable this to support Designware Watchdog Timer IP, present e.g.
-          on Altera SoCFPGA SoCs.
-
 config WDT
        bool "Enable driver model for watchdog timer drivers"
        depends on DM
@@ -54,6 +47,13 @@ config WDT
          What exactly happens when the timer expires is up to a particular
          device/driver.
 
+config DESIGNWARE_WATCHDOG
+       bool "Designware watchdog timer support"
+       depends on WDT
+       help
+          Enable this to support Designware Watchdog Timer IP, present e.g.
+          on Altera SoCFPGA SoCs.
+
 config WDT_ARMADA_37XX
        bool "Marvell Armada 37xx watchdog timer support"
        depends on WDT && ARMADA_3700
drivers/watchdog/designware_wdt.c +19 -22
index c668567c66..f2b9175345 100644
@@ -4,7 +4,8 @@
  */
 
 #include <common.h>
-#include <watchdog.h>
+#include <dm.h>
+#include <wdt.h>
 #include <asm/io.h>
 #include <asm/utils.h>
 
@@ -17,57 +18,95 @@
 #define DW_WDT_CR_RMOD_VAL     0x00
 #define DW_WDT_CRR_RESTART_VAL 0x76
 
+struct designware_wdt_priv {
+       void __iomem    *base;
+};
+
 /*
  * Set the watchdog time interval.
  * Counter is 32 bit.
  */
-static int designware_wdt_settimeout(unsigned int timeout)
+static int designware_wdt_settimeout(struct udevice *dev, unsigned int timeout)
 {
+       struct designware_wdt_priv *priv = dev_get_priv(dev);
        signed int i;
 
        /* calculate the timeout range value */
        i = (log_2_n_round_up(timeout * CONFIG_DW_WDT_CLOCK_KHZ)) - 16;
-       if (i > 15)
-               i = 15;
-       if (i < 0)
-               i = 0;
+       i = clamp(i, 0, 15);
+
+       writel(i | (i << 4), priv->base + DW_WDT_TORR);
 
-       writel((i | (i << 4)), (CONFIG_DW_WDT_BASE + DW_WDT_TORR));
        return 0;
 }
 
-static void designware_wdt_enable(void)
+static unsigned int designware_wdt_is_enabled(struct udevice *dev)
 {
-       writel(((DW_WDT_CR_RMOD_VAL << DW_WDT_CR_RMOD_OFFSET) |
-             (0x1 << DW_WDT_CR_EN_OFFSET)),
-             (CONFIG_DW_WDT_BASE + DW_WDT_CR));
-}
+       struct designware_wdt_priv *priv = dev_get_priv(dev);
 
-static unsigned int designware_wdt_is_enabled(void)
-{
-       unsigned long val;
-       val = readl((CONFIG_DW_WDT_BASE + DW_WDT_CR));
-       return val & 0x1;
+       return readl(priv->base + DW_WDT_CR) & BIT(0);
 }
 
-#if defined(CONFIG_HW_WATCHDOG)
-void hw_watchdog_reset(void)
+static int designware_wdt_reset(struct udevice *dev)
 {
-       if (designware_wdt_is_enabled())
+       struct designware_wdt_priv *priv = dev_get_priv(dev);
+
+       if (designware_wdt_is_enabled(dev))
                /* restart the watchdog counter */
-               writel(DW_WDT_CRR_RESTART_VAL,
-                      (CONFIG_DW_WDT_BASE + DW_WDT_CRR));
+               writel(DW_WDT_CRR_RESTART_VAL, priv->base + DW_WDT_CRR);

drivers/watchdog/designware_wdt.c line 64

Quoted 10 lines
drivers/watchdog/designware_wdt.c +4 -2
+
+       return 0;
 }
 
-void hw_watchdog_init(void)
+static int designware_wdt_stop(struct udevice *dev)
 {
        /* reset to disable the watchdog */
-       hw_watchdog_reset();
+       designware_wdt_reset(dev);

Need to clear BIT(DW_WDT_CR_EN_OFFSET) in CR register to disable watchdog.

Quoted 12 lines
drivers/watchdog/designware_wdt.c +9 -2
+       return 0;
+}
+
+static int designware_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
+{
+       struct designware_wdt_priv *priv = dev_get_priv(dev);
+
+       designware_wdt_stop(dev);
+
        /* set timer in miliseconds */
-       designware_wdt_settimeout(CONFIG_WATCHDOG_TIMEOUT_MSECS);
-       /* enable the watchdog */

drivers/watchdog/designware_wdt.c line 82

Quoted 10 lines
drivers/watchdog/designware_wdt.c +7 -2
-       designware_wdt_enable();
+       designware_wdt_settimeout(dev, timeout);
+
+       writel((DW_WDT_CR_RMOD_VAL << DW_WDT_CR_RMOD_OFFSET) |
+             BIT(DW_WDT_CR_EN_OFFSET),
+             priv->base + DW_WDT_CR);
+
        /* reset the watchdog */
-       hw_watchdog_reset();
+       designware_wdt_reset(dev);

Need move to before enable CR_EN bit if we add clear CR_EN bit in designware_wdt_reset().

drivers/watchdog/designware_wdt.c line 87

Quoted 5 lines
drivers/watchdog/designware_wdt.c +5 -0
+       return 0;
+}
+
+static int designware_wdt_probe(struct udevice *dev)
+{

Need to de-assert reset for watchdog in probe using reset framework.

drivers/watchdog/designware_wdt.c line 89

Quoted 2 lines
drivers/watchdog/designware_wdt.c +2 -0
+       /* reset to disable the watchdog */
+       designware_wdt_reset(dev);

designware_wdt_reset() only reset watchdog counter, but doesn't disable the watchdog.
Can change call to designware_wdt_stop() if _stop() add clear CR_EN bit.

Quoted 31 lines
drivers/watchdog/designware_wdt.c +22 -2
+       return 0;
 }
-#endif
+
+static const struct wdt_ops designware_wdt_ops = {
+       .start = designware_wdt_start,
+       .reset = designware_wdt_reset,
+       .stop = designware_wdt_stop,
+};
+
+static const struct udevice_id designware_wdt_ids[] = {
+       { .compatible = "snps,dw-wdt"},
+       {}
+};
+
+U_BOOT_DRIVER(designware_wdt) = {
+       .name = "designware_wdt",
+       .id = UCLASS_WDT,
+       .of_match = designware_wdt_ids,
+       .priv_auto_alloc_size = sizeof(struct designware_wdt_priv),
+       .probe = designware_wdt_probe,
+       .ops = &designware_wdt_ops,
+       .flags = DM_FLAG_PRE_RELOC,
+};
--

2.23.0

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#3 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

On 10/3/19 3:57 AM, Ley Foon Tan wrote:

[...]

Quoted 8 lines
Quoted 8 lines
drivers/watchdog/Kconfig +0 -0
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
Quoted 9 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 3 lines
drivers/watchdog/Kconfig +0 -3
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

You're right, and the WDT is enabled early on, before the DM structures are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

[...]

Quoted 7 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG

Quoted 6 lines
drivers/watchdog/Kconfig +2 -2
-void hw_watchdog_init(void)
+static int designware_wdt_stop(struct udevice *dev)
 {
        /* reset to disable the watchdog */
-       hw_watchdog_reset();
+       designware_wdt_reset(dev);

Need to clear BIT(DW_WDT_CR_EN_OFFSET) in CR register to disable watchdog.

Fixed

Quoted 16 lines
Quoted 16 lines
drivers/watchdog/Kconfig +12 -3
+       return 0;
+}
+
+static int designware_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
+{
+       struct designware_wdt_priv *priv = dev_get_priv(dev);
+
+       designware_wdt_stop(dev);
+
        /* set timer in miliseconds */
-       designware_wdt_settimeout(CONFIG_WATCHDOG_TIMEOUT_MSECS);
-       /* enable the watchdog */
-       designware_wdt_enable();
+       designware_wdt_settimeout(dev, timeout);
+
+       writel((DW_WDT_CR_RMOD_VAL << DW_WDT_CR_RMOD_OFFSET) |
Quoted 8 lines

drivers/watchdog/Kconfig

Quoted 6 lines
drivers/watchdog/Kconfig +4 -1
+             BIT(DW_WDT_CR_EN_OFFSET),
+             priv->base + DW_WDT_CR);
+
        /* reset the watchdog */
-       hw_watchdog_reset();
+       designware_wdt_reset(dev);

Need move to before enable CR_EN bit if we add clear CR_EN bit in designware_wdt_reset().

I think if someone needs to clear CR_EN, they should call designware_wdt_stop(), which should clear the CR_EN.

Quoted 11 lines

drivers/watchdog/Kconfig

Quoted 5 lines
drivers/watchdog/Kconfig +5 -0
+       return 0;
+}
+
+static int designware_wdt_probe(struct udevice *dev)
+{

Need to de-assert reset for watchdog in probe using reset framework.

drivers/watchdog/Kconfig

Quoted 2 lines
drivers/watchdog/Kconfig +2 -0
+       /* reset to disable the watchdog */
+       designware_wdt_reset(dev);

designware_wdt_reset() only reset watchdog counter, but doesn't disable the watchdog.
Can change call to designware_wdt_stop() if _stop() add clear CR_EN bit.

Yep, fixed, thanks.

[...]

Signature · 2 lines
Best regards,
Marek Vasut
#4 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Marek Vasut <[email protected]> schrieb am Do., 3. Okt. 2019, 09:22:

Quoted 22 lines · Ley Foon Tan

[...]

Quoted 8 lines
Quoted 8 lines
drivers/watchdog/Kconfig +0 -0
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
Quoted 9 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 3 lines
drivers/watchdog/Kconfig +0 -3
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

Quoted 6 lines

You're right, and the WDT is enabled early on, before the DM structures are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I get a message that WDT is not found. I haven't sent a patch to fix that yet, since the message is the only thing that happens, works normally otherwise.

But if you're working on that, you might check side effects of that setting (which is new for this release).

Regards,
Simon

Quoted 66 lines

[...]

Quoted 7 lines

drivers/watchdog/Kconfig

Quoted 6 lines
drivers/watchdog/Kconfig +2 -2
-void hw_watchdog_init(void)
+static int designware_wdt_stop(struct udevice *dev)
 {
        /* reset to disable the watchdog */
-       hw_watchdog_reset();
+       designware_wdt_reset(dev);

Need to clear BIT(DW_WDT_CR_EN_OFFSET) in CR register to disable

watchdog.

Fixed

Quoted 4 lines

drivers/watchdog/Kconfig

Quoted 4 lines
drivers/watchdog/Kconfig +4 -0
+       return 0;
+}
+
+static int designware_wdt_start(struct udevice *dev, u64 timeout,

ulong flags)

Quoted 12 lines
Quoted 12 lines
drivers/watchdog/Kconfig +8 -3
+{
+       struct designware_wdt_priv *priv = dev_get_priv(dev);
+
+       designware_wdt_stop(dev);
+
        /* set timer in miliseconds */
-       designware_wdt_settimeout(CONFIG_WATCHDOG_TIMEOUT_MSECS);
-       /* enable the watchdog */
-       designware_wdt_enable();
+       designware_wdt_settimeout(dev, timeout);
+
+       writel((DW_WDT_CR_RMOD_VAL << DW_WDT_CR_RMOD_OFFSET) |
Quoted 8 lines

drivers/watchdog/Kconfig

Quoted 6 lines
drivers/watchdog/Kconfig +4 -1
+             BIT(DW_WDT_CR_EN_OFFSET),
+             priv->base + DW_WDT_CR);
+
        /* reset the watchdog */
-       hw_watchdog_reset();
+       designware_wdt_reset(dev);

Need move to before enable CR_EN bit if we add clear CR_EN bit in designware_wdt_reset().

I think if someone needs to clear CR_EN, they should call designware_wdt_stop(), which should clear the CR_EN.

Quoted 11 lines

drivers/watchdog/Kconfig

Quoted 5 lines
drivers/watchdog/Kconfig +5 -0
+       return 0;
+}
+
+static int designware_wdt_probe(struct udevice *dev)
+{

Need to de-assert reset for watchdog in probe using reset framework.

drivers/watchdog/Kconfig

Quoted 2 lines
drivers/watchdog/Kconfig +2 -0
+       /* reset to disable the watchdog */
+       designware_wdt_reset(dev);

designware_wdt_reset() only reset watchdog counter, but doesn't disable the watchdog.
Can change call to designware_wdt_stop() if _stop() add clear CR_EN bit.

Yep, fixed, thanks.

[...]

--
Best regards,
Marek Vasut
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#5 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 31 lines · Simon Goldschmidt

Marek Vasut schrieb am Do., 3. Okt. 2019, 09:22:

Quoted 22 lines · Ley Foon Tan

[...]

Quoted 8 lines
Quoted 8 lines
drivers/watchdog/Kconfig +0 -0
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
Quoted 9 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 3 lines
drivers/watchdog/Kconfig +0 -3
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

Quoted 6 lines

You're right, and the WDT is enabled early on, before the DM structures are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

Quoted 6 lines

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I get a message that WDT is not found. I haven't sent a patch to fix that yet, since the message is the only thing that happens, works normally otherwise.

But if you're working on that, you might check side effects of that setting (which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

[...]

Signature · 6 lines
Best regards,
Marek Vasut

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-56 Email: marex at denx.de
#6 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Marek Vasut <[email protected]> schrieb am Do., 3. Okt. 2019, 20:09:

Quoted 39 lines · Simon Goldschmidt
Quoted 24 lines

Marek Vasut schrieb am Do., 3. Okt. 2019, 09:22:

Quoted 22 lines · Ley Foon Tan

[...]

Quoted 17 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 11 lines
drivers/watchdog/Kconfig +0 -3
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

Quoted 8 lines
Quoted 6 lines

You're right, and the WDT is enabled early on, before the DM structures are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I

get

Quoted 2 lines

a message that WDT is not found. I haven't sent a patch to fix that yet, since the message is the only thing that happens, works normally

otherwise.

Quoted 2 lines

But if you're working on that, you might check side effects of that

Quoted 9 lines

setting

Quoted 1 line

(which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

Hmm, it probably is. I'm not using a watchdog right now, so I couldn't really tell... It'll be a week or so until I'll find the time for u-boot again :-(

Regards,
Simon

#7 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 51 lines · Simon Goldschmidt

Marek Vasut schrieb am Do., 3. Okt. 2019, 20:09:

Quoted 39 lines · Simon Goldschmidt
Quoted 24 lines

Marek Vasut schrieb am Do., 3. Okt. 2019, 09:22:

Quoted 22 lines · Ley Foon Tan

[...]

Quoted 17 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 11 lines
drivers/watchdog/Kconfig +0 -3
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

Quoted 8 lines
Quoted 6 lines

You're right, and the WDT is enabled early on, before the DM structures are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I

get

Quoted 2 lines

a message that WDT is not found. I haven't sent a patch to fix that yet, since the message is the only thing that happens, works normally

otherwise.

Quoted 2 lines

But if you're working on that, you might check side effects of that

Quoted 9 lines

setting

Quoted 1 line

(which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

Quoted 3 lines

Hmm, it probably is. I'm not using a watchdog right now, so I couldn't really tell... It'll be a week or so until I'll find the time for u-boot again :-(

We probably should fix that before the release though.

#8 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Marek Vasut <[email protected]> schrieb am Do., 3. Okt. 2019, 20:13:

Quoted 54 lines · Simon Goldschmidt
Quoted 28 lines

Marek Vasut schrieb am Do., 3. Okt. 2019, 20:09:

Quoted 26 lines · Simon Goldschmidt
Quoted 25 lines

Marek Vasut schrieb am Do., 3. Okt. 2019, 09:22:

Quoted 23 lines · Ley Foon Tan

[...]

Quoted 8 lines
Quoted 8 lines
drivers/watchdog/Kconfig +0 -0
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
Quoted 9 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 3 lines
drivers/watchdog/Kconfig +0 -3
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

You're right, and the WDT is enabled early on, before the DM

structures

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines

are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I

get

Quoted 1 line

a message that WDT is not found. I haven't sent a patch to fix that

yet,

Quoted 14 lines
Quoted 13 lines
Quoted 1 line

since the message is the only thing that happens, works normally

otherwise.

Quoted 2 lines

But if you're working on that, you might check side effects of that

setting

Quoted 1 line

(which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

Quoted 6 lines
Quoted 3 lines

Hmm, it probably is. I'm not using a watchdog right now, so I couldn't really tell... It'll be a week or so until I'll find the time for u-boot again :-(

We probably should fix that before the release though.

If it's a problem, then yes, we should. Let me see if I can squeeze it in tomorrow...

Regards,
Simon

#9 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

[...]

Quoted 22 lines
Quoted 22 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I

get

Quoted 1 line

a message that WDT is not found. I haven't sent a patch to fix that

yet,

Quoted 17 lines
Quoted 4 lines
Quoted 1 line

since the message is the only thing that happens, works normally

otherwise.

Quoted 2 lines

But if you're working on that, you might check side effects of that

Quoted 9 lines

setting

Quoted 1 line

(which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

Hmm, it probably is. I'm not using a watchdog right now, so I couldn't really tell... It'll be a week or so until I'll find the time for u-boot again :-(

Quoted 5 lines
Quoted 2 lines

We probably should fix that before the release though.

If it's a problem, then yes, we should. Let me see if I can squeeze it in tomorrow...

Thanks

I almost suspect it's one of my WDT DM conversion patches which caused this.

#10 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Am 03.10.2019 um 21:12 schrieb Marek Vasut:

Quoted 26 lines

[...]

Quoted 25 lines
Quoted 24 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I

get

Quoted 1 line

a message that WDT is not found. I haven't sent a patch to fix that

yet,

Quoted 14 lines
Quoted 4 lines
Quoted 1 line

since the message is the only thing that happens, works normally

otherwise.

Quoted 2 lines

But if you're working on that, you might check side effects of that

Quoted 9 lines

setting

Quoted 1 line

(which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

Quoted 3 lines

Hmm, it probably is. I'm not using a watchdog right now, so I couldn't really tell... It'll be a week or so until I'll find the time for u-boot again :-(

We probably should fix that before the release though.

Quoted 6 lines
Quoted 2 lines

If it's a problem, then yes, we should. Let me see if I can squeeze it in tomorrow...

Thanks

I almost suspect it's one of my WDT DM conversion patches which caused this.

Hehe, a fast blame on github shows me you're right :-)

The problem is that SPL_WATCHDOG_SUPPORT (which is selected by ARCH_SOCFPGA) implies SPL_WDT if !HW_WATCHDOG. Now for my board, HW_WATCHDOG is obviously disabled. I'd have to check the mainline gen5 boards though...

I'll try to check socfpga_socrates tomorrow and check the other boards by comparing the defconfigs.

Regards,
Simon

#11 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 45 lines · Simon Goldschmidt

Am 03.10.2019 um 21:12 schrieb Marek Vasut:

Quoted 33 lines

[...]

Quoted 32 lines
Quoted 31 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I

get

Quoted 1 line

a message that WDT is not found. I haven't sent a patch to fix that

yet,

Quoted 18 lines
Quoted 7 lines
Quoted 1 line

since the message is the only thing that happens, works normally

otherwise.

Quoted 2 lines

But if you're working on that, you might check side effects of that

setting

Quoted 1 line

(which is new for this release).

Quoted 10 lines

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some
places as Ley pointed out, so if DM WDT is enabled in SPL, that code in
HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird
problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now
is a bug ?

Quoted 5 lines

Hmm, it probably is. I'm not using  a watchdog right now, so I couldn't
really tell... It'll be a week or so until I'll find the time for u-boot
again :-(

We probably should fix that before the release though.

Quoted 8 lines
Quoted 3 lines

If it's a problem, then yes, we should. Let me see if I can squeeze it in
tomorrow...

Thanks

I almost suspect it's one of my WDT DM conversion patches which caused this.

Hehe, a fast blame on github shows me you're right :-)

Quoted 7 lines

The problem is that SPL_WATCHDOG_SUPPORT (which is selected by ARCH_SOCFPGA) implies SPL_WDT if !HW_WATCHDOG. Now for my board, HW_WATCHDOG is obviously disabled. I'd have to check the mainline gen5 boards though...

I'll try to check socfpga_socrates tomorrow and check the other boards by comparing the defconfigs.

Thanks

#12 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

In reply to Simon Goldschmidt
Quoted 31 lines · Simon Goldschmidt

Marek Vasut schrieb am Do., 3. Okt. 2019, 09:22:

Quoted 22 lines · Ley Foon Tan

[...]

Quoted 8 lines
Quoted 8 lines
drivers/watchdog/Kconfig +0 -0
index 6fd9b0a177..ec34993664 100644
@@ -36,13 +36,6 @@ config ULP_WATCHDOG
        help
          Say Y here to enable i.MX7ULP watchdog driver.
 
Quoted 9 lines

drivers/watchdog/Kconfig config ULP_WATCHDOG · line 41

Quoted 3 lines
drivers/watchdog/Kconfig +0 -3
-config DESIGNWARE_WATCHDOG
-       bool "Designware watchdog timer support"
-       select HW_WATCHDOG

CONFIG_HW_WATCHDOG is disabled now. Few areas of code in arm/mach-socfpga/ still using this CONFIG and call to hw_watchdog_init(). They need to remove too.
Do we need call to uclass_get_device(UCLASS_WDT, 0, &dev) in SPL to probe watchdog and call to wdt_start() to start watchdog? Can't find place that start watchdog.

Quoted 6 lines

You're right, and the WDT is enabled early on, before the DM structures are available.

I wonder whether we should do what we did on iMX -- have a non-DM WDT driver for SPL and DM-one for U-Boot proper.

Quoted 6 lines

Are you aware that DM WDT is enabled in SPL by default for gen5 now? I get a message that WDT is not found. I haven't sent a patch to fix that yet, since the message is the only thing that happens, works normally otherwise.

But if you're working on that, you might check side effects of that setting (which is new for this release).

That doesn't sound right, the SoCFPGA core code uses HW_WATCHDOG in some places as Ley pointed out, so if DM WDT is enabled in SPL, that code in HW_WATCHDOG ifdefs isn't used. And I think that will trigger some weird problems. So in the end, enabling DM watchdog in SoCFPGA SPL right now is a bug ?

#13 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

In reply to Marek Vasut
Quoted 12 lines · Marek Vasut

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 6 lines
---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

[1] https://patchwork.ozlabs.org/patch/1153389/

#14 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 20 lines · Jagan Teki
Quoted 12 lines · Marek Vasut

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 6 lines
---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)
Quoted 4 lines

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

[1] https://patchwork.ozlabs.org/patch/1153389/

It's a pity I wasn't CCed on that patch.

That patch won't work for SoCFPGA, see my reply to Ley. We will need one which can do non-DM WDT in SPL, so I will be sending a V2 of this one which retains the common code and still supports HW_WATCHDOG in SPL and DM-WDT in U-Boot proper.

Signature · 2 lines
Best regards,
Marek Vasut
#15 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 16 lines · Marek Vasut
Quoted 15 lines · Jagan Teki
Quoted 10 lines · Marek Vasut

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

Quoted 8 lines
Quoted 1 line

[1] https://patchwork.ozlabs.org/patch/1153389/

It's a pity I wasn't CCed on that patch.

That patch won't work for SoCFPGA, see my reply to Ley. We will need one which can do non-DM WDT in SPL, so I will be sending a V2 of this one which retains the common code and still supports HW_WATCHDOG in SPL and DM-WDT in U-Boot proper.

Oh, and the clock/reset stuff should be optional, since at least DM clock are not present on socfpga gen5 yet.

Signature · 2 lines
Best regards,
Marek Vasut
#16 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Marek Vasut <[email protected]> schrieb am Do., 3. Okt. 2019, 14:19:

Quoted 21 lines · Marek Vasut
Quoted 20 lines · Jagan Teki
Quoted 12 lines · Marek Vasut
Quoted 10 lines

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)
Quoted 4 lines

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

[1] https://patchwork.ozlabs.org/patch/1153389/

It's a pity I wasn't CCed on that patch.

Quoted 8 lines
Quoted 4 lines

That patch won't work for SoCFPGA, see my reply to Ley. We will need one which can do non-DM WDT in SPL, so I will be sending a V2 of this one which retains the common code and still supports HW_WATCHDOG in SPL and DM-WDT in U-Boot proper.

Oh, and the clock/reset stuff should be optional, since at least DM clock are not present on socfpga gen5 yet.

I'm working on that. Sadly, I haven't fou,d the time to finish it up since mid August, but I'm planning to do it in the upcoming merge window.

Regards,
Simon

#17 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 28 lines · Simon Goldschmidt

Marek Vasut schrieb am Do., 3. Okt. 2019, 14:19:

Quoted 26 lines · Marek Vasut
Quoted 24 lines · Jagan Teki
Quoted 12 lines · Marek Vasut
Quoted 10 lines

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97 +++++++++++++++++++--------
 4 files changed, 77 insertions(+), 36 deletions(-)
Quoted 4 lines

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

[1] https://patchwork.ozlabs.org/patch/1153389/

It's a pity I wasn't CCed on that patch.

That patch won't work for SoCFPGA, see my reply to Ley. We will need one which can do non-DM WDT in SPL, so I will be sending a V2 of this one which retains the common code and still supports HW_WATCHDOG in SPL and DM-WDT in U-Boot proper.

Quoted 6 lines
Quoted 3 lines

Oh, and the clock/reset stuff should be optional, since at least DM clock are not present on socfpga gen5 yet.

I'm working on that. Sadly, I haven't fou,d the time to finish it up since mid August, but I'm planning to do it in the upcoming merge window.

Great!

Note that if you build a board without DM watchdog today, it complains about removal until 2019.10, so that's one issue here. The other is that I don't think we can do DM watchdog in SPL on Gen5, can we ?

#18 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Marek Vasut <[email protected]> schrieb am Do., 3. Okt. 2019, 20:06:

Quoted 36 lines · Simon Goldschmidt
Quoted 14 lines

Marek Vasut schrieb am Do., 3. Okt. 2019, 14:19:

Quoted 12 lines · Marek Vasut
Quoted 11 lines · Jagan Teki
Quoted 10 lines · Marek Vasut
Quoted 9 lines

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97

+++++++++++++++++++--------

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 1 line
 4 files changed, 77 insertions(+), 36 deletions(-)

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

[1] https://patchwork.ozlabs.org/patch/1153389/

It's a pity I wasn't CCed on that patch.

That patch won't work for SoCFPGA, see my reply to Ley. We will need

one

Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

which can do non-DM WDT in SPL, so I will be sending a V2 of this one which retains the common code and still supports HW_WATCHDOG in SPL and DM-WDT in U-Boot proper.

Oh, and the clock/reset stuff should be optional, since at least DM clock are not present on socfpga gen5 yet.

I'm working on that. Sadly, I haven't fou,d the time to finish it up

Quoted 9 lines

since

Quoted 1 line

mid August, but I'm planning to do it in the upcoming merge window.

Great!

Note that if you build a board without DM watchdog today, it complains about removal until 2019.10, so that's one issue here. The other is that I don't think we can do DM watchdog in SPL on Gen5, can we ?

If I'm not using watchdog at all, will it complain???

I think we should be able to get that running. We'll need an idea to shrink DM SPL anyway... :-)

Regards,
Simon

Quoted 1 line
#19 lore raw

PATCH 2/2 watchdog: designware: Convert to DM and DT probing

Quoted 41 lines · Simon Goldschmidt

Marek Vasut schrieb am Do., 3. Okt. 2019, 20:06:

Quoted 39 lines · Simon Goldschmidt
Quoted 14 lines

Marek Vasut schrieb am Do., 3. Okt. 2019, 14:19:

Quoted 12 lines · Marek Vasut
Quoted 11 lines · Jagan Teki
Quoted 10 lines · Marek Vasut
Quoted 9 lines

Convert the designware watchdog timer driver to DM and add DT probing support. Perform minor coding style clean up, like drop superfluous braces. These ought to be no functional change.

---
 configs/socfpga_stratix10_defconfig   |  1 +
 configs/socfpga_vining_fpga_defconfig |  1 +
 drivers/watchdog/Kconfig              | 14 ++--
 drivers/watchdog/designware_wdt.c     | 97

+++++++++++++++++++--------

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 1 line
 4 files changed, 77 insertions(+), 36 deletions(-)

fyi: this is already in ML [1] and yet to pick for next MW. let me know if you have any questions?

[1] https://patchwork.ozlabs.org/patch/1153389/

It's a pity I wasn't CCed on that patch.

That patch won't work for SoCFPGA, see my reply to Ley. We will need

one

Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

which can do non-DM WDT in SPL, so I will be sending a V2 of this one which retains the common code and still supports HW_WATCHDOG in SPL and DM-WDT in U-Boot proper.

Oh, and the clock/reset stuff should be optional, since at least DM clock are not present on socfpga gen5 yet.

I'm working on that. Sadly, I haven't fou,d the time to finish it up

since

Quoted 1 line

mid August, but I'm planning to do it in the upcoming merge window.

Quoted 8 lines
Quoted 6 lines

Great!

Note that if you build a board without DM watchdog today, it complains about removal until 2019.10, so that's one issue here. The other is that I don't think we can do DM watchdog in SPL on Gen5, can we ?

If I'm not using watchdog at all, will it complain???

It only complains about non-DM watchdog in U-Boot proper.

Quoted 2 lines

I think we should be able to get that running. We'll need an idea to shrink DM SPL anyway... :-)

Using DM watchdog in SPL won't help in that direction.

There are a few boards which enable WDT early in SPL that depend on HW_WATCHDOG to enable it real early.