diff options
author | Michael Sparmann <theseven@rockbox.org> | 2010-01-17 19:05:42 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2010-01-17 19:05:42 +0000 |
commit | 5b94d44cc0b0bc7caceafff60131b633cc45c6bc (patch) | |
tree | 885b2a55ed3c819e4a593f22479f016a132e7fb2 | |
parent | 703e0d0e9ce0b9778a87f51fdd897676e8b75078 (diff) | |
download | rockbox-5b94d44cc0b0bc7caceafff60131b633cc45c6bc.tar.gz rockbox-5b94d44cc0b0bc7caceafff60131b633cc45c6bc.zip |
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
-rw-r--r-- | firmware/target/arm/usb-s3c6400x.c | 26 |
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) | |||
276 | DIEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */ | 276 | DIEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */ |
277 | int blocksize = usb_drv_port_speed() ? 512 : 64; | 277 | int blocksize = usb_drv_port_speed() ? 512 : 64; |
278 | int packets = (length + blocksize - 1) / blocksize; | 278 | int packets = (length + blocksize - 1) / blocksize; |
279 | if (!length) DIEPTSIZ(ep) = 1 << 19; /* one empty packet */ | 279 | if (!length) |
280 | else DIEPTSIZ(ep) = length | (packets << 19); | 280 | { |
281 | DIEPDMA(ep) = (uint32_t)ptr; | 281 | DIEPTSIZ(ep) = 1 << 19; /* one empty packet */ |
282 | DIEPDMA(ep) = 0x10000000; /* dummy address */ | ||
283 | } | ||
284 | else | ||
285 | { | ||
286 | DIEPTSIZ(ep) = length | (packets << 19); | ||
287 | DIEPDMA(ep) = (uint32_t)ptr; | ||
288 | } | ||
282 | clean_dcache(); | 289 | clean_dcache(); |
283 | DIEPCTL(ep) |= 0x84000000; /* EPx OUT ENABLE CLEARNAK */ | 290 | DIEPCTL(ep) |= 0x84000000; /* EPx OUT ENABLE CLEARNAK */ |
284 | } | 291 | } |
@@ -291,9 +298,16 @@ void ep_recv(int ep, void *ptr, int length) | |||
291 | DOEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */ | 298 | DOEPCTL(ep) |= 0x8000; /* EPx OUT ACTIVE */ |
292 | int blocksize = usb_drv_port_speed() ? 512 : 64; | 299 | int blocksize = usb_drv_port_speed() ? 512 : 64; |
293 | int packets = (length + blocksize - 1) / blocksize; | 300 | int packets = (length + blocksize - 1) / blocksize; |
294 | if (!length) DIEPTSIZ(ep) = 1 << 19; /* one empty packet */ | 301 | if (!length) |
295 | else DOEPTSIZ(ep) = length | (packets << 19); | 302 | { |
296 | DOEPDMA(ep) = (uint32_t)ptr; | 303 | DOEPTSIZ(ep) = 1 << 19; /* one empty packet */ |
304 | DOEPDMA(ep) = 0x10000000; /* dummy address */ | ||
305 | } | ||
306 | else | ||
307 | { | ||
308 | DOEPTSIZ(ep) = length | (packets << 19); | ||
309 | DOEPDMA(ep) = (uint32_t)ptr; | ||
310 | } | ||
297 | clean_dcache(); | 311 | clean_dcache(); |
298 | DOEPCTL(ep) |= 0x84000000; /* EPx OUT ENABLE CLEARNAK */ | 312 | DOEPCTL(ep) |= 0x84000000; /* EPx OUT ENABLE CLEARNAK */ |
299 | } | 313 | } |