diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-11-17 08:55:52 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-11-17 14:12:28 -0500 |
commit | 6a06d5bf26f078212de084da93e4af863a6e5ccf (patch) | |
tree | 34d67c640edb47c3a239c6b186b6aff58096c2cf /arch/sh/kernel/cpu/sh4a/clock-sh7722.c | |
parent | 8cc88a55b03bd4940390125c2521c99368513be5 (diff) |
sh: sh7722: use runtime PM implementation, common with arm/mach-shmobile
Switch sh7722 to a runtime PM implementation, common with ARM-based
sh-mobile platforms.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7722.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c index c9a48088ad47..212c72ef959c 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <linux/sh_clk.h> | ||
25 | #include <asm/clock.h> | 26 | #include <asm/clock.h> |
26 | #include <asm/hwblk.h> | ||
27 | #include <cpu/sh7722.h> | 27 | #include <cpu/sh7722.h> |
28 | 28 | ||
29 | /* SH7722 registers */ | 29 | /* SH7722 registers */ |
@@ -33,6 +33,9 @@ | |||
33 | #define SCLKBCR 0xa415000c | 33 | #define SCLKBCR 0xa415000c |
34 | #define IRDACLKCR 0xa4150018 | 34 | #define IRDACLKCR 0xa4150018 |
35 | #define PLLCR 0xa4150024 | 35 | #define PLLCR 0xa4150024 |
36 | #define MSTPCR0 0xa4150030 | ||
37 | #define MSTPCR1 0xa4150034 | ||
38 | #define MSTPCR2 0xa4150038 | ||
36 | #define DLLFRQ 0xa4150050 | 39 | #define DLLFRQ 0xa4150050 |
37 | 40 | ||
38 | /* Fixed 32 KHz root clock for RTC and Power Management purposes */ | 41 | /* Fixed 32 KHz root clock for RTC and Power Management purposes */ |
@@ -148,31 +151,31 @@ struct clk div6_clks[DIV6_NR] = { | |||
148 | }; | 151 | }; |
149 | 152 | ||
150 | static struct clk mstp_clks[HWBLK_NR] = { | 153 | static struct clk mstp_clks[HWBLK_NR] = { |
151 | SH_HWBLK_CLK(HWBLK_URAM, &div4_clks[DIV4_U], CLK_ENABLE_ON_INIT), | 154 | [HWBLK_URAM] = SH_CLK_MSTP32(&div4_clks[DIV4_U], MSTPCR0, 28, CLK_ENABLE_ON_INIT), |
152 | SH_HWBLK_CLK(HWBLK_XYMEM, &div4_clks[DIV4_B], CLK_ENABLE_ON_INIT), | 155 | [HWBLK_XYMEM] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR0, 26, CLK_ENABLE_ON_INIT), |
153 | SH_HWBLK_CLK(HWBLK_TMU, &div4_clks[DIV4_P], 0), | 156 | [HWBLK_TMU] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 15, 0), |
154 | SH_HWBLK_CLK(HWBLK_CMT, &r_clk, 0), | 157 | [HWBLK_CMT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 14, 0), |
155 | SH_HWBLK_CLK(HWBLK_RWDT, &r_clk, 0), | 158 | [HWBLK_RWDT] = SH_CLK_MSTP32(&r_clk, MSTPCR0, 13, 0), |
156 | SH_HWBLK_CLK(HWBLK_FLCTL, &div4_clks[DIV4_P], 0), | 159 | [HWBLK_FLCTL] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 10, 0), |
157 | SH_HWBLK_CLK(HWBLK_SCIF0, &div4_clks[DIV4_P], 0), | 160 | [HWBLK_SCIF0] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 7, 0), |
158 | SH_HWBLK_CLK(HWBLK_SCIF1, &div4_clks[DIV4_P], 0), | 161 | [HWBLK_SCIF1] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 6, 0), |
159 | SH_HWBLK_CLK(HWBLK_SCIF2, &div4_clks[DIV4_P], 0), | 162 | [HWBLK_SCIF2] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 5, 0), |
160 | 163 | ||
161 | SH_HWBLK_CLK(HWBLK_IIC, &div4_clks[DIV4_P], 0), | 164 | [HWBLK_IIC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 9, 0), |
162 | SH_HWBLK_CLK(HWBLK_RTC, &r_clk, 0), | 165 | [HWBLK_RTC] = SH_CLK_MSTP32(&r_clk, MSTPCR1, 8, 0), |
163 | 166 | ||
164 | SH_HWBLK_CLK(HWBLK_SDHI, &div4_clks[DIV4_P], 0), | 167 | [HWBLK_SDHI] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 18, 0), |
165 | SH_HWBLK_CLK(HWBLK_KEYSC, &r_clk, 0), | 168 | [HWBLK_KEYSC] = SH_CLK_MSTP32(&r_clk, MSTPCR2, 14, 0), |
166 | SH_HWBLK_CLK(HWBLK_USBF, &div4_clks[DIV4_P], 0), | 169 | [HWBLK_USBF] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 11, 0), |
167 | SH_HWBLK_CLK(HWBLK_2DG, &div4_clks[DIV4_B], 0), | 170 | [HWBLK_2DG] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 9, 0), |
168 | SH_HWBLK_CLK(HWBLK_SIU, &div4_clks[DIV4_B], 0), | 171 | [HWBLK_SIU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 8, 0), |
169 | SH_HWBLK_CLK(HWBLK_VOU, &div4_clks[DIV4_B], 0), | 172 | [HWBLK_JPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 6, 0), |
170 | SH_HWBLK_CLK(HWBLK_JPU, &div4_clks[DIV4_B], 0), | 173 | [HWBLK_VOU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 5, 0), |
171 | SH_HWBLK_CLK(HWBLK_BEU, &div4_clks[DIV4_B], 0), | 174 | [HWBLK_BEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 4, 0), |
172 | SH_HWBLK_CLK(HWBLK_CEU, &div4_clks[DIV4_B], 0), | 175 | [HWBLK_CEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 3, 0), |
173 | SH_HWBLK_CLK(HWBLK_VEU, &div4_clks[DIV4_B], 0), | 176 | [HWBLK_VEU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 2, 0), |
174 | SH_HWBLK_CLK(HWBLK_VPU, &div4_clks[DIV4_B], 0), | 177 | [HWBLK_VPU] = SH_CLK_MSTP32(&div4_clks[DIV4_B], MSTPCR2, 1, 0), |
175 | SH_HWBLK_CLK(HWBLK_LCDC, &div4_clks[DIV4_P], 0), | 178 | [HWBLK_LCDC] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 0, 0), |
176 | }; | 179 | }; |
177 | 180 | ||
178 | static struct clk_lookup lookups[] = { | 181 | static struct clk_lookup lookups[] = { |
@@ -205,27 +208,27 @@ static struct clk_lookup lookups[] = { | |||
205 | CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]), | 208 | CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]), |
206 | 209 | ||
207 | CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), | 210 | CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), |
208 | CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]), | 211 | CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), |
209 | CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), | 212 | CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), |
210 | 213 | ||
211 | CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]), | 214 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]), |
212 | CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]), | 215 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]), |
213 | CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[HWBLK_SCIF2]), | 216 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]), |
214 | 217 | ||
215 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]), | 218 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC]), |
216 | CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), | 219 | CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]), |
217 | CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI]), | 220 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI]), |
218 | CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]), | 221 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[HWBLK_KEYSC]), |
219 | CLKDEV_CON_ID("usbf0", &mstp_clks[HWBLK_USBF]), | 222 | CLKDEV_CON_ID("usbf0", &mstp_clks[HWBLK_USBF]), |
220 | CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), | 223 | CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), |
221 | CLKDEV_CON_ID("siu0", &mstp_clks[HWBLK_SIU]), | 224 | CLKDEV_DEV_ID("siu-pcm-audio", &mstp_clks[HWBLK_SIU]), |
222 | CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]), | 225 | CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), |
223 | CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), | 226 | CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), |
224 | CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]), | 227 | CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]), |
225 | CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU]), | 228 | CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU]), |
226 | CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU]), | 229 | CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU]), |
227 | CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), | 230 | CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), |
228 | CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]), | 231 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[HWBLK_LCDC]), |
229 | }; | 232 | }; |
230 | 233 | ||
231 | int __init arch_clk_init(void) | 234 | int __init arch_clk_init(void) |
@@ -258,7 +261,7 @@ int __init arch_clk_init(void) | |||
258 | ret = sh_clk_div6_register(div6_clks, DIV6_NR); | 261 | ret = sh_clk_div6_register(div6_clks, DIV6_NR); |
259 | 262 | ||
260 | if (!ret) | 263 | if (!ret) |
261 | ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR); | 264 | ret = sh_clk_mstp32_register(mstp_clks, HWBLK_NR); |
262 | 265 | ||
263 | return ret; | 266 | return ret; |
264 | } | 267 | } |