aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-04-07 02:32:55 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:49 -0400
commit3cf2723432dd27402a4a4941ad2d04eae5dd639c (patch)
treec63fb9258fcb0f2665ba818881cd84dc9b299daa /drivers
parenta89a2cd396b20c46a37fa8db4b652fb00f29d0a4 (diff)
USB: at91_udc can prefetch data
The at91sam9 chip are ARMv5 so they support preload instructions. Use preloading to load the FIFO a bit faster. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/at91_udc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index fd15ced899d8..5d352c900d2c 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -389,6 +389,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req)
389 u32 csr = __raw_readl(creg); 389 u32 csr = __raw_readl(creg);
390 u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0)); 390 u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0));
391 unsigned total, count, is_last; 391 unsigned total, count, is_last;
392 u8 *buf;
392 393
393 /* 394 /*
394 * TODO: allow for writing two packets to the fifo ... that'll 395 * TODO: allow for writing two packets to the fifo ... that'll
@@ -413,6 +414,8 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req)
413 return 0; 414 return 0;
414 } 415 }
415 416
417 buf = req->req.buf + req->req.actual;
418 prefetch(buf);
416 total = req->req.length - req->req.actual; 419 total = req->req.length - req->req.actual;
417 if (ep->ep.maxpacket < total) { 420 if (ep->ep.maxpacket < total) {
418 count = ep->ep.maxpacket; 421 count = ep->ep.maxpacket;
@@ -435,7 +438,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req)
435 * recover when the actual bytecount matters (e.g. for USB Test 438 * recover when the actual bytecount matters (e.g. for USB Test
436 * and Measurement Class devices). 439 * and Measurement Class devices).
437 */ 440 */
438 __raw_writesb(dreg, req->req.buf + req->req.actual, count); 441 __raw_writesb(dreg, buf, count);
439 csr &= ~SET_FX; 442 csr &= ~SET_FX;
440 csr |= CLR_FX | AT91_UDP_TXPKTRDY; 443 csr |= CLR_FX | AT91_UDP_TXPKTRDY;
441 __raw_writel(csr, creg); 444 __raw_writel(csr, creg);