Skip to content

Commit 861df87

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: r9a09g056: Add support for PLLVDO, CRU clocks, and resets
Add support for the PLLVDO clock and its related CRU clocks and reset entries in the R9A09G056 CPG driver. Introduce `CLK_PLLVDO` and associated clocks like `CLK_PLLVDO_CRU0` and `CLK_PLLVDO_CRU1`, along with their corresponding dividers. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20251023210724.666476-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent d64522b commit 861df87

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

drivers/clk/renesas/r9a09g056-cpg.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ enum clk_ids {
2929
CLK_PLLCLN,
3030
CLK_PLLDTY,
3131
CLK_PLLCA55,
32+
CLK_PLLVDO,
3233
CLK_PLLETH,
3334
CLK_PLLDSI,
3435
CLK_PLLGPU,
@@ -50,6 +51,8 @@ enum clk_ids {
5051
CLK_PLLDTY_ACPU_DIV4,
5152
CLK_PLLDTY_DIV8,
5253
CLK_PLLDTY_DIV16,
54+
CLK_PLLVDO_CRU0,
55+
CLK_PLLVDO_CRU1,
5356
CLK_PLLETH_DIV_250_FIX,
5457
CLK_PLLETH_DIV_125_FIX,
5558
CLK_CSDIV_PLLETH_GBE0,
@@ -75,6 +78,12 @@ static const struct clk_div_table dtable_1_8[] = {
7578
{0, 0},
7679
};
7780

81+
static const struct clk_div_table dtable_2_4[] = {
82+
{0, 2},
83+
{1, 4},
84+
{0, 0},
85+
};
86+
7887
static const struct clk_div_table dtable_2_16[] = {
7988
{0, 2},
8089
{1, 4},
@@ -149,6 +158,7 @@ static const struct cpg_core_clk r9a09g056_core_clks[] __initconst = {
149158
DEF_FIXED(".pllcln", CLK_PLLCLN, CLK_QEXTAL, 200, 3),
150159
DEF_FIXED(".plldty", CLK_PLLDTY, CLK_QEXTAL, 200, 3),
151160
DEF_PLL(".pllca55", CLK_PLLCA55, CLK_QEXTAL, PLLCA55),
161+
DEF_FIXED(".pllvdo", CLK_PLLVDO, CLK_QEXTAL, 105, 2),
152162
DEF_FIXED(".plleth", CLK_PLLETH, CLK_QEXTAL, 125, 3),
153163
DEF_PLLDSI(".plldsi", CLK_PLLDSI, CLK_QEXTAL, PLLDSI),
154164
DEF_PLL(".pllgpu", CLK_PLLGPU, CLK_QEXTAL, PLLGPU),
@@ -174,6 +184,9 @@ static const struct cpg_core_clk r9a09g056_core_clks[] __initconst = {
174184
DEF_FIXED(".plldty_div8", CLK_PLLDTY_DIV8, CLK_PLLDTY, 1, 8),
175185
DEF_FIXED(".plldty_div16", CLK_PLLDTY_DIV16, CLK_PLLDTY, 1, 16),
176186

187+
DEF_DDIV(".pllvdo_cru0", CLK_PLLVDO_CRU0, CLK_PLLVDO, CDDIV3_DIVCTL3, dtable_2_4),
188+
DEF_DDIV(".pllvdo_cru1", CLK_PLLVDO_CRU1, CLK_PLLVDO, CDDIV4_DIVCTL0, dtable_2_4),
189+
177190
DEF_FIXED(".plleth_250_fix", CLK_PLLETH_DIV_250_FIX, CLK_PLLETH, 1, 4),
178191
DEF_FIXED(".plleth_125_fix", CLK_PLLETH_DIV_125_FIX, CLK_PLLETH_DIV_250_FIX, 1, 2),
179192
DEF_CSDIV(".plleth_gbe0", CLK_CSDIV_PLLETH_GBE0,
@@ -334,6 +347,18 @@ static const struct rzv2h_mod_clk r9a09g056_mod_clks[] __initconst = {
334347
BUS_MSTOP(8, BIT(6))),
335348
DEF_MOD("gbeth_1_aclk_i", CLK_PLLDTY_DIV8, 12, 3, 6, 3,
336349
BUS_MSTOP(8, BIT(6))),
350+
DEF_MOD("cru_0_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 2, 6, 18,
351+
BUS_MSTOP(9, BIT(4))),
352+
DEF_MOD_NO_PM("cru_0_vclk", CLK_PLLVDO_CRU0, 13, 3, 6, 19,
353+
BUS_MSTOP(9, BIT(4))),
354+
DEF_MOD("cru_0_pclk", CLK_PLLDTY_DIV16, 13, 4, 6, 20,
355+
BUS_MSTOP(9, BIT(4))),
356+
DEF_MOD("cru_1_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 5, 6, 21,
357+
BUS_MSTOP(9, BIT(5))),
358+
DEF_MOD_NO_PM("cru_1_vclk", CLK_PLLVDO_CRU1, 13, 6, 6, 22,
359+
BUS_MSTOP(9, BIT(5))),
360+
DEF_MOD("cru_1_pclk", CLK_PLLDTY_DIV16, 13, 7, 6, 23,
361+
BUS_MSTOP(9, BIT(5))),
337362
DEF_MOD("dsi_0_pclk", CLK_PLLDTY_DIV16, 14, 8, 7, 8,
338363
BUS_MSTOP(9, BIT(14) | BIT(15))),
339364
DEF_MOD("dsi_0_aclk", CLK_PLLDTY_ACPU_DIV2, 14, 9, 7, 9,
@@ -396,6 +421,12 @@ static const struct rzv2h_reset r9a09g056_resets[] __initconst = {
396421
DEF_RST(10, 15, 5, 0), /* USB2_0_PRESETN */
397422
DEF_RST(11, 0, 5, 1), /* GBETH_0_ARESETN_I */
398423
DEF_RST(11, 1, 5, 2), /* GBETH_1_ARESETN_I */
424+
DEF_RST(12, 5, 5, 22), /* CRU_0_PRESETN */
425+
DEF_RST(12, 6, 5, 23), /* CRU_0_ARESETN */
426+
DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */
427+
DEF_RST(12, 8, 5, 25), /* CRU_1_PRESETN */
428+
DEF_RST(12, 9, 5, 26), /* CRU_1_ARESETN */
429+
DEF_RST(12, 10, 5, 27), /* CRU_1_S_RESETN */
399430
DEF_RST(13, 7, 6, 8), /* DSI_0_PRESETN */
400431
DEF_RST(13, 8, 6, 9), /* DSI_0_ARESETN */
401432
DEF_RST(13, 12, 6, 13), /* LCDC_0_RESET_N */

0 commit comments

Comments
 (0)