@@ -36,9 +36,11 @@ enum clk_ids {
36
36
CLK_PLL3_DIV2_4_2 ,
37
37
CLK_SEL_PLL3_3 ,
38
38
CLK_DIV_PLL3_C ,
39
+ #ifdef CONFIG_ARM64
39
40
CLK_PLL5 ,
40
41
CLK_PLL5_500 ,
41
42
CLK_PLL5_250 ,
43
+ #endif
42
44
CLK_PLL6 ,
43
45
CLK_PLL6_250 ,
44
46
CLK_P1_DIV2 ,
@@ -100,9 +102,11 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
100
102
DEF_FIXED (".pll3_533" , CLK_PLL3_533 , CLK_PLL3 , 1 , 3 ),
101
103
DEF_MUX_RO (".sel_pll3_3" , CLK_SEL_PLL3_3 , SEL_PLL3_3 , sel_pll3_3 ),
102
104
DEF_DIV ("divpl3c" , CLK_DIV_PLL3_C , CLK_SEL_PLL3_3 , DIVPL3C , dtable_1_32 ),
105
+ #ifdef CONFIG_ARM64
103
106
DEF_FIXED (".pll5" , CLK_PLL5 , CLK_EXTAL , 125 , 1 ),
104
107
DEF_FIXED (".pll5_500" , CLK_PLL5_500 , CLK_PLL5 , 1 , 6 ),
105
108
DEF_FIXED (".pll5_250" , CLK_PLL5_250 , CLK_PLL5_500 , 1 , 2 ),
109
+ #endif
106
110
DEF_FIXED (".pll6" , CLK_PLL6 , CLK_EXTAL , 125 , 6 ),
107
111
DEF_FIXED (".pll6_250" , CLK_PLL6_250 , CLK_PLL6 , 1 , 2 ),
108
112
@@ -126,12 +130,20 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
126
130
};
127
131
128
132
static struct rzg2l_mod_clk r9a07g043_mod_clks [] = {
133
+ #ifdef CONFIG_ARM64
129
134
DEF_MOD ("gic" , R9A07G043_GIC600_GICCLK , R9A07G043_CLK_P1 ,
130
135
0x514 , 0 ),
131
136
DEF_MOD ("ia55_pclk" , R9A07G043_IA55_PCLK , R9A07G043_CLK_P2 ,
132
137
0x518 , 0 ),
133
138
DEF_MOD ("ia55_clk" , R9A07G043_IA55_CLK , R9A07G043_CLK_P1 ,
134
139
0x518 , 1 ),
140
+ #endif
141
+ #ifdef CONFIG_RISCV
142
+ DEF_MOD ("iax45_pclk" , R9A07G043_IAX45_PCLK , R9A07G043_CLK_P2 ,
143
+ 0x518 , 0 ),
144
+ DEF_MOD ("iax45_clk" , R9A07G043_IAX45_CLK , R9A07G043_CLK_P1 ,
145
+ 0x518 , 1 ),
146
+ #endif
135
147
DEF_MOD ("dmac_aclk" , R9A07G043_DMAC_ACLK , R9A07G043_CLK_P1 ,
136
148
0x52c , 0 ),
137
149
DEF_MOD ("dmac_pclk" , R9A07G043_DMAC_PCLK , CLK_P1_DIV2 ,
@@ -243,9 +255,14 @@ static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
243
255
};
244
256
245
257
static struct rzg2l_reset r9a07g043_resets [] = {
258
+ #ifdef CONFIG_ARM64
246
259
DEF_RST (R9A07G043_GIC600_GICRESET_N , 0x814 , 0 ),
247
260
DEF_RST (R9A07G043_GIC600_DBG_GICRESET_N , 0x814 , 1 ),
248
261
DEF_RST (R9A07G043_IA55_RESETN , 0x818 , 0 ),
262
+ #endif
263
+ #ifdef CONFIG_RISCV
264
+ DEF_RST (R9A07G043_IAX45_RESETN , 0x818 , 0 ),
265
+ #endif
249
266
DEF_RST (R9A07G043_DMAC_ARESETN , 0x82c , 0 ),
250
267
DEF_RST (R9A07G043_DMAC_RST_ASYNC , 0x82c , 1 ),
251
268
DEF_RST (R9A07G043_OSTM0_PRESETZ , 0x834 , 0 ),
@@ -291,8 +308,13 @@ static struct rzg2l_reset r9a07g043_resets[] = {
291
308
};
292
309
293
310
static const unsigned int r9a07g043_crit_mod_clks [] __initconst = {
311
+ #ifdef CONFIG_ARM64
294
312
MOD_CLK_BASE + R9A07G043_GIC600_GICCLK ,
295
313
MOD_CLK_BASE + R9A07G043_IA55_CLK ,
314
+ #endif
315
+ #ifdef CONFIG_RISCV
316
+ MOD_CLK_BASE + R9A07G043_IAX45_CLK ,
317
+ #endif
296
318
MOD_CLK_BASE + R9A07G043_DMAC_ACLK ,
297
319
};
298
320
@@ -310,11 +332,21 @@ const struct rzg2l_cpg_info r9a07g043_cpg_info = {
310
332
/* Module Clocks */
311
333
.mod_clks = r9a07g043_mod_clks ,
312
334
.num_mod_clks = ARRAY_SIZE (r9a07g043_mod_clks ),
335
+ #ifdef CONFIG_ARM64
313
336
.num_hw_mod_clks = R9A07G043_TSU_PCLK + 1 ,
337
+ #endif
338
+ #ifdef CONFIG_RISCV
339
+ .num_hw_mod_clks = R9A07G043_IAX45_PCLK + 1 ,
340
+ #endif
314
341
315
342
/* Resets */
316
343
.resets = r9a07g043_resets ,
344
+ #ifdef CONFIG_ARM64
317
345
.num_resets = R9A07G043_TSU_PRESETN + 1 , /* Last reset ID + 1 */
346
+ #endif
347
+ #ifdef CONFIG_RISCV
348
+ .num_resets = R9A07G043_IAX45_RESETN + 1 , /* Last reset ID + 1 */
349
+ #endif
318
350
319
351
.has_clk_mon_regs = true,
320
352
};
0 commit comments