summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-02-17 22:24:00 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-02-17 22:24:00 +0000
commit25be896b9fed6f3dbaf7787d1ebbe3152664495e (patch)
treef986607a45c7993c450c218e7f1b863c12f7482a
parent00baccd945d3dc2e561c7a982fe77f9755777ebe (diff)
downloadrockbox-25be896b9fed6f3dbaf7787d1ebbe3152664495e.zip
rockbox-25be896b9fed6f3dbaf7787d1ebbe3152664495e.tar.gz
rockbox-25be896b9fed6f3dbaf7787d1ebbe3152664495e.tar.bz2
rockbox-25be896b9fed6f3dbaf7787d1ebbe3152664495e.tar.xz
PP5022/PP5024-specific USB init which may fix "signal quality issues"
FS#9923 by Boris Gjenero (dreamlayers) This is reasonably likely to finally solve the USB issues on PP5022 and PP5024, but more testing is needed before USB will be considered stable enough to be enabled by default git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20032 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/usb-drv-arc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c
index 5a08acb..af97e3e 100644
--- a/firmware/target/arm/usb-drv-arc.c
+++ b/firmware/target/arm/usb-drv-arc.c
@@ -388,6 +388,30 @@ void usb_drv_reset(void)
sleep(HZ/20);
REG_USBCMD |= USBCMD_CTRL_RESET;
while (REG_USBCMD & USBCMD_CTRL_RESET);
+
+#if CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
+ /* On a CPU which identifies as a PP5022, this
+ initialization must be done after USB is reset.
+ */
+ outl(inl(0x70000060) | 0xF, 0x70000060);
+ outl(inl(0x70000028) | 0x10000, 0x70000028);
+ outl(inl(0x70000028) & ~0x10000, 0x70000028);
+ outl(inl(0x70000060) & ~0x20, 0x70000060);
+ udelay(10);
+ outl(inl(0x70000060) | 0x20, 0x70000060);
+ udelay(10);
+ outl((inl(0x70000060) & ~0xF) | 4, 0x70000060);
+ udelay(10);
+ outl(inl(0x70000060) & ~0x20, 0x70000060);
+ udelay(10);
+ outl(inl(0x70000060) & ~0xF, 0x70000060);
+ udelay(10);
+ outl(inl(0x70000060) | 0x20, 0x70000060);
+ udelay(10);
+ outl(inl(0x70000028) | 0x800, 0x70000028);
+ outl(inl(0x70000028) & ~0x800, 0x70000028);
+ while (inl(0x70000028) & 0x80);
+#endif
}
/* One-time driver startup init */