aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-02-22 08:29:14 +0000
committerJohn Crispin <john@openwrt.org>2015-02-22 08:29:14 +0000
commit565a6f2a273ca2a12ea9d3cc92f10774b2bd1987 (patch)
treeb15d20b249f3f424ec20154f0a62dce4c76eb230 /target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
parent5072954cd0900894a27f0588257733fa2bd7fc11 (diff)
downloadupstream-565a6f2a273ca2a12ea9d3cc92f10774b2bd1987.tar.gz
upstream-565a6f2a273ca2a12ea9d3cc92f10774b2bd1987.tar.bz2
upstream-565a6f2a273ca2a12ea9d3cc92f10774b2bd1987.zip
ipq806x: fix "reboot" command
The watchdog driver already registers a restart notifier, we just have to enable it in the config and in the DT to fix the "reboot" command. This is done by integratin the following patch-set: https://lkml.org/lkml/2015/2/20/610 I'm copy-pasting the description below: qcom-wdt is currently assuming the presence of a dedicated node in DT to gets its configuration. However, on msm architecture, the watchdog is usually part of the timer block. So this patch-set is changing the driver and slightly enhancing the timer DT bindings to provide the relevant clocks and interrupts. Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org> SVN-Revision: 44504
Diffstat (limited to 'target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch')
-rw-r--r--target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch b/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
new file mode 100644
index 0000000000..0cd7da1f6d
--- /dev/null
+++ b/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
@@ -0,0 +1,72 @@
+From fded70251b1b58f68de1d3757ece9965f0b75452 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari <mathieu@codeaurora.org>
+Date: Thu, 19 Feb 2015 20:19:30 -0800
+Subject: [PATCH 1/3] watchdog: qcom: use timer devicetree binding
+
+MSM watchdog configuration happens in the same register block as the
+timer, so we'll use the same binding as the existing timer.
+
+The qcom-wdt will now be probed when devicetree has an entry compatible
+with "qcom,kpss-timer" or "qcom-scss-timer".
+
+Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
+---
+ drivers/watchdog/qcom-wdt.c | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
+index aa85618..aa03ca8 100644
+--- a/drivers/watchdog/qcom-wdt.c
++++ b/drivers/watchdog/qcom-wdt.c
+@@ -20,9 +20,9 @@
+ #include <linux/reboot.h>
+ #include <linux/watchdog.h>
+
+-#define WDT_RST 0x0
+-#define WDT_EN 0x8
+-#define WDT_BITE_TIME 0x24
++#define WDT_RST 0x38
++#define WDT_EN 0x40
++#define WDT_BITE_TIME 0x5C
+
+ struct qcom_wdt {
+ struct watchdog_device wdd;
+@@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
+ {
+ struct qcom_wdt *wdt;
+ struct resource *res;
++ struct device_node *np = pdev->dev.of_node;
++ u32 percpu_offset;
+ int ret;
+
+ wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
+@@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platform_device *pdev)
+ return -ENOMEM;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++
++ /* We use CPU0's DGT for the watchdog */
++ if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
++ percpu_offset = 0;
++
++ res->start += percpu_offset;
++ res->end += percpu_offset;
++
+ wdt->base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(wdt->base))
+ return PTR_ERR(wdt->base);
+@@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platform_device *pdev)
+ }
+
+ static const struct of_device_id qcom_wdt_of_table[] = {
+- { .compatible = "qcom,kpss-wdt-msm8960", },
+- { .compatible = "qcom,kpss-wdt-apq8064", },
+- { .compatible = "qcom,kpss-wdt-ipq8064", },
++ { .compatible = "qcom,kpss-timer" },
++ { .compatible = "qcom,scss-timer" },
+ { },
+ };
+ MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);
+--
+1.9.1
+