diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7763.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 204 |
1 files changed, 204 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c index bdf0f61ae1ed..f1e0c0d36da7 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/sh_timer.h> | ||
15 | #include <linux/io.h> | 16 | #include <linux/io.h> |
16 | #include <linux/serial_sci.h> | 17 | #include <linux/serial_sci.h> |
17 | 18 | ||
@@ -113,7 +114,195 @@ static struct platform_device usbf_device = { | |||
113 | .resource = usbf_resources, | 114 | .resource = usbf_resources, |
114 | }; | 115 | }; |
115 | 116 | ||
117 | static struct sh_timer_config tmu0_platform_data = { | ||
118 | .name = "TMU0", | ||
119 | .channel_offset = 0x04, | ||
120 | .timer_bit = 0, | ||
121 | .clk = "peripheral_clk", | ||
122 | .clockevent_rating = 200, | ||
123 | }; | ||
124 | |||
125 | static struct resource tmu0_resources[] = { | ||
126 | [0] = { | ||
127 | .name = "TMU0", | ||
128 | .start = 0xffd80008, | ||
129 | .end = 0xffd80013, | ||
130 | .flags = IORESOURCE_MEM, | ||
131 | }, | ||
132 | [1] = { | ||
133 | .start = 28, | ||
134 | .flags = IORESOURCE_IRQ, | ||
135 | }, | ||
136 | }; | ||
137 | |||
138 | static struct platform_device tmu0_device = { | ||
139 | .name = "sh_tmu", | ||
140 | .id = 0, | ||
141 | .dev = { | ||
142 | .platform_data = &tmu0_platform_data, | ||
143 | }, | ||
144 | .resource = tmu0_resources, | ||
145 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
146 | }; | ||
147 | |||
148 | static struct sh_timer_config tmu1_platform_data = { | ||
149 | .name = "TMU1", | ||
150 | .channel_offset = 0x10, | ||
151 | .timer_bit = 1, | ||
152 | .clk = "peripheral_clk", | ||
153 | .clocksource_rating = 200, | ||
154 | }; | ||
155 | |||
156 | static struct resource tmu1_resources[] = { | ||
157 | [0] = { | ||
158 | .name = "TMU1", | ||
159 | .start = 0xffd80014, | ||
160 | .end = 0xffd8001f, | ||
161 | .flags = IORESOURCE_MEM, | ||
162 | }, | ||
163 | [1] = { | ||
164 | .start = 29, | ||
165 | .flags = IORESOURCE_IRQ, | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | static struct platform_device tmu1_device = { | ||
170 | .name = "sh_tmu", | ||
171 | .id = 1, | ||
172 | .dev = { | ||
173 | .platform_data = &tmu1_platform_data, | ||
174 | }, | ||
175 | .resource = tmu1_resources, | ||
176 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
177 | }; | ||
178 | |||
179 | static struct sh_timer_config tmu2_platform_data = { | ||
180 | .name = "TMU2", | ||
181 | .channel_offset = 0x1c, | ||
182 | .timer_bit = 2, | ||
183 | .clk = "peripheral_clk", | ||
184 | }; | ||
185 | |||
186 | static struct resource tmu2_resources[] = { | ||
187 | [0] = { | ||
188 | .name = "TMU2", | ||
189 | .start = 0xffd80020, | ||
190 | .end = 0xffd8002f, | ||
191 | .flags = IORESOURCE_MEM, | ||
192 | }, | ||
193 | [1] = { | ||
194 | .start = 30, | ||
195 | .flags = IORESOURCE_IRQ, | ||
196 | }, | ||
197 | }; | ||
198 | |||
199 | static struct platform_device tmu2_device = { | ||
200 | .name = "sh_tmu", | ||
201 | .id = 2, | ||
202 | .dev = { | ||
203 | .platform_data = &tmu2_platform_data, | ||
204 | }, | ||
205 | .resource = tmu2_resources, | ||
206 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
207 | }; | ||
208 | |||
209 | static struct sh_timer_config tmu3_platform_data = { | ||
210 | .name = "TMU3", | ||
211 | .channel_offset = 0x04, | ||
212 | .timer_bit = 0, | ||
213 | .clk = "peripheral_clk", | ||
214 | }; | ||
215 | |||
216 | static struct resource tmu3_resources[] = { | ||
217 | [0] = { | ||
218 | .name = "TMU3", | ||
219 | .start = 0xffd88008, | ||
220 | .end = 0xffd88013, | ||
221 | .flags = IORESOURCE_MEM, | ||
222 | }, | ||
223 | [1] = { | ||
224 | .start = 96, | ||
225 | .flags = IORESOURCE_IRQ, | ||
226 | }, | ||
227 | }; | ||
228 | |||
229 | static struct platform_device tmu3_device = { | ||
230 | .name = "sh_tmu", | ||
231 | .id = 3, | ||
232 | .dev = { | ||
233 | .platform_data = &tmu3_platform_data, | ||
234 | }, | ||
235 | .resource = tmu3_resources, | ||
236 | .num_resources = ARRAY_SIZE(tmu3_resources), | ||
237 | }; | ||
238 | |||
239 | static struct sh_timer_config tmu4_platform_data = { | ||
240 | .name = "TMU4", | ||
241 | .channel_offset = 0x10, | ||
242 | .timer_bit = 1, | ||
243 | .clk = "peripheral_clk", | ||
244 | }; | ||
245 | |||
246 | static struct resource tmu4_resources[] = { | ||
247 | [0] = { | ||
248 | .name = "TMU4", | ||
249 | .start = 0xffd88014, | ||
250 | .end = 0xffd8801f, | ||
251 | .flags = IORESOURCE_MEM, | ||
252 | }, | ||
253 | [1] = { | ||
254 | .start = 97, | ||
255 | .flags = IORESOURCE_IRQ, | ||
256 | }, | ||
257 | }; | ||
258 | |||
259 | static struct platform_device tmu4_device = { | ||
260 | .name = "sh_tmu", | ||
261 | .id = 4, | ||
262 | .dev = { | ||
263 | .platform_data = &tmu4_platform_data, | ||
264 | }, | ||
265 | .resource = tmu4_resources, | ||
266 | .num_resources = ARRAY_SIZE(tmu4_resources), | ||
267 | }; | ||
268 | |||
269 | static struct sh_timer_config tmu5_platform_data = { | ||
270 | .name = "TMU5", | ||
271 | .channel_offset = 0x1c, | ||
272 | .timer_bit = 2, | ||
273 | .clk = "peripheral_clk", | ||
274 | }; | ||
275 | |||
276 | static struct resource tmu5_resources[] = { | ||
277 | [0] = { | ||
278 | .name = "TMU5", | ||
279 | .start = 0xffd88020, | ||
280 | .end = 0xffd8802b, | ||
281 | .flags = IORESOURCE_MEM, | ||
282 | }, | ||
283 | [1] = { | ||
284 | .start = 98, | ||
285 | .flags = IORESOURCE_IRQ, | ||
286 | }, | ||
287 | }; | ||
288 | |||
289 | static struct platform_device tmu5_device = { | ||
290 | .name = "sh_tmu", | ||
291 | .id = 5, | ||
292 | .dev = { | ||
293 | .platform_data = &tmu5_platform_data, | ||
294 | }, | ||
295 | .resource = tmu5_resources, | ||
296 | .num_resources = ARRAY_SIZE(tmu5_resources), | ||
297 | }; | ||
298 | |||
116 | static struct platform_device *sh7763_devices[] __initdata = { | 299 | static struct platform_device *sh7763_devices[] __initdata = { |
300 | &tmu0_device, | ||
301 | &tmu1_device, | ||
302 | &tmu2_device, | ||
303 | &tmu3_device, | ||
304 | &tmu4_device, | ||
305 | &tmu5_device, | ||
117 | &rtc_device, | 306 | &rtc_device, |
118 | &sci_device, | 307 | &sci_device, |
119 | &usb_ohci_device, | 308 | &usb_ohci_device, |
@@ -127,6 +316,21 @@ static int __init sh7763_devices_setup(void) | |||
127 | } | 316 | } |
128 | __initcall(sh7763_devices_setup); | 317 | __initcall(sh7763_devices_setup); |
129 | 318 | ||
319 | static struct platform_device *sh7763_early_devices[] __initdata = { | ||
320 | &tmu0_device, | ||
321 | &tmu1_device, | ||
322 | &tmu2_device, | ||
323 | &tmu3_device, | ||
324 | &tmu4_device, | ||
325 | &tmu5_device, | ||
326 | }; | ||
327 | |||
328 | void __init plat_early_device_setup(void) | ||
329 | { | ||
330 | early_platform_add_devices(sh7763_early_devices, | ||
331 | ARRAY_SIZE(sh7763_early_devices)); | ||
332 | } | ||
333 | |||
130 | enum { | 334 | enum { |
131 | UNUSED = 0, | 335 | UNUSED = 0, |
132 | 336 | ||