diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-11-29 23:37:33 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-11-29 23:44:08 -0500 |
commit | 25338f2e09fcbaa0470841c928bf0e718ca13382 (patch) | |
tree | 76049bce7307df6436776bec8cb78fe2d13f6d49 /arch/arm/mach-shmobile/board-mackerel.c | |
parent | eb87e6770a9b1ad54b13fcfe80a1346d0c257536 (diff) |
ARM: mach-shmobile: mackerel: Add USB1(Host) support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index e6407cc6fec7..f9418e72900b 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/mtd/partitions.h> | 33 | #include <linux/mtd/partitions.h> |
34 | #include <linux/mtd/physmap.h> | 34 | #include <linux/mtd/physmap.h> |
35 | #include <linux/smsc911x.h> | 35 | #include <linux/smsc911x.h> |
36 | #include <linux/usb/r8a66597.h> | ||
36 | 37 | ||
37 | #include <video/sh_mobile_lcdc.h> | 38 | #include <video/sh_mobile_lcdc.h> |
38 | 39 | ||
@@ -114,8 +115,22 @@ | |||
114 | * IRQ9 | ICR2A.IRQ9SA=0010 | KEY(TCA6408) | Low | 115 | * IRQ9 | ICR2A.IRQ9SA=0010 | KEY(TCA6408) | Low |
115 | * IRQ21 | ICR4A.IRQ21SA=0011 | Sensor(ADXL345) | High | 116 | * IRQ21 | ICR4A.IRQ21SA=0011 | Sensor(ADXL345) | High |
116 | * IRQ22 | ICR4A.IRQ22SA=0011 | Sensor(AK8975) | High | 117 | * IRQ22 | ICR4A.IRQ22SA=0011 | Sensor(AK8975) | High |
118 | */ | ||
117 | 119 | ||
118 | */ | 120 | /* |
121 | * USB | ||
122 | * | ||
123 | * USB0 : CN22 : Function | ||
124 | * USB1 : CN31 : Function/Host *1 | ||
125 | * | ||
126 | * J30 (for CN31) *1 | ||
127 | * ----------+---------------+------------- | ||
128 | * 1-2 short | VBUS 5V | Host | ||
129 | * open | external VBUS | Function | ||
130 | * | ||
131 | * *1 | ||
132 | * CN31 is used as Host in Linux. | ||
133 | */ | ||
119 | 134 | ||
120 | /* MTD */ | 135 | /* MTD */ |
121 | static struct mtd_partition nor_flash_partitions[] = { | 136 | static struct mtd_partition nor_flash_partitions[] = { |
@@ -254,10 +269,51 @@ static struct platform_device lcdc_device = { | |||
254 | }, | 269 | }, |
255 | }; | 270 | }; |
256 | 271 | ||
272 | /* USB1 (Host) */ | ||
273 | static void usb1_host_port_power(int port, int power) | ||
274 | { | ||
275 | if (!power) /* only power-on is supported for now */ | ||
276 | return; | ||
277 | |||
278 | /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */ | ||
279 | __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008); | ||
280 | } | ||
281 | |||
282 | static struct r8a66597_platdata usb1_host_data = { | ||
283 | .on_chip = 1, | ||
284 | .port_power = usb1_host_port_power, | ||
285 | }; | ||
286 | |||
287 | static struct resource usb1_host_resources[] = { | ||
288 | [0] = { | ||
289 | .name = "USBHS", | ||
290 | .start = 0xE68B0000, | ||
291 | .end = 0xE68B00E6 - 1, | ||
292 | .flags = IORESOURCE_MEM, | ||
293 | }, | ||
294 | [1] = { | ||
295 | .start = evt2irq(0x1ce0) /* USB1_USB1I0 */, | ||
296 | .flags = IORESOURCE_IRQ, | ||
297 | }, | ||
298 | }; | ||
299 | |||
300 | static struct platform_device usb1_host_device = { | ||
301 | .name = "r8a66597_hcd", | ||
302 | .id = 1, | ||
303 | .dev = { | ||
304 | .dma_mask = NULL, /* not use dma */ | ||
305 | .coherent_dma_mask = 0xffffffff, | ||
306 | .platform_data = &usb1_host_data, | ||
307 | }, | ||
308 | .num_resources = ARRAY_SIZE(usb1_host_resources), | ||
309 | .resource = usb1_host_resources, | ||
310 | }; | ||
311 | |||
257 | static struct platform_device *mackerel_devices[] __initdata = { | 312 | static struct platform_device *mackerel_devices[] __initdata = { |
258 | &nor_flash_device, | 313 | &nor_flash_device, |
259 | &smc911x_device, | 314 | &smc911x_device, |
260 | &lcdc_device, | 315 | &lcdc_device, |
316 | &usb1_host_device, | ||
261 | }; | 317 | }; |
262 | 318 | ||
263 | static struct map_desc mackerel_io_desc[] __initdata = { | 319 | static struct map_desc mackerel_io_desc[] __initdata = { |
@@ -327,6 +383,17 @@ static void __init mackerel_init(void) | |||
327 | gpio_request(GPIO_PORT151, NULL); /* LCDDON */ | 383 | gpio_request(GPIO_PORT151, NULL); /* LCDDON */ |
328 | gpio_direction_output(GPIO_PORT151, 1); | 384 | gpio_direction_output(GPIO_PORT151, 1); |
329 | 385 | ||
386 | /* USB enable */ | ||
387 | gpio_request(GPIO_FN_VBUS0_1, NULL); | ||
388 | gpio_request(GPIO_FN_IDIN_1_18, NULL); | ||
389 | gpio_request(GPIO_FN_PWEN_1_115, NULL); | ||
390 | gpio_request(GPIO_FN_OVCN_1_114, NULL); | ||
391 | gpio_request(GPIO_FN_EXTLP_1, NULL); | ||
392 | gpio_request(GPIO_FN_OVCN2_1, NULL); | ||
393 | |||
394 | /* setup USB phy */ | ||
395 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ | ||
396 | |||
330 | 397 | ||
331 | sh7372_add_standard_devices(); | 398 | sh7372_add_standard_devices(); |
332 | 399 | ||