From 5b94d44cc0b0bc7caceafff60131b633cc45c6bc Mon Sep 17 00:00:00 2001 From: Michael Sparmann Date: Sun, 17 Jan 2010 19:05:42 +0000 Subject: 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 --- firmware/target/arm/usb-s3c6400x.c | 26 ++++++++++++++++++++------ 1 file 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 */ } -- cgit v1.2.3