1 From b6ef36d2c1e391adc1fe1b2dd2a0f887a9f3052b Mon Sep 17 00:00:00 2001
2 From: Guenter Roeck <groeck@chromium.org>
3 Date: Mon, 4 Apr 2016 17:37:46 -0700
4 Subject: watchdog: qcom: Report reboot reason
6 The Qualcom watchdog timer block reports if the system was reset by the
7 watchdog. Pass the information to user space.
9 Reviewed-by: Grant Grundler <grundler@chromium.org>
10 Tested-by: Grant Grundler <grundler@chromium.org>
11 Signed-off-by: Guenter Roeck <groeck@chromium.org>
12 Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 drivers/watchdog/qcom-wdt.c | 7 ++++++-
15 1 file changed, 6 insertions(+), 1 deletion(-)
17 --- a/drivers/watchdog/qcom-wdt.c
18 +++ b/drivers/watchdog/qcom-wdt.c
24 #define WDT_BITE_TIME 0x5C
27 @@ -108,7 +109,8 @@ static const struct watchdog_ops qcom_wd
28 static const struct watchdog_info qcom_wdt_info = {
29 .options = WDIOF_KEEPALIVEPING
34 .identity = KBUILD_MODNAME,
37 @@ -171,6 +173,9 @@ static int qcom_wdt_probe(struct platfor
38 wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
39 wdt->wdd.parent = &pdev->dev;
41 + if (readl(wdt->base + WDT_STS) & 1)
42 + wdt->wdd.bootstatus = WDIOF_CARDRESET;
45 * If 'timeout-sec' unspecified in devicetree, assume a 30 second
46 * default, unless the max timeout is less than 30 seconds, then use