aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7722.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c123
1 files changed, 114 insertions, 9 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 406747f07dc0..ea524a2da3e4 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -13,7 +13,7 @@
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/uio_driver.h> 15#include <linux/uio_driver.h>
16#include <linux/sh_cmt.h> 16#include <linux/sh_timer.h>
17#include <asm/clock.h> 17#include <asm/clock.h>
18#include <asm/mmzone.h> 18#include <asm/mmzone.h>
19 19
@@ -177,13 +177,13 @@ static struct platform_device jpu_device = {
177 .num_resources = ARRAY_SIZE(jpu_resources), 177 .num_resources = ARRAY_SIZE(jpu_resources),
178}; 178};
179 179
180static struct sh_cmt_config cmt_platform_data = { 180static struct sh_timer_config cmt_platform_data = {
181 .name = "CMT", 181 .name = "CMT",
182 .channel_offset = 0x60, 182 .channel_offset = 0x60,
183 .timer_bit = 5, 183 .timer_bit = 5,
184 .clk = "cmt0", 184 .clk = "cmt0",
185 .clockevent_rating = 125, 185 .clockevent_rating = 125,
186 .clocksource_rating = 200, 186 .clocksource_rating = 125,
187}; 187};
188 188
189static struct resource cmt_resources[] = { 189static struct resource cmt_resources[] = {
@@ -209,24 +209,119 @@ static struct platform_device cmt_device = {
209 .num_resources = ARRAY_SIZE(cmt_resources), 209 .num_resources = ARRAY_SIZE(cmt_resources),
210}; 210};
211 211
212static struct sh_timer_config tmu0_platform_data = {
213 .name = "TMU0",
214 .channel_offset = 0x04,
215 .timer_bit = 0,
216 .clk = "tmu0",
217 .clockevent_rating = 200,
218};
219
220static struct resource tmu0_resources[] = {
221 [0] = {
222 .name = "TMU0",
223 .start = 0xffd80008,
224 .end = 0xffd80013,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = 16,
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device tmu0_device = {
234 .name = "sh_tmu",
235 .id = 0,
236 .dev = {
237 .platform_data = &tmu0_platform_data,
238 },
239 .resource = tmu0_resources,
240 .num_resources = ARRAY_SIZE(tmu0_resources),
241};
242
243static struct sh_timer_config tmu1_platform_data = {
244 .name = "TMU1",
245 .channel_offset = 0x10,
246 .timer_bit = 1,
247 .clk = "tmu0",
248 .clocksource_rating = 200,
249};
250
251static struct resource tmu1_resources[] = {
252 [0] = {
253 .name = "TMU1",
254 .start = 0xffd80014,
255 .end = 0xffd8001f,
256 .flags = IORESOURCE_MEM,
257 },
258 [1] = {
259 .start = 17,
260 .flags = IORESOURCE_IRQ,
261 },
262};
263
264static struct platform_device tmu1_device = {
265 .name = "sh_tmu",
266 .id = 1,
267 .dev = {
268 .platform_data = &tmu1_platform_data,
269 },
270 .resource = tmu1_resources,
271 .num_resources = ARRAY_SIZE(tmu1_resources),
272};
273
274static struct sh_timer_config tmu2_platform_data = {
275 .name = "TMU2",
276 .channel_offset = 0x1c,
277 .timer_bit = 2,
278 .clk = "tmu0",
279};
280
281static struct resource tmu2_resources[] = {
282 [0] = {
283 .name = "TMU2",
284 .start = 0xffd80020,
285 .end = 0xffd8002b,
286 .flags = IORESOURCE_MEM,
287 },
288 [1] = {
289 .start = 18,
290 .flags = IORESOURCE_IRQ,
291 },
292};
293
294static struct platform_device tmu2_device = {
295 .name = "sh_tmu",
296 .id = 2,
297 .dev = {
298 .platform_data = &tmu2_platform_data,
299 },
300 .resource = tmu2_resources,
301 .num_resources = ARRAY_SIZE(tmu2_resources),
302};
303
212static struct plat_sci_port sci_platform_data[] = { 304static struct plat_sci_port sci_platform_data[] = {
213 { 305 {
214 .mapbase = 0xffe00000, 306 .mapbase = 0xffe00000,
215 .flags = UPF_BOOT_AUTOCONF, 307 .flags = UPF_BOOT_AUTOCONF,
216 .type = PORT_SCIF, 308 .type = PORT_SCIF,
217 .irqs = { 80, 80, 80, 80 }, 309 .irqs = { 80, 80, 80, 80 },
310 .clk = "scif0",
218 }, 311 },
219 { 312 {
220 .mapbase = 0xffe10000, 313 .mapbase = 0xffe10000,
221 .flags = UPF_BOOT_AUTOCONF, 314 .flags = UPF_BOOT_AUTOCONF,
222 .type = PORT_SCIF, 315 .type = PORT_SCIF,
223 .irqs = { 81, 81, 81, 81 }, 316 .irqs = { 81, 81, 81, 81 },
317 .clk = "scif1",
224 }, 318 },
225 { 319 {
226 .mapbase = 0xffe20000, 320 .mapbase = 0xffe20000,
227 .flags = UPF_BOOT_AUTOCONF, 321 .flags = UPF_BOOT_AUTOCONF,
228 .type = PORT_SCIF, 322 .type = PORT_SCIF,
229 .irqs = { 82, 82, 82, 82 }, 323 .irqs = { 82, 82, 82, 82 },
324 .clk = "scif2",
230 }, 325 },
231 { 326 {
232 .flags = 0, 327 .flags = 0,
@@ -243,6 +338,9 @@ static struct platform_device sci_device = {
243 338
244static struct platform_device *sh7722_devices[] __initdata = { 339static struct platform_device *sh7722_devices[] __initdata = {
245 &cmt_device, 340 &cmt_device,
341 &tmu0_device,
342 &tmu1_device,
343 &tmu2_device,
246 &rtc_device, 344 &rtc_device,
247 &usbf_device, 345 &usbf_device,
248 &iic_device, 346 &iic_device,
@@ -254,12 +352,6 @@ static struct platform_device *sh7722_devices[] __initdata = {
254 352
255static int __init sh7722_devices_setup(void) 353static int __init sh7722_devices_setup(void)
256{ 354{
257 clk_always_enable("uram0"); /* URAM */
258 clk_always_enable("xymem0"); /* XYMEM */
259 clk_always_enable("veu0"); /* VEU */
260 clk_always_enable("vpu0"); /* VPU */
261 clk_always_enable("jpu0"); /* JPU */
262
263 platform_resource_setup_memory(&vpu_device, "vpu", 1 << 20); 355 platform_resource_setup_memory(&vpu_device, "vpu", 1 << 20);
264 platform_resource_setup_memory(&veu_device, "veu", 2 << 20); 356 platform_resource_setup_memory(&veu_device, "veu", 2 << 20);
265 platform_resource_setup_memory(&jpu_device, "jpu", 2 << 20); 357 platform_resource_setup_memory(&jpu_device, "jpu", 2 << 20);
@@ -269,6 +361,19 @@ static int __init sh7722_devices_setup(void)
269} 361}
270__initcall(sh7722_devices_setup); 362__initcall(sh7722_devices_setup);
271 363
364static struct platform_device *sh7722_early_devices[] __initdata = {
365 &cmt_device,
366 &tmu0_device,
367 &tmu1_device,
368 &tmu2_device,
369};
370
371void __init plat_early_device_setup(void)
372{
373 early_platform_add_devices(sh7722_early_devices,
374 ARRAY_SIZE(sh7722_early_devices));
375}
376
272enum { 377enum {
273 UNUSED=0, 378 UNUSED=0,
274 379