Skip to content

Commit 6337029

Browse files
Fabrizio Castrogeertu
authored andcommitted
clk: renesas: r9a09g011: Add CSI related clocks
The Renesas RZ/V2M SoC comes with 6 CSI IPs (CSI0, CSI1, CSI2 CSI3, CSI4, and CSI5), however Linux is only allowed control of CSI0 and CSI4. CSI0 shares its reset and PCLK lines with CSI1, CSI2, and CSI3. CSI4 shares its reset and PCLK lines with CSI5. This commit adds support for the relevant clocks. Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230622113341.657842-3-fabrizio.castro.jz@renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent adf6b91 commit 6337029

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/clk/renesas/r9a09g011-cpg.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#define DIV_W DDIV_PACK(0x328, 0, 3)
2929

3030
#define SEL_B SEL_PLL_PACK(0x214, 0, 1)
31+
#define SEL_CSI0 SEL_PLL_PACK(0x330, 0, 1)
32+
#define SEL_CSI4 SEL_PLL_PACK(0x330, 4, 1)
3133
#define SEL_D SEL_PLL_PACK(0x214, 1, 1)
3234
#define SEL_E SEL_PLL_PACK(0x214, 2, 1)
3335
#define SEL_SDI SEL_PLL_PACK(0x300, 0, 1)
@@ -58,6 +60,8 @@ enum clk_ids {
5860
CLK_DIV_W,
5961
CLK_SEL_B,
6062
CLK_SEL_B_D2,
63+
CLK_SEL_CSI0,
64+
CLK_SEL_CSI4,
6165
CLK_SEL_D,
6266
CLK_SEL_E,
6367
CLK_SEL_SDI,
@@ -108,6 +112,7 @@ static const struct clk_div_table dtable_divw[] = {
108112

109113
/* Mux clock tables */
110114
static const char * const sel_b[] = { ".main", ".divb" };
115+
static const char * const sel_csi[] = { ".main_24", ".main" };
111116
static const char * const sel_d[] = { ".main", ".divd" };
112117
static const char * const sel_e[] = { ".main", ".dive" };
113118
static const char * const sel_w[] = { ".main", ".divw" };
@@ -139,6 +144,8 @@ static const struct cpg_core_clk r9a09g011_core_clks[] __initconst = {
139144
DEF_MUX_RO(".seld", CLK_SEL_D, SEL_D, sel_d),
140145
DEF_MUX_RO(".sele", CLK_SEL_E, SEL_E, sel_e),
141146
DEF_MUX(".selsdi", CLK_SEL_SDI, SEL_SDI, sel_sdi),
147+
DEF_MUX(".selcsi0", CLK_SEL_CSI0, SEL_CSI0, sel_csi),
148+
DEF_MUX(".selcsi4", CLK_SEL_CSI4, SEL_CSI4, sel_csi),
142149
DEF_MUX(".selw0", CLK_SEL_W0, SEL_W0, sel_w),
143150

144151
DEF_FIXED(".selb_d2", CLK_SEL_B_D2, CLK_SEL_B, 1, 2),
@@ -196,8 +203,12 @@ static const struct rzg2l_mod_clk r9a09g011_mod_clks[] __initconst = {
196203
DEF_MOD("pwm12_clk", R9A09G011_PWM12_CLK, CLK_MAIN, 0x434, 8),
197204
DEF_MOD("pwm13_clk", R9A09G011_PWM13_CLK, CLK_MAIN, 0x434, 9),
198205
DEF_MOD("pwm14_clk", R9A09G011_PWM14_CLK, CLK_MAIN, 0x434, 10),
206+
DEF_MOD("cperi_grpg", R9A09G011_CPERI_GRPG_PCLK, CLK_SEL_E, 0x438, 0),
207+
DEF_MOD("cperi_grph", R9A09G011_CPERI_GRPH_PCLK, CLK_SEL_E, 0x438, 1),
199208
DEF_MOD("urt_pclk", R9A09G011_URT_PCLK, CLK_SEL_E, 0x438, 4),
200209
DEF_MOD("urt0_clk", R9A09G011_URT0_CLK, CLK_SEL_W0, 0x438, 5),
210+
DEF_MOD("csi0_clk", R9A09G011_CSI0_CLK, CLK_SEL_CSI0, 0x438, 8),
211+
DEF_MOD("csi4_clk", R9A09G011_CSI4_CLK, CLK_SEL_CSI4, 0x438, 12),
201212
DEF_MOD("ca53", R9A09G011_CA53_CLK, CLK_DIV_A, 0x448, 0),
202213
};
203214

@@ -215,6 +226,8 @@ static const struct rzg2l_reset r9a09g011_resets[] = {
215226
DEF_RST(R9A09G011_TIM_GPB_PRESETN, 0x614, 1),
216227
DEF_RST(R9A09G011_TIM_GPC_PRESETN, 0x614, 2),
217228
DEF_RST_MON(R9A09G011_PWM_GPF_PRESETN, 0x614, 5, 23),
229+
DEF_RST_MON(R9A09G011_CSI_GPG_PRESETN, 0x614, 6, 22),
230+
DEF_RST_MON(R9A09G011_CSI_GPH_PRESETN, 0x614, 7, 23),
218231
DEF_RST(R9A09G011_IIC_GPA_PRESETN, 0x614, 8),
219232
DEF_RST(R9A09G011_IIC_GPB_PRESETN, 0x614, 9),
220233
DEF_RST_MON(R9A09G011_WDT0_PRESETN, 0x614, 12, 19),
@@ -225,6 +238,8 @@ static const unsigned int r9a09g011_crit_mod_clks[] __initconst = {
225238
MOD_CLK_BASE + R9A09G011_CPERI_GRPB_PCLK,
226239
MOD_CLK_BASE + R9A09G011_CPERI_GRPC_PCLK,
227240
MOD_CLK_BASE + R9A09G011_CPERI_GRPF_PCLK,
241+
MOD_CLK_BASE + R9A09G011_CPERI_GRPG_PCLK,
242+
MOD_CLK_BASE + R9A09G011_CPERI_GRPH_PCLK,
228243
MOD_CLK_BASE + R9A09G011_GIC_CLK,
229244
MOD_CLK_BASE + R9A09G011_SYC_CNT_CLK,
230245
MOD_CLK_BASE + R9A09G011_URT_PCLK,

0 commit comments

Comments
 (0)