Skip to content

Commit

Permalink
drivers: watchdog: Allow WDT_DISABLE_AT_BOOT only when supported
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
anangl authored and carlescufi committed May 27, 2024
1 parent fa716d9 commit 7abb9d7
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ menuconfig WATCHDOG

if WATCHDOG

config HAS_WDT_DISABLE_AT_BOOT
bool

config WDT_DISABLE_AT_BOOT
bool "Disable at boot"
depends on HAS_WDT_DISABLE_AT_BOOT
help
Disable watchdog at Zephyr system startup.

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.andes_atcwdt200
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ config WDT_ANDES_ATCWDT200
bool "Andes Watchdog driver"
default y
depends on DT_HAS_ANDESTECH_ATCWDT200_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
select COUNTER
help
Enable driver for the Andes Watchdog driver.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.cc13xx_cc26xx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config WDT_CC13XX_CC26XX
bool "Watchdog Driver for CC13xx / CC26xx family of MCUs"
default y
depends on DT_HAS_TI_CC13XX_CC26XX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable watchdog for CC13xx / CC26xx family of MCUs

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.cc32xx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config WDT_CC32XX
bool "Watchdog Driver for cc32xx family of MCUs"
default y
depends on DT_HAS_TI_CC32XX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Watchdog for cc32xx family of MCUs

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.dw
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_DW
bool "Synopsys DesignWare Watchdog driver"
default y
depends on DT_HAS_SNPS_DESIGNWARE_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Synopsys DesignWare Watchdog driver.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.ene
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ config WDT_ENE_KB1200
bool "ENE KB1200 watchdog driver"
default y
depends on DT_HAS_ENE_KB1200_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
This option enables the KB1200 watchdog driver.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.esp32
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_ESP32
bool "ESP32 Watchdog (WDT) Driver"
default y
depends on DT_HAS_ESPRESSIF_ESP32_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable WDT driver for ESP32.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.gd32
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config FWDGT_GD32
bool "GD32 Free watchdog timer (FWDGT) driver"
default y
depends on DT_HAS_GD_GD32_FWDGT_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
select USE_GD32_FWDGT
help
Enable the Free watchdog timer (FWDGT) driver for GD32 SoCs.
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/Kconfig.gecko
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config WDT_GECKO
bool "Gecko series Watchdog (WDOG) Driver"
default y
depends on DT_HAS_SILABS_GECKO_WDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
select SOC_GECKO_WDOG
default y
help
Enable WDOG driver for Silicon Labs Gecko MCUs.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.it8xxx2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config WDT_ITE_IT8XXX2
bool "ITE it8xxx2 Watchdog Timer (WDT) driver"
default y
depends on DT_HAS_ITE_IT8XXX2_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
This option enables the Watchdog Timer driver for ITE it8xxx2.
This driver supports only one channel that id is 0 and 16-bits
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.npcx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config WDT_NPCX
bool "Nuvoton NPCX embedded controller (EC) Watchdog Timer driver"
default y
depends on DT_HAS_NUVOTON_NPCX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
This option enables the Watchdog Timer driver for NPCX family of
processors.
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.rpi_pico
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config WDT_RPI_PICO
bool "Raspberry Pi Pico Watchdog driver"
default y
depends on DT_HAS_RASPBERRYPI_PICO_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT

config WDT_RPI_PICO_INITIAL_TIMEOUT
int "Default watchdog timeout in us"
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.sam
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_SAM
bool "Atmel SAM MCU Family Watchdog (WDT) Driver"
default y
depends on DT_HAS_ATMEL_SAM_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable WDT driver for Atmel SAM MCUs.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.sam0
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_SAM0
bool "Atmel SAM0 series Watchdog (WDT) Driver"
default y
depends on DT_HAS_ATMEL_SAM0_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable WDT driver for Atmel SAM0 MCUs.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.sifive
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_SIFIVE
bool "SiFive Watchdog (WDT) Driver"
default y
depends on DT_HAS_SIFIVE_WDT_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
This option enables WDT driver for SiFive Freedom.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.smartbond
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config WDT_SMARTBOND
bool "Watchdog Driver for Smartbond family of MCUs"
default y
depends on DT_HAS_RENESAS_SMARTBOND_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable watchdog driver for Smartbond line of MCUs

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.stm32
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ config IWDG_STM32
bool "Independent Watchdog (IWDG) Driver for STM32 family of MCUs"
default y
depends on DT_HAS_ST_STM32_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable IWDG driver for STM32 line of MCUs

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.tco
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_TCO
bool "Intel TCO Watchdog driver"
default y
depends on DT_HAS_INTEL_TCO_WDT_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable support for Intel TCO WDT driver.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.xec
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config WDT_XEC
bool "Microchip XEC series Watchdog Timer (WDT) driver"
default y
depends on DT_HAS_MICROCHIP_XEC_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable WDT driver for Microchip XEC MCU series.
1 change: 1 addition & 0 deletions drivers/watchdog/Kconfig.xmc4xxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ config WDT_XMC4XXX
bool "Infineon XMC4xxx MCU Family Watchdog (WDT) Driver"
default y
depends on DT_HAS_INFINEON_XMC4XXX_WATCHDOG_ENABLED
select HAS_WDT_DISABLE_AT_BOOT
help
Enable WDT driver for Infineon XMC4xxx MCUs.

Expand Down

0 comments on commit 7abb9d7

Please sign in to comment.