All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
@ 2019-06-09  1:46 Marek Vasut
  2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Marek Vasut @ 2019-06-09  1:46 UTC (permalink / raw)
  To: u-boot

Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
while the full U-Boot can use rich DM/DT WDT driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Peng Fan <Peng.Fan@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
---
V2: - Make SPL_WATCHDOG_SUPPORT imply SPL_WDT if !HW_WATCHDOG
    - Add SPL_WDT Kconfig entry
---
 common/board_r.c                  | 2 +-
 common/spl/Kconfig                | 1 +
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Kconfig          | 7 +++++++
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 7 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 150e8cd424..988e40abb2 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -678,7 +678,7 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_DM
 	initr_dm,
 #endif
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	initr_watchdog,
 #endif
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c7cd34449a..09761b1db7 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -876,6 +876,7 @@ endif
 
 config SPL_WATCHDOG_SUPPORT
 	bool "Support watchdog drivers"
+	imply SPL_WDT if !HW_WATCHDOG
 	help
 	  Enable support for watchdog drivers in SPL. A watchdog is
 	  typically a hardware peripheral which can reset the system when it
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4ddeff9b51..c595697fc5 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -603,7 +603,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	spl_board_init();
 #endif
 
-#if defined(CONFIG_SPL_WATCHDOG_SUPPORT) && defined(CONFIG_WDT)
+#if defined(CONFIG_SPL_WATCHDOG_SUPPORT) && CONFIG_IS_ENABLED(WDT)
 	initr_watchdog();
 #endif
 
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index b01dbc446d..0330a3b3a1 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -161,4 +161,11 @@ config WDT_MPC8xx
 	help
 	   Select this to enable mpc8xx watchdog timer
 
+config SPL_WDT
+	bool "Enable driver model for watchdog timer drivers in SPL"
+	depends on SPL_DM
+	help
+	  Enable driver model for watchdog timer in SPL.
+	  This is similar to CONFIG_WDT in U-Boot.
+
 endmenu
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 6f20e73810..fe8023bda2 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
 obj-$(CONFIG_TANGIER_WATCHDOG) += tangier_wdt.o
 obj-$(CONFIG_ULP_WATCHDOG) += ulp_wdog.o
-obj-$(CONFIG_WDT) += wdt-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)WDT) += wdt-uclass.o
 obj-$(CONFIG_WDT_SANDBOX) += sandbox_wdt.o
 obj-$(CONFIG_WDT_ARMADA_37XX) += armada-37xx-wdt.o
 obj-$(CONFIG_WDT_ASPEED) += ast_wdt.o
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 02a3ed6838..7c2220643b 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional translation offset */
 #endif
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
diff --git a/include/wdt.h b/include/wdt.h
index aa77d3e9b4..5bcff24ab3 100644
--- a/include/wdt.h
+++ b/include/wdt.h
@@ -106,7 +106,7 @@ struct wdt_ops {
 	int (*expire_now)(struct udevice *dev, ulong flags);
 };
 
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS	(60 * 1000)
 #endif
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support
  2019-06-09  1:46 [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Marek Vasut
@ 2019-06-09  1:46 ` Marek Vasut
  2019-06-11  5:33   ` Heiko Schocher
                     ` (2 more replies)
  2019-06-12  4:00 ` [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Heiko Schocher
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 13+ messages in thread
From: Marek Vasut @ 2019-06-09  1:46 UTC (permalink / raw)
  To: u-boot

Add DM and DT probing support to iMX watchdog driver. This should
allow boards to move over to this driver, enable SYSRESET_WATCHDOG
to handle cpu_reset() if required.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Peng Fan <Peng.Fan@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
---
V2: No change
---
 drivers/watchdog/Kconfig        |   2 +-
 drivers/watchdog/imx_watchdog.c | 119 +++++++++++++++++++++++++++-----
 2 files changed, 104 insertions(+), 17 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 0330a3b3a1..5993865647 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -136,7 +136,7 @@ config XILINX_TB_WATCHDOG
 
 config IMX_WATCHDOG
 	bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
-	select HW_WATCHDOG
+	select HW_WATCHDOG if !WDT
 	help
 	   Select this to enable the IMX and LSCH2 of Layerscape watchdog
 	   driver.
diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
index 14cc618074..53a3e9f5c7 100644
--- a/drivers/watchdog/imx_watchdog.c
+++ b/drivers/watchdog/imx_watchdog.c
@@ -5,7 +5,9 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <asm/io.h>
+#include <wdt.h>
 #include <watchdog.h>
 #include <asm/arch/imx-regs.h>
 #ifdef CONFIG_FSL_LSCH2
@@ -13,20 +15,40 @@
 #endif
 #include <fsl_wdog.h>
 
-#ifdef CONFIG_IMX_WATCHDOG
-void hw_watchdog_reset(void)
+static void imx_watchdog_expire_now(struct watchdog_regs *wdog)
+{
+	clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE);
+
+	writew(0x5555, &wdog->wsr);
+	writew(0xaaaa, &wdog->wsr);	/* load minimum 1/2 second timeout */
+	while (1) {
+		/*
+		 * spin for .5 seconds before reset
+		 */
+	}
+}
+
+#if !defined(CONFIG_IMX_WATCHDOG) || \
+    (defined(CONFIG_IMX_WATCHDOG) && !CONFIG_IS_ENABLED(WDT))
+void __attribute__((weak)) reset_cpu(ulong addr)
 {
-#ifndef CONFIG_WATCHDOG_RESET_DISABLE
 	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
+	imx_watchdog_expire_now(wdog);
+}
+#endif
+
+#if defined(CONFIG_IMX_WATCHDOG)
+static void imx_watchdog_reset(struct watchdog_regs *wdog)
+{
+#ifndef CONFIG_WATCHDOG_RESET_DISABLE
 	writew(0x5555, &wdog->wsr);
 	writew(0xaaaa, &wdog->wsr);
 #endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
 }
 
-void hw_watchdog_init(void)
+static void imx_watchdog_init(struct watchdog_regs *wdog)
 {
-	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 	u16 timeout;
 
 	/*
@@ -44,21 +66,86 @@ void hw_watchdog_init(void)
 	writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
 		WCR_WDA | SET_WCR_WT(timeout), &wdog->wcr);
 #endif /* CONFIG_FSL_LSCH2*/
-	hw_watchdog_reset();
+	imx_watchdog_reset(wdog);
 }
-#endif
 
-void __attribute__((weak)) reset_cpu(ulong addr)
+#if !CONFIG_IS_ENABLED(WDT)
+void hw_watchdog_reset(void)
 {
 	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
 
-	clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE);
+	imx_watchdog_reset(wdog);
+}
 
-	writew(0x5555, &wdog->wsr);
-	writew(0xaaaa, &wdog->wsr);	/* load minimum 1/2 second timeout */
-	while (1) {
-		/*
-		 * spin for .5 seconds before reset
-		 */
-	}
+void hw_watchdog_init(void)
+{
+	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+	imx_watchdog_init(wdog);
+}
+#else
+struct imx_wdt_priv {
+	void __iomem *base;
+};
+
+static int imx_wdt_reset(struct udevice *dev)
+{
+	struct imx_wdt_priv *priv = dev_get_priv(dev);
+
+	imx_watchdog_reset(priv->base);
+
+	return 0;
+}
+
+static int imx_wdt_expire_now(struct udevice *dev, ulong flags)
+{
+	struct imx_wdt_priv *priv = dev_get_priv(dev);
+
+	imx_watchdog_expire_now(priv->base);
+	hang();
+
+	return 0;
+}
+
+static int imx_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
+{
+	struct imx_wdt_priv *priv = dev_get_priv(dev);
+
+	imx_watchdog_init(priv->base);
+
+	return 0;
+}
+
+static int imx_wdt_probe(struct udevice *dev)
+{
+	struct imx_wdt_priv *priv = dev_get_priv(dev);
+
+	priv->base = dev_read_addr_ptr(dev);
+	if (!priv->base)
+		return -ENOENT;
+
+	return 0;
 }
+
+static const struct wdt_ops imx_wdt_ops = {
+	.start		= imx_wdt_start,
+	.reset		= imx_wdt_reset,
+	.expire_now	= imx_wdt_expire_now,
+};
+
+static const struct udevice_id imx_wdt_ids[] = {
+	{ .compatible = "fsl,imx21-wdt" },
+	{}
+};
+
+U_BOOT_DRIVER(imx_wdt) = {
+	.name		= "imx_wdt",
+	.id		= UCLASS_WDT,
+	.of_match	= imx_wdt_ids,
+	.probe		= imx_wdt_probe,
+	.ops		= &imx_wdt_ops,
+	.priv_auto_alloc_size = sizeof(struct imx_wdt_priv),
+	.flags		= DM_FLAG_PRE_RELOC,
+};
+#endif
+#endif
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support
  2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
@ 2019-06-11  5:33   ` Heiko Schocher
  2019-06-11  9:55     ` Marek Vasut
  2019-06-12  4:01   ` Heiko Schocher
  2019-07-20  9:06   ` sbabic at denx.de
  2 siblings, 1 reply; 13+ messages in thread
From: Heiko Schocher @ 2019-06-11  5:33 UTC (permalink / raw)
  To: u-boot

Hello Marek,

Am 09.06.2019 um 03:46 schrieb Marek Vasut:
> Add DM and DT probing support to iMX watchdog driver. This should
> allow boards to move over to this driver, enable SYSRESET_WATCHDOG
> to handle cpu_reset() if required.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Peng Fan <Peng.Fan@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> V2: No change
> ---
>   drivers/watchdog/Kconfig        |   2 +-
>   drivers/watchdog/imx_watchdog.c | 119 +++++++++++++++++++++++++++-----
>   2 files changed, 104 insertions(+), 17 deletions(-)

just worked on similiar patch (not ready for mainline) ... patch looks
good to me, but I stumbled over a nitpick ...

CONFIG_WATCHDOG_TIMEOUT_MSECS is defined in imx_watchdog to 128000 ms

37 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
38 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
39 #endif

If now using DM approach it is set to 60000 ms, see include/wdt.h

109 #if defined(CONFIG_WDT)
110 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
111 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   (60 * 1000)
112 #endif
113 #define WATCHDOG_TIMEOUT_SECS   (CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000)

Can you try my patch:
https://github.com/hsdenx/u-boot-test/commit/11503dba89cade8b81ee9d93d503d0bcce868b33

which moves WATCHDOG_TIMEOUT_MSECS to Kconfig ?
(Travis build just started, may not mainline ready, also patman
  notes in commit messages can now be removed.)

Thanks!

bye,
Heiko
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 0330a3b3a1..5993865647 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -136,7 +136,7 @@ config XILINX_TB_WATCHDOG
>   
>   config IMX_WATCHDOG
>   	bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP"
> -	select HW_WATCHDOG
> +	select HW_WATCHDOG if !WDT
>   	help
>   	   Select this to enable the IMX and LSCH2 of Layerscape watchdog
>   	   driver.
> diff --git a/drivers/watchdog/imx_watchdog.c b/drivers/watchdog/imx_watchdog.c
> index 14cc618074..53a3e9f5c7 100644
> --- a/drivers/watchdog/imx_watchdog.c
> +++ b/drivers/watchdog/imx_watchdog.c
> @@ -5,7 +5,9 @@
>    */
>   
>   #include <common.h>
> +#include <dm.h>
>   #include <asm/io.h>
> +#include <wdt.h>
>   #include <watchdog.h>
>   #include <asm/arch/imx-regs.h>
>   #ifdef CONFIG_FSL_LSCH2
> @@ -13,20 +15,40 @@
>   #endif
>   #include <fsl_wdog.h>
>   
> -#ifdef CONFIG_IMX_WATCHDOG
> -void hw_watchdog_reset(void)
> +static void imx_watchdog_expire_now(struct watchdog_regs *wdog)
> +{
> +	clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE);
> +
> +	writew(0x5555, &wdog->wsr);
> +	writew(0xaaaa, &wdog->wsr);	/* load minimum 1/2 second timeout */
> +	while (1) {
> +		/*
> +		 * spin for .5 seconds before reset
> +		 */
> +	}
> +}
> +
> +#if !defined(CONFIG_IMX_WATCHDOG) || \
> +    (defined(CONFIG_IMX_WATCHDOG) && !CONFIG_IS_ENABLED(WDT))
> +void __attribute__((weak)) reset_cpu(ulong addr)
>   {
> -#ifndef CONFIG_WATCHDOG_RESET_DISABLE
>   	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
>   
> +	imx_watchdog_expire_now(wdog);
> +}
> +#endif
> +
> +#if defined(CONFIG_IMX_WATCHDOG)
> +static void imx_watchdog_reset(struct watchdog_regs *wdog)
> +{
> +#ifndef CONFIG_WATCHDOG_RESET_DISABLE
>   	writew(0x5555, &wdog->wsr);
>   	writew(0xaaaa, &wdog->wsr);
>   #endif /* CONFIG_WATCHDOG_RESET_DISABLE*/
>   }
>   
> -void hw_watchdog_init(void)
> +static void imx_watchdog_init(struct watchdog_regs *wdog)
>   {
> -	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
>   	u16 timeout;
>   
>   	/*
> @@ -44,21 +66,86 @@ void hw_watchdog_init(void)
>   	writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS |
>   		WCR_WDA | SET_WCR_WT(timeout), &wdog->wcr);
>   #endif /* CONFIG_FSL_LSCH2*/
> -	hw_watchdog_reset();
> +	imx_watchdog_reset(wdog);
>   }
> -#endif
>   
> -void __attribute__((weak)) reset_cpu(ulong addr)
> +#if !CONFIG_IS_ENABLED(WDT)
> +void hw_watchdog_reset(void)
>   {
>   	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
>   
> -	clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE);
> +	imx_watchdog_reset(wdog);
> +}
>   
> -	writew(0x5555, &wdog->wsr);
> -	writew(0xaaaa, &wdog->wsr);	/* load minimum 1/2 second timeout */
> -	while (1) {
> -		/*
> -		 * spin for .5 seconds before reset
> -		 */
> -	}
> +void hw_watchdog_init(void)
> +{
> +	struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
> +
> +	imx_watchdog_init(wdog);
> +}
> +#else
> +struct imx_wdt_priv {
> +	void __iomem *base;
> +};
> +
> +static int imx_wdt_reset(struct udevice *dev)
> +{
> +	struct imx_wdt_priv *priv = dev_get_priv(dev);
> +
> +	imx_watchdog_reset(priv->base);
> +
> +	return 0;
> +}
> +
> +static int imx_wdt_expire_now(struct udevice *dev, ulong flags)
> +{
> +	struct imx_wdt_priv *priv = dev_get_priv(dev);
> +
> +	imx_watchdog_expire_now(priv->base);
> +	hang();
> +
> +	return 0;
> +}
> +
> +static int imx_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
> +{
> +	struct imx_wdt_priv *priv = dev_get_priv(dev);
> +
> +	imx_watchdog_init(priv->base);
> +
> +	return 0;
> +}
> +
> +static int imx_wdt_probe(struct udevice *dev)
> +{
> +	struct imx_wdt_priv *priv = dev_get_priv(dev);
> +
> +	priv->base = dev_read_addr_ptr(dev);
> +	if (!priv->base)
> +		return -ENOENT;
> +
> +	return 0;
>   }
> +
> +static const struct wdt_ops imx_wdt_ops = {
> +	.start		= imx_wdt_start,
> +	.reset		= imx_wdt_reset,
> +	.expire_now	= imx_wdt_expire_now,
> +};
> +
> +static const struct udevice_id imx_wdt_ids[] = {
> +	{ .compatible = "fsl,imx21-wdt" },
> +	{}
> +};
> +
> +U_BOOT_DRIVER(imx_wdt) = {
> +	.name		= "imx_wdt",
> +	.id		= UCLASS_WDT,
> +	.of_match	= imx_wdt_ids,
> +	.probe		= imx_wdt_probe,
> +	.ops		= &imx_wdt_ops,
> +	.priv_auto_alloc_size = sizeof(struct imx_wdt_priv),
> +	.flags		= DM_FLAG_PRE_RELOC,
> +};
> +#endif
> +#endif
> 

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support
  2019-06-11  5:33   ` Heiko Schocher
@ 2019-06-11  9:55     ` Marek Vasut
  2019-06-12  3:26       ` Heiko Schocher
  0 siblings, 1 reply; 13+ messages in thread
From: Marek Vasut @ 2019-06-11  9:55 UTC (permalink / raw)
  To: u-boot

On 6/11/19 7:33 AM, Heiko Schocher wrote:
> Hello Marek,
> 
> Am 09.06.2019 um 03:46 schrieb Marek Vasut:
>> Add DM and DT probing support to iMX watchdog driver. This should
>> allow boards to move over to this driver, enable SYSRESET_WATCHDOG
>> to handle cpu_reset() if required.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Peng Fan <Peng.Fan@freescale.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> ---
>> V2: No change
>> ---
>>   drivers/watchdog/Kconfig        |   2 +-
>>   drivers/watchdog/imx_watchdog.c | 119 +++++++++++++++++++++++++++-----
>>   2 files changed, 104 insertions(+), 17 deletions(-)
> 
> just worked on similiar patch (not ready for mainline) ... patch looks
> good to me, but I stumbled over a nitpick ...
> 
> CONFIG_WATCHDOG_TIMEOUT_MSECS is defined in imx_watchdog to 128000 ms
> 
> 37 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
> 38 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
> 39 #endif
> 
> If now using DM approach it is set to 60000 ms, see include/wdt.h
> 
> 109 #if defined(CONFIG_WDT)
> 110 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
> 111 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   (60 * 1000)
> 112 #endif
> 113 #define WATCHDOG_TIMEOUT_SECS   (CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000)
> 
> Can you try my patch:
> https://github.com/hsdenx/u-boot-test/commit/11503dba89cade8b81ee9d93d503d0bcce868b33
> 
> 
> which moves WATCHDOG_TIMEOUT_MSECS to Kconfig ?
> (Travis build just started, may not mainline ready, also patman
>  notes in commit messages can now be removed.)

Looks good to me :)

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support
  2019-06-11  9:55     ` Marek Vasut
@ 2019-06-12  3:26       ` Heiko Schocher
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Schocher @ 2019-06-12  3:26 UTC (permalink / raw)
  To: u-boot

Hello Marek,

Am 11.06.2019 um 11:55 schrieb Marek Vasut:
> On 6/11/19 7:33 AM, Heiko Schocher wrote:
>> Hello Marek,
>>
>> Am 09.06.2019 um 03:46 schrieb Marek Vasut:
>>> Add DM and DT probing support to iMX watchdog driver. This should
>>> allow boards to move over to this driver, enable SYSRESET_WATCHDOG
>>> to handle cpu_reset() if required.
>>>
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Peng Fan <Peng.Fan@freescale.com>
>>> Cc: Stefano Babic <sbabic@denx.de>
>>> ---
>>> V2: No change
>>> ---
>>>    drivers/watchdog/Kconfig        |   2 +-
>>>    drivers/watchdog/imx_watchdog.c | 119 +++++++++++++++++++++++++++-----
>>>    2 files changed, 104 insertions(+), 17 deletions(-)
>>
>> just worked on similiar patch (not ready for mainline) ... patch looks
>> good to me, but I stumbled over a nitpick ...
>>
>> CONFIG_WATCHDOG_TIMEOUT_MSECS is defined in imx_watchdog to 128000 ms
>>
>> 37 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
>> 38 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000
>> 39 #endif
>>
>> If now using DM approach it is set to 60000 ms, see include/wdt.h
>>
>> 109 #if defined(CONFIG_WDT)
>> 110 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
>> 111 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   (60 * 1000)
>> 112 #endif
>> 113 #define WATCHDOG_TIMEOUT_SECS   (CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000)
>>
>> Can you try my patch:
>> https://github.com/hsdenx/u-boot-test/commit/11503dba89cade8b81ee9d93d503d0bcce868b33
>>
>>
>> which moves WATCHDOG_TIMEOUT_MSECS to Kconfig ?
>> (Travis build just started, may not mainline ready, also patman
>>   notes in commit messages can now be removed.)
> 
> Looks good to me :)

Fine, so I rework the commit message and post it.

Thanks!

bye,
Heiko
-- 
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
  2019-06-09  1:46 [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Marek Vasut
  2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
@ 2019-06-12  4:00 ` Heiko Schocher
  2019-07-01  6:45 ` Suniel Mahesh
  2019-07-20  8:45 ` sbabic at denx.de
  3 siblings, 0 replies; 13+ messages in thread
From: Heiko Schocher @ 2019-06-12  4:00 UTC (permalink / raw)
  To: u-boot

Hello Marek,

Am 09.06.2019 um 03:46 schrieb Marek Vasut:
> Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
> while the full U-Boot can use rich DM/DT WDT driver.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Peng Fan <Peng.Fan@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> V2: - Make SPL_WATCHDOG_SUPPORT imply SPL_WDT if !HW_WATCHDOG
>      - Add SPL_WDT Kconfig entry
> ---
>   common/board_r.c                  | 2 +-
>   common/spl/Kconfig                | 1 +
>   common/spl/spl.c                  | 2 +-
>   drivers/watchdog/Kconfig          | 7 +++++++
>   drivers/watchdog/Makefile         | 2 +-
>   include/asm-generic/global_data.h | 2 +-
>   include/wdt.h                     | 2 +-
>   7 files changed, 13 insertions(+), 5 deletions(-)

Tested on the aristainetos board.

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support
  2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
  2019-06-11  5:33   ` Heiko Schocher
@ 2019-06-12  4:01   ` Heiko Schocher
  2019-07-20  9:06   ` sbabic at denx.de
  2 siblings, 0 replies; 13+ messages in thread
From: Heiko Schocher @ 2019-06-12  4:01 UTC (permalink / raw)
  To: u-boot

Hello Marek,

Am 09.06.2019 um 03:46 schrieb Marek Vasut:
> Add DM and DT probing support to iMX watchdog driver. This should
> allow boards to move over to this driver, enable SYSRESET_WATCHDOG
> to handle cpu_reset() if required.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Peng Fan <Peng.Fan@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> V2: No change
> ---
>   drivers/watchdog/Kconfig        |   2 +-
>   drivers/watchdog/imx_watchdog.c | 119 +++++++++++++++++++++++++++-----
>   2 files changed, 104 insertions(+), 17 deletions(-)

Tested on the aristainetos board.

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
  2019-06-09  1:46 [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Marek Vasut
  2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
  2019-06-12  4:00 ` [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Heiko Schocher
@ 2019-07-01  6:45 ` Suniel Mahesh
  2019-07-01 20:25   ` Marek Vasut
  2019-07-20  8:45 ` sbabic at denx.de
  3 siblings, 1 reply; 13+ messages in thread
From: Suniel Mahesh @ 2019-07-01  6:45 UTC (permalink / raw)
  To: u-boot

Hi Marek,

May I know if this patch series is still under review ?

I have converted OMAP3 watchdog driver into driver model for TI AM33XX based SOC and tested corresponding
patches on BeagleBone Black board.

Because of SPL size constraints, I have to disable driver model for watchdog in SPL. Some of the changes I
have done are in agreement with your work and I thought it would be better to pause until this change set gets
accepted(avoiding patch duplication), especially changes in :

common/spl/spl.c
drivers/watchdog/Kconfig
drivers/watchdog/Makefile

These changes are tested on AM335X based BeagleBone Black, and they look good.

Regards
-- 
Suniel Mahesh
Embedded Linux, Kernel & U-Boot engineer
https://github.com/sunielmahesh
www.tuxtrons.com
https://github.com/techveda
Hyderabad, India

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
  2019-07-01  6:45 ` Suniel Mahesh
@ 2019-07-01 20:25   ` Marek Vasut
  2019-07-08 10:05     ` Suniel Mahesh
  2019-07-12  4:34     ` Suniel Mahesh
  0 siblings, 2 replies; 13+ messages in thread
From: Marek Vasut @ 2019-07-01 20:25 UTC (permalink / raw)
  To: u-boot

On 7/1/19 8:45 AM, Suniel Mahesh wrote:
> Hi Marek,
> 
> May I know if this patch series is still under review ?

I guess Stefano is taking them for next ... or ?

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
  2019-07-01 20:25   ` Marek Vasut
@ 2019-07-08 10:05     ` Suniel Mahesh
  2019-07-12  4:34     ` Suniel Mahesh
  1 sibling, 0 replies; 13+ messages in thread
From: Suniel Mahesh @ 2019-07-08 10:05 UTC (permalink / raw)
  To: u-boot

On 02/07/19 01:55, Marek Vasut wrote:
> On 7/1/19 8:45 AM, Suniel Mahesh wrote:
>> Hi Marek,
>>
>> May I know if this patch series is still under review ?
> 
> I guess Stefano is taking them for next ... or ?
> 
Hi Marek,

Because of this change set applied to u-boot, this patch might not apply, especially
changes in common/board_r.c (please verify)

# 84b2416b6a0531a9ad46a4e445e558f183c50171
board_r: move initr_watchdog to be called after initr_serial

Reported by: Suniel Mahesh <sunil.m@techveda.org>

Thanks and Regards
Sunil

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
  2019-07-01 20:25   ` Marek Vasut
  2019-07-08 10:05     ` Suniel Mahesh
@ 2019-07-12  4:34     ` Suniel Mahesh
  1 sibling, 0 replies; 13+ messages in thread
From: Suniel Mahesh @ 2019-07-12  4:34 UTC (permalink / raw)
  To: u-boot

On 02/07/19 01:55, Marek Vasut wrote:
> On 7/1/19 8:45 AM, Suniel Mahesh wrote:
>> Hi Marek,
>>
>> May I know if this patch series is still under review ?
> 
> I guess Stefano is taking them for next ... or ?
> 

Hi Marek/Stefano,

Because of this entry "Make SPL_WATCHDOG_SUPPORT imply SPL_WDT if !HW_WATCHDOG",
SPL_WDT is getting enabled by default, when board configuration is done.

For AM335X based beaglebone black, we dont need SPL_WDT, as the built image is getting
too big to fit into SRAM.

Is it fine if I disable SPL_WDT in board defconfig file ? used the following entry in defconfig
# CONFIG_SPL_WDT is not set (couldn't find a proper place to disable it, except in defconfig)

with this the build is fine and board boots.

Tested on the beaglebone black board.

Tested-by: Suniel Mahesh <sunil.m@techveda.org>

Thanks
Sunil

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot]  [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT
  2019-06-09  1:46 [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Marek Vasut
                   ` (2 preceding siblings ...)
  2019-07-01  6:45 ` Suniel Mahesh
@ 2019-07-20  8:45 ` sbabic at denx.de
  3 siblings, 0 replies; 13+ messages in thread
From: sbabic at denx.de @ 2019-07-20  8:45 UTC (permalink / raw)
  To: u-boot

> Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
> while the full U-Boot can use rich DM/DT WDT driver.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Peng Fan <Peng.Fan@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Tested-by: Heiko Schocher <hs@denx.de>
> Tested-by: Suniel Mahesh <sunil.m@techveda.org>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot]  [PATCH V2 2/2] watchdog: imx: Add DM support
  2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
  2019-06-11  5:33   ` Heiko Schocher
  2019-06-12  4:01   ` Heiko Schocher
@ 2019-07-20  9:06   ` sbabic at denx.de
  2 siblings, 0 replies; 13+ messages in thread
From: sbabic at denx.de @ 2019-07-20  9:06 UTC (permalink / raw)
  To: u-boot

> Add DM and DT probing support to iMX watchdog driver. This should
> allow boards to move over to this driver, enable SYSRESET_WATCHDOG
> to handle cpu_reset() if required.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Peng Fan <Peng.Fan@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Tested-by: Heiko Schocher <hs@denx.de>

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-07-20  9:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-09  1:46 [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Marek Vasut
2019-06-09  1:46 ` [U-Boot] [PATCH V2 2/2] watchdog: imx: Add DM support Marek Vasut
2019-06-11  5:33   ` Heiko Schocher
2019-06-11  9:55     ` Marek Vasut
2019-06-12  3:26       ` Heiko Schocher
2019-06-12  4:01   ` Heiko Schocher
2019-07-20  9:06   ` sbabic at denx.de
2019-06-12  4:00 ` [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT Heiko Schocher
2019-07-01  6:45 ` Suniel Mahesh
2019-07-01 20:25   ` Marek Vasut
2019-07-08 10:05     ` Suniel Mahesh
2019-07-12  4:34     ` Suniel Mahesh
2019-07-20  8:45 ` sbabic at denx.de

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.