diff options
author | Martin Fuzzey <mfuzzey@gmail.com> | 2010-09-30 18:21:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:22:03 -0400 |
commit | d0cc3d4100e829d726d7c0fbf5b7b8d2146f60ba (patch) | |
tree | 94e3c28cc1e11448c74ed0f7be0a19af761f3c6d /drivers/usb/host/imx21-hcd.h | |
parent | 1dae423dd9b247b048eda00cb598c755e5933213 (diff) |
USB: imx21-hcd accept arbitary transfer buffer alignement.
The hardware can only do DMA to 4 byte aligned addresses.
When this requirement is not met use PIO or a bounce buffer.
PIO is used when the buffer is small enough to directly
use the hardware data memory (2*maxpacket).
A bounce buffer is used for larger transfers.
Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/imx21-hcd.h')
-rw-r--r-- | drivers/usb/host/imx21-hcd.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/host/imx21-hcd.h b/drivers/usb/host/imx21-hcd.h index 1b0d913780a5..87b29fd971b4 100644 --- a/drivers/usb/host/imx21-hcd.h +++ b/drivers/usb/host/imx21-hcd.h | |||
@@ -250,6 +250,7 @@ | |||
250 | #define USBCTRL_USB_BYP (1 << 2) | 250 | #define USBCTRL_USB_BYP (1 << 2) |
251 | #define USBCTRL_HOST1_TXEN_OE (1 << 1) | 251 | #define USBCTRL_HOST1_TXEN_OE (1 << 1) |
252 | 252 | ||
253 | #define USBOTG_DMEM 0x1000 | ||
253 | 254 | ||
254 | /* Values in TD blocks */ | 255 | /* Values in TD blocks */ |
255 | #define TD_DIR_SETUP 0 | 256 | #define TD_DIR_SETUP 0 |
@@ -346,8 +347,8 @@ struct td { | |||
346 | struct list_head list; | 347 | struct list_head list; |
347 | struct urb *urb; | 348 | struct urb *urb; |
348 | struct usb_host_endpoint *ep; | 349 | struct usb_host_endpoint *ep; |
349 | dma_addr_t data; | 350 | dma_addr_t dma_handle; |
350 | unsigned long buf_addr; | 351 | void *cpu_buffer; |
351 | int len; | 352 | int len; |
352 | int frame; | 353 | int frame; |
353 | int isoc_index; | 354 | int isoc_index; |
@@ -360,6 +361,8 @@ struct etd_priv { | |||
360 | struct td *td; | 361 | struct td *td; |
361 | struct list_head queue; | 362 | struct list_head queue; |
362 | dma_addr_t dma_handle; | 363 | dma_addr_t dma_handle; |
364 | void *cpu_buffer; | ||
365 | void *bounce_buffer; | ||
363 | int alloc; | 366 | int alloc; |
364 | int len; | 367 | int len; |
365 | int dmem_size; | 368 | int dmem_size; |
@@ -412,6 +415,7 @@ struct debug_isoc_trace { | |||
412 | struct imx21 { | 415 | struct imx21 { |
413 | spinlock_t lock; | 416 | spinlock_t lock; |
414 | struct device *dev; | 417 | struct device *dev; |
418 | struct usb_hcd *hcd; | ||
415 | struct mx21_usbh_platform_data *pdata; | 419 | struct mx21_usbh_platform_data *pdata; |
416 | struct list_head dmem_list; | 420 | struct list_head dmem_list; |
417 | struct list_head queue_for_etd; /* eps queued due to etd shortage */ | 421 | struct list_head queue_for_etd; /* eps queued due to etd shortage */ |