aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-05-10 10:01:22 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-10 22:48:39 -0400
commitfd30401b07fdcf21e4be87fd276d1b2c84d712a3 (patch)
treeeba1a28658d1e83e4e86c785db7cfcbe0db50d0b /arch/sh/kernel/cpu/sh4a
parente4e06697977bf6731d940ab1bd84e16cb53c3ae3 (diff)
sh: tie in hwblk clocks using clkdev
Use clkdev for lookup of hwblk clocks on sh7722/sh7723/sh7724. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c25
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c48
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c50
3 files changed, 119 insertions, 4 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index ed57c631b09a..2a122e0d3983 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -186,7 +186,12 @@ static struct clk mstp_clks[HWBLK_NR] = {
186 SH_HWBLK_CLK("lcdc0", -1, P_CLK, HWBLK_LCDC, 0), 186 SH_HWBLK_CLK("lcdc0", -1, P_CLK, HWBLK_LCDC, 0),
187}; 187};
188 188
189#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
190
189static struct clk_lookup lookups[] = { 191static struct clk_lookup lookups[] = {
192 /* MSTP clocks */
193 CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]),
194 CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]),
190 { 195 {
191 /* TMU0 */ 196 /* TMU0 */
192 .dev_id = "sh_tmu.0", 197 .dev_id = "sh_tmu.0",
@@ -202,7 +207,11 @@ static struct clk_lookup lookups[] = {
202 .dev_id = "sh_tmu.2", 207 .dev_id = "sh_tmu.2",
203 .con_id = "tmu_fck", 208 .con_id = "tmu_fck",
204 .clk = &mstp_clks[HWBLK_TMU], 209 .clk = &mstp_clks[HWBLK_TMU],
205 }, { 210 },
211 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
212 CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
213 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
214 {
206 /* SCIF0 */ 215 /* SCIF0 */
207 .dev_id = "sh-sci.0", 216 .dev_id = "sh-sci.0",
208 .con_id = "sci_fck", 217 .con_id = "sci_fck",
@@ -218,6 +227,20 @@ static struct clk_lookup lookups[] = {
218 .con_id = "sci_fck", 227 .con_id = "sci_fck",
219 .clk = &mstp_clks[HWBLK_SCIF2], 228 .clk = &mstp_clks[HWBLK_SCIF2],
220 }, 229 },
230 CLKDEV_CON_ID("i2c0", &mstp_clks[HWBLK_IIC]),
231 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
232 CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI]),
233 CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
234 CLKDEV_CON_ID("usbf0", &mstp_clks[HWBLK_USBF]),
235 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
236 CLKDEV_CON_ID("siu0", &mstp_clks[HWBLK_SIU]),
237 CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]),
238 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
239 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]),
240 CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU]),
241 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU]),
242 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
243 CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]),
221}; 244};
222 245
223int __init arch_clk_init(void) 246int __init arch_clk_init(void)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index d92d7cddd099..36e17dc27b0a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -213,7 +213,21 @@ static struct clk mstp_clks[] = {
213 SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0), 213 SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0),
214}; 214};
215 215
216#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
217
216static struct clk_lookup lookups[] = { 218static struct clk_lookup lookups[] = {
219 /* MSTP clocks */
220 CLKDEV_CON_ID("tlb0", &mstp_clks[HWBLK_TLB]),
221 CLKDEV_CON_ID("ic0", &mstp_clks[HWBLK_IC]),
222 CLKDEV_CON_ID("oc0", &mstp_clks[HWBLK_OC]),
223 CLKDEV_CON_ID("l2c0", &mstp_clks[HWBLK_L2C]),
224 CLKDEV_CON_ID("ilmem0", &mstp_clks[HWBLK_ILMEM]),
225 CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]),
226 CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]),
227 CLKDEV_CON_ID("dmac0", &mstp_clks[HWBLK_DMAC0]),
228 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
229 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
230 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
217 { 231 {
218 /* TMU0 */ 232 /* TMU0 */
219 .dev_id = "sh_tmu.0", 233 .dev_id = "sh_tmu.0",
@@ -229,7 +243,11 @@ static struct clk_lookup lookups[] = {
229 .dev_id = "sh_tmu.2", 243 .dev_id = "sh_tmu.2",
230 .con_id = "tmu_fck", 244 .con_id = "tmu_fck",
231 .clk = &mstp_clks[HWBLK_TMU0], 245 .clk = &mstp_clks[HWBLK_TMU0],
232 }, { 246 },
247 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
248 CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
249 CLKDEV_CON_ID("dmac1", &mstp_clks[HWBLK_DMAC1]),
250 {
233 /* TMU3 */ 251 /* TMU3 */
234 .dev_id = "sh_tmu.3", 252 .dev_id = "sh_tmu.3",
235 .con_id = "tmu_fck", 253 .con_id = "tmu_fck",
@@ -244,7 +262,9 @@ static struct clk_lookup lookups[] = {
244 .dev_id = "sh_tmu.5", 262 .dev_id = "sh_tmu.5",
245 .con_id = "tmu_fck", 263 .con_id = "tmu_fck",
246 .clk = &mstp_clks[HWBLK_TMU1], 264 .clk = &mstp_clks[HWBLK_TMU1],
247 }, { 265 },
266 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
267 {
248 /* SCIF0 */ 268 /* SCIF0 */
249 .dev_id = "sh-sci.0", 269 .dev_id = "sh-sci.0",
250 .con_id = "sci_fck", 270 .con_id = "sci_fck",
@@ -275,6 +295,30 @@ static struct clk_lookup lookups[] = {
275 .con_id = "sci_fck", 295 .con_id = "sci_fck",
276 .clk = &mstp_clks[HWBLK_SCIF5], 296 .clk = &mstp_clks[HWBLK_SCIF5],
277 }, 297 },
298 CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]),
299 CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]),
300 CLKDEV_CON_ID("meram0", &mstp_clks[HWBLK_MERAM]),
301 CLKDEV_CON_ID("i2c0", &mstp_clks[HWBLK_IIC]),
302 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
303 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
304 CLKDEV_CON_ID("adc0", &mstp_clks[HWBLK_ADC]),
305 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]),
306 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]),
307 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]),
308 CLKDEV_CON_ID("icb0", &mstp_clks[HWBLK_ICB]),
309 CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI0]),
310 CLKDEV_CON_ID("sdhi1", &mstp_clks[HWBLK_SDHI1]),
311 CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
312 CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB]),
313 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
314 CLKDEV_CON_ID("siu0", &mstp_clks[HWBLK_SIU]),
315 CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU2H1]),
316 CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]),
317 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]),
318 CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU]),
319 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),
320 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
321 CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]),
278}; 322};
279 323
280int __init arch_clk_init(void) 324int __init arch_clk_init(void)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 0c2aa34c7847..fe59f34a6e00 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -235,7 +235,22 @@ static struct clk mstp_clks[HWBLK_NR] = {
235 SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0), 235 SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0),
236}; 236};
237 237
238#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
239
238static struct clk_lookup lookups[] = { 240static struct clk_lookup lookups[] = {
241 /* MSTP clocks */
242 CLKDEV_CON_ID("tlb0", &mstp_clks[HWBLK_TLB]),
243 CLKDEV_CON_ID("ic0", &mstp_clks[HWBLK_IC]),
244 CLKDEV_CON_ID("oc0", &mstp_clks[HWBLK_OC]),
245 CLKDEV_CON_ID("rs0", &mstp_clks[HWBLK_RSMEM]),
246 CLKDEV_CON_ID("ilmem0", &mstp_clks[HWBLK_ILMEM]),
247 CLKDEV_CON_ID("l2c0", &mstp_clks[HWBLK_L2C]),
248 CLKDEV_CON_ID("fpu0", &mstp_clks[HWBLK_FPU]),
249 CLKDEV_CON_ID("intc0", &mstp_clks[HWBLK_INTC]),
250 CLKDEV_CON_ID("dmac0", &mstp_clks[HWBLK_DMAC0]),
251 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
252 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
253 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
239 { 254 {
240 /* TMU0 */ 255 /* TMU0 */
241 .dev_id = "sh_tmu.0", 256 .dev_id = "sh_tmu.0",
@@ -256,7 +271,11 @@ static struct clk_lookup lookups[] = {
256 .dev_id = "sh_tmu.3", 271 .dev_id = "sh_tmu.3",
257 .con_id = "tmu_fck", 272 .con_id = "tmu_fck",
258 .clk = &mstp_clks[HWBLK_TMU1], 273 .clk = &mstp_clks[HWBLK_TMU1],
259 }, { 274 },
275 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
276 CLKDEV_CON_ID("rwdt0", &mstp_clks[HWBLK_RWDT]),
277 CLKDEV_CON_ID("dmac1", &mstp_clks[HWBLK_DMAC1]),
278 {
260 /* TMU4 */ 279 /* TMU4 */
261 .dev_id = "sh_tmu.4", 280 .dev_id = "sh_tmu.4",
262 .con_id = "tmu_fck", 281 .con_id = "tmu_fck",
@@ -297,6 +316,35 @@ static struct clk_lookup lookups[] = {
297 .con_id = "sci_fck", 316 .con_id = "sci_fck",
298 .clk = &mstp_clks[HWBLK_SCIF5], 317 .clk = &mstp_clks[HWBLK_SCIF5],
299 }, 318 },
319 CLKDEV_CON_ID("msiof0", &mstp_clks[HWBLK_MSIOF0]),
320 CLKDEV_CON_ID("msiof1", &mstp_clks[HWBLK_MSIOF1]),
321 CLKDEV_CON_ID("keysc0", &mstp_clks[HWBLK_KEYSC]),
322 CLKDEV_CON_ID("rtc0", &mstp_clks[HWBLK_RTC]),
323 CLKDEV_CON_ID("i2c0", &mstp_clks[HWBLK_IIC0]),
324 CLKDEV_CON_ID("i2c1", &mstp_clks[HWBLK_IIC1]),
325 CLKDEV_CON_ID("mmc0", &mstp_clks[HWBLK_MMC]),
326 CLKDEV_CON_ID("eth0", &mstp_clks[HWBLK_ETHER]),
327 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
328 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]),
329 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]),
330 CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]),
331 CLKDEV_CON_ID("usb1", &mstp_clks[HWBLK_USB1]),
332 CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB0]),
333 CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]),
334 CLKDEV_CON_ID("sdhi0", &mstp_clks[HWBLK_SDHI0]),
335 CLKDEV_CON_ID("sdhi1", &mstp_clks[HWBLK_SDHI1]),
336 CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU1]),
337 CLKDEV_CON_ID("ceu1", &mstp_clks[HWBLK_CEU1]),
338 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
339 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
340 CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]),
341 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
342 CLKDEV_CON_ID("vou0", &mstp_clks[HWBLK_VOU]),
343 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
344 CLKDEV_CON_ID("ceu0", &mstp_clks[HWBLK_CEU0]),
345 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU0]),
346 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
347 CLKDEV_CON_ID("lcdc0", &mstp_clks[HWBLK_LCDC]),
300}; 348};
301 349
302int __init arch_clk_init(void) 350int __init arch_clk_init(void)