1 diff -Nur linux-2.6.24.2/drivers/usb/host/ehci.h linux-2.6.24.2-owrt/drivers/usb/host/ehci.h
2 --- linux-2.6.24.2/drivers/usb/host/ehci.h 2008-02-11 06:51:11.000000000 +0100
3 +++ linux-2.6.24.2-owrt/drivers/usb/host/ehci.h 2008-04-22 12:58:42.000000000 +0200
5 #define writel_be(val, addr) out_be32((__force unsigned *)addr, val)
8 +#if defined(CONFIG_ARM) && defined(CONFIG_ARCH_IXP4XX)
9 +#define readl_be(addr) __raw_readl((__force unsigned *)addr)
10 +#define writel_be(val, addr) __raw_writel(val, (__force unsigned *)addr)
13 static inline unsigned int ehci_readl(const struct ehci_hcd *ehci,
16 diff -Nur linux-2.6.24.2/drivers/usb/host/ehci-hcd.c linux-2.6.24.2-owrt/drivers/usb/host/ehci-hcd.c
17 --- linux-2.6.24.2/drivers/usb/host/ehci-hcd.c 2008-02-11 06:51:11.000000000 +0100
18 +++ linux-2.6.24.2-owrt/drivers/usb/host/ehci-hcd.c 2008-04-22 12:58:42.000000000 +0200
20 #define PLATFORM_DRIVER ehci_ppc_soc_driver
23 +#ifdef CONFIG_ARCH_IXP4XX
24 +#include "ehci-ixp4xx.c"
25 +#define PLATFORM_DRIVER ixp4xx_ehci_driver
28 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
29 !defined(PS3_SYSTEM_BUS_DRIVER)
30 #error "missing bus glue for ehci-hcd"
31 diff -Nur linux-2.6.24.2/drivers/usb/host/ehci-ixp4xx.c linux-2.6.24.2-owrt/drivers/usb/host/ehci-ixp4xx.c
32 --- linux-2.6.24.2/drivers/usb/host/ehci-ixp4xx.c 1970-01-01 01:00:00.000000000 +0100
33 +++ linux-2.6.24.2-owrt/drivers/usb/host/ehci-ixp4xx.c 2008-04-22 12:58:42.000000000 +0200
36 + * IXP4XX EHCI Host Controller Driver
38 + * Author: Vladimir Barinov <vbarinov@ru.mvista.com>
40 + * Based on "ehci-fsl.c" by Randy Vinson <rvinson@mvista.com>
42 + * 2007 (c) MontaVista Software, Inc. This file is licensed under
43 + * the terms of the GNU General Public License version 2. This program
44 + * is licensed "as is" without any warranty of any kind, whether express
48 +#include <linux/platform_device.h>
50 +static int ixp4xx_ehci_init(struct usb_hcd *hcd)
52 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
55 + ehci->big_endian_desc = 1;
56 + ehci->big_endian_mmio = 1;
58 + ehci->caps = hcd->regs + 0x100;
59 + ehci->regs = hcd->regs + 0x100
60 + + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
61 + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
63 + ehci->is_tdi_rh_tt = 1;
66 + retval = ehci_init(hcd);
70 + ehci_port_power(ehci, 0);
75 +static const struct hc_driver ixp4xx_ehci_hc_driver = {
76 + .description = hcd_name,
77 + .product_desc = "IXP4XX EHCI Host Controller",
78 + .hcd_priv_size = sizeof(struct ehci_hcd),
80 + .flags = HCD_MEMORY | HCD_USB2,
81 + .reset = ixp4xx_ehci_init,
84 + .shutdown = ehci_shutdown,
85 + .urb_enqueue = ehci_urb_enqueue,
86 + .urb_dequeue = ehci_urb_dequeue,
87 + .endpoint_disable = ehci_endpoint_disable,
88 + .get_frame_number = ehci_get_frame,
89 + .hub_status_data = ehci_hub_status_data,
90 + .hub_control = ehci_hub_control,
91 +#if defined(CONFIG_PM)
92 + .bus_suspend = ehci_bus_suspend,
93 + .bus_resume = ehci_bus_resume,
97 +static int ixp4xx_ehci_probe(struct platform_device *pdev)
99 + struct usb_hcd *hcd;
100 + const struct hc_driver *driver = &ixp4xx_ehci_hc_driver;
101 + struct resource *res;
105 + if (usb_disabled())
108 + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
110 + dev_err(&pdev->dev,
111 + "Found HC with no IRQ. Check %s setup!\n",
117 + hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
120 + goto fail_create_hcd;
123 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
125 + dev_err(&pdev->dev,
126 + "Found HC with no register addr. Check %s setup!\n",
129 + goto fail_request_resource;
131 + hcd->rsrc_start = res->start;
132 + hcd->rsrc_len = res->end - res->start + 1;
134 + if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
135 + driver->description)) {
136 + dev_dbg(&pdev->dev, "controller already in use\n");
138 + goto fail_request_resource;
141 + hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
142 + if (hcd->regs == NULL) {
143 + dev_dbg(&pdev->dev, "error mapping memory\n");
148 + retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
155 + iounmap(hcd->regs);
157 + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
158 +fail_request_resource:
161 + dev_err(&pdev->dev, "init %s fail, %d\n", pdev->dev.bus_id, retval);
165 +static int ixp4xx_ehci_remove(struct platform_device *pdev)
167 + struct usb_hcd *hcd = platform_get_drvdata(pdev);
169 + usb_remove_hcd(hcd);
170 + iounmap(hcd->regs);
171 + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
177 +MODULE_ALIAS("platform:ixp4xx-ehci");
179 +static struct platform_driver ixp4xx_ehci_driver = {
180 + .probe = ixp4xx_ehci_probe,
181 + .remove = ixp4xx_ehci_remove,
183 + .name = "ixp4xx-ehci",
184 +// .bus = &platform_bus_type
187 diff -Nur linux-2.6.24.2/drivers/usb/host/Kconfig linux-2.6.24.2-owrt/drivers/usb/host/Kconfig
188 --- linux-2.6.24.2/drivers/usb/host/Kconfig 2008-02-11 06:51:11.000000000 +0100
189 +++ linux-2.6.24.2-owrt/drivers/usb/host/Kconfig 2008-04-22 12:58:42.000000000 +0200
192 config USB_EHCI_BIG_ENDIAN_MMIO
194 - depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX)
195 + depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX || ARCH_IXP4XX)
198 config USB_EHCI_BIG_ENDIAN_DESC
200 - depends on USB_EHCI_HCD && 440EPX
201 + depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX)
205 diff -Nur linux-2.6.24.2/drivers/usb/Kconfig linux-2.6.24.2-owrt/drivers/usb/Kconfig
206 --- linux-2.6.24.2/drivers/usb/Kconfig 2008-02-11 06:51:11.000000000 +0100
207 +++ linux-2.6.24.2-owrt/drivers/usb/Kconfig 2008-04-22 12:58:42.000000000 +0200
210 default y if PPC_83xx
211 default y if SOC_AU1200
212 + default y if ARCH_IXP4XX
215 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.