Skip to content

Commit fdea114

Browse files
geertustorulf
authored andcommitted
pmdomain: renesas: rcar-sysc: Add R-Car M3-W power-off delay quirk
R-Car M3-W needs a delay of 1 µs before powering off the A3IR and A3VC power domains. Add support for this using a new flag, which indicates that a power area is subject to this quirk. Inspired by a patch in the BSP by Dien Pham. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/ecbc3465c598084c904dd3714e2894463094ed9a.1713348705.git.geert+renesas@glider.be Signed-off-by: Ulf Hansson <[email protected]>
1 parent c8d8770 commit fdea114

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

drivers/pmdomain/renesas/r8a77960-sysc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ static const struct rcar_sysc_area r8a77960_areas[] __initconst = {
3232
{ "ca53-cpu3", 0x200, 3, R8A7796_PD_CA53_CPU3, R8A7796_PD_CA53_SCU,
3333
PD_CPU_NOCR },
3434
{ "cr7", 0x240, 0, R8A7796_PD_CR7, R8A7796_PD_ALWAYS_ON },
35-
{ "a3vc", 0x380, 0, R8A7796_PD_A3VC, R8A7796_PD_ALWAYS_ON },
35+
{ "a3vc", 0x380, 0, R8A7796_PD_A3VC, R8A7796_PD_ALWAYS_ON,
36+
PD_OFF_DELAY },
3637
{ "a2vc0", 0x3c0, 0, R8A7796_PD_A2VC0, R8A7796_PD_A3VC },
3738
{ "a2vc1", 0x3c0, 1, R8A7796_PD_A2VC1, R8A7796_PD_A3VC },
3839
{ "3dg-a", 0x100, 0, R8A7796_PD_3DG_A, R8A7796_PD_ALWAYS_ON },
3940
{ "3dg-b", 0x100, 1, R8A7796_PD_3DG_B, R8A7796_PD_3DG_A },
40-
{ "a3ir", 0x180, 0, R8A7796_PD_A3IR, R8A7796_PD_ALWAYS_ON },
41+
{ "a3ir", 0x180, 0, R8A7796_PD_A3IR, R8A7796_PD_ALWAYS_ON,
42+
PD_OFF_DELAY },
4143
};
4244

4345

drivers/pmdomain/renesas/rcar-sysc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ static int rcar_sysc_pwr_on_off(const struct rcar_sysc_pd *pd, bool on)
9090
if (ret)
9191
return -EAGAIN;
9292

93+
/* Power-off delay quirk */
94+
if (!on && (pd->flags & PD_OFF_DELAY))
95+
udelay(1);
96+
9397
/* Submit power shutoff or power resume request */
9498
iowrite32(BIT(pd->chan_bit), rcar_sysc_base + pd->chan_offs + reg_offs);
9599

drivers/pmdomain/renesas/rcar-sysc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define PD_CPU BIT(0) /* Area contains main CPU core */
1717
#define PD_SCU BIT(1) /* Area contains SCU and L2 cache */
1818
#define PD_NO_CR BIT(2) /* Area lacks PWR{ON,OFF}CR registers */
19+
#define PD_OFF_DELAY BIT(3) /* Area is subject to power-off delay quirk */
1920

2021
#define PD_CPU_CR PD_CPU /* CPU area has CR (R-Car H1) */
2122
#define PD_CPU_NOCR PD_CPU | PD_NO_CR /* CPU area lacks CR (R-Car Gen2/3) */

0 commit comments

Comments
 (0)