Skip to content

Commit 09d50e0

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: r9a09g077: Add PLL2 and SDHI clock support
Add support for PLL2 to the R9A09G077 (RZ/T2H) clock definitions and register it as the source for the high-speed SDHI clock (SDHI_CLKHS) operating at 800MHz. Also add fixed-factor clock PCLKAM derived from CLK_PLL4D1, and define module clocks for SDHI0 and SDHI1, both of which use PCLKAM as their clock source. 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 8f9ad76 commit 09d50e0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/clk/renesas/r9a09g077-cpg.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum rzt2h_clk_types {
6767

6868
enum clk_ids {
6969
/* Core Clock Outputs exported to DT */
70-
LAST_DT_CORE_CLK = R9A09G077_CLK_PCLKL,
70+
LAST_DT_CORE_CLK = R9A09G077_SDHI_CLKHS,
7171

7272
/* External Input Clocks */
7373
CLK_EXTAL,
@@ -76,9 +76,11 @@ enum clk_ids {
7676
CLK_LOCO,
7777
CLK_PLL0,
7878
CLK_PLL1,
79+
CLK_PLL2,
7980
CLK_PLL4,
8081
CLK_SEL_CLK_PLL0,
8182
CLK_SEL_CLK_PLL1,
83+
CLK_SEL_CLK_PLL2,
8284
CLK_SEL_CLK_PLL4,
8385
CLK_PLL4D1,
8486
CLK_SCI0ASYNC,
@@ -105,6 +107,7 @@ static const struct clk_div_table dtable_24_25_30_32[] = {
105107

106108
static const char * const sel_clk_pll0[] = { ".loco", ".pll0" };
107109
static const char * const sel_clk_pll1[] = { ".loco", ".pll1" };
110+
static const char * const sel_clk_pll2[] = { ".loco", ".pll2" };
108111
static const char * const sel_clk_pll4[] = { ".loco", ".pll4" };
109112

110113
static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
@@ -115,12 +118,15 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
115118
DEF_RATE(".loco", CLK_LOCO, 1000 * 1000),
116119
DEF_FIXED(".pll0", CLK_PLL0, CLK_EXTAL, 1, 48),
117120
DEF_FIXED(".pll1", CLK_PLL1, CLK_EXTAL, 1, 40),
121+
DEF_FIXED(".pll2", CLK_PLL2, CLK_EXTAL, 1, 32),
118122
DEF_FIXED(".pll4", CLK_PLL4, CLK_EXTAL, 1, 96),
119123

120124
DEF_MUX(".sel_clk_pll0", CLK_SEL_CLK_PLL0, SEL_PLL,
121125
sel_clk_pll0, ARRAY_SIZE(sel_clk_pll0), CLK_MUX_READ_ONLY),
122126
DEF_MUX(".sel_clk_pll1", CLK_SEL_CLK_PLL1, SEL_PLL,
123127
sel_clk_pll1, ARRAY_SIZE(sel_clk_pll1), CLK_MUX_READ_ONLY),
128+
DEF_MUX(".sel_clk_pll2", CLK_SEL_CLK_PLL2, SEL_PLL,
129+
sel_clk_pll2, ARRAY_SIZE(sel_clk_pll2), CLK_MUX_READ_ONLY),
124130
DEF_MUX(".sel_clk_pll4", CLK_SEL_CLK_PLL4, SEL_PLL,
125131
sel_clk_pll4, ARRAY_SIZE(sel_clk_pll4), CLK_MUX_READ_ONLY),
126132

@@ -142,10 +148,14 @@ static const struct cpg_core_clk r9a09g077_core_clks[] __initconst = {
142148
DEF_FIXED("PCLKGPTL", R9A09G077_CLK_PCLKGPTL, CLK_SEL_CLK_PLL1, 2, 1),
143149
DEF_FIXED("PCLKM", R9A09G077_CLK_PCLKM, CLK_SEL_CLK_PLL1, 8, 1),
144150
DEF_FIXED("PCLKL", R9A09G077_CLK_PCLKL, CLK_SEL_CLK_PLL1, 16, 1),
151+
DEF_FIXED("PCLKAM", R9A09G077_CLK_PCLKAM, CLK_PLL4D1, 12, 1),
152+
DEF_FIXED("SDHI_CLKHS", R9A09G077_SDHI_CLKHS, CLK_SEL_CLK_PLL2, 1, 1),
145153
};
146154

147155
static const struct mssr_mod_clk r9a09g077_mod_clks[] __initconst = {
148156
DEF_MOD("sci0fck", 8, CLK_SCI0ASYNC),
157+
DEF_MOD("sdhi0", 1212, R9A09G077_CLK_PCLKAM),
158+
DEF_MOD("sdhi1", 1213, R9A09G077_CLK_PCLKAM),
149159
};
150160

151161
static struct clk * __init

0 commit comments

Comments
 (0)