diff options
Diffstat (limited to 'arch/arm/mach-realview')
-rw-r--r-- | arch/arm/mach-realview/core.c | 106 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/clkdev.h | 16 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/gpio.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb1176.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb11mp.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pba8.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pbx.c | 5 |
8 files changed, 15 insertions, 133 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 45868bb43cb..ff007d15e0e 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/ata_platform.h> | 30 | #include <linux/ata_platform.h> |
31 | #include <linux/amba/mmci.h> | 31 | #include <linux/amba/mmci.h> |
32 | #include <linux/gfp.h> | 32 | #include <linux/gfp.h> |
33 | #include <linux/clkdev.h> | ||
34 | #include <linux/mtd/physmap.h> | 33 | #include <linux/mtd/physmap.h> |
35 | 34 | ||
36 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
@@ -226,115 +225,10 @@ struct mmci_platform_data realview_mmc1_plat_data = { | |||
226 | .cd_invert = true, | 225 | .cd_invert = true, |
227 | }; | 226 | }; |
228 | 227 | ||
229 | /* | ||
230 | * Clock handling | ||
231 | */ | ||
232 | static const struct icst_params realview_oscvco_params = { | ||
233 | .ref = 24000000, | ||
234 | .vco_max = ICST307_VCO_MAX, | ||
235 | .vco_min = ICST307_VCO_MIN, | ||
236 | .vd_min = 4 + 8, | ||
237 | .vd_max = 511 + 8, | ||
238 | .rd_min = 1 + 2, | ||
239 | .rd_max = 127 + 2, | ||
240 | .s2div = icst307_s2div, | ||
241 | .idx2s = icst307_idx2s, | ||
242 | }; | ||
243 | |||
244 | static void realview_oscvco_set(struct clk *clk, struct icst_vco vco) | ||
245 | { | ||
246 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; | ||
247 | u32 val; | ||
248 | |||
249 | val = readl(clk->vcoreg) & ~0x7ffff; | ||
250 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | ||
251 | |||
252 | writel(0xa05f, sys_lock); | ||
253 | writel(val, clk->vcoreg); | ||
254 | writel(0, sys_lock); | ||
255 | } | ||
256 | |||
257 | static const struct clk_ops oscvco_clk_ops = { | ||
258 | .round = icst_clk_round, | ||
259 | .set = icst_clk_set, | ||
260 | .setvco = realview_oscvco_set, | ||
261 | }; | ||
262 | |||
263 | static struct clk oscvco_clk = { | ||
264 | .ops = &oscvco_clk_ops, | ||
265 | .params = &realview_oscvco_params, | ||
266 | }; | ||
267 | |||
268 | /* | ||
269 | * These are fixed clocks. | ||
270 | */ | ||
271 | static struct clk ref24_clk = { | ||
272 | .rate = 24000000, | ||
273 | }; | ||
274 | |||
275 | static struct clk sp804_clk = { | ||
276 | .rate = 1000000, | ||
277 | }; | ||
278 | |||
279 | static struct clk dummy_apb_pclk; | ||
280 | |||
281 | static struct clk_lookup lookups[] = { | ||
282 | { /* Bus clock */ | ||
283 | .con_id = "apb_pclk", | ||
284 | .clk = &dummy_apb_pclk, | ||
285 | }, { /* UART0 */ | ||
286 | .dev_id = "dev:uart0", | ||
287 | .clk = &ref24_clk, | ||
288 | }, { /* UART1 */ | ||
289 | .dev_id = "dev:uart1", | ||
290 | .clk = &ref24_clk, | ||
291 | }, { /* UART2 */ | ||
292 | .dev_id = "dev:uart2", | ||
293 | .clk = &ref24_clk, | ||
294 | }, { /* UART3 */ | ||
295 | .dev_id = "fpga:uart3", | ||
296 | .clk = &ref24_clk, | ||
297 | }, { /* UART3 is on the dev chip in PB1176 */ | ||
298 | .dev_id = "dev:uart3", | ||
299 | .clk = &ref24_clk, | ||
300 | }, { /* UART4 only exists in PB1176 */ | ||
301 | .dev_id = "fpga:uart4", | ||
302 | .clk = &ref24_clk, | ||
303 | }, { /* KMI0 */ | ||
304 | .dev_id = "fpga:kmi0", | ||
305 | .clk = &ref24_clk, | ||
306 | }, { /* KMI1 */ | ||
307 | .dev_id = "fpga:kmi1", | ||
308 | .clk = &ref24_clk, | ||
309 | }, { /* MMC0 */ | ||
310 | .dev_id = "fpga:mmc0", | ||
311 | .clk = &ref24_clk, | ||
312 | }, { /* CLCD is in the PB1176 and EB DevChip */ | ||
313 | .dev_id = "dev:clcd", | ||
314 | .clk = &oscvco_clk, | ||
315 | }, { /* PB:CLCD */ | ||
316 | .dev_id = "issp:clcd", | ||
317 | .clk = &oscvco_clk, | ||
318 | }, { /* SSP */ | ||
319 | .dev_id = "dev:ssp0", | ||
320 | .clk = &ref24_clk, | ||
321 | }, { /* SP804 timers */ | ||
322 | .dev_id = "sp804", | ||
323 | .clk = &sp804_clk, | ||
324 | }, | ||
325 | }; | ||
326 | |||
327 | void __init realview_init_early(void) | 228 | void __init realview_init_early(void) |
328 | { | 229 | { |
329 | void __iomem *sys = __io_address(REALVIEW_SYS_BASE); | 230 | void __iomem *sys = __io_address(REALVIEW_SYS_BASE); |
330 | 231 | ||
331 | if (machine_is_realview_pb1176()) | ||
332 | oscvco_clk.vcoreg = sys + REALVIEW_SYS_OSC0_OFFSET; | ||
333 | else | ||
334 | oscvco_clk.vcoreg = sys + REALVIEW_SYS_OSC4_OFFSET; | ||
335 | |||
336 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
337 | |||
338 | versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000); | 232 | versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000); |
339 | } | 233 | } |
340 | 234 | ||
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h deleted file mode 100644 index e58d0771b64..00000000000 --- a/arch/arm/mach-realview/include/mach/clkdev.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #include <plat/clock.h> | ||
5 | |||
6 | struct clk { | ||
7 | unsigned long rate; | ||
8 | const struct clk_ops *ops; | ||
9 | const struct icst_params *params; | ||
10 | void __iomem *vcoreg; | ||
11 | }; | ||
12 | |||
13 | #define __clk_get(clk) ({ 1; }) | ||
14 | #define __clk_put(clk) do { } while (0) | ||
15 | |||
16 | #endif | ||
diff --git a/arch/arm/mach-realview/include/mach/gpio.h b/arch/arm/mach-realview/include/mach/gpio.h deleted file mode 100644 index 40a8c178f10..00000000000 --- a/arch/arm/mach-realview/include/mach/gpio.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | /* empty */ | ||
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index baf382c5e77..ce7747692c8 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -27,12 +27,12 @@ | |||
27 | #include <linux/amba/mmci.h> | 27 | #include <linux/amba/mmci.h> |
28 | #include <linux/amba/pl022.h> | 28 | #include <linux/amba/pl022.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/platform_data/clk-realview.h> | ||
30 | 31 | ||
31 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
32 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
33 | #include <asm/leds.h> | 34 | #include <asm/leds.h> |
34 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
35 | #include <asm/pmu.h> | ||
36 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
37 | #include <asm/hardware/gic.h> | 37 | #include <asm/hardware/gic.h> |
38 | #include <asm/hardware/cache-l2x0.h> | 38 | #include <asm/hardware/cache-l2x0.h> |
@@ -297,7 +297,7 @@ static struct resource pmu_resources[] = { | |||
297 | 297 | ||
298 | static struct platform_device pmu_device = { | 298 | static struct platform_device pmu_device = { |
299 | .name = "arm-pmu", | 299 | .name = "arm-pmu", |
300 | .id = ARM_PMU_DEVICE_CPU, | 300 | .id = -1, |
301 | .num_resources = ARRAY_SIZE(pmu_resources), | 301 | .num_resources = ARRAY_SIZE(pmu_resources), |
302 | .resource = pmu_resources, | 302 | .resource = pmu_resources, |
303 | }; | 303 | }; |
@@ -414,6 +414,7 @@ static void __init realview_eb_timer_init(void) | |||
414 | else | 414 | else |
415 | timer_irq = IRQ_EB_TIMER0_1; | 415 | timer_irq = IRQ_EB_TIMER0_1; |
416 | 416 | ||
417 | realview_clk_init(__io_address(REALVIEW_SYS_BASE), false); | ||
417 | realview_timer_init(timer_irq); | 418 | realview_timer_init(timer_irq); |
418 | realview_eb_twd_init(); | 419 | realview_eb_twd_init(); |
419 | } | 420 | } |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index b1d7cafa1a6..e21711d72ee 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -29,12 +29,12 @@ | |||
29 | #include <linux/mtd/physmap.h> | 29 | #include <linux/mtd/physmap.h> |
30 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
32 | #include <linux/platform_data/clk-realview.h> | ||
32 | 33 | ||
33 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
34 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
35 | #include <asm/leds.h> | 36 | #include <asm/leds.h> |
36 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
37 | #include <asm/pmu.h> | ||
38 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
39 | #include <asm/hardware/gic.h> | 39 | #include <asm/hardware/gic.h> |
40 | #include <asm/hardware/cache-l2x0.h> | 40 | #include <asm/hardware/cache-l2x0.h> |
@@ -280,7 +280,7 @@ static struct resource pmu_resource = { | |||
280 | 280 | ||
281 | static struct platform_device pmu_device = { | 281 | static struct platform_device pmu_device = { |
282 | .name = "arm-pmu", | 282 | .name = "arm-pmu", |
283 | .id = ARM_PMU_DEVICE_CPU, | 283 | .id = -1, |
284 | .num_resources = 1, | 284 | .num_resources = 1, |
285 | .resource = &pmu_resource, | 285 | .resource = &pmu_resource, |
286 | }; | 286 | }; |
@@ -326,6 +326,7 @@ static void __init realview_pb1176_timer_init(void) | |||
326 | timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE); | 326 | timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE); |
327 | timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20; | 327 | timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20; |
328 | 328 | ||
329 | realview_clk_init(__io_address(REALVIEW_SYS_BASE), true); | ||
329 | realview_timer_init(IRQ_DC1176_TIMER0); | 330 | realview_timer_init(IRQ_DC1176_TIMER0); |
330 | } | 331 | } |
331 | 332 | ||
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 2eacda179f7..a80269981dd 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -27,12 +27,12 @@ | |||
27 | #include <linux/amba/mmci.h> | 27 | #include <linux/amba/mmci.h> |
28 | #include <linux/amba/pl022.h> | 28 | #include <linux/amba/pl022.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/platform_data/clk-realview.h> | ||
30 | 31 | ||
31 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
32 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
33 | #include <asm/leds.h> | 34 | #include <asm/leds.h> |
34 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
35 | #include <asm/pmu.h> | ||
36 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
37 | #include <asm/hardware/gic.h> | 37 | #include <asm/hardware/gic.h> |
38 | #include <asm/hardware/cache-l2x0.h> | 38 | #include <asm/hardware/cache-l2x0.h> |
@@ -263,7 +263,7 @@ static struct resource pmu_resources[] = { | |||
263 | 263 | ||
264 | static struct platform_device pmu_device = { | 264 | static struct platform_device pmu_device = { |
265 | .name = "arm-pmu", | 265 | .name = "arm-pmu", |
266 | .id = ARM_PMU_DEVICE_CPU, | 266 | .id = -1, |
267 | .num_resources = ARRAY_SIZE(pmu_resources), | 267 | .num_resources = ARRAY_SIZE(pmu_resources), |
268 | .resource = pmu_resources, | 268 | .resource = pmu_resources, |
269 | }; | 269 | }; |
@@ -312,6 +312,7 @@ static void __init realview_pb11mp_timer_init(void) | |||
312 | timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); | 312 | timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); |
313 | timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; | 313 | timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; |
314 | 314 | ||
315 | realview_clk_init(__io_address(REALVIEW_SYS_BASE), false); | ||
315 | realview_timer_init(IRQ_TC11MP_TIMER0_1); | 316 | realview_timer_init(IRQ_TC11MP_TIMER0_1); |
316 | realview_pb11mp_twd_init(); | 317 | realview_pb11mp_twd_init(); |
317 | } | 318 | } |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 59650174e6e..1435cd86396 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -27,11 +27,11 @@ | |||
27 | #include <linux/amba/mmci.h> | 27 | #include <linux/amba/mmci.h> |
28 | #include <linux/amba/pl022.h> | 28 | #include <linux/amba/pl022.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/platform_data/clk-realview.h> | ||
30 | 31 | ||
31 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
32 | #include <asm/leds.h> | 33 | #include <asm/leds.h> |
33 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
34 | #include <asm/pmu.h> | ||
35 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
36 | #include <asm/hardware/gic.h> | 36 | #include <asm/hardware/gic.h> |
37 | 37 | ||
@@ -241,7 +241,7 @@ static struct resource pmu_resource = { | |||
241 | 241 | ||
242 | static struct platform_device pmu_device = { | 242 | static struct platform_device pmu_device = { |
243 | .name = "arm-pmu", | 243 | .name = "arm-pmu", |
244 | .id = ARM_PMU_DEVICE_CPU, | 244 | .id = -1, |
245 | .num_resources = 1, | 245 | .num_resources = 1, |
246 | .resource = &pmu_resource, | 246 | .resource = &pmu_resource, |
247 | }; | 247 | }; |
@@ -261,6 +261,7 @@ static void __init realview_pba8_timer_init(void) | |||
261 | timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE); | 261 | timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE); |
262 | timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20; | 262 | timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20; |
263 | 263 | ||
264 | realview_clk_init(__io_address(REALVIEW_SYS_BASE), false); | ||
264 | realview_timer_init(IRQ_PBA8_TIMER0_1); | 265 | realview_timer_init(IRQ_PBA8_TIMER0_1); |
265 | } | 266 | } |
266 | 267 | ||
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index 2cd4f157c6f..a4b1aa93bb5 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -26,11 +26,11 @@ | |||
26 | #include <linux/amba/mmci.h> | 26 | #include <linux/amba/mmci.h> |
27 | #include <linux/amba/pl022.h> | 27 | #include <linux/amba/pl022.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/platform_data/clk-realview.h> | ||
29 | 30 | ||
30 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
31 | #include <asm/leds.h> | 32 | #include <asm/leds.h> |
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
33 | #include <asm/pmu.h> | ||
34 | #include <asm/smp_twd.h> | 34 | #include <asm/smp_twd.h> |
35 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
36 | #include <asm/hardware/gic.h> | 36 | #include <asm/hardware/gic.h> |
@@ -280,7 +280,7 @@ static struct resource pmu_resources[] = { | |||
280 | 280 | ||
281 | static struct platform_device pmu_device = { | 281 | static struct platform_device pmu_device = { |
282 | .name = "arm-pmu", | 282 | .name = "arm-pmu", |
283 | .id = ARM_PMU_DEVICE_CPU, | 283 | .id = -1, |
284 | .num_resources = ARRAY_SIZE(pmu_resources), | 284 | .num_resources = ARRAY_SIZE(pmu_resources), |
285 | .resource = pmu_resources, | 285 | .resource = pmu_resources, |
286 | }; | 286 | }; |
@@ -320,6 +320,7 @@ static void __init realview_pbx_timer_init(void) | |||
320 | timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); | 320 | timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); |
321 | timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; | 321 | timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; |
322 | 322 | ||
323 | realview_clk_init(__io_address(REALVIEW_SYS_BASE), false); | ||
323 | realview_timer_init(IRQ_PBX_TIMER0_1); | 324 | realview_timer_init(IRQ_PBX_TIMER0_1); |
324 | realview_pbx_twd_init(); | 325 | realview_pbx_twd_init(); |
325 | } | 326 | } |