aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch
diff options
context:
space:
mode:
authorPavel Kubelun <be.dissent@gmail.com>2016-11-04 02:12:32 +0300
committerJohn Crispin <john@phrozen.org>2016-11-16 10:59:30 +0100
commit793d448a51b53d81e2dbd58a5865a204de92ad34 (patch)
treec0bc1ee32bdff6336dfa73288b5d7f2ac8564a7b /target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch
parent4a6f9fc6333d5043d4ddfd25d87be3ae17f9e794 (diff)
downloadupstream-793d448a51b53d81e2dbd58a5865a204de92ad34.tar.gz
upstream-793d448a51b53d81e2dbd58a5865a204de92ad34.tar.bz2
upstream-793d448a51b53d81e2dbd58a5865a204de92ad34.zip
ipq806x: backport upstream wdt driver
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch')
-rw-r--r--target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch b/target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch
new file mode 100644
index 0000000000..f7fcaeeda2
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/010-4-watchdog-qcom-Report-reboot-reason.patch
@@ -0,0 +1,46 @@
+From b6ef36d2c1e391adc1fe1b2dd2a0f887a9f3052b Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <groeck@chromium.org>
+Date: Mon, 4 Apr 2016 17:37:46 -0700
+Subject: watchdog: qcom: Report reboot reason
+
+The Qualcom watchdog timer block reports if the system was reset by the
+watchdog. Pass the information to user space.
+
+Reviewed-by: Grant Grundler <grundler@chromium.org>
+Tested-by: Grant Grundler <grundler@chromium.org>
+Signed-off-by: Guenter Roeck <groeck@chromium.org>
+Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
+---
+ drivers/watchdog/qcom-wdt.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/watchdog/qcom-wdt.c
++++ b/drivers/watchdog/qcom-wdt.c
+@@ -21,6 +21,7 @@
+
+ #define WDT_RST 0x38
+ #define WDT_EN 0x40
++#define WDT_STS 0x44
+ #define WDT_BITE_TIME 0x5C
+
+ struct qcom_wdt {
+@@ -108,7 +109,8 @@ static const struct watchdog_ops qcom_wd
+ static const struct watchdog_info qcom_wdt_info = {
+ .options = WDIOF_KEEPALIVEPING
+ | WDIOF_MAGICCLOSE
+- | WDIOF_SETTIMEOUT,
++ | WDIOF_SETTIMEOUT
++ | WDIOF_CARDRESET,
+ .identity = KBUILD_MODNAME,
+ };
+
+@@ -171,6 +173,9 @@ static int qcom_wdt_probe(struct platfor
+ wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
+ wdt->wdd.parent = &pdev->dev;
+
++ if (readl(wdt->base + WDT_STS) & 1)
++ wdt->wdd.bootstatus = WDIOF_CARDRESET;
++
+ /*
+ * If 'timeout-sec' unspecified in devicetree, assume a 30 second
+ * default, unless the max timeout is less than 30 seconds, then use