summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Martin <amartin@nvidia.com>2012-10-24 08:32:04 +0000
committerMarek Vasut <marex@denx.de>2012-11-20 00:16:05 +0100
commitd7475386bb75ec4e49be66d83775edb043dbfb43 (patch)
tree5f2f6888d5aec547ec5639061336067d1ca0d7ef
parentc11ace6b7bcfef535198b607e43adea65c8ce7dd (diff)
downloadu-boot-imx-d7475386bb75ec4e49be66d83775edb043dbfb43.zip
u-boot-imx-d7475386bb75ec4e49be66d83775edb043dbfb43.tar.gz
u-boot-imx-d7475386bb75ec4e49be66d83775edb043dbfb43.tar.bz2
USB: make usb_kbd obey USB DMA alignment requirements
Change usb_kbd driver to obey alignment requirements for USB DMA on the buffer used for data transfer. This is necessary for architectures that enable dcache and enable USB DMA. Signed-off-by: Allen Martin <amartin@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r--common/usb_kbd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 19f01db..24467ce 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -112,7 +112,7 @@ struct usb_kbd_pdata {
uint32_t usb_out_pointer;
uint8_t usb_kbd_buffer[USB_KBD_BUFFER_LEN];
- uint8_t new[8];
+ uint8_t *new;
uint8_t old[8];
uint8_t flags;
@@ -435,6 +435,9 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
/* Clear private data */
memset(data, 0, sizeof(struct usb_kbd_pdata));
+ /* allocate input buffer aligned and sized to USB DMA alignment */
+ data->new = memalign(USB_DMA_MINALIGN, roundup(8, USB_DMA_MINALIGN));
+
/* Insert private data into USB device structure */
dev->privptr = data;