diff options
Diffstat (limited to 'arch/sh/boards/mach-se/7724/setup.c')
-rw-r--r-- | arch/sh/boards/mach-se/7724/setup.c | 110 |
1 files changed, 98 insertions, 12 deletions
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 15456a0773bf..00973e0f8c63 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -39,7 +39,15 @@ | |||
39 | * SW41 : abxx xxxx -> a = 0 : Analog monitor | 39 | * SW41 : abxx xxxx -> a = 0 : Analog monitor |
40 | * 1 : Digital monitor | 40 | * 1 : Digital monitor |
41 | * b = 0 : VGA | 41 | * b = 0 : VGA |
42 | * 1 : SVGA | 42 | * 1 : 720p |
43 | */ | ||
44 | |||
45 | /* | ||
46 | * about 720p | ||
47 | * | ||
48 | * When you use 1280 x 720 lcdc output, | ||
49 | * you should change OSC6 lcdc clock from 25.175MHz to 74.25MHz, | ||
50 | * and change SW41 to use 720p | ||
43 | */ | 51 | */ |
44 | 52 | ||
45 | /* Heartbeat */ | 53 | /* Heartbeat */ |
@@ -158,7 +166,7 @@ static struct resource lcdc_resources[] = { | |||
158 | [0] = { | 166 | [0] = { |
159 | .name = "LCDC", | 167 | .name = "LCDC", |
160 | .start = 0xfe940000, | 168 | .start = 0xfe940000, |
161 | .end = 0xfe941fff, | 169 | .end = 0xfe942fff, |
162 | .flags = IORESOURCE_MEM, | 170 | .flags = IORESOURCE_MEM, |
163 | }, | 171 | }, |
164 | [1] = { | 172 | [1] = { |
@@ -174,6 +182,9 @@ static struct platform_device lcdc_device = { | |||
174 | .dev = { | 182 | .dev = { |
175 | .platform_data = &lcdc_info, | 183 | .platform_data = &lcdc_info, |
176 | }, | 184 | }, |
185 | .archdata = { | ||
186 | .hwblk_id = HWBLK_LCDC, | ||
187 | }, | ||
177 | }; | 188 | }; |
178 | 189 | ||
179 | /* CEU0 */ | 190 | /* CEU0 */ |
@@ -205,6 +216,9 @@ static struct platform_device ceu0_device = { | |||
205 | .dev = { | 216 | .dev = { |
206 | .platform_data = &sh_mobile_ceu0_info, | 217 | .platform_data = &sh_mobile_ceu0_info, |
207 | }, | 218 | }, |
219 | .archdata = { | ||
220 | .hwblk_id = HWBLK_CEU0, | ||
221 | }, | ||
208 | }; | 222 | }; |
209 | 223 | ||
210 | /* CEU1 */ | 224 | /* CEU1 */ |
@@ -236,6 +250,9 @@ static struct platform_device ceu1_device = { | |||
236 | .dev = { | 250 | .dev = { |
237 | .platform_data = &sh_mobile_ceu1_info, | 251 | .platform_data = &sh_mobile_ceu1_info, |
238 | }, | 252 | }, |
253 | .archdata = { | ||
254 | .hwblk_id = HWBLK_CEU1, | ||
255 | }, | ||
239 | }; | 256 | }; |
240 | 257 | ||
241 | /* KEYSC in SoC (Needs SW33-2 set to ON) */ | 258 | /* KEYSC in SoC (Needs SW33-2 set to ON) */ |
@@ -274,6 +291,9 @@ static struct platform_device keysc_device = { | |||
274 | .dev = { | 291 | .dev = { |
275 | .platform_data = &keysc_info, | 292 | .platform_data = &keysc_info, |
276 | }, | 293 | }, |
294 | .archdata = { | ||
295 | .hwblk_id = HWBLK_KEYSC, | ||
296 | }, | ||
277 | }; | 297 | }; |
278 | 298 | ||
279 | /* SH Eth */ | 299 | /* SH Eth */ |
@@ -302,15 +322,19 @@ static struct platform_device sh_eth_device = { | |||
302 | }, | 322 | }, |
303 | .num_resources = ARRAY_SIZE(sh_eth_resources), | 323 | .num_resources = ARRAY_SIZE(sh_eth_resources), |
304 | .resource = sh_eth_resources, | 324 | .resource = sh_eth_resources, |
325 | .archdata = { | ||
326 | .hwblk_id = HWBLK_ETHER, | ||
327 | }, | ||
305 | }; | 328 | }; |
306 | 329 | ||
307 | static struct r8a66597_platdata sh7724_usb0_host_data = { | 330 | static struct r8a66597_platdata sh7724_usb0_host_data = { |
331 | .on_chip = 1, | ||
308 | }; | 332 | }; |
309 | 333 | ||
310 | static struct resource sh7724_usb0_host_resources[] = { | 334 | static struct resource sh7724_usb0_host_resources[] = { |
311 | [0] = { | 335 | [0] = { |
312 | .start = 0xa4d80000, | 336 | .start = 0xa4d80000, |
313 | .end = 0xa4d800ff, | 337 | .end = 0xa4d80124 - 1, |
314 | .flags = IORESOURCE_MEM, | 338 | .flags = IORESOURCE_MEM, |
315 | }, | 339 | }, |
316 | [1] = { | 340 | [1] = { |
@@ -330,6 +354,38 @@ static struct platform_device sh7724_usb0_host_device = { | |||
330 | }, | 354 | }, |
331 | .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources), | 355 | .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources), |
332 | .resource = sh7724_usb0_host_resources, | 356 | .resource = sh7724_usb0_host_resources, |
357 | .archdata = { | ||
358 | .hwblk_id = HWBLK_USB0, | ||
359 | }, | ||
360 | }; | ||
361 | |||
362 | static struct r8a66597_platdata sh7724_usb1_gadget_data = { | ||
363 | .on_chip = 1, | ||
364 | }; | ||
365 | |||
366 | static struct resource sh7724_usb1_gadget_resources[] = { | ||
367 | [0] = { | ||
368 | .start = 0xa4d90000, | ||
369 | .end = 0xa4d90123, | ||
370 | .flags = IORESOURCE_MEM, | ||
371 | }, | ||
372 | [1] = { | ||
373 | .start = 66, | ||
374 | .end = 66, | ||
375 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | ||
376 | }, | ||
377 | }; | ||
378 | |||
379 | static struct platform_device sh7724_usb1_gadget_device = { | ||
380 | .name = "r8a66597_udc", | ||
381 | .id = 1, /* USB1 */ | ||
382 | .dev = { | ||
383 | .dma_mask = NULL, /* not use dma */ | ||
384 | .coherent_dma_mask = 0xffffffff, | ||
385 | .platform_data = &sh7724_usb1_gadget_data, | ||
386 | }, | ||
387 | .num_resources = ARRAY_SIZE(sh7724_usb1_gadget_resources), | ||
388 | .resource = sh7724_usb1_gadget_resources, | ||
333 | }; | 389 | }; |
334 | 390 | ||
335 | static struct platform_device *ms7724se_devices[] __initdata = { | 391 | static struct platform_device *ms7724se_devices[] __initdata = { |
@@ -342,6 +398,7 @@ static struct platform_device *ms7724se_devices[] __initdata = { | |||
342 | &keysc_device, | 398 | &keysc_device, |
343 | &sh_eth_device, | 399 | &sh_eth_device, |
344 | &sh7724_usb0_host_device, | 400 | &sh7724_usb0_host_device, |
401 | &sh7724_usb1_gadget_device, | ||
345 | }; | 402 | }; |
346 | 403 | ||
347 | #define EEPROM_OP 0xBA206000 | 404 | #define EEPROM_OP 0xBA206000 |
@@ -421,9 +478,38 @@ static int __init devices_setup(void) | |||
421 | /* turn on USB clocks, use external clock */ | 478 | /* turn on USB clocks, use external clock */ |
422 | ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); | 479 | ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); |
423 | 480 | ||
481 | #ifdef CONFIG_PM | ||
482 | /* Let LED9 show STATUS2 */ | ||
483 | gpio_request(GPIO_FN_STATUS2, NULL); | ||
484 | |||
485 | /* Lit LED10 show STATUS0 */ | ||
486 | gpio_request(GPIO_FN_STATUS0, NULL); | ||
487 | |||
488 | /* Lit LED11 show PDSTATUS */ | ||
489 | gpio_request(GPIO_FN_PDSTATUS, NULL); | ||
490 | #else | ||
491 | /* Lit LED9 */ | ||
492 | gpio_request(GPIO_PTJ6, NULL); | ||
493 | gpio_direction_output(GPIO_PTJ6, 1); | ||
494 | gpio_export(GPIO_PTJ6, 0); | ||
495 | |||
496 | /* Lit LED10 */ | ||
497 | gpio_request(GPIO_PTJ5, NULL); | ||
498 | gpio_direction_output(GPIO_PTJ5, 1); | ||
499 | gpio_export(GPIO_PTJ5, 0); | ||
500 | |||
501 | /* Lit LED11 */ | ||
502 | gpio_request(GPIO_PTJ7, NULL); | ||
503 | gpio_direction_output(GPIO_PTJ7, 1); | ||
504 | gpio_export(GPIO_PTJ7, 0); | ||
505 | #endif | ||
506 | |||
424 | /* enable USB0 port */ | 507 | /* enable USB0 port */ |
425 | ctrl_outw(0x0600, 0xa40501d4); | 508 | ctrl_outw(0x0600, 0xa40501d4); |
426 | 509 | ||
510 | /* enable USB1 port */ | ||
511 | ctrl_outw(0x0600, 0xa4050192); | ||
512 | |||
427 | /* enable IRQ 0,1,2 */ | 513 | /* enable IRQ 0,1,2 */ |
428 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | 514 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); |
429 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); | 515 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); |
@@ -546,15 +632,15 @@ static int __init devices_setup(void) | |||
546 | sh_eth_init(); | 632 | sh_eth_init(); |
547 | 633 | ||
548 | if (sw & SW41_B) { | 634 | if (sw & SW41_B) { |
549 | /* SVGA */ | 635 | /* 720p */ |
550 | lcdc_info.ch[0].lcd_cfg.xres = 800; | 636 | lcdc_info.ch[0].lcd_cfg.xres = 1280; |
551 | lcdc_info.ch[0].lcd_cfg.yres = 600; | 637 | lcdc_info.ch[0].lcd_cfg.yres = 720; |
552 | lcdc_info.ch[0].lcd_cfg.left_margin = 142; | 638 | lcdc_info.ch[0].lcd_cfg.left_margin = 220; |
553 | lcdc_info.ch[0].lcd_cfg.right_margin = 52; | 639 | lcdc_info.ch[0].lcd_cfg.right_margin = 110; |
554 | lcdc_info.ch[0].lcd_cfg.hsync_len = 96; | 640 | lcdc_info.ch[0].lcd_cfg.hsync_len = 40; |
555 | lcdc_info.ch[0].lcd_cfg.upper_margin = 24; | 641 | lcdc_info.ch[0].lcd_cfg.upper_margin = 20; |
556 | lcdc_info.ch[0].lcd_cfg.lower_margin = 2; | 642 | lcdc_info.ch[0].lcd_cfg.lower_margin = 5; |
557 | lcdc_info.ch[0].lcd_cfg.vsync_len = 2; | 643 | lcdc_info.ch[0].lcd_cfg.vsync_len = 5; |
558 | } else { | 644 | } else { |
559 | /* VGA */ | 645 | /* VGA */ |
560 | lcdc_info.ch[0].lcd_cfg.xres = 640; | 646 | lcdc_info.ch[0].lcd_cfg.xres = 640; |