aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-04-12 03:43:09 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-06-07 01:24:49 -0400
commit46632512c4b6ed9d52abe5ef3ba288d8441af73c (patch)
tree39bff8e640ca3bcb2275e36fdfeb498de36f97ba
parent9f13ee6f83c52065112d3e396e42e3780911ef53 (diff)
ARM: shmobile: r8a7790: add div6 clocks
DIV6 clocks control SD*/MMC* core clocks. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7790.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index c85e6432fc8a..a48100345275 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -52,6 +52,12 @@
52 52
53#define MODEMR 0xE6160060 53#define MODEMR 0xE6160060
54#define SDCKCR 0xE6150074 54#define SDCKCR 0xE6150074
55#define SD2CKCR 0xE6150078
56#define SD3CKCR 0xE615007C
57#define MMC0CKCR 0xE6150240
58#define MMC1CKCR 0xE6150244
59#define SSPCKCR 0xE6150248
60#define SSPRSCKCR 0xE615024C
55 61
56static struct clk_mapping cpg_mapping = { 62static struct clk_mapping cpg_mapping = {
57 .phys = CPG_BASE, 63 .phys = CPG_BASE,
@@ -154,6 +160,23 @@ struct clk div4_clks[DIV4_NR] = {
154 [DIV4_SD1] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 0, 0x1de0, CLK_ENABLE_ON_INIT), 160 [DIV4_SD1] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 0, 0x1de0, CLK_ENABLE_ON_INIT),
155}; 161};
156 162
163/* DIV6 clocks */
164enum {
165 DIV6_SD2, DIV6_SD3,
166 DIV6_MMC0, DIV6_MMC1,
167 DIV6_SSP, DIV6_SSPRS,
168 DIV6_NR
169};
170
171static struct clk div6_clks[DIV6_NR] = {
172 [DIV6_SD2] = SH_CLK_DIV6(&pll1_div2_clk, SD2CKCR, 0),
173 [DIV6_SD3] = SH_CLK_DIV6(&pll1_div2_clk, SD3CKCR, 0),
174 [DIV6_MMC0] = SH_CLK_DIV6(&pll1_div2_clk, MMC0CKCR, 0),
175 [DIV6_MMC1] = SH_CLK_DIV6(&pll1_div2_clk, MMC1CKCR, 0),
176 [DIV6_SSP] = SH_CLK_DIV6(&pll1_div2_clk, SSPCKCR, 0),
177 [DIV6_SSPRS] = SH_CLK_DIV6(&pll1_div2_clk, SSPRSCKCR, 0),
178};
179
157/* MSTP */ 180/* MSTP */
158enum { MSTP721, MSTP720, 181enum { MSTP721, MSTP720,
159 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR }; 182 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR };
@@ -202,6 +225,14 @@ static struct clk_lookup lookups[] = {
202 CLKDEV_CON_ID("sd0", &div4_clks[DIV4_SD0]), 225 CLKDEV_CON_ID("sd0", &div4_clks[DIV4_SD0]),
203 CLKDEV_CON_ID("sd1", &div4_clks[DIV4_SD1]), 226 CLKDEV_CON_ID("sd1", &div4_clks[DIV4_SD1]),
204 227
228 /* DIV6 */
229 CLKDEV_CON_ID("sd2", &div6_clks[DIV6_SD2]),
230 CLKDEV_CON_ID("sd3", &div6_clks[DIV6_SD3]),
231 CLKDEV_CON_ID("mmc0", &div6_clks[DIV6_MMC0]),
232 CLKDEV_CON_ID("mmc1", &div6_clks[DIV6_MMC1]),
233 CLKDEV_CON_ID("ssp", &div6_clks[DIV6_SSP]),
234 CLKDEV_CON_ID("ssprs", &div6_clks[DIV6_SSPRS]),
235
205 /* MSTP */ 236 /* MSTP */
206 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), 237 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
207 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), 238 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]),
@@ -265,6 +296,9 @@ void __init r8a7790_clock_init(void)
265 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 296 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
266 297
267 if (!ret) 298 if (!ret)
299 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
300
301 if (!ret)
268 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 302 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
269 303
270 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 304 clkdev_add_table(lookups, ARRAY_SIZE(lookups));