1 Index: linux-2.6.24.7/drivers/usb/host/ehci.h
2 ===================================================================
3 --- linux-2.6.24.7.orig/drivers/usb/host/ehci.h
4 +++ linux-2.6.24.7/drivers/usb/host/ehci.h
5 @@ -730,6 +730,11 @@ ehci_port_speed(struct ehci_hcd *ehci, u
6 #define writel_be(val, addr) out_be32((__force unsigned *)addr, val)
9 +#if defined(CONFIG_ARM) && defined(CONFIG_ARCH_IXP4XX)
10 +#define readl_be(addr) __raw_readl((__force unsigned *)addr)
11 +#define writel_be(val, addr) __raw_writel(val, (__force unsigned *)addr)
14 static inline unsigned int ehci_readl(const struct ehci_hcd *ehci,
17 Index: linux-2.6.24.7/drivers/usb/host/ehci-hcd.c
18 ===================================================================
19 --- linux-2.6.24.7.orig/drivers/usb/host/ehci-hcd.c
20 +++ linux-2.6.24.7/drivers/usb/host/ehci-hcd.c
21 @@ -964,6 +964,11 @@ MODULE_LICENSE ("GPL");
22 #define PLATFORM_DRIVER ehci_ppc_soc_driver
25 +#ifdef CONFIG_ARCH_IXP4XX
26 +#include "ehci-ixp4xx.c"
27 +#define PLATFORM_DRIVER ixp4xx_ehci_driver
30 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
31 !defined(PS3_SYSTEM_BUS_DRIVER)
32 #error "missing bus glue for ehci-hcd"
33 Index: linux-2.6.24.7/drivers/usb/host/ehci-ixp4xx.c
34 ===================================================================
36 +++ linux-2.6.24.7/drivers/usb/host/ehci-ixp4xx.c
39 + * IXP4XX EHCI Host Controller Driver
41 + * Author: Vladimir Barinov <vbarinov@ru.mvista.com>
43 + * Based on "ehci-fsl.c" by Randy Vinson <rvinson@mvista.com>
45 + * 2007 (c) MontaVista Software, Inc. This file is licensed under
46 + * the terms of the GNU General Public License version 2. This program
47 + * is licensed "as is" without any warranty of any kind, whether express
51 +#include <linux/platform_device.h>
53 +static int ixp4xx_ehci_init(struct usb_hcd *hcd)
55 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
58 + ehci->big_endian_desc = 1;
59 + ehci->big_endian_mmio = 1;
61 + ehci->caps = hcd->regs + 0x100;
62 + ehci->regs = hcd->regs + 0x100
63 + + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
64 + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
66 + ehci->is_tdi_rh_tt = 1;
69 + retval = ehci_init(hcd);
73 + ehci_port_power(ehci, 0);
78 +static const struct hc_driver ixp4xx_ehci_hc_driver = {
79 + .description = hcd_name,
80 + .product_desc = "IXP4XX EHCI Host Controller",
81 + .hcd_priv_size = sizeof(struct ehci_hcd),
83 + .flags = HCD_MEMORY | HCD_USB2,
84 + .reset = ixp4xx_ehci_init,
87 + .shutdown = ehci_shutdown,
88 + .urb_enqueue = ehci_urb_enqueue,
89 + .urb_dequeue = ehci_urb_dequeue,
90 + .endpoint_disable = ehci_endpoint_disable,
91 + .get_frame_number = ehci_get_frame,
92 + .hub_status_data = ehci_hub_status_data,
93 + .hub_control = ehci_hub_control,
94 +#if defined(CONFIG_PM)
95 + .bus_suspend = ehci_bus_suspend,
96 + .bus_resume = ehci_bus_resume,
100 +static int ixp4xx_ehci_probe(struct platform_device *pdev)
102 + struct usb_hcd *hcd;
103 + const struct hc_driver *driver = &ixp4xx_ehci_hc_driver;
104 + struct resource *res;
108 + if (usb_disabled())
111 + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
113 + dev_err(&pdev->dev,
114 + "Found HC with no IRQ. Check %s setup!\n",
120 + hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
123 + goto fail_create_hcd;
126 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
128 + dev_err(&pdev->dev,
129 + "Found HC with no register addr. Check %s setup!\n",
132 + goto fail_request_resource;
134 + hcd->rsrc_start = res->start;
135 + hcd->rsrc_len = res->end - res->start + 1;
137 + if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
138 + driver->description)) {
139 + dev_dbg(&pdev->dev, "controller already in use\n");
141 + goto fail_request_resource;
144 + hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
145 + if (hcd->regs == NULL) {
146 + dev_dbg(&pdev->dev, "error mapping memory\n");
151 + retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
158 + iounmap(hcd->regs);
160 + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
161 +fail_request_resource:
164 + dev_err(&pdev->dev, "init %s fail, %d\n", pdev->dev.bus_id, retval);
168 +static int ixp4xx_ehci_remove(struct platform_device *pdev)
170 + struct usb_hcd *hcd = platform_get_drvdata(pdev);
172 + usb_remove_hcd(hcd);
173 + iounmap(hcd->regs);
174 + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
180 +MODULE_ALIAS("platform:ixp4xx-ehci");
182 +static struct platform_driver ixp4xx_ehci_driver = {
183 + .probe = ixp4xx_ehci_probe,
184 + .remove = ixp4xx_ehci_remove,
186 + .name = "ixp4xx-ehci",
187 +// .bus = &platform_bus_type
190 Index: linux-2.6.24.7/drivers/usb/host/Kconfig
191 ===================================================================
192 --- linux-2.6.24.7.orig/drivers/usb/host/Kconfig
193 +++ linux-2.6.24.7/drivers/usb/host/Kconfig
194 @@ -69,12 +69,12 @@ config USB_EHCI_TT_NEWSCHED
196 config USB_EHCI_BIG_ENDIAN_MMIO
198 - depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX)
199 + depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX || ARCH_IXP4XX)
202 config USB_EHCI_BIG_ENDIAN_DESC
204 - depends on USB_EHCI_HCD && 440EPX
205 + depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX)
209 Index: linux-2.6.24.7/drivers/usb/Kconfig
210 ===================================================================
211 --- linux-2.6.24.7.orig/drivers/usb/Kconfig
212 +++ linux-2.6.24.7/drivers/usb/Kconfig
213 @@ -49,6 +49,7 @@ config USB_ARCH_HAS_EHCI
215 default y if PPC_83xx
216 default y if SOC_AU1200
217 + default y if ARCH_IXP4XX
220 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.