Skip to contentSkip to conversation

watchdog: introduce separate SPL symbol for WDT_GPIO

PATCH In review Rasmus Villemoes 3 participants 4 messages Oct 7, 2024 – Oct 23, 2024 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: introduce separate SPL symbol for WDT_GPIO

Currently, enabling WDT_GPIO on a board which uses SPL, but does not have SPL_WDT, SPL_DM_GPIO or SPL_OF_CONTROL enabled, breaks the build.

Make it possible to use the WDT_GPIO driver on such boards by introducing a separate symbol controlling whether the driver is built for SPL. Make it default to WDT_GPIO such that boards that already have it enabled and all the SPL prerequisites satisfied will continue to have it in SPL.

---
 drivers/watchdog/Kconfig  | 9 +++++++++
 drivers/watchdog/Makefile | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/watchdog/Kconfig +9 -0
index 0c3e9913318..18028269b9e 100644
@@ -178,6 +178,15 @@ config WDT_GPIO
 	  doc/device-tree-bindings/watchdog/gpio-wdt.txt for
 	  information on how to describe the watchdog in device tree.
 
+config SPL_WDT_GPIO
+	bool "External gpio watchdog support in SPL"
+	depends on SPL_WDT
+	depends on SPL_DM_GPIO
+	depends on SPL_OF_REAL
+	default WDT_GPIO
+	help
+	  Support for external watchdog fed by toggling a gpio in SPL.
+
 config WDT_MAX6370
 	bool "MAX6370 watchdog timer support"
 	depends on WDT
drivers/watchdog/Makefile +1 -1
index 7b39adcf0ff..a450c33b3ad 100644
@@ -30,7 +30,7 @@ obj-$(CONFIG_WDT_CORTINA) += cortina_wdt.o
 obj-$(CONFIG_WDT_ORION) += orion_wdt.o
 obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
 obj-$(CONFIG_WDT_FTWDT010) += ftwdt010_wdt.o
-obj-$(CONFIG_WDT_GPIO) += gpio_wdt.o
+obj-$(CONFIG_$(SPL_TPL_)WDT_GPIO) += gpio_wdt.o
 obj-$(CONFIG_WDT_MAX6370) += max6370_wdt.o
 obj-$(CONFIG_WDT_MCF) += mcf_wdt.o
 obj-$(CONFIG_WDT_MESON_GXBB) += meson_gxbb_wdt.o
Signature · 1 line
2.46.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rasmus Villemoes

Currently, enabling WDT_GPIO on a board which uses SPL, but does not have SPL_WDT, SPL_DM_GPIO or SPL_OF_CONTROL enabled, breaks the build.

Make it possible to use the WDT_GPIO driver on such boards by introducing a separate symbol controlling whether the driver is built for SPL. Make it default to WDT_GPIO such that boards that already have it enabled and all the SPL prerequisites satisfied will continue to have it in SPL.

Signature · 1 line
Tom
Reviewed-by on v1 1/1
#2 lore raw
In reply to Rasmus Villemoes
Quoted 10 lines · Rasmus Villemoes

Currently, enabling WDT_GPIO on a board which uses SPL, but does not have SPL_WDT, SPL_DM_GPIO or SPL_OF_CONTROL enabled, breaks the build.

Make it possible to use the WDT_GPIO driver on such boards by introducing a separate symbol controlling whether the driver is built for SPL. Make it default to WDT_GPIO such that boards that already have it enabled and all the SPL prerequisites satisfied will continue to have it in SPL.

Thanks,
Stefan

Quoted 30 lines
---
  drivers/watchdog/Kconfig  | 9 +++++++++
  drivers/watchdog/Makefile | 2 +-
  2 files changed, 10 insertions(+), 1 deletion(-)
drivers/watchdog/Kconfig +9 -0
index 0c3e9913318..18028269b9e 100644
@@ -178,6 +178,15 @@ config WDT_GPIO
  	  doc/device-tree-bindings/watchdog/gpio-wdt.txt for
  	  information on how to describe the watchdog in device tree.
 
+config SPL_WDT_GPIO
+	bool "External gpio watchdog support in SPL"
+	depends on SPL_WDT
+	depends on SPL_DM_GPIO
+	depends on SPL_OF_REAL
+	default WDT_GPIO
+	help
+	  Support for external watchdog fed by toggling a gpio in SPL.
+
  config WDT_MAX6370
  	bool "MAX6370 watchdog timer support"
  	depends on WDT
drivers/watchdog/Makefile +0 -0
index 7b39adcf0ff..a450c33b3ad 100644

drivers/watchdog/Makefile obj-$(CONFIG_WDT_CORTINA) += cortina_wdt.o · line 36

Quoted 8 lines
drivers/watchdog/Makefile +1 -1
@@ -30,7 +30,7 @@ obj-$(CONFIG_WDT_CORTINA) += cortina_wdt.o
  obj-$(CONFIG_WDT_ORION) += orion_wdt.o
  obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
  obj-$(CONFIG_WDT_FTWDT010) += ftwdt010_wdt.o
-obj-$(CONFIG_WDT_GPIO) += gpio_wdt.o
+obj-$(CONFIG_$(SPL_TPL_)WDT_GPIO) += gpio_wdt.o
  obj-$(CONFIG_WDT_MAX6370) += max6370_wdt.o
  obj-$(CONFIG_WDT_MCF) += mcf_wdt.o
  obj-$(CONFIG_WDT_MESON_GXBB) += meson_gxbb_wdt.o

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw
In reply to Rasmus Villemoes
Quoted 10 lines · Rasmus Villemoes

Currently, enabling WDT_GPIO on a board which uses SPL, but does not have SPL_WDT, SPL_DM_GPIO or SPL_OF_CONTROL enabled, breaks the build.

Make it possible to use the WDT_GPIO driver on such boards by introducing a separate symbol controlling whether the driver is built for SPL. Make it default to WDT_GPIO such that boards that already have it enabled and all the SPL prerequisites satisfied will continue to have it in SPL.

Applied to u-boot-watchdog/master

Thanks,
Stefan

Quoted 30 lines
---
  drivers/watchdog/Kconfig  | 9 +++++++++
  drivers/watchdog/Makefile | 2 +-
  2 files changed, 10 insertions(+), 1 deletion(-)
drivers/watchdog/Kconfig +9 -0
index 0c3e9913318..18028269b9e 100644
@@ -178,6 +178,15 @@ config WDT_GPIO
  	  doc/device-tree-bindings/watchdog/gpio-wdt.txt for
  	  information on how to describe the watchdog in device tree.
 
+config SPL_WDT_GPIO
+	bool "External gpio watchdog support in SPL"
+	depends on SPL_WDT
+	depends on SPL_DM_GPIO
+	depends on SPL_OF_REAL
+	default WDT_GPIO
+	help
+	  Support for external watchdog fed by toggling a gpio in SPL.
+
  config WDT_MAX6370
  	bool "MAX6370 watchdog timer support"
  	depends on WDT
drivers/watchdog/Makefile +0 -0
index 7b39adcf0ff..a450c33b3ad 100644

drivers/watchdog/Makefile obj-$(CONFIG_WDT_CORTINA) += cortina_wdt.o · line 36

Quoted 8 lines
drivers/watchdog/Makefile +1 -1
@@ -30,7 +30,7 @@ obj-$(CONFIG_WDT_CORTINA) += cortina_wdt.o
  obj-$(CONFIG_WDT_ORION) += orion_wdt.o
  obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
  obj-$(CONFIG_WDT_FTWDT010) += ftwdt010_wdt.o
-obj-$(CONFIG_WDT_GPIO) += gpio_wdt.o
+obj-$(CONFIG_$(SPL_TPL_)WDT_GPIO) += gpio_wdt.o
  obj-$(CONFIG_WDT_MAX6370) += max6370_wdt.o
  obj-$(CONFIG_WDT_MCF) += mcf_wdt.o
  obj-$(CONFIG_WDT_MESON_GXBB) += meson_gxbb_wdt.o

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]