Skip to contentSkip to conversation

ARM: mediatek: Add watchdog driver

PATCH In review Matthias Brugger 3 participants 6 messages Jan 13, 2015 – Feb 3, 2015

Subsystems (3)
lore
Share & tools
lore

Matthias Brugger

author maintainer
#0 lore raw

v5 cover ARM: mediatek: Add watchdog driver

Mediatek SoCs have a watchdog driver. This patch set adds driver and DTS binding. The driver also implements a restart handler to reboot the SoC.

Changes for v5:
- add newline in dev_info message
- add tested-by and reviewed-by

Changes for v4:
- fix indentation errors
- delete unused include
- reorganize while loop to eliminate code duplication
- eliminate indirection to watchdog_device structure
- delete unnecessary brackets

Changes for v3:
- fix based on file name
- fix style problems
- fix error return value and warning message
- delete unnecessary watchdog_set_drvdata
- delete unused variable

Changes for v2:
- we don't need to have the watchdog enabled to do a software reset
- disable dual mode and irq mode when starting the watchdog
- update commit message to name the SoCs the driver supports

Matthias Brugger (2):
watchdog: Add driver for Mediatek watchdog
ARM: mediatek: dts: Add bindings for watchdog

 .../devicetree/bindings/watchdog/mtk-wdt.txt       |  13 ++
 drivers/watchdog/Kconfig                           |  10 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/mtk_wdt.c                         | 252 +++++++++++++++++++++
 4 files changed, 276 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
 create mode 100644 drivers/watchdog/mtk_wdt.c
Signature · 1 line
1.9.1
author maintainer
#1 lore raw

PATCH v5 1/2 watchdog: Add driver for Mediatek watchdog

This patch adds a driver for the Mediatek SoC integrated watchdog. This driver supports watchdog and software reset for mt65xx and mt81xx SoCs.

---
 drivers/watchdog/Kconfig   |  10 ++
 drivers/watchdog/Makefile  |   1 +
 drivers/watchdog/mtk_wdt.c | 252 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 263 insertions(+)
 create mode 100644 drivers/watchdog/mtk_wdt.c
drivers/watchdog/Kconfig +10 -0
index 08f41ad..9957a34 100644
@@ -505,6 +505,16 @@ config MESON_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called meson_wdt.
 
+config MEDIATEK_WATCHDOG
+	tristate "Mediatek SoCs watchdog support"
+	depends on ARCH_MEDIATEK
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the watchdog timer
+	  in Mediatek SoCs.
+	  To compile this driver as a module, choose M here: the
+	  module will be called mtk_wdt.
+
 # AVR32 Architecture
 
 config AT32AP700X_WDT
drivers/watchdog/Makefile +1 -0
index c569ec8..0d4821f 100644
@@ -63,6 +63,7 @@ obj-$(CONFIG_QCOM_WDT) += qcom-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
+obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
 
 # AVR32 Architecture
 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
drivers/watchdog/mtk_wdt.c new file +252 -0

252 lines not on this page · raw message

Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH v5 2/2 ARM: mediatek: dts: Add bindings for watchdog

In reply to Matthias Brugger
---
 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
Documentation/devicetree/bindings/watchdog/mtk-wdt.txt new file +13 -0
new file mode 100644
index 0000000..af9eb5b
@@ -0,0 +1,13 @@
+Mediatek SoCs Watchdog timer
+
+Required properties:
+
+- compatible : should be "mediatek,mt6589-wdt"
+- reg : Specifies base physical address and size of the registers.
+
+Example:
+
+wdt: watchdog at 010000000 {
+	compatible = "mediatek,mt6589-wdt";
+	reg = <0x10000000 0x18>;
+};
Signature · 1 line
1.9.1
author maintainer
#3 lore raw
In reply to Matthias Brugger

Hi all,

2015-01-13 13:28 GMT+01:00 Matthias Brugger <[email protected]>:

Quoted 2 lines

Mediatek SoCs have a watchdog driver. This patch set adds driver and DTS binding. The driver also implements a restart handler to reboot the SoC.

Any comments on this patch set?

Quoted 40 lines

Changes for v5:
- add newline in dev_info message
- add tested-by and reviewed-by

Changes for v4:
- fix indentation errors
- delete unused include
- reorganize while loop to eliminate code duplication
- eliminate indirection to watchdog_device structure
- delete unnecessary brackets

Changes for v3:
- fix based on file name
- fix style problems
- fix error return value and warning message
- delete unnecessary watchdog_set_drvdata
- delete unused variable

Changes for v2:
- we don't need to have the watchdog enabled to do a software reset
- disable dual mode and irq mode when starting the watchdog
- update commit message to name the SoCs the driver supports

Matthias Brugger (2):
watchdog: Add driver for Mediatek watchdog
ARM: mediatek: dts: Add bindings for watchdog

 .../devicetree/bindings/watchdog/mtk-wdt.txt       |  13 ++
 drivers/watchdog/Kconfig                           |  10 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/mtk_wdt.c                         | 252 +++++++++++++++++++++
 4 files changed, 276 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
 create mode 100644 drivers/watchdog/mtk_wdt.c

--
1.9.1

Signature · 1 line
motzblog.wordpress.com
maintainer
#4 lore raw
Quoted 8 lines · Matthias Brugger

Hi all,

2015-01-13 13:28 GMT+01:00 Matthias Brugger <[email protected]>:

Quoted 2 lines

Mediatek SoCs have a watchdog driver. This patch set adds driver and DTS binding. The driver also implements a restart handler to reboot the SoC.

Any comments on this patch set?

I have it included in the set of patches that I am going to send to Wim, hopefully this weekend.

Guenter

#5 lore raw
In reply to Matthias Brugger

Hi Matthias,

Quoted 31 lines

Mediatek SoCs have a watchdog driver. This patch set adds driver and DTS binding. The driver also implements a restart handler to reboot the SoC.

Changes for v5:
- add newline in dev_info message
- add tested-by and reviewed-by

Changes for v4:
- fix indentation errors
- delete unused include
- reorganize while loop to eliminate code duplication
- eliminate indirection to watchdog_device structure
- delete unnecessary brackets

Changes for v3:
- fix based on file name
- fix style problems
- fix error return value and warning message
- delete unnecessary watchdog_set_drvdata
- delete unused variable

Changes for v2:
- we don't need to have the watchdog enabled to do a software reset
- disable dual mode and irq mode when starting the watchdog
- update commit message to name the SoCs the driver supports

Matthias Brugger (2):
watchdog: Add driver for Mediatek watchdog
ARM: mediatek: dts: Add bindings for watchdog

Quoted 8 lines
 .../devicetree/bindings/watchdog/mtk-wdt.txt       |  13 ++
 drivers/watchdog/Kconfig                           |  10 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/mtk_wdt.c                         | 252 +++++++++++++++++++++
 4 files changed, 276 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt
 create mode 100644 drivers/watchdog/mtk_wdt.c

Both patches have been added to linux-watchdog-next.
I made a small change: I removed the .owner field in the platform_driver struct. This is now normally set by the core.

Kind regards,
Wim.