summaryrefslogtreecommitdiff
path: root/firmware/target/arm/usb-s3c6400x.c
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2011-12-31 01:54:58 +0000
committerMichael Sparmann <theseven@rockbox.org>2011-12-31 01:54:58 +0000
commit07605a659e06efaedb325e9a91214be503188f06 (patch)
tree35a5372b378fd9d26ae9a82bac61647ba9f72f28 /firmware/target/arm/usb-s3c6400x.c
parent4c2126b5a8b0bea04d4c5ba8bee032f9bc0efbe0 (diff)
usb-s3c6400x: Fix endpoints being enabled too late
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31469 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/usb-s3c6400x.c')
-rw-r--r--firmware/target/arm/usb-s3c6400x.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/target/arm/usb-s3c6400x.c b/firmware/target/arm/usb-s3c6400x.c
index 1bd02f9e51..4b0382d2cd 100644
--- a/firmware/target/arm/usb-s3c6400x.c
+++ b/firmware/target/arm/usb-s3c6400x.c
@@ -85,21 +85,22 @@ static void reset_endpoints(int reinit)
DEPDMA(0, true) = &ctrlreq;
DEPCTL(0, true) |= DEPCTL_epena | DEPCTL_cnak;
+ /* HACK: Enable all endpoints here, because we have no other chance to do it */
if (reinit)
{
/* The size is getting set to zero, because we don't know
whether we are Full Speed or High Speed at this stage */
- DEPCTL(1, false) = DEPCTL_setd0pid | (3 << DEPCTL_nextep_bitp);
- DEPCTL(2, true) = DEPCTL_setd0pid;
- DEPCTL(3, false) = DEPCTL_setd0pid | (0 << DEPCTL_nextep_bitp);
- DEPCTL(4, true) = DEPCTL_setd0pid;
+ DEPCTL(1, false) = DEPCTL_usbactep | DEPCTL_setd0pid | (3 << DEPCTL_nextep_bitp);
+ DEPCTL(2, true) = DEPCTL_usbactep | DEPCTL_setd0pid;
+ DEPCTL(3, false) = DEPCTL_usbactep | DEPCTL_setd0pid | (0 << DEPCTL_nextep_bitp);
+ DEPCTL(4, true) = DEPCTL_usbactep | DEPCTL_setd0pid;
}
else
{
- DEPCTL(1, false) = (DEPCTL(1, false) & ~DEPCTL_usbactep) | DEPCTL_setd0pid;
- DEPCTL(2, true) = (DEPCTL(2, true) & ~DEPCTL_usbactep) | DEPCTL_setd0pid;
- DEPCTL(3, false) = (DEPCTL(3, false) & ~DEPCTL_usbactep) | DEPCTL_setd0pid;
- DEPCTL(4, true) = (DEPCTL(4, true) & ~DEPCTL_usbactep) | DEPCTL_setd0pid;
+ DEPCTL(1, false) = DEPCTL(1, false) | DEPCTL_usbactep | DEPCTL_setd0pid;
+ DEPCTL(2, true) = DEPCTL(2, true) | DEPCTL_usbactep | DEPCTL_setd0pid;
+ DEPCTL(3, false) = DEPCTL(3, false) | DEPCTL_usbactep | DEPCTL_setd0pid;
+ DEPCTL(4, true) = DEPCTL(4, true) | DEPCTL_usbactep | DEPCTL_setd0pid;
}
DAINTMSK = 0xFFFFFFFF; /* Enable interrupts on all EPs */
}
@@ -112,7 +113,7 @@ int usb_drv_request_endpoint(int type, int dir)
{
endpoints[ep].active = true;
DEPCTL(ep, out) = (DEPCTL(ep, out) & ~(DEPCTL_eptype_bits << DEPCTL_eptype_bitp)) |
- (type << DEPCTL_eptype_bitp) | DEPCTL_setd0pid;
+ (type << DEPCTL_eptype_bitp);
return ep | dir;
}
@@ -273,7 +274,6 @@ static void ep_transfer(int ep, void *ptr, int length, int out)
endpoints[ep].size = length;
if (out)
DEPCTL(ep, out) &= ~DEPCTL_stall;
- DEPCTL(ep, out) |= DEPCTL_usbactep;
int blocksize = usb_drv_port_speed() ? 512 : 64;
int packets = (length + blocksize - 1) / blocksize;
if (packets == 0)