rendered paste bodyIndex: firmware/target/arm/usb-fw-pp502x.c
===================================================================
--- firmware/target/arm/usb-fw-pp502x.c (revision 16396)
+++ firmware/target/arm/usb-fw-pp502x.c (working copy)
@@ -180,20 +180,26 @@
/* Disable USB devices */
DEV_EN &=~ DEV_USB0;
DEV_EN &=~ DEV_USB1;
-#if CONFIG_CPU == PP5020
DEV_INIT2 &=~ INIT_USB;
-#endif
return status;
+
} else {
- /* if USB is detected, re-enable the USB-devices, otherwise make sure it's disabled */
+ /* if USB is detected, re-enable the USB-devices */
DEV_EN |= DEV_USB0;
+ DEV_EN |= DEV_USB1;
+
+ /* reset both USBs */
+ DEV_RS |= DEV_USB0;
DEV_RS &=~DEV_USB0;
- DEV_EN |= DEV_USB1;
+ DEV_RS |= DEV_USB1;
DEV_RS &=~DEV_USB1;
-#if CONFIG_CPU == PP5020
+
DEV_INIT2 |= INIT_USB;
-#endif
+
+ while ((inl(0x70000028) & 0x80) == 0);
+ outl(inl(0x70000028) | 0x2, 0x70000028);
+ udelay(0x186A0);
}
/* Run the USB stack to request full bus power */