Skip to content

Commit 5b1d16d

Browse files
alvsunnashif
authored andcommitted
drivers: wdt: npcx: add wdt driver support for npck3
Enables the extended Watchdog Timer driver for npck3. Signed-off-by: Alvis Sun <yfsun@nuvoton.com> Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
1 parent 7b49381 commit 5b1d16d

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

drivers/watchdog/Kconfig.npcx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ config WDT_NPCX_WARNING_LEADING_TIME_MS
2121
This option defines the window in which a watchdog event must be
2222
handled. After this time window, the watchdog reset triggers
2323
immediately.
24+
25+
config WDT_NPCX_EX
26+
bool "Extended NPCX watchdog driver support"
27+
default y
28+
depends on $(dt_compat_any_has_prop,$(DT_COMPAT_NUVOTON_NPCX_WATCHDOG),support-npckn-v1,True)
29+
help
30+
This option enables the extended Watchdog Timer driver for NPCKn variant
31+
of processors.

drivers/watchdog/wdt_npcx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ static int wdt_npcx_init(const struct device *dev)
379379
inst->WDCP = 0x05; /* Prescaler is 32 in Watchdog Timer */
380380
inst->TWCP = 0x05; /* Prescaler is 32 in T0 Timer */
381381

382+
#if defined(CONFIG_WDT_NPCX_EX)
383+
/* Enable T0OUT if extended driver is enabled */
384+
inst->T0CSR |= BIT(NPCX_T0CSR_T0EN);
385+
#endif /* CONFIG_WDT_NPCX_EX */
386+
382387
return 0;
383388
}
384389

dts/arm/nuvoton/npck/npck.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
compatible = "nuvoton,npcx-watchdog";
380380
reg = <0x400d8000 0x2000>;
381381
t0-out = <&wui_t0out>;
382+
support-npckn-v1;
382383
};
383384

384385
espi0: espi@4000a000 {

dts/bindings/watchdog/nuvoton,npcx-watchdog.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ properties:
1616
description: |
1717
Mapping table between Wake-Up Input (WUI) and t0-out timer expired signal.
1818
For example, the WUI mapping on NPCX7 t0-out timer would be
19-
t0-out = <&wui_t0out>;
19+
t0-out = <&wui_t0out>;
20+
support-npckn-v1:
21+
type: boolean
22+
description: |
23+
This option enables the extended Watchdog Timer driver for NPCKn.

0 commit comments

Comments
 (0)