ar71xx: backport ar7241/ar7242 fixes from trunk
[openwrt-10.03/.git] / target / linux / ar71xx / files / arch / mips / ar71xx / dev-usb.c
index 514ab3d7b7a9ff40ec4fd824b152f1652a8e773d..20ab17f0c358147d8e2fda1479090cb813c2bf0b 100644 (file)
@@ -64,7 +64,7 @@ static struct platform_device ar71xx_ohci_device = {
 };
 
 /*
- * EHCI (USB full speed host controller)
+ * EHCI (USB high/full speed host controller)
  */
 static struct resource ar71xx_ehci_resources[] = {
        [0] = {
@@ -130,10 +130,26 @@ static void __init ar7240_usb_setup(void)
 
        ar71xx_ohci_device.resource = ar7240_ohci_resources;
        ar71xx_ohci_device.num_resources = ARRAY_SIZE(ar7240_ohci_resources);
-
        platform_device_register(&ar71xx_ohci_device);
 }
 
+static void __init ar7241_usb_setup(void)
+{
+       ar71xx_device_start(AR724X_RESET_USBSUS_OVERRIDE);
+       mdelay(10);
+
+       ar71xx_device_start(AR724X_RESET_USB_HOST);
+       mdelay(10);
+
+       ar71xx_device_start(AR724X_RESET_USB_PHY);
+       mdelay(10);
+
+       ar71xx_ehci_data.is_ar91xx = 1;
+       ar71xx_ehci_device.resource = ar7240_ohci_resources;
+       ar71xx_ehci_device.num_resources = ARRAY_SIZE(ar7240_ohci_resources);
+       platform_device_register(&ar71xx_ehci_device);
+}
+
 static void __init ar91xx_usb_setup(void)
 {
        ar71xx_device_stop(RESET_MODULE_USBSUS_OVERRIDE);
@@ -156,6 +172,11 @@ void __init ar71xx_add_device_usb(void)
                ar7240_usb_setup();
                break;
 
+       case AR71XX_SOC_AR7241:
+       case AR71XX_SOC_AR7242:
+               ar7241_usb_setup();
+               break;
+
        case AR71XX_SOC_AR7130:
        case AR71XX_SOC_AR7141:
        case AR71XX_SOC_AR7161: