drivers: watchdog: Allow WDT_DISABLE_AT_BOOT only when supported

Introduce a hidden Kconfig option named HAS_WDT_DISABLE_AT_BOOT and
allow users to enable WDT_DISABLE_AT_BOOT only when that hidden option
is selected by a watchdog driver, i.e. disabling at boot is supported.
Select this new hidden option for all existing watchdog drivers that
refer to WDT_DISABLE_AT_BOOT.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2024-05-21 16:57:07 +02:00 committed by Carles Cufí
commit 7abb9d7593
20 changed files with 23 additions and 1 deletions

View file

@ -11,8 +11,12 @@ menuconfig WATCHDOG
if WATCHDOG if WATCHDOG
config HAS_WDT_DISABLE_AT_BOOT
bool
config WDT_DISABLE_AT_BOOT config WDT_DISABLE_AT_BOOT
bool "Disable at boot" bool "Disable at boot"
depends on HAS_WDT_DISABLE_AT_BOOT
help help
Disable watchdog at Zephyr system startup. Disable watchdog at Zephyr system startup.

View file

@ -9,6 +9,7 @@ config WDT_ANDES_ATCWDT200
bool "Andes Watchdog driver" bool "Andes Watchdog driver"
default y default y
depends on DT_HAS_ANDESTECH_ATCWDT200_ENABLED depends on DT_HAS_ANDESTECH_ATCWDT200_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
select COUNTER select COUNTER
help help
Enable driver for the Andes Watchdog driver. Enable driver for the Andes Watchdog driver.

View file

@ -5,6 +5,7 @@ config WDT_CC13XX_CC26XX
bool "Watchdog Driver for CC13xx / CC26xx family of MCUs" bool "Watchdog Driver for CC13xx / CC26xx family of MCUs"
default y default y
depends on DT_HAS_TI_CC13XX_CC26XX_WATCHDOG_ENABLED depends on DT_HAS_TI_CC13XX_CC26XX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable watchdog for CC13xx / CC26xx family of MCUs Enable watchdog for CC13xx / CC26xx family of MCUs

View file

@ -5,6 +5,7 @@ config WDT_CC32XX
bool "Watchdog Driver for cc32xx family of MCUs" bool "Watchdog Driver for cc32xx family of MCUs"
default y default y
depends on DT_HAS_TI_CC32XX_WATCHDOG_ENABLED depends on DT_HAS_TI_CC32XX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Watchdog for cc32xx family of MCUs Watchdog for cc32xx family of MCUs

View file

@ -7,5 +7,6 @@ config WDT_DW
bool "Synopsys DesignWare Watchdog driver" bool "Synopsys DesignWare Watchdog driver"
default y default y
depends on DT_HAS_SNPS_DESIGNWARE_WATCHDOG_ENABLED depends on DT_HAS_SNPS_DESIGNWARE_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Synopsys DesignWare Watchdog driver. Synopsys DesignWare Watchdog driver.

View file

@ -5,5 +5,6 @@ config WDT_ENE_KB1200
bool "ENE KB1200 watchdog driver" bool "ENE KB1200 watchdog driver"
default y default y
depends on DT_HAS_ENE_KB1200_WATCHDOG_ENABLED depends on DT_HAS_ENE_KB1200_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
This option enables the KB1200 watchdog driver. This option enables the KB1200 watchdog driver.

View file

@ -7,5 +7,6 @@ config WDT_ESP32
bool "ESP32 Watchdog (WDT) Driver" bool "ESP32 Watchdog (WDT) Driver"
default y default y
depends on DT_HAS_ESPRESSIF_ESP32_WATCHDOG_ENABLED depends on DT_HAS_ESPRESSIF_ESP32_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable WDT driver for ESP32. Enable WDT driver for ESP32.

View file

@ -5,6 +5,7 @@ config FWDGT_GD32
bool "GD32 Free watchdog timer (FWDGT) driver" bool "GD32 Free watchdog timer (FWDGT) driver"
default y default y
depends on DT_HAS_GD_GD32_FWDGT_ENABLED depends on DT_HAS_GD_GD32_FWDGT_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
select USE_GD32_FWDGT select USE_GD32_FWDGT
help help
Enable the Free watchdog timer (FWDGT) driver for GD32 SoCs. Enable the Free watchdog timer (FWDGT) driver for GD32 SoCs.

View file

@ -9,7 +9,7 @@ config WDT_GECKO
bool "Gecko series Watchdog (WDOG) Driver" bool "Gecko series Watchdog (WDOG) Driver"
default y default y
depends on DT_HAS_SILABS_GECKO_WDOG_ENABLED depends on DT_HAS_SILABS_GECKO_WDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
select SOC_GECKO_WDOG select SOC_GECKO_WDOG
default y
help help
Enable WDOG driver for Silicon Labs Gecko MCUs. Enable WDOG driver for Silicon Labs Gecko MCUs.

View file

@ -5,6 +5,7 @@ config WDT_ITE_IT8XXX2
bool "ITE it8xxx2 Watchdog Timer (WDT) driver" bool "ITE it8xxx2 Watchdog Timer (WDT) driver"
default y default y
depends on DT_HAS_ITE_IT8XXX2_WATCHDOG_ENABLED depends on DT_HAS_ITE_IT8XXX2_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
This option enables the Watchdog Timer driver for ITE it8xxx2. This option enables the Watchdog Timer driver for ITE it8xxx2.
This driver supports only one channel that id is 0 and 16-bits This driver supports only one channel that id is 0 and 16-bits

View file

@ -7,6 +7,7 @@ config WDT_NPCX
bool "Nuvoton NPCX embedded controller (EC) Watchdog Timer driver" bool "Nuvoton NPCX embedded controller (EC) Watchdog Timer driver"
default y default y
depends on DT_HAS_NUVOTON_NPCX_WATCHDOG_ENABLED depends on DT_HAS_NUVOTON_NPCX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
This option enables the Watchdog Timer driver for NPCX family of This option enables the Watchdog Timer driver for NPCX family of
processors. processors.

View file

@ -5,6 +5,7 @@ config WDT_RPI_PICO
bool "Raspberry Pi Pico Watchdog driver" bool "Raspberry Pi Pico Watchdog driver"
default y default y
depends on DT_HAS_RASPBERRYPI_PICO_WATCHDOG_ENABLED depends on DT_HAS_RASPBERRYPI_PICO_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
config WDT_RPI_PICO_INITIAL_TIMEOUT config WDT_RPI_PICO_INITIAL_TIMEOUT
int "Default watchdog timeout in us" int "Default watchdog timeout in us"

View file

@ -7,5 +7,6 @@ config WDT_SAM
bool "Atmel SAM MCU Family Watchdog (WDT) Driver" bool "Atmel SAM MCU Family Watchdog (WDT) Driver"
default y default y
depends on DT_HAS_ATMEL_SAM_WATCHDOG_ENABLED depends on DT_HAS_ATMEL_SAM_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable WDT driver for Atmel SAM MCUs. Enable WDT driver for Atmel SAM MCUs.

View file

@ -7,5 +7,6 @@ config WDT_SAM0
bool "Atmel SAM0 series Watchdog (WDT) Driver" bool "Atmel SAM0 series Watchdog (WDT) Driver"
default y default y
depends on DT_HAS_ATMEL_SAM0_WATCHDOG_ENABLED depends on DT_HAS_ATMEL_SAM0_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable WDT driver for Atmel SAM0 MCUs. Enable WDT driver for Atmel SAM0 MCUs.

View file

@ -7,5 +7,6 @@ config WDT_SIFIVE
bool "SiFive Watchdog (WDT) Driver" bool "SiFive Watchdog (WDT) Driver"
default y default y
depends on DT_HAS_SIFIVE_WDT_ENABLED depends on DT_HAS_SIFIVE_WDT_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
This option enables WDT driver for SiFive Freedom. This option enables WDT driver for SiFive Freedom.

View file

@ -7,6 +7,7 @@ config WDT_SMARTBOND
bool "Watchdog Driver for Smartbond family of MCUs" bool "Watchdog Driver for Smartbond family of MCUs"
default y default y
depends on DT_HAS_RENESAS_SMARTBOND_WATCHDOG_ENABLED depends on DT_HAS_RENESAS_SMARTBOND_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable watchdog driver for Smartbond line of MCUs Enable watchdog driver for Smartbond line of MCUs

View file

@ -9,6 +9,7 @@ config IWDG_STM32
bool "Independent Watchdog (IWDG) Driver for STM32 family of MCUs" bool "Independent Watchdog (IWDG) Driver for STM32 family of MCUs"
default y default y
depends on DT_HAS_ST_STM32_WATCHDOG_ENABLED depends on DT_HAS_ST_STM32_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable IWDG driver for STM32 line of MCUs Enable IWDG driver for STM32 line of MCUs

View file

@ -7,5 +7,6 @@ config WDT_TCO
bool "Intel TCO Watchdog driver" bool "Intel TCO Watchdog driver"
default y default y
depends on DT_HAS_INTEL_TCO_WDT_ENABLED depends on DT_HAS_INTEL_TCO_WDT_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable support for Intel TCO WDT driver. Enable support for Intel TCO WDT driver.

View file

@ -7,5 +7,6 @@ config WDT_XEC
bool "Microchip XEC series Watchdog Timer (WDT) driver" bool "Microchip XEC series Watchdog Timer (WDT) driver"
default y default y
depends on DT_HAS_MICROCHIP_XEC_WATCHDOG_ENABLED depends on DT_HAS_MICROCHIP_XEC_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable WDT driver for Microchip XEC MCU series. Enable WDT driver for Microchip XEC MCU series.

View file

@ -7,6 +7,7 @@ config WDT_XMC4XXX
bool "Infineon XMC4xxx MCU Family Watchdog (WDT) Driver" bool "Infineon XMC4xxx MCU Family Watchdog (WDT) Driver"
default y default y
depends on DT_HAS_INFINEON_XMC4XXX_WATCHDOG_ENABLED depends on DT_HAS_INFINEON_XMC4XXX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help help
Enable WDT driver for Infineon XMC4xxx MCUs. Enable WDT driver for Infineon XMC4xxx MCUs.