Skip to content

Commit d969103

Browse files
Phil Edworthygeertu
authored andcommitted
clk: renesas: r9a09g011: Add SDHI/eMMC clock and reset entries
Add SDHI/eMMC clock/reset entries to CPG driver. Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20221213230129.549968-2-fabrizio.castro.jz@renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 5edf5b5 commit d969103

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

drivers/clk/renesas/r9a09g011-cpg.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define SEL_B SEL_PLL_PACK(0x214, 0, 1)
3131
#define SEL_D SEL_PLL_PACK(0x214, 1, 1)
3232
#define SEL_E SEL_PLL_PACK(0x214, 2, 1)
33+
#define SEL_SDI SEL_PLL_PACK(0x300, 0, 1)
3334
#define SEL_W0 SEL_PLL_PACK(0x32C, 0, 1)
3435

3536
enum clk_ids {
@@ -59,6 +60,7 @@ enum clk_ids {
5960
CLK_SEL_B_D2,
6061
CLK_SEL_D,
6162
CLK_SEL_E,
63+
CLK_SEL_SDI,
6264
CLK_SEL_W0,
6365

6466
/* Module Clocks */
@@ -92,6 +94,7 @@ static const struct clk_div_table dtable_divd[] = {
9294
{0, 0},
9395
};
9496

97+
9598
static const struct clk_div_table dtable_divw[] = {
9699
{0, 6},
97100
{1, 7},
@@ -108,6 +111,7 @@ static const char * const sel_b[] = { ".main", ".divb" };
108111
static const char * const sel_d[] = { ".main", ".divd" };
109112
static const char * const sel_e[] = { ".main", ".dive" };
110113
static const char * const sel_w[] = { ".main", ".divw" };
114+
static const char * const sel_sdi[] = { ".main", ".pll2_200" };
111115

112116
static const struct cpg_core_clk r9a09g011_core_clks[] __initconst = {
113117
/* External Clock Inputs */
@@ -134,6 +138,7 @@ static const struct cpg_core_clk r9a09g011_core_clks[] __initconst = {
134138
DEF_MUX_RO(".selb", CLK_SEL_B, SEL_B, sel_b),
135139
DEF_MUX_RO(".seld", CLK_SEL_D, SEL_D, sel_d),
136140
DEF_MUX_RO(".sele", CLK_SEL_E, SEL_E, sel_e),
141+
DEF_MUX(".selsdi", CLK_SEL_SDI, SEL_SDI, sel_sdi),
137142
DEF_MUX(".selw0", CLK_SEL_W0, SEL_W0, sel_w),
138143

139144
DEF_FIXED(".selb_d2", CLK_SEL_B_D2, CLK_SEL_B, 1, 2),
@@ -142,6 +147,18 @@ static const struct cpg_core_clk r9a09g011_core_clks[] __initconst = {
142147
static const struct rzg2l_mod_clk r9a09g011_mod_clks[] __initconst = {
143148
DEF_MOD("pfc", R9A09G011_PFC_PCLK, CLK_MAIN, 0x400, 2),
144149
DEF_MOD("gic", R9A09G011_GIC_CLK, CLK_SEL_B_D2, 0x400, 5),
150+
DEF_MOD("sdi0_aclk", R9A09G011_SDI0_ACLK, CLK_SEL_D, 0x408, 0),
151+
DEF_MOD("sdi0_imclk", R9A09G011_SDI0_IMCLK, CLK_SEL_SDI, 0x408, 1),
152+
DEF_MOD("sdi0_imclk2", R9A09G011_SDI0_IMCLK2, CLK_SEL_SDI, 0x408, 2),
153+
DEF_MOD("sdi0_clk_hs", R9A09G011_SDI0_CLK_HS, CLK_PLL2_800, 0x408, 3),
154+
DEF_MOD("sdi1_aclk", R9A09G011_SDI1_ACLK, CLK_SEL_D, 0x408, 4),
155+
DEF_MOD("sdi1_imclk", R9A09G011_SDI1_IMCLK, CLK_SEL_SDI, 0x408, 5),
156+
DEF_MOD("sdi1_imclk2", R9A09G011_SDI1_IMCLK2, CLK_SEL_SDI, 0x408, 6),
157+
DEF_MOD("sdi1_clk_hs", R9A09G011_SDI1_CLK_HS, CLK_PLL2_800, 0x408, 7),
158+
DEF_MOD("emm_aclk", R9A09G011_EMM_ACLK, CLK_SEL_D, 0x408, 8),
159+
DEF_MOD("emm_imclk", R9A09G011_EMM_IMCLK, CLK_SEL_SDI, 0x408, 9),
160+
DEF_MOD("emm_imclk2", R9A09G011_EMM_IMCLK2, CLK_SEL_SDI, 0x408, 10),
161+
DEF_MOD("emm_clk_hs", R9A09G011_EMM_CLK_HS, CLK_PLL2_800, 0x408, 11),
145162
DEF_COUPLED("eth_axi", R9A09G011_ETH0_CLK_AXI, CLK_PLL2_200, 0x40c, 8),
146163
DEF_COUPLED("eth_chi", R9A09G011_ETH0_CLK_CHI, CLK_PLL2_100, 0x40c, 8),
147164
DEF_MOD("eth_clk_gptp", R9A09G011_ETH0_GPTP_EXT, CLK_PLL2_100, 0x40c, 9),
@@ -186,6 +203,9 @@ static const struct rzg2l_mod_clk r9a09g011_mod_clks[] __initconst = {
186203

187204
static const struct rzg2l_reset r9a09g011_resets[] = {
188205
DEF_RST(R9A09G011_PFC_PRESETN, 0x600, 2),
206+
DEF_RST_MON(R9A09G011_SDI0_IXRST, 0x608, 0, 6),
207+
DEF_RST_MON(R9A09G011_SDI1_IXRST, 0x608, 1, 7),
208+
DEF_RST_MON(R9A09G011_EMM_IXRST, 0x608, 2, 8),
189209
DEF_RST(R9A09G011_USB_PRESET_N, 0x608, 7),
190210
DEF_RST(R9A09G011_USB_DRD_RESET, 0x608, 8),
191211
DEF_RST(R9A09G011_USB_ARESETN_P, 0x608, 9),

0 commit comments

Comments
 (0)