Skip to contentSkip to conversation

watchdog: Split WDT from SPL_WDT

PATCH Superseded Marek Vasut 3 participants 16 messages May 12, 2019 – Jun 8, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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) || \
common/spl/spl.c +1 -1
index 0a6a47c202..f22f854718 100644
@@ -601,7 +601,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
 
drivers/watchdog/Makefile +1 -1
index 40b2f4bc66..4b94ae988c 100644
@@ -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
include/asm-generic/global_data.h +1 -1
index 02a3ed6838..7c2220643b 100644
@@ -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;
include/wdt.h +1 -1
index aa77d3e9b4..5bcff24ab3 100644
@@ -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
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 watchdog: imx: Add DM support

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/watchdog/Kconfig        |   2 +-
 drivers/watchdog/imx_watchdog.c | 119 +++++++++++++++++++++++++++-----
 2 files changed, 104 insertions(+), 17 deletions(-)
drivers/watchdog/Kconfig +1 -1
index f909d40f45..b2ebe528ab 100644
@@ -129,7 +129,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.
drivers/watchdog/imx_watchdog.c +103 -16

151 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 watchdog: imx: Add DM support

Quoted 178 lines

Subject: [U-Boot] [PATCH 2/2] watchdog: imx: Add DM support

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/watchdog/Kconfig        |   2 +-
 drivers/watchdog/imx_watchdog.c | 119
+++++++++++++++++++++++++++-----
 2 files changed, 104 insertions(+), 17 deletions(-)
drivers/watchdog/Kconfig index renamed from drivers/watchdog/Kconfig +0 -0

f909d40f45..b2ebe528ab 100644

drivers/watchdog/Kconfig +1 -1
@@ -129,7 +129,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.
(quoted diff) +0 -0

b/drivers/watchdog/imx_watchdog.c index 14cc618074..53a3e9f5c7 100644

drivers/watchdog/imx_watchdog.c +16 -2
@@ -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

drivers/watchdog/imx_watchdog.c +1 -1
+__attribute__((weak)) reset_cpu(ulong addr)
 {
-#ifndef CONFIG_WATCHDOG_RESET_DISABLE
 	struct watchdog_regs *wdog = (struct watchdog_regs

*)WDOG1_BASE_ADDR;

drivers/watchdog/imx_watchdog.c +8 -2
+	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;

drivers/watchdog/imx_watchdog.c +0 -0
 	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*/

drivers/watchdog/imx_watchdog.c +3 -3
-	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;

drivers/watchdog/imx_watchdog.c +2 -3
-	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

*/

drivers/watchdog/imx_watchdog.c +3 -5
-	while (1) {
-		/*
-		 * spin for .5 seconds before reset
-		 */
-	}
+void hw_watchdog_init(void)
+{
+	struct watchdog_regs *wdog = (struct watchdog_regs

*)WDOG1_BASE_ADDR;

drivers/watchdog/imx_watchdog.c +55 -0
+
+	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) = {

drivers/watchdog/imx_watchdog.c void hw_watchdog_init(void) · line 151

Quoted 10 lines
drivers/watchdog/imx_watchdog.c +10 -0
+	.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
Quoted 11 lines

--
2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.d
enx.de%2Flistinfo%2Fu-boot&amp;data=02%7C01%7CPeng.Fan%40nxp.com %7C3104426ece13427d689008d6d721d25b%7C686ea1d3bc2b4c6fa92cd99c 5c301635%7C0%7C0%7C636932937614272001&amp;sdata=l54tJxZN03iuNL XrqPvykahvk2YF0vduEbDU9tPFqXo%3D&amp;reserved=0

#3 lore raw

PATCH 2/2 watchdog: imx: Add DM support

In reply to Marek Vasut
Quoted 176 lines · On Sun, 12 May 2019 23:34:53 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/watchdog/Kconfig        |   2 +-
 drivers/watchdog/imx_watchdog.c | 119

+++++++++++++++++++++++++++----- 2 files changed, 104 insertions(+), 17 deletions(-)

drivers/watchdog/Kconfig +1 -1
index f909d40f45..b2ebe528ab 100644
@@ -129,7 +129,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.

(quoted diff) +0 -0

b/drivers/watchdog/imx_watchdog.c index 14cc618074..53a3e9f5c7 100644

drivers/watchdog/imx_watchdog.c +8 -2
@@ -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 */

drivers/watchdog/imx_watchdog.c +10 -1
+	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;

drivers/watchdog/imx_watchdog.c +9 -2
+	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;

drivers/watchdog/imx_watchdog.c +5 -6
 	/*
@@ -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 */

drivers/watchdog/imx_watchdog.c +3 -5
-	while (1) {
-		/*
-		 * spin for .5 seconds before reset
-		 */
-	}
+void hw_watchdog_init(void)
+{
+	struct watchdog_regs *wdog = (struct watchdog_regs

*)WDOG1_BASE_ADDR; +

drivers/watchdog/imx_watchdog.c +27 -0
+	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) +{

drivers/watchdog/imx_watchdog.c +29 -0
+	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) = {

drivers/watchdog/imx_watchdog.c void hw_watchdog_init(void) · line 151

Quoted 10 lines
drivers/watchdog/imx_watchdog.c +10 -0
+	.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

Test-HW: i.MX6Q - display5

For the record - one needs to add following code to dts file:

+ wdt-reboot {
+ compatible = "wdt-reboot";
+ wdt = <&wdog1>;
+ };

@ _defconfig:

+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y

@ include/<board_config>.h

+#if defined(CONFIG_SPL_BUILD)
+#undef CONFIG_WDT
+#undef CONFIG_WATCHDOG
+#define CONFIG_HW_WATCHDOG
+#endif

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190604/3e8c1bbf/attachment.sig>

#4 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

In reply to Marek Vasut
Quoted 75 lines

Subject: [U-Boot] [PATCH 1/2] watchdog: Split WDT from SPL_WDT

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c index renamed from common/board_r.c +0 -0

150e8cd424..988e40abb2 100644

common/board_r.c +0 -0
@@ -678,7 +678,7 @@ static init_fnc_t init_sequence_r[] = {  #ifdef

CONFIG_DM

common/board_r.c +1 -1
 	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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
drivers/watchdog/Makefile index renamed from drivers/watchdog/Makefile +0 -0

40b2f4bc66..4b94ae988c 100644

drivers/watchdog/Makefile +1 -1
@@ -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
include/asm-generic/global_data.h +1 -1
index 02a3ed6838..7c2220643b 100644
@@ -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;
include/wdt.h index aa77d3e9b4..5bcff24ab3 renamed from include/wdt.h +0 -0

100644

include/wdt.h struct wdt_ops { · line 111

Quoted 7 lines
include/wdt.h +1 -1
@@ -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
Quoted 11 lines
include/wdt.h +0 -1
--

2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.d
enx.de%2Flistinfo%2Fu-boot&amp;data=02%7C01%7CPeng.Fan%40nxp.com %7C80a98d74e79849cca5bd08d6d721cb41%7C686ea1d3bc2b4c6fa92cd99c 5c301635%7C0%7C0%7C636932937538649220&amp;sdata=JB4foxgQVteQw MUJrefgqegLm6N%2ByFq%2BfLknDE89nfo%3D&amp;reserved=0

#5 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

In reply to Marek Vasut
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
 
drivers/watchdog/Makefile +1 -1
index 40b2f4bc66..4b94ae988c 100644
@@ -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
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional

translation offset */ #endif

include/asm-generic/global_data.h +1 -1
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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

Test HW: display5 i.MX6Q device

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190604/1b014a93/attachment.sig>

#6 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
 
drivers/watchdog/Makefile +1 -1
index 40b2f4bc66..4b94ae988c 100644
@@ -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
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional

translation offset */ #endif

include/asm-generic/global_data.h +1 -1
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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  
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to watchdog_reset' +drivers/built-in.o: In function atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to

       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1

+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
14 38 1 /53 axm
boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

Quoted 10 lines

Best regards,

Lukasz Majewski

--

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

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190605/718acc7f/attachment.sig>

#7 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 106 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
 
drivers/watchdog/Makefile +1 -1
index 40b2f4bc66..4b94ae988c 100644
@@ -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
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional

translation offset */ #endif

include/asm-generic/global_data.h +1 -1
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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    
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

Quoted 18 lines
Quoted 4 lines

Best regards,

Quoted 8 lines

Lukasz Majewski

--

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

Best regards,

Quoted 8 lines

Lukasz Majewski

--

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

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190606/7484218c/attachment.sig>

#8 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 109 lines · Lukasz Majewski
Quoted 106 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
 
drivers/watchdog/Makefile +1 -1
index 40b2f4bc66..4b94ae988c 100644
@@ -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
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional

translation offset */ #endif

include/asm-generic/global_data.h +1 -1
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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    
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 7 lines
Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

What's the fix ?

I am testing this since yesterday:
https://github.com/marex/u-boot-imx/commit/c8e1bff9f332a35859e1f4d44e114c3aa639b390

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

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 117 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 116 lines · Lukasz Majewski
Quoted 107 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
 
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644

drivers/watchdog/Makefile +1 -1
@@ -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
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional

translation offset */ #endif

include/asm-generic/global_data.h +1 -1
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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      
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

Quoted 4 lines
Quoted 1 line

I will post patches when it finishes.

What's the fix ?

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

Quoted 3 lines

I am testing this since yesterday:
https://github.com/marex/u-boot-imx/commit/c8e1bff9f332a35859e1f4d44e114c3aa639b390

However, if your version is building without any issues, it looks better than mine (IMHO imply is more elegant).

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190606/bf9ec55c/attachment.sig>

#10 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 120 lines · Lukasz Majewski
Quoted 117 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 116 lines · Lukasz Majewski
Quoted 107 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +1 -1
@@ -601,7 +601,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
 
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644

drivers/watchdog/Makefile +1 -1
@@ -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
(quoted diff) +0 -0

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

(quoted diff) +0 -0
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
 	fdt_addr_t translation_offset;	/* optional

translation offset */ #endif

include/asm-generic/global_data.h +1 -1
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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      
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I will post patches when it finishes.

What's the fix ?

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

I don't think that's the right approach, it should be possible to do without explicit board config modification. I'm building another take, since some boards still failed to build.

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

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 126 lines · On Thu, 6 Jun 2019 10:08:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 125 lines · Lukasz Majewski
Quoted 121 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 110 lines · Lukasz Majewski
Quoted 107 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +0 -1
@@ -601,7 +601,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
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644

drivers/watchdog/Makefile +1 -1
@@ -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
(quoted diff) +0 -0

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)

(quoted diff) +1 -0
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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        
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 7 lines
Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

What's the fix ?

Quoted 8 lines
Quoted 3 lines

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

I don't think that's the right approach, it should be possible to do without explicit board config modification. I'm building another take, since some boards still failed to build.

Just to be clear - if it works with imply - I'm for this solution.

However, if it breaks, then we may need to find another solution (as for example shown here:
https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d
- the number of affected boards is small - just 3 of them).

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190606/a0903f6e/attachment.sig>

#12 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 138 lines · Lukasz Majewski
Quoted 126 lines · On Thu, 6 Jun 2019 10:08:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 125 lines · Lukasz Majewski
Quoted 121 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 110 lines · Lukasz Majewski
Quoted 107 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 85 lines
Quoted 71 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +0 -1
@@ -601,7 +601,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
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644

drivers/watchdog/Makefile +1 -1
@@ -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
(quoted diff) +0 -0

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)

(quoted diff) +1 -0
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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        
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 7 lines
Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

What's the fix ?

Quoted 8 lines
Quoted 3 lines

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

I don't think that's the right approach, it should be possible to do without explicit board config modification. I'm building another take, since some boards still failed to build.

Quoted 6 lines

Just to be clear - if it works with imply - I'm for this solution.

However, if it breaks, then we may need to find another solution (as for example shown here:
https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d
- the number of affected boards is small - just 3 of them).

I would very much prefer to make it work without defconfig modifications. This has to be possible, since it worked before the split.

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

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 142 lines · On Thu, 6 Jun 2019 10:23:06 +0200 Marek Vasut <[email protected]> wrote:
Quoted 141 lines · Lukasz Majewski
Quoted 127 lines · On Thu, 6 Jun 2019 10:08:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 126 lines · Lukasz Majewski
Quoted 122 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 111 lines · Lukasz Majewski
Quoted 108 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 86 lines
Quoted 72 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +0 -1
@@ -601,7 +601,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
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644 --- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile

(quoted diff) +1 -1
@@ -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
(quoted diff) +0 -0

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)

(quoted diff) +1 -0
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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          
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 7 lines
Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

What's the fix ?

Quoted 8 lines
Quoted 3 lines

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

I don't think that's the right approach, it should be possible to do without explicit board config modification. I'm building another take, since some boards still failed to build.

Just to be clear - if it works with imply - I'm for this solution.

Quoted 9 lines
Quoted 4 lines

However, if it breaks, then we may need to find another solution (as for example shown here:
https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d
- the number of affected boards is small - just 3 of them).

I would very much prefer to make it work without defconfig modifications. This has to be possible, since it worked before the split.

Ok.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190606/8fe457ea/attachment.sig>

#14 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

In reply to Marek Vasut

Hi Marek,

Quoted 142 lines · Lukasz Majewski
Quoted 141 lines
Quoted 127 lines · On Thu, 6 Jun 2019 10:08:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 126 lines · Lukasz Majewski
Quoted 122 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 111 lines · Lukasz Majewski
Quoted 108 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 86 lines
Quoted 72 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +0 -1
@@ -601,7 +601,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
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644 --- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile

(quoted diff) +1 -1
@@ -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
(quoted diff) +0 -0

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)

(quoted diff) +1 -0
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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          
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 7 lines
Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

What's the fix ?

Quoted 8 lines
Quoted 3 lines

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

I don't think that's the right approach, it should be possible to do without explicit board config modification. I'm building another take, since some boards still failed to build.

Just to be clear - if it works with imply - I'm for this solution.

Quoted 9 lines
Quoted 4 lines

However, if it breaks, then we may need to find another solution (as for example shown here:
https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d
- the number of affected boards is small - just 3 of them).

I would very much prefer to make it work without defconfig modifications. This has to be possible, since it worked before the split.

Have you managed to fix the code? Will you post revised patches soon?

Best regards and thanks in advance,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190608/d3ea901f/attachment.sig>

#15 lore raw

PATCH 1/2 watchdog: Split WDT from SPL_WDT

Quoted 149 lines · Lukasz Majewski

Hi Marek,

Quoted 147 lines · Lukasz Majewski
Quoted 145 lines
Quoted 127 lines · On Thu, 6 Jun 2019 10:08:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 126 lines · Lukasz Majewski
Quoted 122 lines · On Thu, 6 Jun 2019 09:26:04 +0200 Marek Vasut <[email protected]> wrote:
Quoted 111 lines · Lukasz Majewski
Quoted 108 lines · On Wed, 5 Jun 2019 18:24:11 +0200 Lukasz Majewski <[email protected]> wrote:

Hi Marek,

Quoted 86 lines
Quoted 72 lines · On Sun, 12 May 2019 23:34:52 +0200 Marek Vasut <[email protected]> wrote:

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.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 common/board_r.c                  | 2 +-
 common/spl/spl.c                  | 2 +-
 drivers/watchdog/Makefile         | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
common/board_r.c +1 -1
index 150e8cd424..988e40abb2 100644
@@ -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/spl.c b/common/spl/spl.c index 0a6a47c202..f22f854718 100644

common/spl/spl.c +0 -1
@@ -601,7 +601,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
(quoted diff) +0 -0

b/drivers/watchdog/Makefile index 40b2f4bc66..4b94ae988c 100644 --- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile

(quoted diff) +1 -1
@@ -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
(quoted diff) +0 -0

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)

(quoted diff) +1 -0
+#if CONFIG_IS_ENABLED(WDT)
 	struct udevice *watchdog_dev;
 #endif
 } gd_t;
include/wdt.h +0 -0
index aa77d3e9b4..5bcff24ab3 100644

include/wdt.h struct wdt_ops { · line 112

Quoted 8 lines
include/wdt.h +1 -1
@@ -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          
Quoted 2 lines

Test HW: display5 i.MX6Q device

Unfortunately this series causes build break when run on Travis-CI for some Atmel/Microchip:

arm: + picosam9g45

(quoted diff) +6 -0
+lib/built-in.o: In function `udelay':
+lib/time.c:167: undefined reference to `watchdog_reset'
+drivers/built-in.o: In function `atmel_serial_getc':
+drivers/serial/atmel_usart.c:103: undefined reference to
       `watchdog_reset' +make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   14   38    1 /53     axm

boards.cfg is up to date. Nothing to do.
Summary of current source for 53 boards (2 threads, 1 job per thread)

Quoted 7 lines
Quoted 2 lines

u-boot master SHA1: e1a2ed7180adeefb6164239a18249dca5701319d

The fix is under Travis-CI testing:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/542118403

I will post patches when it finishes.

What's the fix ?

Quoted 8 lines
Quoted 3 lines

https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d

I've explicitly enabled SPL_WDT=y for affected boards.

I don't think that's the right approach, it should be possible to do without explicit board config modification. I'm building another take, since some boards still failed to build.

Just to be clear - if it works with imply - I'm for this solution.

However, if it breaks, then we may need to find another solution (as for example shown here:
https://github.com/lmajewski/u-boot-dfu/commit/98c95790fee02296023a2906811092a1868f622d
- the number of affected boards is small - just 3 of them).

Quoted 6 lines
Quoted 4 lines

I would very much prefer to make it work without defconfig modifications. This has to be possible, since it worked before the split.

Have you managed to fix the code? Will you post revised patches soon?

Yes, when they are ready and tested.

Signature · 2 lines
Best regards,
Marek Vasut