Skip to content

Commit a278d0c

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: r9a07g044: 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 r9a07g044_no_pm_mod_clks[] array and pass it as part of CPG data for both RZ/G2L and RZ/V2L SoCs. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20221221212703.348278-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent d969103 commit a278d0c

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

drivers/clk/renesas/r9a07g044-cpg.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static const struct {
182182
};
183183

184184
static const struct {
185-
struct rzg2l_mod_clk common[75];
185+
struct rzg2l_mod_clk common[79];
186186
#ifdef CONFIG_CLK_R9A07G054
187187
struct rzg2l_mod_clk drp[0];
188188
#endif
@@ -250,6 +250,14 @@ static const struct {
250250
0x558, 1),
251251
DEF_MOD("gpu_ace_clk", R9A07G044_GPU_ACE_CLK, R9A07G044_CLK_P1,
252252
0x558, 2),
253+
DEF_MOD("cru_sysclk", R9A07G044_CRU_SYSCLK, CLK_M2_DIV2,
254+
0x564, 0),
255+
DEF_MOD("cru_vclk", R9A07G044_CRU_VCLK, R9A07G044_CLK_M2,
256+
0x564, 1),
257+
DEF_MOD("cru_pclk", R9A07G044_CRU_PCLK, R9A07G044_CLK_ZT,
258+
0x564, 2),
259+
DEF_MOD("cru_aclk", R9A07G044_CRU_ACLK, R9A07G044_CLK_M0,
260+
0x564, 3),
253261
DEF_MOD("dsi_pll_clk", R9A07G044_MIPI_DSI_PLLCLK, R9A07G044_CLK_M1,
254262
0x568, 0),
255263
DEF_MOD("dsi_sys_clk", R9A07G044_MIPI_DSI_SYSCLK, CLK_M2_DIV2,
@@ -368,6 +376,9 @@ static struct rzg2l_reset r9a07g044_resets[] = {
368376
DEF_RST(R9A07G044_GPU_RESETN, 0x858, 0),
369377
DEF_RST(R9A07G044_GPU_AXI_RESETN, 0x858, 1),
370378
DEF_RST(R9A07G044_GPU_ACE_RESETN, 0x858, 2),
379+
DEF_RST(R9A07G044_CRU_CMN_RSTB, 0x864, 0),
380+
DEF_RST(R9A07G044_CRU_PRESETN, 0x864, 1),
381+
DEF_RST(R9A07G044_CRU_ARESETN, 0x864, 2),
371382
DEF_RST(R9A07G044_MIPI_DSI_CMN_RSTB, 0x868, 0),
372383
DEF_RST(R9A07G044_MIPI_DSI_ARESET_N, 0x868, 1),
373384
DEF_RST(R9A07G044_MIPI_DSI_PRESET_N, 0x868, 2),
@@ -412,6 +423,11 @@ static const unsigned int r9a07g044_crit_mod_clks[] __initconst = {
412423
MOD_CLK_BASE + R9A07G044_DMAC_ACLK,
413424
};
414425

426+
static const unsigned int r9a07g044_no_pm_mod_clks[] = {
427+
MOD_CLK_BASE + R9A07G044_CRU_SYSCLK,
428+
MOD_CLK_BASE + R9A07G044_CRU_VCLK,
429+
};
430+
415431
#ifdef CONFIG_CLK_R9A07G044
416432
const struct rzg2l_cpg_info r9a07g044_cpg_info = {
417433
/* Core Clocks */
@@ -429,6 +445,10 @@ const struct rzg2l_cpg_info r9a07g044_cpg_info = {
429445
.num_mod_clks = ARRAY_SIZE(mod_clks.common),
430446
.num_hw_mod_clks = R9A07G044_TSU_PCLK + 1,
431447

448+
/* No PM Module Clocks */
449+
.no_pm_mod_clks = r9a07g044_no_pm_mod_clks,
450+
.num_no_pm_mod_clks = ARRAY_SIZE(r9a07g044_no_pm_mod_clks),
451+
432452
/* Resets */
433453
.resets = r9a07g044_resets,
434454
.num_resets = R9A07G044_TSU_PRESETN + 1, /* Last reset ID + 1 */
@@ -454,6 +474,10 @@ const struct rzg2l_cpg_info r9a07g054_cpg_info = {
454474
.num_mod_clks = ARRAY_SIZE(mod_clks.common) + ARRAY_SIZE(mod_clks.drp),
455475
.num_hw_mod_clks = R9A07G054_STPAI_ACLK_DRP + 1,
456476

477+
/* No PM Module Clocks */
478+
.no_pm_mod_clks = r9a07g044_no_pm_mod_clks,
479+
.num_no_pm_mod_clks = ARRAY_SIZE(r9a07g044_no_pm_mod_clks),
480+
457481
/* Resets */
458482
.resets = r9a07g044_resets,
459483
.num_resets = R9A07G054_STPAI_ARESETN + 1, /* Last reset ID + 1 */

0 commit comments

Comments
 (0)