diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-12 06:17:52 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-12 06:53:01 -0400 |
commit | 4a1a5a2f60ceabc026ba28cdbf81d7d47603b480 (patch) | |
tree | ba282867c67272b5bc5f1afc42837b89d3c4427c /arch | |
parent | e5ad00896a381937326ac55fc173630fe731d041 (diff) |
sh: TMU platform data for sh7720/sh7721
This patch adds TMU platform data for sh7720 and sh7721.
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')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7720.c | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c index 003874a2fd2a..c09619c25d9d 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/serial.h> | 18 | #include <linux/serial.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/serial_sci.h> | 20 | #include <linux/serial_sci.h> |
21 | #include <linux/sh_timer.h> | ||
21 | #include <asm/rtc.h> | 22 | #include <asm/rtc.h> |
22 | 23 | ||
23 | static struct resource rtc_resources[] = { | 24 | static struct resource rtc_resources[] = { |
@@ -123,7 +124,103 @@ static struct platform_device usbf_device = { | |||
123 | .resource = usbf_resources, | 124 | .resource = usbf_resources, |
124 | }; | 125 | }; |
125 | 126 | ||
127 | |||
128 | static struct sh_timer_config tmu0_platform_data = { | ||
129 | .name = "TMU0", | ||
130 | .channel_offset = 0x02, | ||
131 | .timer_bit = 0, | ||
132 | .clk = "module_clk", | ||
133 | .clockevent_rating = 200, | ||
134 | }; | ||
135 | |||
136 | static struct resource tmu0_resources[] = { | ||
137 | [0] = { | ||
138 | .name = "TMU0", | ||
139 | .start = 0xa412fe94, | ||
140 | .end = 0xa412fe9f, | ||
141 | .flags = IORESOURCE_MEM, | ||
142 | }, | ||
143 | [1] = { | ||
144 | .start = 16, | ||
145 | .flags = IORESOURCE_IRQ, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | static struct platform_device tmu0_device = { | ||
150 | .name = "sh_tmu", | ||
151 | .id = 0, | ||
152 | .dev = { | ||
153 | .platform_data = &tmu0_platform_data, | ||
154 | }, | ||
155 | .resource = tmu0_resources, | ||
156 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
157 | }; | ||
158 | |||
159 | static struct sh_timer_config tmu1_platform_data = { | ||
160 | .name = "TMU1", | ||
161 | .channel_offset = 0xe, | ||
162 | .timer_bit = 1, | ||
163 | .clk = "module_clk", | ||
164 | .clocksource_rating = 200, | ||
165 | }; | ||
166 | |||
167 | static struct resource tmu1_resources[] = { | ||
168 | [0] = { | ||
169 | .name = "TMU1", | ||
170 | .start = 0xa412fea0, | ||
171 | .end = 0xa412feab, | ||
172 | .flags = IORESOURCE_MEM, | ||
173 | }, | ||
174 | [1] = { | ||
175 | .start = 17, | ||
176 | .flags = IORESOURCE_IRQ, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | static struct platform_device tmu1_device = { | ||
181 | .name = "sh_tmu", | ||
182 | .id = 1, | ||
183 | .dev = { | ||
184 | .platform_data = &tmu1_platform_data, | ||
185 | }, | ||
186 | .resource = tmu1_resources, | ||
187 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
188 | }; | ||
189 | |||
190 | static struct sh_timer_config tmu2_platform_data = { | ||
191 | .name = "TMU2", | ||
192 | .channel_offset = 0x1a, | ||
193 | .timer_bit = 2, | ||
194 | .clk = "module_clk", | ||
195 | }; | ||
196 | |||
197 | static struct resource tmu2_resources[] = { | ||
198 | [0] = { | ||
199 | .name = "TMU2", | ||
200 | .start = 0xa412feac, | ||
201 | .end = 0xa412feb5, | ||
202 | .flags = IORESOURCE_MEM, | ||
203 | }, | ||
204 | [1] = { | ||
205 | .start = 18, | ||
206 | .flags = IORESOURCE_IRQ, | ||
207 | }, | ||
208 | }; | ||
209 | |||
210 | static struct platform_device tmu2_device = { | ||
211 | .name = "sh_tmu", | ||
212 | .id = 2, | ||
213 | .dev = { | ||
214 | .platform_data = &tmu2_platform_data, | ||
215 | }, | ||
216 | .resource = tmu2_resources, | ||
217 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
218 | }; | ||
219 | |||
126 | static struct platform_device *sh7720_devices[] __initdata = { | 220 | static struct platform_device *sh7720_devices[] __initdata = { |
221 | &tmu0_device, | ||
222 | &tmu1_device, | ||
223 | &tmu2_device, | ||
127 | &rtc_device, | 224 | &rtc_device, |
128 | &sci_device, | 225 | &sci_device, |
129 | &usb_ohci_device, | 226 | &usb_ohci_device, |
@@ -137,6 +234,18 @@ static int __init sh7720_devices_setup(void) | |||
137 | } | 234 | } |
138 | __initcall(sh7720_devices_setup); | 235 | __initcall(sh7720_devices_setup); |
139 | 236 | ||
237 | static struct platform_device *sh7720_early_devices[] __initdata = { | ||
238 | &tmu0_device, | ||
239 | &tmu1_device, | ||
240 | &tmu2_device, | ||
241 | }; | ||
242 | |||
243 | void __init plat_early_device_setup(void) | ||
244 | { | ||
245 | early_platform_add_devices(sh7720_early_devices, | ||
246 | ARRAY_SIZE(sh7720_early_devices)); | ||
247 | } | ||
248 | |||
140 | enum { | 249 | enum { |
141 | UNUSED = 0, | 250 | UNUSED = 0, |
142 | 251 | ||