Skip to content

Commit 989d673

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: r9a07g044: Add clock and reset entry for DRP-AI
Add clock and reset entries for the DRP-AI block, which is available only on the Renesas RZ/V2L SoC. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 5599c7c commit 989d673

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

drivers/clk/renesas/r9a07g044-cpg.c

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,41 @@ static const struct clk_div_table dtable_1_32[] = {
9494
{0, 0},
9595
};
9696

97+
#ifdef CONFIG_CLK_R9A07G054
98+
static const struct clk_div_table dtable_4_32[] = {
99+
{3, 4},
100+
{4, 5},
101+
{5, 6},
102+
{6, 7},
103+
{7, 8},
104+
{8, 9},
105+
{9, 10},
106+
{10, 11},
107+
{11, 12},
108+
{12, 13},
109+
{13, 14},
110+
{14, 15},
111+
{15, 16},
112+
{16, 17},
113+
{17, 18},
114+
{18, 19},
115+
{19, 20},
116+
{20, 21},
117+
{21, 22},
118+
{22, 23},
119+
{23, 24},
120+
{24, 25},
121+
{25, 26},
122+
{26, 27},
123+
{27, 28},
124+
{28, 29},
125+
{29, 30},
126+
{30, 31},
127+
{31, 32},
128+
{0, 0},
129+
};
130+
#endif
131+
97132
static const struct clk_div_table dtable_16_128[] = {
98133
{0, 16},
99134
{1, 32},
@@ -114,7 +149,7 @@ static const u32 mtable_sdhi[] = { 1, 2, 3 };
114149
static const struct {
115150
struct cpg_core_clk common[56];
116151
#ifdef CONFIG_CLK_R9A07G054
117-
struct cpg_core_clk drp[0];
152+
struct cpg_core_clk drp[3];
118153
#endif
119154
} core_clks __initconst = {
120155
.common = {
@@ -192,14 +227,17 @@ static const struct {
192227
},
193228
#ifdef CONFIG_CLK_R9A07G054
194229
.drp = {
230+
DEF_FIXED("DRP_M", R9A07G054_CLK_DRP_M, CLK_PLL3, 1, 5),
231+
DEF_FIXED("DRP_D", R9A07G054_CLK_DRP_D, CLK_PLL3, 1, 2),
232+
DEF_DIV("DRP_A", R9A07G054_CLK_DRP_A, CLK_PLL3, DIVPL3E, dtable_4_32),
195233
},
196234
#endif
197235
};
198236

199237
static const struct {
200238
struct rzg2l_mod_clk common[79];
201239
#ifdef CONFIG_CLK_R9A07G054
202-
struct rzg2l_mod_clk drp[0];
240+
struct rzg2l_mod_clk drp[5];
203241
#endif
204242
} mod_clks = {
205243
.common = {
@@ -364,6 +402,16 @@ static const struct {
364402
},
365403
#ifdef CONFIG_CLK_R9A07G054
366404
.drp = {
405+
DEF_MOD("stpai_initclk", R9A07G054_STPAI_INITCLK, R9A07G044_OSCCLK,
406+
0x5e8, 0),
407+
DEF_MOD("stpai_aclk", R9A07G054_STPAI_ACLK, R9A07G044_CLK_P1,
408+
0x5e8, 1),
409+
DEF_MOD("stpai_mclk", R9A07G054_STPAI_MCLK, R9A07G054_CLK_DRP_M,
410+
0x5e8, 2),
411+
DEF_MOD("stpai_dclkin", R9A07G054_STPAI_DCLKIN, R9A07G054_CLK_DRP_D,
412+
0x5e8, 3),
413+
DEF_MOD("stpai_aclk_drp", R9A07G054_STPAI_ACLK_DRP, R9A07G054_CLK_DRP_A,
414+
0x5e8, 4),
367415
},
368416
#endif
369417
};
@@ -430,6 +478,9 @@ static const struct rzg2l_reset r9a07g044_resets[] = {
430478
DEF_RST(R9A07G044_ADC_PRESETN, 0x8a8, 0),
431479
DEF_RST(R9A07G044_ADC_ADRST_N, 0x8a8, 1),
432480
DEF_RST(R9A07G044_TSU_PRESETN, 0x8ac, 0),
481+
#ifdef CONFIG_CLK_R9A07G054
482+
DEF_RST(R9A07G054_STPAI_ARESETN, 0x8e8, 0),
483+
#endif
433484
};
434485

435486
static const unsigned int r9a07g044_crit_mod_clks[] __initconst = {

drivers/clk/renesas/rzg2l-cpg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define CPG_PL2_DDIV (0x204)
2222
#define CPG_PL3A_DDIV (0x208)
2323
#define CPG_PL6_DDIV (0x210)
24+
#define CPG_PL3C_SDIV (0x214)
2425
#define CPG_CLKSTATUS (0x280)
2526
#define CPG_PL3_SSEL (0x408)
2627
#define CPG_PL6_SSEL (0x414)
@@ -70,6 +71,7 @@
7071
#define DIVPL3A DDIV_PACK(CPG_PL3A_DDIV, 0, 3)
7172
#define DIVPL3B DDIV_PACK(CPG_PL3A_DDIV, 4, 3)
7273
#define DIVPL3C DDIV_PACK(CPG_PL3A_DDIV, 8, 3)
74+
#define DIVPL3E DDIV_PACK(CPG_PL3C_SDIV, 8, 5)
7375
#define DIVGPU DDIV_PACK(CPG_PL6_DDIV, 0, 2)
7476

7577
#define SEL_PLL_PACK(offset, bitpos, size) \

0 commit comments

Comments
 (0)