aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/usb/platform-uhci.txt12
-rw-r--r--arch/arm/mach-vt8500/bv07.c1
-rw-r--r--arch/arm/mach-vt8500/devices-vt8500.c5
-rw-r--r--arch/arm/mach-vt8500/devices-wm8505.c4
-rw-r--r--arch/arm/mach-vt8500/devices.c11
-rw-r--r--arch/arm/mach-vt8500/devices.h1
-rw-r--r--arch/arm/mach-vt8500/wm8505_7in.c1
-rw-r--r--drivers/usb/host/Kconfig12
-rw-r--r--drivers/usb/host/uhci-hcd.c5
-rw-r--r--drivers/usb/host/uhci-platform.c157
10 files changed, 207 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/usb/platform-uhci.txt b/Documentation/devicetree/bindings/usb/platform-uhci.txt
new file mode 100644
index 000000000000..91477d6830ec
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/platform-uhci.txt
@@ -0,0 +1,12 @@
1Generic Platform UHCI controllers.
2
3Required properties:
4 - compatible: Should be "platform-uhci".
5 - reg: Address range of the uhci registers
6 - interrupts: Should contain the uhci interrupt.
7
8usb: uhci@D8007301 {
9 compatible = "platform-uhci", "usb-uhci";
10 reg = <0xD8007301 0x200>;
11 interrupts = <0>;
12};
diff --git a/arch/arm/mach-vt8500/bv07.c b/arch/arm/mach-vt8500/bv07.c
index f9fbeb2d10e9..6fd9d609ebaa 100644
--- a/arch/arm/mach-vt8500/bv07.c
+++ b/arch/arm/mach-vt8500/bv07.c
@@ -33,6 +33,7 @@ static struct platform_device *devices[] __initdata = {
33 &vt8500_device_uart0, 33 &vt8500_device_uart0,
34 &vt8500_device_lcdc, 34 &vt8500_device_lcdc,
35 &vt8500_device_ehci, 35 &vt8500_device_ehci,
36 &vt8500_device_uhci,
36 &vt8500_device_ge_rops, 37 &vt8500_device_ge_rops,
37 &vt8500_device_pwm, 38 &vt8500_device_pwm,
38 &vt8500_device_pwmbl, 39 &vt8500_device_pwmbl,
diff --git a/arch/arm/mach-vt8500/devices-vt8500.c b/arch/arm/mach-vt8500/devices-vt8500.c
index 19519aeecf37..def7fe393a2c 100644
--- a/arch/arm/mach-vt8500/devices-vt8500.c
+++ b/arch/arm/mach-vt8500/devices-vt8500.c
@@ -48,6 +48,11 @@ void __init vt8500_set_resources(void)
48 tmp[1] = wmt_irq_res(IRQ_EHCI); 48 tmp[1] = wmt_irq_res(IRQ_EHCI);
49 wmt_res_add(&vt8500_device_ehci, tmp, 2); 49 wmt_res_add(&vt8500_device_ehci, tmp, 2);
50 50
51 /* vt8500 uses a single IRQ for both EHCI and UHCI controllers */
52 tmp[0] = wmt_mmio_res(VT8500_UHCI_BASE, SZ_512);
53 tmp[1] = wmt_irq_res(IRQ_EHCI);
54 wmt_res_add(&vt8500_device_uhci, tmp, 2);
55
51 tmp[0] = wmt_mmio_res(VT8500_GEGEA_BASE, SZ_256); 56 tmp[0] = wmt_mmio_res(VT8500_GEGEA_BASE, SZ_256);
52 wmt_res_add(&vt8500_device_ge_rops, tmp, 1); 57 wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
53 58
diff --git a/arch/arm/mach-vt8500/devices-wm8505.c b/arch/arm/mach-vt8500/devices-wm8505.c
index db4594e029f4..c810454178dc 100644
--- a/arch/arm/mach-vt8500/devices-wm8505.c
+++ b/arch/arm/mach-vt8500/devices-wm8505.c
@@ -55,6 +55,10 @@ void __init wm8505_set_resources(void)
55 tmp[1] = wmt_irq_res(IRQ_EHCI); 55 tmp[1] = wmt_irq_res(IRQ_EHCI);
56 wmt_res_add(&vt8500_device_ehci, tmp, 2); 56 wmt_res_add(&vt8500_device_ehci, tmp, 2);
57 57
58 tmp[0] = wmt_mmio_res(WM8505_UHCI_BASE, SZ_512);
59 tmp[1] = wmt_irq_res(IRQ_UHCI);
60 wmt_res_add(&vt8500_device_uhci, tmp, 2);
61
58 tmp[0] = wmt_mmio_res(WM8505_GEGEA_BASE, SZ_256); 62 tmp[0] = wmt_mmio_res(WM8505_GEGEA_BASE, SZ_256);
59 wmt_res_add(&vt8500_device_ge_rops, tmp, 1); 63 wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
60 64
diff --git a/arch/arm/mach-vt8500/devices.c b/arch/arm/mach-vt8500/devices.c
index 1fcdc36b358d..46ff82dad544 100644
--- a/arch/arm/mach-vt8500/devices.c
+++ b/arch/arm/mach-vt8500/devices.c
@@ -204,6 +204,17 @@ struct platform_device vt8500_device_ehci = {
204 }, 204 },
205}; 205};
206 206
207static u64 uhci_dma_mask = DMA_BIT_MASK(32);
208
209struct platform_device vt8500_device_uhci = {
210 .name = "platform-uhci",
211 .id = 0,
212 .dev = {
213 .dma_mask = &uhci_dma_mask,
214 .coherent_dma_mask = DMA_BIT_MASK(32),
215 },
216};
217
207struct platform_device vt8500_device_ge_rops = { 218struct platform_device vt8500_device_ge_rops = {
208 .name = "wmt_ge_rops", 219 .name = "wmt_ge_rops",
209 .id = -1, 220 .id = -1,
diff --git a/arch/arm/mach-vt8500/devices.h b/arch/arm/mach-vt8500/devices.h
index 188d4e17f35c..0e6d9f904c77 100644
--- a/arch/arm/mach-vt8500/devices.h
+++ b/arch/arm/mach-vt8500/devices.h
@@ -81,6 +81,7 @@ extern struct platform_device vt8500_device_uart5;
81extern struct platform_device vt8500_device_lcdc; 81extern struct platform_device vt8500_device_lcdc;
82extern struct platform_device vt8500_device_wm8505_fb; 82extern struct platform_device vt8500_device_wm8505_fb;
83extern struct platform_device vt8500_device_ehci; 83extern struct platform_device vt8500_device_ehci;
84extern struct platform_device vt8500_device_uhci;
84extern struct platform_device vt8500_device_ge_rops; 85extern struct platform_device vt8500_device_ge_rops;
85extern struct platform_device vt8500_device_pwm; 86extern struct platform_device vt8500_device_pwm;
86extern struct platform_device vt8500_device_pwmbl; 87extern struct platform_device vt8500_device_pwmbl;
diff --git a/arch/arm/mach-vt8500/wm8505_7in.c b/arch/arm/mach-vt8500/wm8505_7in.c
index db19886caf7c..4804e2a45574 100644
--- a/arch/arm/mach-vt8500/wm8505_7in.c
+++ b/arch/arm/mach-vt8500/wm8505_7in.c
@@ -32,6 +32,7 @@ static void __iomem *pmc_hiber;
32static struct platform_device *devices[] __initdata = { 32static struct platform_device *devices[] __initdata = {
33 &vt8500_device_uart0, 33 &vt8500_device_uart0,
34 &vt8500_device_ehci, 34 &vt8500_device_ehci,
35 &vt8500_device_uhci,
35 &vt8500_device_wm8505_fb, 36 &vt8500_device_wm8505_fb,
36 &vt8500_device_ge_rops, 37 &vt8500_device_ge_rops,
37 &vt8500_device_pwm, 38 &vt8500_device_pwm,
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 075d2eca8108..c3f619b1f598 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -450,7 +450,7 @@ config USB_OHCI_LITTLE_ENDIAN
450 450
451config USB_UHCI_HCD 451config USB_UHCI_HCD
452 tristate "UHCI HCD (most Intel and VIA) support" 452 tristate "UHCI HCD (most Intel and VIA) support"
453 depends on USB && (PCI || SPARC_LEON) 453 depends on USB && (PCI || SPARC_LEON || ARCH_VT8500)
454 ---help--- 454 ---help---
455 The Universal Host Controller Interface is a standard by Intel for 455 The Universal Host Controller Interface is a standard by Intel for
456 accessing the USB hardware in the PC (which is also called the USB 456 accessing the USB hardware in the PC (which is also called the USB
@@ -468,7 +468,15 @@ config USB_UHCI_HCD
468config USB_UHCI_SUPPORT_NON_PCI_HC 468config USB_UHCI_SUPPORT_NON_PCI_HC
469 bool 469 bool
470 depends on USB_UHCI_HCD 470 depends on USB_UHCI_HCD
471 default y if SPARC_LEON 471 default y if (SPARC_LEON || ARCH_VT8500)
472
473config USB_UHCI_PLATFORM
474 bool "Generic UHCI Platform Driver support"
475 depends on USB_UHCI_SUPPORT_NON_PCI_HC
476 default y if ARCH_VT8500
477 ---help---
478 Enable support for generic UHCI platform devices that require no
479 additional configuration.
472 480
473config USB_UHCI_BIG_ENDIAN_MMIO 481config USB_UHCI_BIG_ENDIAN_MMIO
474 bool 482 bool
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index e4db350602b8..4b9e9aba2665 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -846,6 +846,11 @@ static const char hcd_name[] = "uhci_hcd";
846#define PLATFORM_DRIVER uhci_grlib_driver 846#define PLATFORM_DRIVER uhci_grlib_driver
847#endif 847#endif
848 848
849#ifdef CONFIG_USB_UHCI_PLATFORM
850#include "uhci-platform.c"
851#define PLATFORM_DRIVER uhci_platform_driver
852#endif
853
849#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) 854#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER)
850#error "missing bus glue for uhci-hcd" 855#error "missing bus glue for uhci-hcd"
851#endif 856#endif
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
new file mode 100644
index 000000000000..e4780491df4a
--- /dev/null
+++ b/drivers/usb/host/uhci-platform.c
@@ -0,0 +1,157 @@
1/*
2 * Generic UHCI HCD (Host Controller Driver) for Platform Devices
3 *
4 * Copyright (c) 2011 Tony Prisk <linux@prisktech.co.nz>
5 *
6 * This file is based on uhci-grlib.c
7 * (C) Copyright 2004-2007 Alan Stern, stern@rowland.harvard.edu
8 */
9
10#include <linux/of.h>
11#include <linux/platform_device.h>
12
13static int uhci_platform_init(struct usb_hcd *hcd)
14{
15 struct uhci_hcd *uhci = hcd_to_uhci(hcd);
16
17 uhci->rh_numports = uhci_count_ports(hcd);
18
19 /* Set up pointers to to generic functions */
20 uhci->reset_hc = uhci_generic_reset_hc;
21 uhci->check_and_reset_hc = uhci_generic_check_and_reset_hc;
22
23 /* No special actions need to be taken for the functions below */
24 uhci->con