From: Mathieu Olivari <mathieu@codeaurora.org>
To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
linux@arm.linux.org.uk, wim@iguana.be, corbet@lwn.net,
standby24x7@gmail.com, mathieu@codeaurora.org
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-watchdog@vger.kernel.org
Subject: [PATCH 1/3] watchdog: qcom: use timer devicetree binding
Date: Fri, 20 Feb 2015 18:19:34 -0800 [thread overview]
Message-ID: <1424485176-8348-2-git-send-email-mathieu@codeaurora.org> (raw)
In-Reply-To: <1424485176-8348-1-git-send-email-mathieu@codeaurora.org>
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
WARNING: multiple messages have this Message-ID (diff)
From: mathieu@codeaurora.org (Mathieu Olivari)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] watchdog: qcom: use timer devicetree binding
Date: Fri, 20 Feb 2015 18:19:34 -0800 [thread overview]
Message-ID: <1424485176-8348-2-git-send-email-mathieu@codeaurora.org> (raw)
In-Reply-To: <1424485176-8348-1-git-send-email-mathieu@codeaurora.org>
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
next prev parent reply other threads:[~2015-02-21 2:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-21 2:19 [PATCH 0/3] arm: msm: Use timer DT node for qcom watchdog config Mathieu Olivari
2015-02-21 2:19 ` Mathieu Olivari
2015-02-21 2:19 ` Mathieu Olivari [this message]
2015-02-21 2:19 ` [PATCH 1/3] watchdog: qcom: use timer devicetree binding Mathieu Olivari
2015-02-23 19:04 ` Stephen Boyd
2015-02-23 19:04 ` Stephen Boyd
2015-02-23 19:04 ` Stephen Boyd
2015-02-23 19:31 ` Guenter Roeck
2015-02-23 19:31 ` Guenter Roeck
2015-02-21 2:19 ` [PATCH 2/3] ARM: qcom: add description of KPSS WDT for IPQ8064 Mathieu Olivari
2015-02-21 2:19 ` Mathieu Olivari
2015-02-23 19:05 ` Stephen Boyd
2015-02-23 19:05 ` Stephen Boyd
2015-02-23 19:32 ` Guenter Roeck
2015-02-23 19:32 ` Guenter Roeck
2015-02-21 2:19 ` [PATCH 3/3] ARM: msm: add watchdog entries to DT timer binding doc Mathieu Olivari
2015-02-21 2:19 ` Mathieu Olivari
2015-02-21 2:19 ` Mathieu Olivari
2015-02-23 19:33 ` Guenter Roeck
2015-02-23 19:33 ` Guenter Roeck
2015-02-23 19:33 ` Guenter Roeck
2015-02-23 21:35 ` [PATCH 0/3] arm: msm: Use timer DT node for qcom watchdog config Arnd Bergmann
2015-02-23 21:35 ` Arnd Bergmann
2015-02-23 21:35 ` Arnd Bergmann
2015-02-23 22:07 ` Stephen Boyd
2015-02-23 22:07 ` Stephen Boyd
2015-02-23 22:07 ` Stephen Boyd
2015-03-27 5:55 ` Stephen Boyd
2015-03-27 5:55 ` Stephen Boyd
2015-03-27 5:55 ` Stephen Boyd
2015-03-27 7:59 ` Wim Van Sebroeck
2015-03-27 7:59 ` Wim Van Sebroeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424485176-8348-2-git-send-email-mathieu@codeaurora.org \
--to=mathieu@codeaurora.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=standby24x7@gmail.com \
--cc=wim@iguana.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.