* [PATCH] soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U
@ 2023-04-19 20:15 Wolfram Sang
2023-05-10 9:11 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2023-04-19 20:15 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Geert Uytterhoeven, Wolfram Sang
V3U firmware misses to enable WDT resets. Because there won't be any
updates to the firmware anymore, enable that in Linux.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/soc/renesas/rcar-rst.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index e1c7e91f5a86..98fd97da6cd4 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -12,6 +12,7 @@
#define WDTRSTCR_RESET 0xA55A0002
#define WDTRSTCR 0x0054
+#define GEN4_WDTRSTCR 0x0010
#define CR7BAR 0x0070
#define CR7BAREN BIT(4)
@@ -27,6 +28,12 @@ static int rcar_rst_enable_wdt_reset(void __iomem *base)
return 0;
}
+static int rcar_rst_v3u_enable_wdt_reset(void __iomem *base)
+{
+ iowrite32(WDTRSTCR_RESET, base + GEN4_WDTRSTCR);
+ return 0;
+}
+
/*
* Most of the R-Car Gen3 SoCs have an ARM Realtime Core.
* Firmware boot address has to be set in CR7BAR before
@@ -66,6 +73,12 @@ static const struct rst_config rcar_rst_gen3 __initconst = {
.set_rproc_boot_addr = rcar_rst_set_gen3_rproc_boot_addr,
};
+/* V3U firmware doesn't enable WDT reset and there won't be updates anymore */
+static const struct rst_config rcar_rst_v3u __initconst = {
+ .modemr = 0x00, /* MODEMR0 and it has CPG related bits */
+ .configure = rcar_rst_v3u_enable_wdt_reset,
+};
+
static const struct rst_config rcar_rst_gen4 __initconst = {
.modemr = 0x00, /* MODEMR0 and it has CPG related bits */
};
@@ -101,7 +114,7 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
{ .compatible = "renesas,r8a77990-rst", .data = &rcar_rst_gen3 },
{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
/* R-Car Gen4 */
- { .compatible = "renesas,r8a779a0-rst", .data = &rcar_rst_gen4 },
+ { .compatible = "renesas,r8a779a0-rst", .data = &rcar_rst_v3u },
{ .compatible = "renesas,r8a779f0-rst", .data = &rcar_rst_gen4 },
{ .compatible = "renesas,r8a779g0-rst", .data = &rcar_rst_gen4 },
{ /* sentinel */ }
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U
2023-04-19 20:15 [PATCH] soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U Wolfram Sang
@ 2023-05-10 9:11 ` Geert Uytterhoeven
2023-05-10 13:39 ` Wolfram Sang
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-05-10 9:11 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-renesas-soc
On Wed, Apr 19, 2023 at 10:15 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> V3U firmware misses to enable WDT resets. Because there won't be any
> updates to the firmware anymore, enable that in Linux.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v6.5.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-10 13:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 20:15 [PATCH] soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U Wolfram Sang
2023-05-10 9:11 ` Geert Uytterhoeven
2023-05-10 13:39 ` Wolfram Sang
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.