summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-09-08 00:29:22 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-09-08 00:29:22 +0000
commitb72237a4038d9f9b4dd2fb53bdae9caa89d0289f (patch)
tree9288c7dffb1ce1c115651c68c7ec97bb9bfc36db /firmware
parent03d391d57a57bd9a96b5ffe16c82bf2813cd6c20 (diff)
downloadrockbox-b72237a4038d9f9b4dd2fb53bdae9caa89d0289f.tar.gz
rockbox-b72237a4038d9f9b4dd2fb53bdae9caa89d0289f.tar.bz2
rockbox-b72237a4038d9f9b4dd2fb53bdae9caa89d0289f.zip
usb-drv-as3525v2: fixes
- don't use *_dcache_range() on uncached memory - remove unused struct endpoint->buffer - use correct *_dcache_range() in usb_drv_transfer() for each direction - halve FIFO size sometimes mounts / sometimes fails git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28031 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525v2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c
index 4b0293563a..69aadf481c 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525v2.c
+++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c
@@ -77,7 +77,6 @@ struct usb_endpoint
bool busy; /* true is a transfer is pending */
int status; /* completion status (0 for success) */
struct wakeup complete; /* wait object */
- void *buffer; /* buffer address */
};
/* state of EP0 (to correctly schedule setup packet enqueing) */
@@ -213,7 +212,6 @@ static void prepare_setup_ep0(void)
{
logf("usb-drv: prepare EP0");
/* setup DMA */
- clean_dcache_range((void*)&ep0_setup_pkt, sizeof ep0_setup_pkt); /* force write back */
DOEPDMA(0) = (unsigned long)AS3525_PHYSICAL_ADDR(&__ep0_setup_pkt); /* virtual address=physical address */
/* Setup EP0 OUT with the following parameters:
@@ -389,8 +387,8 @@ static void core_dev_init(void)
}
/* Setup FIFOs */
- GRXFSIZ = 1024;
- GNPTXFSIZ = MAKE_FIFOSIZE_DATA(1024, 1024);
+ GRXFSIZ = 512;
+ GNPTXFSIZ = MAKE_FIFOSIZE_DATA(512, 512);
/* Setup interrupt masks for endpoints */
/* Setup interrupt masks */
@@ -527,7 +525,6 @@ static void handle_ep_int(int ep, bool dir_in)
logf("len=%d reg=%ld xfer=%d", endpoint->len,
(DOEPTSIZ(ep) & DEPTSIZ_xfersize_bits),
transfered);
- invalidate_dcache_range(endpoint->buffer, transfered);
/* handle EP0 state if necessary,
* this is a ack if length is 0 */
if(ep == 0)
@@ -767,7 +764,10 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki
{
DEPDMA = (unsigned long)AS3525_PHYSICAL_ADDR(ptr);
DEPTSIZ = (nb_packets << DEPTSIZ_pkcnt_bitp) | len;
- clean_dcache_range(ptr, len);
+ if(dir_in)
+ clean_dcache_range(ptr, len);
+ else
+ invalidate_dcache_range(ptr, len);
}
logf("pkt=%d dma=%lx", nb_packets, DEPDMA);