Skip to content

Commit 78ed252

Browse files
bijudasgeertu
authored andcommitted
clk: renesas: r9a07g043: Add clock and reset entries for CRU
Add CRU clock and reset entries to CPG driver. CRU_SYSCLK and CRU_VCLK clocks need to be turned ON/OFF in particular sequence for the CRU block hence add these clocks to r9a07g043_no_pm_mod_clks[] array and pass it as part of CPG data for RZ/G2UL SoCs. Signed-off-by: Biju Das <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 292d307 commit 78ed252

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

drivers/clk/renesas/r9a07g043-cpg.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum clk_ids {
4848
CLK_SEL_PLL3_3,
4949
CLK_DIV_PLL3_C,
5050
#ifdef CONFIG_ARM64
51+
CLK_M2_DIV2,
5152
CLK_PLL5,
5253
CLK_PLL5_500,
5354
CLK_PLL5_250,
@@ -142,6 +143,10 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
142143
mtable_sdhi, 0, rzg2l_cpg_sd_clk_mux_notifier),
143144
DEF_FIXED("SD0_DIV4", CLK_SD0_DIV4, R9A07G043_CLK_SD0, 1, 4),
144145
DEF_FIXED("SD1_DIV4", CLK_SD1_DIV4, R9A07G043_CLK_SD1, 1, 4),
146+
#ifdef CONFIG_ARM64
147+
DEF_FIXED("M2", R9A07G043_CLK_M2, CLK_PLL3_533, 1, 2),
148+
DEF_FIXED("M2_DIV2", CLK_M2_DIV2, R9A07G043_CLK_M2, 1, 2),
149+
#endif
145150
};
146151

147152
static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
@@ -195,6 +200,16 @@ static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
195200
0x554, 6),
196201
DEF_MOD("sdhi1_aclk", R9A07G043_SDHI1_ACLK, R9A07G043_CLK_P1,
197202
0x554, 7),
203+
#ifdef CONFIG_ARM64
204+
DEF_MOD("cru_sysclk", R9A07G043_CRU_SYSCLK, CLK_M2_DIV2,
205+
0x564, 0),
206+
DEF_MOD("cru_vclk", R9A07G043_CRU_VCLK, R9A07G043_CLK_M2,
207+
0x564, 1),
208+
DEF_MOD("cru_pclk", R9A07G043_CRU_PCLK, R9A07G043_CLK_ZT,
209+
0x564, 2),
210+
DEF_MOD("cru_aclk", R9A07G043_CRU_ACLK, R9A07G043_CLK_M0,
211+
0x564, 3),
212+
#endif
198213
DEF_MOD("ssi0_pclk", R9A07G043_SSI0_PCLK2, R9A07G043_CLK_P0,
199214
0x570, 0),
200215
DEF_MOD("ssi0_sfr", R9A07G043_SSI0_PCLK_SFR, R9A07G043_CLK_P0,
@@ -286,6 +301,11 @@ static struct rzg2l_reset r9a07g043_resets[] = {
286301
DEF_RST(R9A07G043_SPI_RST, 0x850, 0),
287302
DEF_RST(R9A07G043_SDHI0_IXRST, 0x854, 0),
288303
DEF_RST(R9A07G043_SDHI1_IXRST, 0x854, 1),
304+
#ifdef CONFIG_ARM64
305+
DEF_RST(R9A07G043_CRU_CMN_RSTB, 0x864, 0),
306+
DEF_RST(R9A07G043_CRU_PRESETN, 0x864, 1),
307+
DEF_RST(R9A07G043_CRU_ARESETN, 0x864, 2),
308+
#endif
289309
DEF_RST(R9A07G043_SSI0_RST_M2_REG, 0x870, 0),
290310
DEF_RST(R9A07G043_SSI1_RST_M2_REG, 0x870, 1),
291311
DEF_RST(R9A07G043_SSI2_RST_M2_REG, 0x870, 2),
@@ -331,6 +351,13 @@ static const unsigned int r9a07g043_crit_mod_clks[] __initconst = {
331351
MOD_CLK_BASE + R9A07G043_DMAC_ACLK,
332352
};
333353

354+
#ifdef CONFIG_ARM64
355+
static const unsigned int r9a07g043_no_pm_mod_clks[] = {
356+
MOD_CLK_BASE + R9A07G043_CRU_SYSCLK,
357+
MOD_CLK_BASE + R9A07G043_CRU_VCLK,
358+
};
359+
#endif
360+
334361
const struct rzg2l_cpg_info r9a07g043_cpg_info = {
335362
/* Core Clocks */
336363
.core_clks = r9a07g043_core_clks,
@@ -347,6 +374,10 @@ const struct rzg2l_cpg_info r9a07g043_cpg_info = {
347374
.num_mod_clks = ARRAY_SIZE(r9a07g043_mod_clks),
348375
#ifdef CONFIG_ARM64
349376
.num_hw_mod_clks = R9A07G043_TSU_PCLK + 1,
377+
378+
/* No PM Module Clocks */
379+
.no_pm_mod_clks = r9a07g043_no_pm_mod_clks,
380+
.num_no_pm_mod_clks = ARRAY_SIZE(r9a07g043_no_pm_mod_clks),
350381
#endif
351382
#ifdef CONFIG_RISCV
352383
.num_hw_mod_clks = R9A07G043_IAX45_PCLK + 1,

0 commit comments

Comments
 (0)