Skip to contentSkip to conversation

ARM: meson: watchdog driver

PATCH Superseded Carlo Caione 2 participants 12 messages Sep 19, 2014 – Sep 20, 2014

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover ARM: meson: watchdog driver

This patchset adds support for the watchdog found on Amlogic MesonX SoCs. The watchdog is used also to reboot the device.

DTSI and multi_v7_defconfig are updated and proper documentation is added.

No documentation is provided by Amlogic, the code is reverse-engineered by the code available at http://openlinux.amlogic.com:8000/download/

This patchset depends on:
[1] [PATCH 0/6] ARM: meson: initial support for MesonX SoCs
[2] [PATCH 0/2] ARM: meson: add clocksource support

Changes since v2:
* changed compatible to "amlogic,meson6-wdt"
* removed useless code
* code refactored

Changes since v1:
* added restart handler support

[1] http://www.spinics.net/lists/arm-kernel/msg362521.html
[2] http://www.spinics.net/lists/arm-kernel/msg362483.html

Carlo Caione (4):
ARM: docs: add documentation binding for meson watchdog
ARM: meson: add watchdog driver
ARM: DTS: meson: update DTSI to add watchdog node
ARM: defconfig: update multi_v7_defconfig

 .../devicetree/bindings/watchdog/meson6-wdt.txt    |  13 ++
 arch/arm/boot/dts/meson.dtsi                       |   5 +
 arch/arm/configs/multi_v7_defconfig                |   1 +
 drivers/watchdog/Kconfig                           |  10 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/meson_wdt.c                       | 235 +++++++++++++++++++++
 6 files changed, 265 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/meson6-wdt.txt
 create mode 100644 drivers/watchdog/meson_wdt.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/4 ARM: docs: add documentation binding for meson watchdog

---
 Documentation/devicetree/bindings/watchdog/meson6-wdt.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/meson6-wdt.txt
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +13 -0
new file mode 100644
index 0000000..9200fc2
@@ -0,0 +1,13 @@
+Meson SoCs Watchdog timer
+
+Required properties:
+
+- compatible : should be "amlogic,meson6-wdt"
+- reg : Specifies base physical address and size of the registers.
+
+Example:
+
+wdt: watchdog at c1109900 {
+	compatible = "amlogic,meson6-wdt";
+	reg = <0xc1109900 0x8>;
+};
Signature · 1 line
1.9.1
maintainer
#2 lore raw

PATCH v3 1/4 ARM: docs: add documentation binding for meson watchdog

Quoted 12 lines · Carlo Caione
---
  Documentation/devicetree/bindings/watchdog/meson6-wdt.txt | 13 +++++++++++++
  1 file changed, 13 insertions(+)

create mode 100644 Documentation/devicetree/bindings/watchdog/meson6-wdt.txt

Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +0 -0
new file mode 100644
index 0000000..9200fc2

Documentation/devicetree/bindings/watchdog/meson6-wdt.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +7 -0
@@ -0,0 +1,13 @@
+Meson SoCs Watchdog timer
+
+Required properties:
+
+- compatible : should be "amlogic,meson6-wdt"
+- reg : Specifies base physical address and size of the registers.
+

The 'amlogic' vendor prefix is undefined.
It will have to be added to Documentation/devicetree/bindings/vendor-prefixes.txt.

Guenter

#3 lore raw

PATCH v3 1/4 ARM: docs: add documentation binding for meson watchdog

Quoted 21 lines · Guenter Roeck
Quoted 20 lines · Carlo Caione
---
  Documentation/devicetree/bindings/watchdog/meson6-wdt.txt | 13
+++++++++++++
  1 file changed, 13 insertions(+)

create mode 100644
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt

Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +4 -0
new file mode 100644
index 0000000..9200fc2
@@ -0,0 +1,13 @@
+Meson SoCs Watchdog timer
+
+Required properties:
+
Quoted 8 lines

Documentation/devicetree/bindings/watchdog/meson6-wdt.txt line 7

Quoted 3 lines
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +3 -0
+- compatible : should be "amlogic,meson6-wdt"
+- reg : Specifies base physical address and size of the registers.
+

The 'amlogic' vendor prefix is undefined.
It will have to be added to Documentation/devicetree/bindings/vendor-prefixes.txt.

As stated in the cover, this patchset depends on
http://www.spinics.net/lists/arm-kernel/msg362521.html where the vendor-prefixes.txt is updated.
Probably I should ping it.

Signature · 1 line
Carlo Caione
maintainer
#4 lore raw

PATCH v3 1/4 ARM: docs: add documentation binding for meson watchdog

Quoted 31 lines · Carlo Caione
Quoted 21 lines · Guenter Roeck
Quoted 20 lines · Carlo Caione
---
   Documentation/devicetree/bindings/watchdog/meson6-wdt.txt | 13
+++++++++++++
   1 file changed, 13 insertions(+)

create mode 100644
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt

Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +4 -0
new file mode 100644
index 0000000..9200fc2
@@ -0,0 +1,13 @@
+Meson SoCs Watchdog timer
+
+Required properties:
+
Quoted 8 lines

Documentation/devicetree/bindings/watchdog/meson6-wdt.txt line 7

Quoted 3 lines
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +3 -0
+- compatible : should be "amlogic,meson6-wdt"
+- reg : Specifies base physical address and size of the registers.
+

The 'amlogic' vendor prefix is undefined.
It will have to be added to Documentation/devicetree/bindings/vendor-prefixes.txt.

Quoted 5 lines

As stated in the cover, this patchset depends on
http://www.spinics.net/lists/arm-kernel/msg362521.html where the vendor-prefixes.txt is updated.
Probably I should ping it.

Ah, sorry, I missed that.

Thanks,
Guenter

#5 lore raw

PATCH v3 2/4 ARM: meson: add watchdog driver

In reply to Carlo Caione

This patch adds the watchdog driver for the Amlogic Meson SoCs used also to reboot the device.

---
 drivers/watchdog/Kconfig     |  10 ++
 drivers/watchdog/Makefile    |   1 +
 drivers/watchdog/meson_wdt.c | 235 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 246 insertions(+)
 create mode 100644 drivers/watchdog/meson_wdt.c
drivers/watchdog/Kconfig +10 -0
index f57312f..836cb00 100644
@@ -443,6 +443,16 @@ config TEGRA_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called tegra_wdt.
 
+config MESON_WATCHDOG
+	tristate "Amlogic Meson SoCs watchdog support"
+	depends on ARCH_MESON
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the watchdog timer
+	  in Amlogic Meson SoCs.
+	  To compile this driver as a module, choose M here: the
+	  module will be called meson_wdt.
+
 # AVR32 Architecture
 
 config AT32AP700X_WDT
drivers/watchdog/Makefile +1 -0
index 468c320..e7a9259 100644
@@ -59,6 +59,7 @@ obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
 obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
 obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
 obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
+obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
 
 # AVR32 Architecture
 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
drivers/watchdog/meson_wdt.c new file +235 -0

235 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#6 lore raw

PATCH v3 2/4 ARM: meson: add watchdog driver

Quoted 5 lines · Carlo Caione

This patch adds the watchdog driver for the Amlogic Meson SoCs used also to reboot the device.

---

[ ... ]

drivers/watchdog/meson_wdt.c line 232

Quoted 4 lines
drivers/watchdog/meson_wdt.c new file +4 -0
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+		"(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+

Checkpatch says:

WARNING: quoted string split across lines
#295: FILE: drivers/watchdog/meson_wdt.c:231:
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+ "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

Please fix.

Thanks,
Guenter

#7 lore raw

PATCH v3 2/4 ARM: meson: add watchdog driver

Quoted 20 lines · Guenter Roeck
Quoted 6 lines · Carlo Caione

This patch adds the watchdog driver for the Amlogic Meson SoCs used also to reboot the device.

---

[ ... ]

drivers/watchdog/meson_wdt.c line 232

Quoted 5 lines
drivers/watchdog/meson_wdt.c new file +4 -0
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+               "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+

Checkpatch says:

WARNING: quoted string split across lines
#295: FILE: drivers/watchdog/meson_wdt.c:231:

drivers/watchdog/meson_wdt.c line 231

Quoted 2 lines
drivers/watchdog/meson_wdt.c new file +2 -0
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+               "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

Thought that it was "somehow tolerated" :)
But since I'm wrong I'll submit a v4.

Thanks,

Signature · 1 line
Carlo Caione
maintainer
#8 lore raw

PATCH v3 2/4 ARM: meson: add watchdog driver

Quoted 19 lines · Carlo Caione
Quoted 18 lines · Guenter Roeck
Quoted 6 lines · Carlo Caione

This patch adds the watchdog driver for the Amlogic Meson SoCs used also to reboot the device.

---

[ ... ]

drivers/watchdog/meson_wdt.c line 232

Quoted 5 lines
drivers/watchdog/meson_wdt.c new file +4 -0
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+               "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+

Checkpatch says:

Quoted 6 lines

drivers/watchdog/meson_wdt.c line 231

Quoted 4 lines

WARNING: quoted string split across lines
#295: FILE: drivers/watchdog/meson_wdt.c:231:

drivers/watchdog/meson_wdt.c new file +2 -0
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
+               "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

Thought that it was "somehow tolerated" :)

Not me, at least not in this case.

Quoted 2 lines

But since I'm wrong I'll submit a v4.

MODULE_PARAM_DESC(nowayout,
"Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

is a really simple way of ensuring that you meet both the 80-column limit and avoid the warning. The idea should not be to try to get away with as many checkpatch warnings as possible ;-).

Guenter

#9 lore raw

PATCH v3 3/4 ARM: DTS: meson: update DTSI to add watchdog node

In reply to Carlo Caione
---
 arch/arm/boot/dts/meson.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/meson.dtsi +5 -0
index 55feb14..e6539ea 100644
@@ -70,6 +70,11 @@
 		#size-cells = <1>;
 		ranges;
 
+		wdt: watchdog at c1109900 {
+			compatible = "amlogic,meson6-wdt";
+			reg = <0xc1109900 0x8>;
+		};
+
 		uart_AO: serial at c81004c0 {
 			compatible = "amlogic,meson-uart";
 			reg = <0xc81004c0 0x14>;
Signature · 1 line
1.9.1
#10 lore raw

PATCH v3 4/4 ARM: defconfig: update multi_v7_defconfig

In reply to Carlo Caione

Update the multi_v7_defconfig enabling the watchdog driver for Meson SoCs.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index 5b44796..560e6a9 100644
@@ -242,6 +242,7 @@ CONFIG_ST_THERMAL_MEMMAP=y
 CONFIG_WATCHDOG=y
 CONFIG_ORION_WATCHDOG=y
 CONFIG_SUNXI_WATCHDOG=y
+CONFIG_MESON_WATCHDOG=y
 CONFIG_MFD_AS3722=y
 CONFIG_MFD_BCM590XX=y
 CONFIG_MFD_CROS_EC=y
Signature · 1 line
1.9.1
maintainer
#11 lore raw

v3 cover ARM: meson: watchdog driver

In reply to Carlo Caione
Quoted 36 lines · Carlo Caione

This patchset adds support for the watchdog found on Amlogic MesonX SoCs. The watchdog is used also to reboot the device.

DTSI and multi_v7_defconfig are updated and proper documentation is added.

No documentation is provided by Amlogic, the code is reverse-engineered by the code available at http://openlinux.amlogic.com:8000/download/

This patchset depends on:
[1] [PATCH 0/6] ARM: meson: initial support for MesonX SoCs
[2] [PATCH 0/2] ARM: meson: add clocksource support

Changes since v2:
* changed compatible to "amlogic,meson6-wdt"
* removed useless code
* code refactored

Changes since v1:
* added restart handler support

[1] http://www.spinics.net/lists/arm-kernel/msg362521.html
[2] http://www.spinics.net/lists/arm-kernel/msg362483.html

Carlo Caione (4):
ARM: docs: add documentation binding for meson watchdog
ARM: meson: add watchdog driver
ARM: DTS: meson: update DTSI to add watchdog node
ARM: defconfig: update multi_v7_defconfig

  .../devicetree/bindings/watchdog/meson6-wdt.txt    |  13 ++
  arch/arm/boot/dts/meson.dtsi                       |   5 +
  arch/arm/configs/multi_v7_defconfig                |   1 +
  drivers/watchdog/Kconfig                           |  10 +
  drivers/watchdog/Makefile                          |   1 +
  drivers/watchdog/meson_wdt.c                       | 235 +++++++++++++++++++++
  6 files changed, 265 insertions(+)
Quoted 3 lines

create mode 100644 Documentation/devicetree/bindings/watchdog/meson6-wdt.txt create mode 100644 drivers/watchdog/meson_wdt.c

For the series: