1 #include <linux/platform_device.h>
2 #include <asm/mach/time.h>
6 #define TIMER_NAME "rk_timer"
7 #define BASE RK319X_TIMER_BASE
10 static struct resource rk_timer_resources[] __initdata = {
13 .start = (unsigned long) BASE + 4 * OFFSET,
14 .flags = IORESOURCE_MEM,
17 .start = (unsigned long) "timer4",
20 .start = (unsigned long) "pclk_timer",
25 .start = (unsigned long) BASE + 0 * OFFSET,
26 .flags = IORESOURCE_MEM,
29 .start = (unsigned long) IRQ_TIMER0,
30 .flags = IORESOURCE_IRQ,
33 .start = (unsigned long) "timer0",
36 .start = (unsigned long) "pclk_timer",
41 .start = (unsigned long) BASE + 1 * OFFSET,
42 .flags = IORESOURCE_MEM,
45 .start = (unsigned long) IRQ_TIMER1,
46 .flags = IORESOURCE_IRQ,
49 .start = (unsigned long) "timer1",
52 .start = (unsigned long) "pclk_timer",
57 .start = (unsigned long) BASE + 2 * OFFSET,
58 .flags = IORESOURCE_MEM,
61 .start = (unsigned long) IRQ_TIMER2,
62 .flags = IORESOURCE_IRQ,
65 .start = (unsigned long) "timer2",
68 .start = (unsigned long) "pclk_timer",
73 .start = (unsigned long) BASE + 3 * OFFSET,
74 .flags = IORESOURCE_MEM,
77 .start = (unsigned long) IRQ_TIMER3,
78 .flags = IORESOURCE_IRQ,
81 .start = (unsigned long) "timer3",
84 .start = (unsigned long) "pclk_timer",
88 static struct platform_device rk_timer_device __initdata = {
91 .resource = rk_timer_resources,
92 .num_resources = ARRAY_SIZE(rk_timer_resources),
95 static struct platform_device *rk_timer_devices[] __initdata = {
99 static void __init rk_timer_init(void)
101 early_platform_add_devices(rk_timer_devices, ARRAY_SIZE(rk_timer_devices));
102 early_platform_driver_register_all(TIMER_NAME);
103 early_platform_driver_probe(TIMER_NAME, 1, 0);
106 struct sys_timer rk30_timer = {
107 .init = rk_timer_init