aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2009-09-25 07:11:32 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-10-25 12:00:33 -0400
commitf51f78c06c7fb442d304b93b68b3a1ebe3785a55 (patch)
treeb93409cff89072685231a64bbabdba90a8db3187 /arch/arm/mach-at91
parent2fdc246aaf9a7fa088451ad2a72e9119b5f7f029 (diff)
ARM: 5726/1: at91/USB: at91sam9g45 series USB host integration
This is the at91 specific part of USB host integration. The EHCI high speed controller has a companion OHCI controller to manage USB full and low speed. They are sharing the same IRQ line and vbus pin. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c56
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c1
-rw-r--r--arch/arm/mach-at91/include/mach/board.h1
3 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index d581cff80c4c..003f4f91fa52 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -131,6 +131,62 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {}
131 131
132 132
133/* -------------------------------------------------------------------- 133/* --------------------------------------------------------------------
134 * USB Host HS (EHCI)
135 * Needs an OHCI host for low and full speed management
136 * -------------------------------------------------------------------- */
137
138#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
139static u64 ehci_dmamask = DMA_BIT_MASK(32);
140static struct at91_usbh_data usbh_ehci_data;
141
142static struct resource usbh_ehci_resources[] = {
143 [0] = {
144 .start = AT91SAM9G45_EHCI_BASE,
145 .end = AT91SAM9G45_EHCI_BASE + SZ_1M - 1,
146 .flags = IORESOURCE_MEM,
147 },
148 [1] = {
149 .start = AT91SAM9G45_ID_UHPHS,
150 .end = AT91SAM9G45_ID_UHPHS,
151 .flags = IORESOURCE_IRQ,
152 },
153};
154
155static struct platform_device at91_usbh_ehci_device = {
156 .name = "atmel-ehci",
157 .id = -1,
158 .dev = {
159 .dma_mask = &ehci_dmamask,
160 .coherent_dma_mask = DMA_BIT_MASK(32),
161 .platform_data = &usbh_ehci_data,
162 },
163 .resource = usbh_ehci_resources,
164 .num_resources = ARRAY_SIZE(usbh_ehci_resources),
165};
166
167void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)
168{
169 int i;
170
171 if (!data)
172 return;
173
174 /* Enable VBus control for UHP ports */
175 for (i = 0; i < data->ports; i++) {
176 if (data->vbus_pin[i])
177 at91_set_gpio_output(data->vbus_pin[i], 0);
178 }
179
180 usbh_ehci_data = *data;
181 at91_clock_associate("uhphs_clk", &at91_usbh_ehci_device.dev, "ehci_clk");
182 platform_device_register(&at91_usbh_ehci_device);
183}
184#else
185void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data) {}
186#endif
187
188
189/* --------------------------------------------------------------------
134 * USB HS Device (Gadget) 190 * USB HS Device (Gadget)
135 * -------------------------------------------------------------------- */ 191 * -------------------------------------------------------------------- */
136 192
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 64c3843f323d..1cf4d8681078 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -366,6 +366,7 @@ static void __init ek_board_init(void)
366 at91_add_device_serial(); 366 at91_add_device_serial();
367 /* USB HS Host */ 367 /* USB HS Host */
368 at91_add_device_usbh_ohci(&ek_usbh_hs_data); 368 at91_add_device_usbh_ohci(&ek_usbh_hs_data);
369 at91_add_device_usbh_ehci(&ek_usbh_hs_data);
369 /* USB HS Device */ 370 /* USB HS Device */
370 at91_add_device_usba(&ek_usba_udc_data); 371 at91_add_device_usba(&ek_usba_udc_data);
371 /* SPI */ 372 /* SPI */
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 2f4fcedc02ba..2295d80dd893 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -98,6 +98,7 @@ struct at91_usbh_data {
98}; 98};
99extern void __init at91_add_device_usbh(struct at91_usbh_data *data); 99extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
100extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data); 100extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data);
101extern void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data);
101 102
102 /* NAND / SmartMedia */ 103 /* NAND / SmartMedia */
103struct atmel_nand_data { 104struct atmel_nand_data {