ar71xx: add kernel support for the Allnet ALL0258N board
[openwrt/openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / dev-usb.c
index f7788b5702d04d8c19a196d39e740617fb883f29..f6735713237add74b3f5b1444ef68ffb4e65e430 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] = {
@@ -165,6 +165,23 @@ static void __init ar91xx_usb_setup(void)
        platform_device_register(&ar71xx_ehci_device);
 }
 
+static void __init ar933x_usb_setup(void)
+{
+       ar71xx_device_reset_rmw(0, AR933X_RESET_USBSUS_OVERRIDE);
+       mdelay(10);
+
+       ar71xx_device_reset_rmw(AR933X_RESET_USB_HOST,
+                               AR933X_RESET_USBSUS_OVERRIDE);
+       mdelay(10);
+
+       ar71xx_device_reset_rmw(AR933X_RESET_USB_PHY,
+                               AR933X_RESET_USBSUS_OVERRIDE);
+       mdelay(10);
+
+       ar71xx_ehci_data.is_ar91xx = 1;
+       platform_device_register(&ar71xx_ehci_device);
+}
+
 void __init ar71xx_add_device_usb(void)
 {
        switch (ar71xx_soc) {
@@ -185,9 +202,17 @@ void __init ar71xx_add_device_usb(void)
 
        case AR71XX_SOC_AR9130:
        case AR71XX_SOC_AR9132:
+       case AR71XX_SOC_AR9341:
+       case AR71XX_SOC_AR9342:
+       case AR71XX_SOC_AR9344:
                ar91xx_usb_setup();
                break;
 
+       case AR71XX_SOC_AR9330:
+       case AR71XX_SOC_AR9331:
+               ar933x_usb_setup();
+               break;
+
        default:
                BUG();
        }