Skip to content

Commit 8ba69fd

Browse files
committed
Merge tag 'renesas-clk-for-v5.20-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas
Pull Renesas clk driver updates from Geert Uytterhoeven: - Add support for the Renesas RZ/Five SoC - Fix initconst confusion on Renesas R-Car Gen4 * tag 'renesas-clk-for-v5.20-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: rcar-gen4: Fix initconst confusion for cpg_pll_config clk: renesas: r9a07g043: Add support for RZ/Five SoC dt-bindings: clock: r9a07g043-cpg: Add Renesas RZ/Five CPG Clock and Reset Definitions
2 parents d39afb7 + 0e704f6 commit 8ba69fd

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

drivers/clk/renesas/r9a07g043-cpg.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ enum clk_ids {
3636
CLK_PLL3_DIV2_4_2,
3737
CLK_SEL_PLL3_3,
3838
CLK_DIV_PLL3_C,
39+
#ifdef CONFIG_ARM64
3940
CLK_PLL5,
4041
CLK_PLL5_500,
4142
CLK_PLL5_250,
43+
#endif
4244
CLK_PLL6,
4345
CLK_PLL6_250,
4446
CLK_P1_DIV2,
@@ -100,9 +102,11 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
100102
DEF_FIXED(".pll3_533", CLK_PLL3_533, CLK_PLL3, 1, 3),
101103
DEF_MUX_RO(".sel_pll3_3", CLK_SEL_PLL3_3, SEL_PLL3_3, sel_pll3_3),
102104
DEF_DIV("divpl3c", CLK_DIV_PLL3_C, CLK_SEL_PLL3_3, DIVPL3C, dtable_1_32),
105+
#ifdef CONFIG_ARM64
103106
DEF_FIXED(".pll5", CLK_PLL5, CLK_EXTAL, 125, 1),
104107
DEF_FIXED(".pll5_500", CLK_PLL5_500, CLK_PLL5, 1, 6),
105108
DEF_FIXED(".pll5_250", CLK_PLL5_250, CLK_PLL5_500, 1, 2),
109+
#endif
106110
DEF_FIXED(".pll6", CLK_PLL6, CLK_EXTAL, 125, 6),
107111
DEF_FIXED(".pll6_250", CLK_PLL6_250, CLK_PLL6, 1, 2),
108112

@@ -126,12 +130,20 @@ static const struct cpg_core_clk r9a07g043_core_clks[] __initconst = {
126130
};
127131

128132
static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
133+
#ifdef CONFIG_ARM64
129134
DEF_MOD("gic", R9A07G043_GIC600_GICCLK, R9A07G043_CLK_P1,
130135
0x514, 0),
131136
DEF_MOD("ia55_pclk", R9A07G043_IA55_PCLK, R9A07G043_CLK_P2,
132137
0x518, 0),
133138
DEF_MOD("ia55_clk", R9A07G043_IA55_CLK, R9A07G043_CLK_P1,
134139
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
135147
DEF_MOD("dmac_aclk", R9A07G043_DMAC_ACLK, R9A07G043_CLK_P1,
136148
0x52c, 0),
137149
DEF_MOD("dmac_pclk", R9A07G043_DMAC_PCLK, CLK_P1_DIV2,
@@ -243,9 +255,14 @@ static struct rzg2l_mod_clk r9a07g043_mod_clks[] = {
243255
};
244256

245257
static struct rzg2l_reset r9a07g043_resets[] = {
258+
#ifdef CONFIG_ARM64
246259
DEF_RST(R9A07G043_GIC600_GICRESET_N, 0x814, 0),
247260
DEF_RST(R9A07G043_GIC600_DBG_GICRESET_N, 0x814, 1),
248261
DEF_RST(R9A07G043_IA55_RESETN, 0x818, 0),
262+
#endif
263+
#ifdef CONFIG_RISCV
264+
DEF_RST(R9A07G043_IAX45_RESETN, 0x818, 0),
265+
#endif
249266
DEF_RST(R9A07G043_DMAC_ARESETN, 0x82c, 0),
250267
DEF_RST(R9A07G043_DMAC_RST_ASYNC, 0x82c, 1),
251268
DEF_RST(R9A07G043_OSTM0_PRESETZ, 0x834, 0),
@@ -291,8 +308,13 @@ static struct rzg2l_reset r9a07g043_resets[] = {
291308
};
292309

293310
static const unsigned int r9a07g043_crit_mod_clks[] __initconst = {
311+
#ifdef CONFIG_ARM64
294312
MOD_CLK_BASE + R9A07G043_GIC600_GICCLK,
295313
MOD_CLK_BASE + R9A07G043_IA55_CLK,
314+
#endif
315+
#ifdef CONFIG_RISCV
316+
MOD_CLK_BASE + R9A07G043_IAX45_CLK,
317+
#endif
296318
MOD_CLK_BASE + R9A07G043_DMAC_ACLK,
297319
};
298320

@@ -310,11 +332,21 @@ const struct rzg2l_cpg_info r9a07g043_cpg_info = {
310332
/* Module Clocks */
311333
.mod_clks = r9a07g043_mod_clks,
312334
.num_mod_clks = ARRAY_SIZE(r9a07g043_mod_clks),
335+
#ifdef CONFIG_ARM64
313336
.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
314341

315342
/* Resets */
316343
.resets = r9a07g043_resets,
344+
#ifdef CONFIG_ARM64
317345
.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
318350

319351
.has_clk_mon_regs = true,
320352
};

drivers/clk/renesas/rcar-gen4-cpg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "rcar-gen4-cpg.h"
2424
#include "rcar-cpg-lib.h"
2525

26-
static const struct rcar_gen4_cpg_pll_config *cpg_pll_config __initconst;
26+
static const struct rcar_gen4_cpg_pll_config *cpg_pll_config __initdata;
2727
static unsigned int cpg_clk_extalr __initdata;
2828
static u32 cpg_mode __initdata;
2929

include/dt-bindings/clock/r9a07g043-cpg.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@
108108
#define R9A07G043_ADC_ADCLK 76
109109
#define R9A07G043_ADC_PCLK 77
110110
#define R9A07G043_TSU_PCLK 78
111+
#define R9A07G043_NCEPLDM_DM_CLK 79 /* RZ/Five Only */
112+
#define R9A07G043_NCEPLDM_ACLK 80 /* RZ/Five Only */
113+
#define R9A07G043_NCEPLDM_TCK 81 /* RZ/Five Only */
114+
#define R9A07G043_NCEPLMT_ACLK 82 /* RZ/Five Only */
115+
#define R9A07G043_NCEPLIC_ACLK 83 /* RZ/Five Only */
116+
#define R9A07G043_AX45MP_CORE0_CLK 84 /* RZ/Five Only */
117+
#define R9A07G043_AX45MP_ACLK 85 /* RZ/Five Only */
118+
#define R9A07G043_IAX45_CLK 86 /* RZ/Five Only */
119+
#define R9A07G043_IAX45_PCLK 87 /* RZ/Five Only */
111120

112121
/* R9A07G043 Resets */
113122
#define R9A07G043_CA55_RST_1_0 0 /* RZ/G2UL Only */
@@ -180,5 +189,16 @@
180189
#define R9A07G043_ADC_PRESETN 67
181190
#define R9A07G043_ADC_ADRST_N 68
182191
#define R9A07G043_TSU_PRESETN 69
192+
#define R9A07G043_NCEPLDM_DTM_PWR_RST_N 70 /* RZ/Five Only */
193+
#define R9A07G043_NCEPLDM_ARESETN 71 /* RZ/Five Only */
194+
#define R9A07G043_NCEPLMT_POR_RSTN 72 /* RZ/Five Only */
195+
#define R9A07G043_NCEPLMT_ARESETN 73 /* RZ/Five Only */
196+
#define R9A07G043_NCEPLIC_ARESETN 74 /* RZ/Five Only */
197+
#define R9A07G043_AX45MP_ARESETNM 75 /* RZ/Five Only */
198+
#define R9A07G043_AX45MP_ARESETNS 76 /* RZ/Five Only */
199+
#define R9A07G043_AX45MP_L2_RESETN 77 /* RZ/Five Only */
200+
#define R9A07G043_AX45MP_CORE0_RESETN 78 /* RZ/Five Only */
201+
#define R9A07G043_IAX45_RESETN 79 /* RZ/Five Only */
202+
183203

184204
#endif /* __DT_BINDINGS_CLOCK_R9A07G043_CPG_H__ */

0 commit comments

Comments
 (0)