Skip to content

Commit a645972

Browse files
bijudashorms
authored andcommitted
soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A,B}
The workaround for the wrong hierarchy of the 3DG-{A,B} power domains on RZ/G2E ES1.0 corrected the parent domains. However, the 3DG-{A,B} power domains were still initialized and powered in the wrong order, causing 3DG operation to fail. Fix this by changing the order in the table at runtime, when running on an affected SoC. This work is based on the work done by Geert for R-Car E3. Fixes: f37d211 ("soc: renesas: rcar-sysc: Add r8a774c0 support") Signed-off-by: Biju Das <biju.das@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
1 parent 8070ba6 commit a645972

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

drivers/soc/renesas/r8a774c0-sysc.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,6 @@ static struct rcar_sysc_area r8a774c0_areas[] __initdata = {
2828
{ "3dg-b", 0x100, 1, R8A774C0_PD_3DG_B, R8A774C0_PD_3DG_A },
2929
};
3030

31-
static void __init rcar_sysc_fix_parent(struct rcar_sysc_area *areas,
32-
unsigned int num_areas, u8 id,
33-
int new_parent)
34-
{
35-
unsigned int i;
36-
37-
for (i = 0; i < num_areas; i++)
38-
if (areas[i].isr_bit == id) {
39-
areas[i].parent = new_parent;
40-
return;
41-
}
42-
}
43-
4431
/* Fixups for RZ/G2E ES1.0 revision */
4532
static const struct soc_device_attribute r8a774c0[] __initconst = {
4633
{ .soc_id = "r8a774c0", .revision = "ES1.0" },
@@ -50,12 +37,10 @@ static const struct soc_device_attribute r8a774c0[] __initconst = {
5037
static int __init r8a774c0_sysc_init(void)
5138
{
5239
if (soc_device_match(r8a774c0)) {
53-
rcar_sysc_fix_parent(r8a774c0_areas,
54-
ARRAY_SIZE(r8a774c0_areas),
55-
R8A774C0_PD_3DG_A, R8A774C0_PD_3DG_B);
56-
rcar_sysc_fix_parent(r8a774c0_areas,
57-
ARRAY_SIZE(r8a774c0_areas),
58-
R8A774C0_PD_3DG_B, R8A774C0_PD_ALWAYS_ON);
40+
/* Fix incorrect 3DG hierarchy */
41+
swap(r8a774c0_areas[6], r8a774c0_areas[7]);
42+
r8a774c0_areas[6].parent = R8A774C0_PD_ALWAYS_ON;
43+
r8a774c0_areas[7].parent = R8A774C0_PD_3DG_B;
5944
}
6045

6146
return 0;

0 commit comments

Comments
 (0)