blob: 6a2293a28a84d4abdf756811a7d89836d7ffdc91 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mach-integrator/integrator_cp.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License.
9 */
10#include <linux/types.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/list.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010014#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/dma-mapping.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/string.h>
Kay Sieversedbaa602011-12-21 16:26:03 -080017#include <linux/device.h>
Russell Kinga62c80e2006-01-07 13:52:45 +000018#include <linux/amba/bus.h>
19#include <linux/amba/kmi.h>
20#include <linux/amba/clcd.h>
Linus Walleij6ef297f2009-09-22 14:29:36 +010021#include <linux/amba/mmci.h>
Russell Kingfced80c2008-09-06 12:10:45 +010022#include <linux/io.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090023#include <linux/gfp.h>
Marc Zyngier046dfa02011-05-18 10:51:53 +010024#include <linux/mtd/physmap.h>
Linus Walleija6131632012-06-11 17:33:12 +020025#include <linux/platform_data/clk-integrator.h>
Linus Walleij4980f9b2012-09-06 09:08:24 +010026#include <linux/of_irq.h>
27#include <linux/of_address.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Russell Kinga09e64f2008-08-05 16:14:15 +010029#include <mach/hardware.h>
Russell Kinga285edc2010-01-14 19:59:37 +000030#include <mach/platform.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include <asm/setup.h>
32#include <asm/mach-types.h>
Russell King5a463342010-01-16 23:52:12 +000033#include <asm/hardware/arm_timer.h>
Russell Kingc5a0adb2010-01-16 20:16:10 +000034#include <asm/hardware/icst.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Russell Kinga09e64f2008-08-05 16:14:15 +010036#include <mach/cm.h>
37#include <mach/lm.h>
Linus Walleij695436e2012-02-26 10:46:48 +010038#include <mach/irqs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
40#include <asm/mach/arch.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#include <asm/mach/irq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070042#include <asm/mach/map.h>
43#include <asm/mach/time.h>
44
Rob Herring8a9618f2010-10-06 16:18:08 +010045#include <asm/hardware/timer-sp.h>
Russell King5a463342010-01-16 23:52:12 +000046
Russell King9dfec4f2011-01-18 20:10:10 +000047#include <plat/clcd.h>
Russell Kingc41b16f2011-01-19 15:32:15 +000048#include <plat/fpga-irq.h>
Russell Kingd77e2702011-01-22 11:37:54 +000049#include <plat/sched_clock.h>
Russell King9dfec4f2011-01-18 20:10:10 +000050
Russell King98c672c2010-05-22 18:18:57 +010051#include "common.h"
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#define INTCP_PA_FLASH_BASE 0x24000000
54#define INTCP_FLASH_SIZE SZ_32M
55
56#define INTCP_PA_CLCD_BASE 0xc0000000
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#define INTCP_ETH_SIZE 0x10
59
Russell Kingda7ba952010-01-17 19:59:58 +000060#define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#define INTCP_FLASHPROG 0x04
62#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
63#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
64
65/*
66 * Logical Physical
67 * f1000000 10000000 Core module registers
68 * f1100000 11000000 System controller registers
69 * f1200000 12000000 EBI registers
70 * f1300000 13000000 Counter/Timer
71 * f1400000 14000000 Interrupt controller
72 * f1600000 16000000 UART 0
73 * f1700000 17000000 UART 1
74 * f1a00000 1a000000 Debug LEDs
Russell Kingda7ba952010-01-17 19:59:58 +000075 * fc900000 c9000000 GPIO
76 * fca00000 ca000000 SIC
77 * fcb00000 cb000000 CP system control
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 */
79
80static struct map_desc intcp_io_desc[] __initdata = {
Deepak Saxenac8d27292005-10-28 15:19:10 +010081 {
82 .virtual = IO_ADDRESS(INTEGRATOR_HDR_BASE),
83 .pfn = __phys_to_pfn(INTEGRATOR_HDR_BASE),
84 .length = SZ_4K,
85 .type = MT_DEVICE
86 }, {
87 .virtual = IO_ADDRESS(INTEGRATOR_SC_BASE),
88 .pfn = __phys_to_pfn(INTEGRATOR_SC_BASE),
89 .length = SZ_4K,
90 .type = MT_DEVICE
91 }, {
92 .virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE),
93 .pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE),
94 .length = SZ_4K,
95 .type = MT_DEVICE
96 }, {
97 .virtual = IO_ADDRESS(INTEGRATOR_CT_BASE),
98 .pfn = __phys_to_pfn(INTEGRATOR_CT_BASE),
99 .length = SZ_4K,
100 .type = MT_DEVICE
101 }, {
102 .virtual = IO_ADDRESS(INTEGRATOR_IC_BASE),
103 .pfn = __phys_to_pfn(INTEGRATOR_IC_BASE),
104 .length = SZ_4K,
105 .type = MT_DEVICE
106 }, {
107 .virtual = IO_ADDRESS(INTEGRATOR_UART0_BASE),
108 .pfn = __phys_to_pfn(INTEGRATOR_UART0_BASE),
109 .length = SZ_4K,
110 .type = MT_DEVICE
111 }, {
112 .virtual = IO_ADDRESS(INTEGRATOR_UART1_BASE),
113 .pfn = __phys_to_pfn(INTEGRATOR_UART1_BASE),
114 .length = SZ_4K,
115 .type = MT_DEVICE
116 }, {
117 .virtual = IO_ADDRESS(INTEGRATOR_DBG_BASE),
118 .pfn = __phys_to_pfn(INTEGRATOR_DBG_BASE),
119 .length = SZ_4K,
120 .type = MT_DEVICE
121 }, {
Russell Kingda7ba952010-01-17 19:59:58 +0000122 .virtual = IO_ADDRESS(INTEGRATOR_CP_GPIO_BASE),
123 .pfn = __phys_to_pfn(INTEGRATOR_CP_GPIO_BASE),
Deepak Saxenac8d27292005-10-28 15:19:10 +0100124 .length = SZ_4K,
125 .type = MT_DEVICE
126 }, {
Russell Kingda7ba952010-01-17 19:59:58 +0000127 .virtual = IO_ADDRESS(INTEGRATOR_CP_SIC_BASE),
128 .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE),
Deepak Saxenac8d27292005-10-28 15:19:10 +0100129 .length = SZ_4K,
130 .type = MT_DEVICE
131 }, {
Russell Kingda7ba952010-01-17 19:59:58 +0000132 .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE),
133 .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE),
Deepak Saxenac8d27292005-10-28 15:19:10 +0100134 .length = SZ_4K,
135 .type = MT_DEVICE
136 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137};
138
139static void __init intcp_map_io(void)
140{
141 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc));
142}
143
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 * Flash handling.
146 */
Marc Zyngier046dfa02011-05-18 10:51:53 +0100147static int intcp_flash_init(struct platform_device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148{
149 u32 val;
150
151 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
152 val |= CINTEGRATOR_FLASHPROG_FLWREN;
153 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
154
155 return 0;
156}
157
Marc Zyngier046dfa02011-05-18 10:51:53 +0100158static void intcp_flash_exit(struct platform_device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159{
160 u32 val;
161
162 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
163 val &= ~(CINTEGRATOR_FLASHPROG_FLVPPEN|CINTEGRATOR_FLASHPROG_FLWREN);
164 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
165}
166
Marc Zyngier667f3902011-05-18 10:51:55 +0100167static void intcp_flash_set_vpp(struct platform_device *pdev, int on)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168{
169 u32 val;
170
171 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
172 if (on)
173 val |= CINTEGRATOR_FLASHPROG_FLVPPEN;
174 else
175 val &= ~CINTEGRATOR_FLASHPROG_FLVPPEN;
176 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
177}
178
Marc Zyngier046dfa02011-05-18 10:51:53 +0100179static struct physmap_flash_data intcp_flash_data = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 .width = 4,
181 .init = intcp_flash_init,
182 .exit = intcp_flash_exit,
183 .set_vpp = intcp_flash_set_vpp,
184};
185
186static struct resource intcp_flash_resource = {
187 .start = INTCP_PA_FLASH_BASE,
188 .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1,
189 .flags = IORESOURCE_MEM,
190};
191
192static struct platform_device intcp_flash_device = {
Marc Zyngier046dfa02011-05-18 10:51:53 +0100193 .name = "physmap-flash",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194 .id = 0,
195 .dev = {
196 .platform_data = &intcp_flash_data,
197 },
198 .num_resources = 1,
199 .resource = &intcp_flash_resource,
200};
201
202static struct resource smc91x_resources[] = {
203 [0] = {
Russell Kingda7ba952010-01-17 19:59:58 +0000204 .start = INTEGRATOR_CP_ETH_BASE,
205 .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 .flags = IORESOURCE_MEM,
207 },
208 [1] = {
209 .start = IRQ_CP_ETHINT,
210 .end = IRQ_CP_ETHINT,
211 .flags = IORESOURCE_IRQ,
212 },
213};
214
215static struct platform_device smc91x_device = {
216 .name = "smc91x",
217 .id = 0,
218 .num_resources = ARRAY_SIZE(smc91x_resources),
219 .resource = smc91x_resources,
220};
221
222static struct platform_device *intcp_devs[] __initdata = {
223 &intcp_flash_device,
224 &smc91x_device,
225};
226
227/*
228 * It seems that the card insertion interrupt remains active after
229 * we've acknowledged it. We therefore ignore the interrupt, and
230 * rely on reading it from the SIC. This also means that we must
231 * clear the latched interrupt.
232 */
233static unsigned int mmc_status(struct device *dev)
234{
Russell Kingb830b9b2010-01-17 20:45:12 +0000235 unsigned int status = readl(IO_ADDRESS(0xca000000 + 4));
236 writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
238 return status & 8;
239}
240
Linus Walleij6ef297f2009-09-22 14:29:36 +0100241static struct mmci_platform_data mmc_data = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
243 .status = mmc_status,
Russell King7fb2bbf2009-07-09 15:15:12 +0100244 .gpio_wp = -1,
245 .gpio_cd = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246};
247
Russell King2f64ccd2011-12-18 14:50:51 +0000248#define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }
249#define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250
Linus Walleijd59fdcfc2012-06-11 00:14:15 +0200251static AMBA_APB_DEVICE(mmc, "mmci", 0, INTEGRATOR_CP_MMC_BASE,
Russell King2f64ccd2011-12-18 14:50:51 +0000252 INTEGRATOR_CP_MMC_IRQS, &mmc_data);
253
Linus Walleijd59fdcfc2012-06-11 00:14:15 +0200254static AMBA_APB_DEVICE(aaci, "aaci", 0, INTEGRATOR_CP_AACI_BASE,
Russell King2f64ccd2011-12-18 14:50:51 +0000255 INTEGRATOR_CP_AACI_IRQS, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
257
258/*
259 * CLCD support
260 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261/*
262 * Ensure VGA is selected.
263 */
264static void cp_clcd_enable(struct clcd_fb *fb)
265{
Russell Kinge6b9c1f2011-01-22 11:02:10 +0000266 struct fb_var_screeninfo *var = &fb->fb.var;
267 u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2;
Russell King4774e222005-04-30 23:32:38 +0100268
Russell Kinge6b9c1f2011-01-22 11:02:10 +0000269 if (var->bits_per_pixel <= 8 ||
270 (var->bits_per_pixel == 16 && var->green.length == 5))
271 /* Pseudocolor, RGB555, BGR555 */
272 val |= CM_CTRL_LCDMUXSEL_VGA555_TFT555;
Russell King4774e222005-04-30 23:32:38 +0100273 else if (fb->fb.var.bits_per_pixel <= 16)
Russell Kinge6b9c1f2011-01-22 11:02:10 +0000274 /* truecolor RGB565 */
275 val |= CM_CTRL_LCDMUXSEL_VGA565_TFT555;
Russell King4774e222005-04-30 23:32:38 +0100276 else
277 val = 0; /* no idea for this, don't trust the docs */
278
279 cm_control(CM_CTRL_LCDMUXSEL_MASK|
280 CM_CTRL_LCDEN0|
281 CM_CTRL_LCDEN1|
282 CM_CTRL_STATIC1|
283 CM_CTRL_STATIC2|
284 CM_CTRL_STATIC|
285 CM_CTRL_n24BITEN, val);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286}
287
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288static int cp_clcd_setup(struct clcd_fb *fb)
289{
Russell King9dfec4f2011-01-18 20:10:10 +0000290 fb->panel = versatile_clcd_get_panel("VGA");
291 if (!fb->panel)
292 return -EINVAL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293
Russell King9dfec4f2011-01-18 20:10:10 +0000294 return versatile_clcd_setup_dma(fb, SZ_1M);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295}
296
297static struct clcd_board clcd_data = {
298 .name = "Integrator/CP",
Russell King9dfec4f2011-01-18 20:10:10 +0000299 .caps = CLCD_CAP_5551 | CLCD_CAP_RGB565 | CLCD_CAP_888,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 .check = clcdfb_check,
301 .decode = clcdfb_decode,
302 .enable = cp_clcd_enable,
303 .setup = cp_clcd_setup,
Russell King9dfec4f2011-01-18 20:10:10 +0000304 .mmap = versatile_clcd_mmap_dma,
305 .remove = versatile_clcd_remove_dma,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306};
307
Linus Walleijd59fdcfc2012-06-11 00:14:15 +0200308static AMBA_AHB_DEVICE(clcd, "clcd", 0, INTCP_PA_CLCD_BASE,
Russell King2f64ccd2011-12-18 14:50:51 +0000309 { IRQ_CP_CLCDCINT }, &clcd_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310
311static struct amba_device *amba_devs[] __initdata = {
312 &mmc_device,
313 &aaci_device,
314 &clcd_device,
315};
316
Russell Kingd77e2702011-01-22 11:37:54 +0000317#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28)
318
Russell Kingc735c982011-01-11 13:00:04 +0000319static void __init intcp_init_early(void)
320{
Russell Kingd77e2702011-01-22 11:37:54 +0000321#ifdef CONFIG_PLAT_VERSATILE_SCHED_CLOCK
322 versatile_sched_clock_init(REFCOUNTER, 24000000);
323#endif
Russell Kingc735c982011-01-11 13:00:04 +0000324}
325
Linus Walleij4980f9b2012-09-06 09:08:24 +0100326static void __init intcp_timer_init_of(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327{
Linus Walleij4980f9b2012-09-06 09:08:24 +0100328 struct device_node *node;
329 const char *path;
330 void __iomem *base;
331 int err;
332 int irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333
Linus Walleij4980f9b2012-09-06 09:08:24 +0100334 err = of_property_read_string(of_aliases,
335 "arm,timer-primary", &path);
336 if (WARN_ON(err))
337 return;
338 node = of_find_node_by_path(path);
339 base = of_iomap(node, 0);
340 if (WARN_ON(!base))
341 return;
342 writel(0, base + TIMER_CTRL);
343 sp804_clocksource_init(base, node->name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344
Linus Walleij4980f9b2012-09-06 09:08:24 +0100345 err = of_property_read_string(of_aliases,
346 "arm,timer-secondary", &path);
347 if (WARN_ON(err))
348 return;
349 node = of_find_node_by_path(path);
350 base = of_iomap(node, 0);
351 if (WARN_ON(!base))
352 return;
353 irq = irq_of_parse_and_map(node, 0);
354 writel(0, base + TIMER_CTRL);
355 sp804_clockevents_init(base, irq, node->name);
356}
357
358static struct sys_timer cp_of_timer = {
359 .init = intcp_timer_init_of,
360};
361
362#ifdef CONFIG_OF
363
364static const struct of_device_id fpga_irq_of_match[] __initconst = {
365 { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
366 { /* Sentinel */ }
367};
368
369static void __init intcp_init_irq_of(void)
370{
371 of_irq_init(fpga_irq_of_match);
372 integrator_clk_init(true);
373}
374
375static const char * intcp_dt_board_compat[] = {
376 "arm,integrator-cp",
377 NULL,
378};
379
380DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
381 .reserve = integrator_reserve,
382 .map_io = intcp_map_io,
383 .nr_irqs = NR_IRQS_INTEGRATOR_CP,
384 .init_early = intcp_init_early,
385 .init_irq = intcp_init_irq_of,
386 .handle_irq = fpga_handle_irq,
387 .timer = &cp_of_timer,
388 .init_machine = intcp_init,
389 .restart = integrator_restart,
390 .dt_compat = intcp_dt_board_compat,
391MACHINE_END
392
393#endif
394
395#ifdef CONFIG_ATAGS
396
397/*
398 * This is where non-devicetree initialization code is collected and stashed
399 * for eventual deletion.
400 */
401
402#define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40)
403#define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE)
404#define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE)
405
406static void __init intcp_init_irq(void)
407{
408 u32 pic_mask, cic_mask, sic_mask;
409
410 /* These masks are for the HW IRQ registers */
411 pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
412 pic_mask |= (~((~0u) << (29 - 22))) << 22;
413 cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START));
414 sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START));
415
416 /*
417 * Disable all interrupt sources
418 */
419 writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR);
420 writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR);
421 writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
422 writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR);
423 writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
424 writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR);
425
426 fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START,
427 -1, pic_mask, NULL);
428
429 fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START,
430 -1, cic_mask, NULL);
431
432 fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START,
433 IRQ_CP_CPPLDINT, sic_mask, NULL);
434
435 integrator_clk_init(true);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436}
437
Russell King5a463342010-01-16 23:52:12 +0000438#define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE)
439#define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
440#define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441
442static void __init intcp_timer_init(void)
443{
Russell King5a463342010-01-16 23:52:12 +0000444 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
445 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
446 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
447
Russell Kingfb593cf2011-05-12 12:08:23 +0100448 sp804_clocksource_init(TIMER2_VA_BASE, "timer2");
Russell King57cc4f72011-05-12 15:31:13 +0100449 sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450}
451
452static struct sys_timer cp_timer = {
453 .init = intcp_timer_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454};
455
456MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100457 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
Nicolas Pitrec5e587a2011-07-05 22:38:12 -0400458 .atag_offset = 0x100,
Russell King98c672c2010-05-22 18:18:57 +0100459 .reserve = integrator_reserve,
Russell Kingc735c982011-01-11 13:00:04 +0000460 .map_io = intcp_map_io,
Linus Walleij695436e2012-02-26 10:46:48 +0100461 .nr_irqs = NR_IRQS_INTEGRATOR_CP,
Russell Kingc735c982011-01-11 13:00:04 +0000462 .init_early = intcp_init_early,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100463 .init_irq = intcp_init_irq,
Linus Walleij3108e6a2012-04-28 14:33:47 +0100464 .handle_irq = fpga_handle_irq,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 .timer = &cp_timer,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100466 .init_machine = intcp_init,
Russell King6338b662011-11-03 19:54:37 +0000467 .restart = integrator_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468MACHINE_END
Linus Walleij4980f9b2012-09-06 09:08:24 +0100469
470#endif