ARM: mediatek: Add watchdog driver
Subsystems (3)
Matthias Brugger
maintainerv4 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 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
Matthias Brugger
maintainerPATCH v4 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
@@ -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
@@ -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
Re: [PATCH v4 1/2] watchdog: Add driver for Mediatek watchdog
Quoted 3 lines · Matthias Brugger
This patch adds a driver for the Mediatek SoC integrated watchdog. This driver supports watchdog and software reset for mt65xx and mt81xx SoCs.
trivia:
drivers/watchdog/mtk_wdt.c
Quoted 1 line
drivers/watchdog/mtk_wdt.c +0
-0
[]
drivers/watchdog/mtk_wdt.c
Quoted 2 lines
drivers/watchdog/mtk_wdt.c +2
-0+static int mtk_wdt_probe (struct platform_device *pdev) +{
[]
drivers/watchdog/mtk_wdt.c line 207
Quoted 1 line
drivers/watchdog/mtk_wdt.c +1
-0+ dev_info(&pdev->dev, "Watchdog enabled (timeout=%d sec, nowayout=%d)",
missing terminating \n newline
Re: [PATCH v4 1/2] watchdog: Add driver for Mediatek watchdog
In reply to Matthias BruggerQuoted 5 lines · Matthias Brugger
This patch adds a driver for the Mediatek SoC integrated watchdog. This driver supports watchdog and software reset for mt65xx and mt81xx SoCs.
Signed-off-by Matthias Brugger <[email protected]>
Assuming you fix the missing newline, as pointed out by Joe:
Matthias Brugger
maintainerPATCH v4 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
@@ -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
Hi Matthias,
Quoted 26 lines · Matthias Brugger
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 v4:
- fix indentation errors
- delete unused include
- reorganize while loop to eliminate code duplication
- eliminate indirection towatchdog_devicestructure
- delete unnecessary bracketsChanges for v3:
- fix based on file name
- fix style problems
- fix error return value and warning message
- delete unnecessarywatchdog_set_drvdata
- delete unused variableChanges 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 supportsMatthias 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
Test OK on mt8173 platform.