Skip to contentSkip to conversation

Add support for NXP LPC18xx Watchdog timer

PATCH New Ariel D'Alessandro 3 participants 6 messages Aug 1, 2015 – Aug 20, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v5 cover Add support for NXP LPC18xx Watchdog timer

This patch series adds support for the watchdog timer found in NXP LPC SoCs family which includes LPC18xx/LPC43xx. Other SoCs in that family may share the same watchdog hardware.

Patchset is based on tag next-20150624 of the linux-next repository. It has been successfully tested on a Hitex LPC4350 Evaluation Board and on a CIAA NXP LPC4337 Board.

Changes since v4:
* Minor coding style fixes.

Changes since v3:
* Changed default timeout to 30.
* Minor changes.

Changes since v2:
* Changed config tristate to "LPC18xx/43xx".
* Added COMPILE_TEST as a dependency.
* Replaced raw_local_irq* calls by spinlock.
* Changed dt compatible string to "nxp,lpc1850-wwdt".

Changes since v1:
* Dropped "Windowed" term in Watchdog's name.
* Changed default timeout value from 1 to 5 because it was too tight.
* Fixed module remove function, since it was keeping the timer enabled. Warning message was added.
* Changed dt compatible string to "nxp,lpc1850-wdt".
* Renamed clocks matching most of the other lpc18xx drivers.

Ariel D'Alessandro (2):
watchdog: NXP LPC18xx Watchdog Timer Driver
DT: watchdog: Add NXP LPC18xx Watchdog Timer binding documentation

 .../devicetree/bindings/watchdog/lpc18xx-wdt.txt   |  19 ++
 drivers/watchdog/Kconfig                           |  11 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/lpc18xx_wdt.c                     | 340 +++++++++++++++++++++
 4 files changed, 371 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/lpc18xx-wdt.txt
 create mode 100644 drivers/watchdog/lpc18xx_wdt.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH v5 1/2 watchdog: NXP LPC18xx Watchdog Timer Driver

This commit adds support for the watchdog timer found in NXP LPC SoCs family, which includes LPC18xx/LPC43xx. Other SoCs in that family may share the same watchdog hardware.

Watchdog driver registers a restart handler that will restart the system by performing an incorrect feed after ensuring the watchdog is enabled in reset mode.

As watchdog cannot be disabled in hardware, driver's stop routine will regularly send a keepalive ping using a timer.

---
 drivers/watchdog/Kconfig       |  11 ++
 drivers/watchdog/Makefile      |   1 +
 drivers/watchdog/lpc18xx_wdt.c | 340 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 352 insertions(+)
 create mode 100644 drivers/watchdog/lpc18xx_wdt.c
drivers/watchdog/Kconfig +11 -0
index 742fbbc..af5e2e3 100644
@@ -547,6 +547,17 @@ config DIGICOLOR_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called digicolor_wdt.
 
+config LPC18XX_WATCHDOG
+	tristate "LPC18xx/43xx Watchdog"
+	depends on ARCH_LPC18XX || COMPILE_TEST
+	select WATCHDOG_CORE
+	help
+	  Say Y here if to include support for the watchdog timer
+	  in NXP LPC SoCs family, which includes LPC18xx/LPC43xx
+	  processors.
+	  To compile this driver as a module, choose M here: the
+	  module will be called lpc18xx_wdt.
+
 # AVR32 Architecture
 
 config AT32AP700X_WDT
drivers/watchdog/Makefile +1 -0
index 59ea9a1..1b0ef48 100644
@@ -66,6 +66,7 @@ obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
 obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
 obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
 obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
+obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
 
 # AVR32 Architecture
 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
drivers/watchdog/lpc18xx_wdt.c new file +340 -0

340 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#2 lore raw

PATCH v5 1/2 watchdog: NXP LPC18xx Watchdog Timer Driver

Quoted 4 lines · Ariel D'Alessandro

This commit adds support for the watchdog timer found in NXP LPC SoCs family, which includes LPC18xx/LPC43xx. Other SoCs in that family may share the same watchdog hardware.

Quoted 8 lines

Watchdog driver registers a restart handler that will restart the system by performing an incorrect feed after ensuring the watchdog is enabled in reset mode.

As watchdog cannot be disabled in hardware, driver's stop routine will regularly send a keepalive ping using a timer.

#3 lore raw

PATCH v5 1/2 watchdog: NXP LPC18xx Watchdog Timer Driver

Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Ariel D'Alessandro

This commit adds support for the watchdog timer found in NXP LPC SoCs family, which includes LPC18xx/LPC43xx. Other SoCs in that family may share the same watchdog hardware.

Watchdog driver registers a restart handler that will restart the system by performing an incorrect feed after ensuring the watchdog is enabled in reset mode.

Quoted 8 lines
Quoted 4 lines

As watchdog cannot be disabled in hardware, driver's stop routine will regularly send a keepalive ping using a timer.

Wim,

Any chances you pick this in time for the next merge window?

Signature · 2 lines
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar
#4 lore raw

PATCH v5 2/2 DT: watchdog: Add NXP LPC18xx Watchdog Timer binding documentation

In reply to Ariel D'Alessandro

Add the devicetree binding document for NXP LPC18xx Watchdog Timer.

---
 .../devicetree/bindings/watchdog/lpc18xx-wdt.txt      | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/lpc18xx-wdt.txt
Documentation/devicetree/bindings/watchdog/lpc18xx-wdt.txt new file +19 -0
new file mode 100644
index 0000000..09f6b24
@@ -0,0 +1,19 @@
+* NXP LPC18xx Watchdog Timer (WDT)
+
+Required properties:
+- compatible: Should be "nxp,lpc1850-wwdt"
+- reg: Should contain WDT registers location and length
+- clocks: Must contain an entry for each entry in clock-names.
+- clock-names: Should contain "wdtclk" and "reg"; the watchdog counter
+               clock and register interface clock respectively.
+- interrupts: Should contain WDT interrupt
+
+Examples:
+
+watchdog at 40080000 {
+	compatible = "nxp,lpc1850-wwdt";
+	reg = <0x40080000 0x24>;
+	clocks = <&cgu BASE_SAFE_CLK>, <&ccu1 CLK_CPU_WWDT>;
+	clock-names = "wdtclk", "reg";
+	interrupts = <49>;
+};
Signature · 1 line
1.9.1