Skip to content

Commit 037800c

Browse files
Scott31393geertu
authored andcommitted
clk: renesas: r9a09g047: Add CRU0 clocks and resets
Add support for CRU0 clocks and resets along with the corresponding divider. Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/20250210114540.524790-2-tommaso.merciai.xr@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 43961f7 commit 037800c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/clk/renesas/r9a09g047-cpg.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ enum clk_ids {
2828
CLK_PLLCLN,
2929
CLK_PLLDTY,
3030
CLK_PLLCA55,
31+
CLK_PLLVDO,
3132

3233
/* Internal Core Clocks */
3334
CLK_PLLCM33_DIV16,
3435
CLK_PLLCLN_DIV2,
3536
CLK_PLLCLN_DIV8,
3637
CLK_PLLCLN_DIV16,
3738
CLK_PLLDTY_ACPU,
39+
CLK_PLLDTY_ACPU_DIV2,
3840
CLK_PLLDTY_ACPU_DIV4,
41+
CLK_PLLDTY_DIV16,
42+
CLK_PLLVDO_CRU0,
3943

4044
/* Module Clocks */
4145
MOD_CLK_BASE,
@@ -49,6 +53,12 @@ static const struct clk_div_table dtable_1_8[] = {
4953
{0, 0},
5054
};
5155

56+
static const struct clk_div_table dtable_2_4[] = {
57+
{0, 2},
58+
{1, 4},
59+
{0, 0},
60+
};
61+
5262
static const struct clk_div_table dtable_2_64[] = {
5363
{0, 2},
5464
{1, 4},
@@ -69,6 +79,7 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
6979
DEF_FIXED(".pllcln", CLK_PLLCLN, CLK_QEXTAL, 200, 3),
7080
DEF_FIXED(".plldty", CLK_PLLDTY, CLK_QEXTAL, 200, 3),
7181
DEF_PLL(".pllca55", CLK_PLLCA55, CLK_QEXTAL, PLL_CONF(0x64)),
82+
DEF_FIXED(".pllvdo", CLK_PLLVDO, CLK_QEXTAL, 105, 2),
7283

7384
/* Internal Core Clocks */
7485
DEF_FIXED(".pllcm33_div16", CLK_PLLCM33_DIV16, CLK_PLLCM33, 1, 16),
@@ -78,7 +89,11 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
7889
DEF_FIXED(".pllcln_div16", CLK_PLLCLN_DIV16, CLK_PLLCLN, 1, 16),
7990

8091
DEF_DDIV(".plldty_acpu", CLK_PLLDTY_ACPU, CLK_PLLDTY, CDDIV0_DIVCTL2, dtable_2_64),
92+
DEF_FIXED(".plldty_acpu_div2", CLK_PLLDTY_ACPU_DIV2, CLK_PLLDTY_ACPU, 1, 2),
8193
DEF_FIXED(".plldty_acpu_div4", CLK_PLLDTY_ACPU_DIV4, CLK_PLLDTY_ACPU, 1, 4),
94+
DEF_FIXED(".plldty_div16", CLK_PLLDTY_DIV16, CLK_PLLDTY, 1, 16),
95+
96+
DEF_DDIV(".pllvdo_cru0", CLK_PLLVDO_CRU0, CLK_PLLVDO, CDDIV3_DIVCTL3, dtable_2_4),
8297

8398
/* Core Clocks */
8499
DEF_FIXED("sys_0_pclk", R9A09G047_SYS_0_PCLK, CLK_QEXTAL, 1, 1),
@@ -154,6 +169,12 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
154169
BUS_MSTOP(8, BIT(4))),
155170
DEF_MOD("sdhi_2_aclk", CLK_PLLDTY_ACPU_DIV4, 10, 14, 5, 14,
156171
BUS_MSTOP(8, BIT(4))),
172+
DEF_MOD("cru_0_aclk", CLK_PLLDTY_ACPU_DIV2, 13, 2, 6, 18,
173+
BUS_MSTOP(9, BIT(4))),
174+
DEF_MOD_NO_PM("cru_0_vclk", CLK_PLLVDO_CRU0, 13, 3, 6, 19,
175+
BUS_MSTOP(9, BIT(4))),
176+
DEF_MOD("cru_0_pclk", CLK_PLLDTY_DIV16, 13, 4, 6, 20,
177+
BUS_MSTOP(9, BIT(4))),
157178
};
158179

159180
static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
@@ -177,6 +198,9 @@ static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
177198
DEF_RST(10, 7, 4, 24), /* SDHI_0_IXRST */
178199
DEF_RST(10, 8, 4, 25), /* SDHI_1_IXRST */
179200
DEF_RST(10, 9, 4, 26), /* SDHI_2_IXRST */
201+
DEF_RST(12, 5, 5, 22), /* CRU_0_PRESETN */
202+
DEF_RST(12, 6, 5, 23), /* CRU_0_ARESETN */
203+
DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */
180204
};
181205

182206
const struct rzv2h_cpg_info r9a09g047_cpg_info __initconst = {

0 commit comments

Comments
 (0)