diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-12 05:28:25 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-12 06:37:21 -0400 |
commit | 5f8a29ba39d52b2eaaed907b3cb3016b949a8f9b (patch) | |
tree | 0d9326248608575d41cb21e04e1d59bd5dc3af8f /arch/sh | |
parent | f251935e02e89aa203e0729bfd727175018cec6f (diff) |
sh: TMU platform data for sh4-202
This patch adds TMU platform data for sh4-202. Both clockevent
and clocksource support is enabled.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/setup-sh4-202.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c index 7371abf64f80..034c069f7155 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
13 | #include <linux/serial_sci.h> | 13 | #include <linux/serial_sci.h> |
14 | #include <linux/sh_timer.h> | ||
14 | 15 | ||
15 | static struct plat_sci_port sci_platform_data[] = { | 16 | static struct plat_sci_port sci_platform_data[] = { |
16 | { | 17 | { |
@@ -31,8 +32,103 @@ static struct platform_device sci_device = { | |||
31 | }, | 32 | }, |
32 | }; | 33 | }; |
33 | 34 | ||
35 | static struct sh_timer_config tmu0_platform_data = { | ||
36 | .name = "TMU0", | ||
37 | .channel_offset = 0x04, | ||
38 | .timer_bit = 0, | ||
39 | .clk = "module_clk", | ||
40 | .clockevent_rating = 200, | ||
41 | }; | ||
42 | |||
43 | static struct resource tmu0_resources[] = { | ||
44 | [0] = { | ||
45 | .name = "TMU0", | ||
46 | .start = 0xffd80008, | ||
47 | .end = 0xffd80013, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, | ||
50 | [1] = { | ||
51 | .start = 16, | ||
52 | .flags = IORESOURCE_IRQ, | ||
53 | }, | ||
54 | }; | ||
55 | |||
56 | static struct platform_device tmu0_device = { | ||
57 | .name = "sh_tmu", | ||
58 | .id = 0, | ||
59 | .dev = { | ||
60 | .platform_data = &tmu0_platform_data, | ||
61 | }, | ||
62 | .resource = tmu0_resources, | ||
63 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
64 | }; | ||
65 | |||
66 | static struct sh_timer_config tmu1_platform_data = { | ||
67 | .name = "TMU1", | ||
68 | .channel_offset = 0x10, | ||
69 | .timer_bit = 1, | ||
70 | .clk = "module_clk", | ||
71 | .clocksource_rating = 200, | ||
72 | }; | ||
73 | |||
74 | static struct resource tmu1_resources[] = { | ||
75 | [0] = { | ||
76 | .name = "TMU1", | ||
77 | .start = 0xffd80014, | ||
78 | .end = 0xffd8001f, | ||
79 | .flags = IORESOURCE_MEM, | ||
80 | }, | ||
81 | [1] = { | ||
82 | .start = 17, | ||
83 | .flags = IORESOURCE_IRQ, | ||
84 | }, | ||
85 | }; | ||
86 | |||
87 | static struct platform_device tmu1_device = { | ||
88 | .name = "sh_tmu", | ||
89 | .id = 1, | ||
90 | .dev = { | ||
91 | .platform_data = &tmu1_platform_data, | ||
92 | }, | ||
93 | .resource = tmu1_resources, | ||
94 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
95 | }; | ||
96 | |||
97 | static struct sh_timer_config tmu2_platform_data = { | ||
98 | .name = "TMU2", | ||
99 | .channel_offset = 0x1c, | ||
100 | .timer_bit = 2, | ||
101 | .clk = "module_clk", | ||
102 | }; | ||
103 | |||
104 | static struct resource tmu2_resources[] = { | ||
105 | [0] = { | ||
106 | .name = "TMU2", | ||
107 | .start = 0xffd80020, | ||
108 | .end = 0xffd8002f, | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }, | ||
111 | [1] = { | ||
112 | .start = 18, | ||
113 | .flags = IORESOURCE_IRQ, | ||
114 | }, | ||
115 | }; | ||
116 | |||
117 | static struct platform_device tmu2_device = { | ||
118 | .name = "sh_tmu", | ||
119 | .id = 2, | ||
120 | .dev = { | ||
121 | .platform_data = &tmu2_platform_data, | ||
122 | }, | ||
123 | .resource = tmu2_resources, | ||
124 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
125 | }; | ||
126 | |||
34 | static struct platform_device *sh4202_devices[] __initdata = { | 127 | static struct platform_device *sh4202_devices[] __initdata = { |
35 | &sci_device, | 128 | &sci_device, |
129 | &tmu0_device, | ||
130 | &tmu1_device, | ||
131 | &tmu2_device, | ||
36 | }; | 132 | }; |
37 | 133 | ||
38 | static int __init sh4202_devices_setup(void) | 134 | static int __init sh4202_devices_setup(void) |
@@ -42,6 +138,18 @@ static int __init sh4202_devices_setup(void) | |||
42 | } | 138 | } |
43 | __initcall(sh4202_devices_setup); | 139 | __initcall(sh4202_devices_setup); |
44 | 140 | ||
141 | static struct platform_device *sh4202_early_devices[] __initdata = { | ||
142 | &tmu0_device, | ||
143 | &tmu1_device, | ||
144 | &tmu2_device, | ||
145 | }; | ||
146 | |||
147 | void __init plat_early_device_setup(void) | ||
148 | { | ||
149 | early_platform_add_devices(sh4202_early_devices, | ||
150 | ARRAY_SIZE(sh4202_early_devices)); | ||
151 | } | ||
152 | |||
45 | void __init plat_irq_setup(void) | 153 | void __init plat_irq_setup(void) |
46 | { | 154 | { |
47 | /* do nothing - all IRL interrupts are handled by the board code */ | 155 | /* do nothing - all IRL interrupts are handled by the board code */ |