diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-08-19 05:52:02 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-19 21:32:18 -0400 |
commit | f8f8c0797d73624d6e81dbb9c9e8f85005500ebc (patch) | |
tree | 7a8a21df1849f51590ccab7de291f575d990a0dd /arch/sh/boards | |
parent | 5a1c4cb5bc228662bfb116f1e07ad658915a5742 (diff) |
sh: add r8a66597 usb1 gadget to the se7724 board
Add USB gadget support for port CN26 on the Solution Engine 7724
board. The r8a66597-udc driver is hooked up as a platform device
and some registers are configured to enable the USB in gadget mode.
The hardware driving the USB port is the on-chip USB1 block in
the sh7724 processor configured as USB gadget controller.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-se/7724/setup.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index c04e134474d8..e6bd09f2e14a 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -341,6 +341,35 @@ static struct platform_device sh7724_usb0_host_device = { | |||
341 | .resource = sh7724_usb0_host_resources, | 341 | .resource = sh7724_usb0_host_resources, |
342 | }; | 342 | }; |
343 | 343 | ||
344 | static struct r8a66597_platdata sh7724_usb1_gadget_data = { | ||
345 | .on_chip = 1, | ||
346 | }; | ||
347 | |||
348 | static struct resource sh7724_usb1_gadget_resources[] = { | ||
349 | [0] = { | ||
350 | .start = 0xa4d90000, | ||
351 | .end = 0xa4d90123, | ||
352 | .flags = IORESOURCE_MEM, | ||
353 | }, | ||
354 | [1] = { | ||
355 | .start = 66, | ||
356 | .end = 66, | ||
357 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | ||
358 | }, | ||
359 | }; | ||
360 | |||
361 | static struct platform_device sh7724_usb1_gadget_device = { | ||
362 | .name = "r8a66597_udc", | ||
363 | .id = 1, /* USB1 */ | ||
364 | .dev = { | ||
365 | .dma_mask = NULL, /* not use dma */ | ||
366 | .coherent_dma_mask = 0xffffffff, | ||
367 | .platform_data = &sh7724_usb1_gadget_data, | ||
368 | }, | ||
369 | .num_resources = ARRAY_SIZE(sh7724_usb1_gadget_resources), | ||
370 | .resource = sh7724_usb1_gadget_resources, | ||
371 | }; | ||
372 | |||
344 | static struct platform_device *ms7724se_devices[] __initdata = { | 373 | static struct platform_device *ms7724se_devices[] __initdata = { |
345 | &heartbeat_device, | 374 | &heartbeat_device, |
346 | &smc91x_eth_device, | 375 | &smc91x_eth_device, |
@@ -351,6 +380,7 @@ static struct platform_device *ms7724se_devices[] __initdata = { | |||
351 | &keysc_device, | 380 | &keysc_device, |
352 | &sh_eth_device, | 381 | &sh_eth_device, |
353 | &sh7724_usb0_host_device, | 382 | &sh7724_usb0_host_device, |
383 | &sh7724_usb1_gadget_device, | ||
354 | }; | 384 | }; |
355 | 385 | ||
356 | #define EEPROM_OP 0xBA206000 | 386 | #define EEPROM_OP 0xBA206000 |
@@ -459,6 +489,9 @@ static int __init devices_setup(void) | |||
459 | /* enable USB0 port */ | 489 | /* enable USB0 port */ |
460 | ctrl_outw(0x0600, 0xa40501d4); | 490 | ctrl_outw(0x0600, 0xa40501d4); |
461 | 491 | ||
492 | /* enable USB1 port */ | ||
493 | ctrl_outw(0x0600, 0xa4050192); | ||
494 | |||
462 | /* enable IRQ 0,1,2 */ | 495 | /* enable IRQ 0,1,2 */ |
463 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | 496 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); |
464 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); | 497 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); |