Skip to content

Commit cb9a39a

Browse files
Wolfram Sanggeertu
authored andcommitted
soc: renesas: rcar-rst: Allow WDT reset on R-Car V3U
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> Link: https://lore.kernel.org/r/20230419201511.31648-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent ac9a786 commit cb9a39a

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

drivers/soc/renesas/rcar-rst.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#define WDTRSTCR_RESET 0xA55A0002
1414
#define WDTRSTCR 0x0054
15+
#define GEN4_WDTRSTCR 0x0010
1516

1617
#define CR7BAR 0x0070
1718
#define CR7BAREN BIT(4)
@@ -27,6 +28,12 @@ static int rcar_rst_enable_wdt_reset(void __iomem *base)
2728
return 0;
2829
}
2930

31+
static int rcar_rst_v3u_enable_wdt_reset(void __iomem *base)
32+
{
33+
iowrite32(WDTRSTCR_RESET, base + GEN4_WDTRSTCR);
34+
return 0;
35+
}
36+
3037
/*
3138
* Most of the R-Car Gen3 SoCs have an ARM Realtime Core.
3239
* Firmware boot address has to be set in CR7BAR before
@@ -66,6 +73,12 @@ static const struct rst_config rcar_rst_gen3 __initconst = {
6673
.set_rproc_boot_addr = rcar_rst_set_gen3_rproc_boot_addr,
6774
};
6875

76+
/* V3U firmware doesn't enable WDT reset and there won't be updates anymore */
77+
static const struct rst_config rcar_rst_v3u __initconst = {
78+
.modemr = 0x00, /* MODEMR0 and it has CPG related bits */
79+
.configure = rcar_rst_v3u_enable_wdt_reset,
80+
};
81+
6982
static const struct rst_config rcar_rst_gen4 __initconst = {
7083
.modemr = 0x00, /* MODEMR0 and it has CPG related bits */
7184
};
@@ -101,7 +114,7 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
101114
{ .compatible = "renesas,r8a77990-rst", .data = &rcar_rst_gen3 },
102115
{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
103116
/* R-Car Gen4 */
104-
{ .compatible = "renesas,r8a779a0-rst", .data = &rcar_rst_gen4 },
117+
{ .compatible = "renesas,r8a779a0-rst", .data = &rcar_rst_v3u },
105118
{ .compatible = "renesas,r8a779f0-rst", .data = &rcar_rst_gen4 },
106119
{ .compatible = "renesas,r8a779g0-rst", .data = &rcar_rst_gen4 },
107120
{ /* sentinel */ }

0 commit comments

Comments
 (0)