diff options
author | David Brownell <david-b@pacbell.net> | 2008-04-06 23:32:55 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-24 21:16:49 -0700 |
commit | 3cf2723432dd27402a4a4941ad2d04eae5dd639c (patch) | |
tree | c63fb9258fcb0f2665ba818881cd84dc9b299daa /drivers/usb | |
parent | a89a2cd396b20c46a37fa8db4b652fb00f29d0a4 (diff) | |
download | linux-3cf2723432dd27402a4a4941ad2d04eae5dd639c.tar.gz linux-3cf2723432dd27402a4a4941ad2d04eae5dd639c.tar.bz2 linux-3cf2723432dd27402a4a4941ad2d04eae5dd639c.zip |
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/usb')
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 5 |
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) u32 csr = __raw_readl(creg); u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0)); unsigned total, count, is_last; + u8 *buf; /* * 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) return 0; } + buf = req->req.buf + req->req.actual; + prefetch(buf); total = req->req.length - req->req.actual; if (ep->ep.maxpacket < total) { count = ep->ep.maxpacket; @@ -435,7 +438,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) * recover when the actual bytecount matters (e.g. for USB Test * and Measurement Class devices). */ - __raw_writesb(dreg, req->req.buf + req->req.actual, count); + __raw_writesb(dreg, buf, count); csr &= ~SET_FX; csr |= CLR_FX | AT91_UDP_TXPKTRDY; __raw_writel(csr, creg); |