summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2010-01-17 19:05:42 +0000
committerMichael Sparmann <theseven@rockbox.org>2010-01-17 19:05:42 +0000
commit5b94d44cc0b0bc7caceafff60131b633cc45c6bc (patch)
tree885b2a55ed3c819e4a593f22479f016a132e7fb2 /firmware
parent703e0d0e9ce0b9778a87f51fdd897676e8b75078 (diff)
Fix iPod Nano 2G USB:
1. Fix a copy paste bug (thanks for catching that one, liar) 2. Use a dummy DMA address for zero-length transfers as some devices seem to need this, and it can't hurt. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24263 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/usb-s3c6400x.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/firmware/target/arm/usb-s3c6400x.c b/firmware/target/arm/usb-s3c6400x.c
index 1d8902bae3..2fbb1a9849 100644
--- a/firmware/target/arm/usb-s3c6400x.c
+++ b/firmware/target/arm/usb-s3c6400x.c
@@ -276,9 +276,16 @@ void ep_send(int ep, void *ptr, int length)
DIEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */
int blocksize = usb_drv_port_speed() ? 512 : 64;
int packets = (length + blocksize - 1) / blocksize;
- if (!length) DIEPTSIZ(ep) = 1 << 19; /* one empty packet */
- else DIEPTSIZ(ep) = length | (packets << 19);
- DIEPDMA(ep) = (uint32_t)ptr;
+ if (!length)
+ {
+ DIEPTSIZ(ep) = 1 << 19; /* one empty packet */
+ DIEPDMA(ep) = 0x10000000; /* dummy address */
+ }
+ else
+ {
+ DIEPTSIZ(ep) = length | (packets << 19);
+ DIEPDMA(ep) = (uint32_t)ptr;
+ }
clean_dcache();
DIEPCTL(ep) |= 0x84000000; /* EPx OUT ENABLE CLEARNAK */
}
@@ -291,9 +298,16 @@ void ep_recv(int ep, void *ptr, int length)
DOEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */
int blocksize = usb_drv_port_speed() ? 512 : 64;
int packets = (length + blocksize - 1) / blocksize;
- if (!length) DIEPTSIZ(ep) = 1 << 19; /* one empty packet */
- else DOEPTSIZ(ep) = length | (packets << 19);
- DOEPDMA(ep) = (uint32_t)ptr;
+ if (!length)
+ {
+ DOEPTSIZ(ep) = 1 << 19; /* one empty packet */
+ DOEPDMA(ep) = 0x10000000; /* dummy address */
+ }
+ else
+ {
+ DOEPTSIZ(ep) = length | (packets << 19);
+ DOEPDMA(ep) = (uint32_t)ptr;
+ }
clean_dcache();
DOEPCTL(ep) |= 0x84000000; /* EPx OUT ENABLE CLEARNAK */
}