From: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Wim Van Sebroeck <wim@iguana.be>,
Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
Chris Paterson <Chris.Paterson2@renesas.com>,
Biju Das <biju.das@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Subject: [RFC v4 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
Date: Wed, 31 Jan 2018 18:24:13 +0000 [thread overview]
Message-ID: <1517423070-24236-10-git-send-email-fabrizio.castro@bp.renesas.com> (raw)
In-Reply-To: <1517423070-24236-1-git-send-email-fabrizio.castro@bp.renesas.com>
This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.
Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v3->4:
* no change
drivers/soc/renesas/rcar-rst.c | 35 +++++++++++++++++++++++++++++------
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index 3316b02..93febe6 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
#include <linux/of_address.h>
#include <linux/soc/renesas/rcar-rst.h>
+#define WDTRSTCR_RESET 0xA55A0002
+#define WDTRSTCR 0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+ iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+ return 0;
+}
+
struct rst_config {
- unsigned int modemr; /* Mode Monitoring Register Offset */
+ unsigned int modemr; /* Mode Monitoring Register Offset */
+ int (*configure)(void *base); /* Platform specific configuration */
};
static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
static const struct rst_config rcar_rst_gen2 __initconst = {
.modemr = 0x60,
+ .configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+ .modemr = 0x60,
};
static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,11 +53,11 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
- /* R-Car Gen3 is handled like R-Car Gen2 */
- { .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
- { .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
- { .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
- { .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+ /* R-Car Gen3 */
+ { .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+ { .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+ { .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+ { .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
{ /* sentinel */ }
};
@@ -71,6 +86,14 @@ static int __init rcar_rst_init(void)
rcar_rst_base = base;
cfg = match->data;
saved_mode = ioread32(base + cfg->modemr);
+ if (cfg->configure) {
+ error = cfg->configure(base);
+ if (error) {
+ pr_warn("%pOF: Cannot run SoC specific configuration\n",
+ np);
+ goto out_put;
+ }
+ }
pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
--
2.7.4
next prev parent reply other threads:[~2018-01-31 18:24 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 18:24 [RFC v4 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 01/26] ARM: shmobile: Add watchdog support Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 04/26] ARM: dts: r8a7790: Adjust SMP routine size Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 06/26] ARM: dts: r8a7792: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 08/26] ARM: dts: r8a7794: " Fabrizio Castro
2018-01-31 18:24 ` Fabrizio Castro [this message]
2018-01-31 18:24 ` [RFC v4 15/26] clk: renesas: r8a7743: Add rwdt clock Fabrizio Castro
[not found] ` <1517423070-24236-16-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:12 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 17/26] clk: renesas: r8a7790: " Fabrizio Castro
2018-02-07 23:17 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 19/26] clk: renesas: r8a7794: " Fabrizio Castro
[not found] ` <1517423070-24236-20-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:17 ` Wolfram Sang
[not found] ` <1517423070-24236-1-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-31 18:24 ` [RFC v4 02/26] ARM: dts: r8a7743: Adjust SMP routine size Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 03/26] ARM: dts: r8a7745: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 05/26] ARM: dts: r8a7791: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 07/26] ARM: dts: r8a7793: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 10/26] ARM: shmobile: rcar-gen2: Add watchdog support Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 11/26] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support Fabrizio Castro
2018-02-05 6:08 ` Rob Herring
[not found] ` <1517423070-24236-12-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:04 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 12/26] watchdog: renesas_wdt: " Fabrizio Castro
[not found] ` <1517423070-24236-13-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-02 2:56 ` Guenter Roeck
[not found] ` <2dd9f76d-b3e9-31f2-11eb-272d327f3b01-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2018-02-05 11:16 ` Fabrizio Castro
2018-02-07 22:53 ` Wolfram Sang
2018-02-12 10:31 ` Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler Fabrizio Castro
[not found] ` <1517423070-24236-14-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-02 2:58 ` Guenter Roeck
2018-02-07 15:46 ` Geert Uytterhoeven
2018-02-07 15:55 ` Fabrizio Castro
2018-02-07 23:03 ` Wolfram Sang
2018-02-12 10:33 ` Fabrizio Castro
2018-02-12 10:54 ` Wolfram Sang
2018-02-12 11:38 ` Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN Fabrizio Castro
[not found] ` <1517423070-24236-15-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:11 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 16/26] clk: renesas: r8a7745: Add rwdt clock Fabrizio Castro
[not found] ` <1517423070-24236-17-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:16 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 18/26] clk: renesas: r8a7791/r8a7793: " Fabrizio Castro
2018-02-07 23:17 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 20/26] ARM: dts: r8a7743: Add watchdog support to SoC dtsi Fabrizio Castro
[not found] ` <1517423070-24236-21-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:20 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 21/26] ARM: dts: r8a7745: " Fabrizio Castro
[not found] ` <1517423070-24236-22-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:20 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 22/26] ARM: dts: r8a7790: " Fabrizio Castro
2018-02-07 23:20 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 23/26] ARM: dts: r8a7791: " Fabrizio Castro
2018-02-07 23:20 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 26/26] ARM: dts: iwg22m: Add watchdog support to SoM dtsi Fabrizio Castro
2018-02-07 23:21 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 24/26] ARM: dts: r8a7794: Add watchdog support to SoC dtsi Fabrizio Castro
[not found] ` <1517423070-24236-25-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:20 ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 25/26] ARM: dts: iwg20m: Add watchdog support to SoM dtsi Fabrizio Castro
[not found] ` <1517423070-24236-26-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-07 23:21 ` Wolfram Sang
2018-02-06 15:44 ` [RFC v4 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Geert Uytterhoeven
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=1517423070-24236-10-git-send-email-fabrizio.castro@bp.renesas.com \
--to=fabrizio.castro@bp.renesas.com \
--cc=Chris.Paterson2@renesas.com \
--cc=biju.das@bp.renesas.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@roeck-us.net \
--cc=magnus.damm@gmail.com \
--cc=mark.rutland@arm.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=ramesh.shanmugasundaram@bp.renesas.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=will.deacon@arm.com \
--cc=wim@iguana.be \
--cc=wsa+renesas@sang-engineering.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).