aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/clock-r8a7790.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-04-12 03:42:52 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-06-07 01:24:49 -0400
commit9f13ee6f83c52065112d3e396e42e3780911ef53 (patch)
tree650cb30dc9ad635ece1a5065082938508b1ea1e5 /arch/arm/mach-shmobile/clock-r8a7790.c
parent8d100c0454a9960c9bf0b67e07225db5d32cca83 (diff)
ARM: shmobile: r8a7790: add div4 clocks
DIV4 clocks control SD* core clocks. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/clock-r8a7790.c')
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7790.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index 850e47f7da48..c85e6432fc8a 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -51,6 +51,7 @@
51#define SMSTPCR7 0xe615014c 51#define SMSTPCR7 0xe615014c
52 52
53#define MODEMR 0xE6160060 53#define MODEMR 0xE6160060
54#define SDCKCR 0xE6150074
54 55
55static struct clk_mapping cpg_mapping = { 56static struct clk_mapping cpg_mapping = {
56 .phys = CPG_BASE, 57 .phys = CPG_BASE,
@@ -131,6 +132,29 @@ static struct clk *main_clks[] = {
131 &cp_clk, 132 &cp_clk,
132}; 133};
133 134
135/* SDHI (DIV4) clock */
136static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10 };
137
138static struct clk_div_mult_table div4_div_mult_table = {
139 .divisors = divisors,
140 .nr_divisors = ARRAY_SIZE(divisors),
141};
142
143static struct clk_div4_table div4_table = {
144 .div_mult_table = &div4_div_mult_table,
145};
146
147enum {
148 DIV4_SDH, DIV4_SD0, DIV4_SD1, DIV4_NR
149};
150
151struct clk div4_clks[DIV4_NR] = {
152 [DIV4_SDH] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 8, 0x0dff, CLK_ENABLE_ON_INIT),
153 [DIV4_SD0] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 4, 0x1de0, CLK_ENABLE_ON_INIT),
154 [DIV4_SD1] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 0, 0x1de0, CLK_ENABLE_ON_INIT),
155};
156
157/* MSTP */
134enum { MSTP721, MSTP720, 158enum { MSTP721, MSTP720,
135 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR }; 159 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP_NR };
136static struct clk mstp_clks[MSTP_NR] = { 160static struct clk mstp_clks[MSTP_NR] = {
@@ -173,6 +197,11 @@ static struct clk_lookup lookups[] = {
173 CLKDEV_CON_ID("qspi", &qspi_clk), 197 CLKDEV_CON_ID("qspi", &qspi_clk),
174 CLKDEV_CON_ID("cp", &cp_clk), 198 CLKDEV_CON_ID("cp", &cp_clk),
175 199
200 /* DIV4 */
201 CLKDEV_CON_ID("sdh", &div4_clks[DIV4_SDH]),
202 CLKDEV_CON_ID("sd0", &div4_clks[DIV4_SD0]),
203 CLKDEV_CON_ID("sd1", &div4_clks[DIV4_SD1]),
204
176 /* MSTP */ 205 /* MSTP */
177 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), 206 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
178 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), 207 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]),
@@ -233,6 +262,9 @@ void __init r8a7790_clock_init(void)
233 ret = clk_register(main_clks[k]); 262 ret = clk_register(main_clks[k]);
234 263
235 if (!ret) 264 if (!ret)
265 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
266
267 if (!ret)
236 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 268 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
237 269
238 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 270 clkdev_add_table(lookups, ARRAY_SIZE(lookups));