usb: musb: implement (un)map_urb_for_dma hooks

MUSB controller cannot work in DMA mode with misaligned buffers,
switching in PIO mode.

HCD core has hooks that allow to override the default DMA
mapping and unmapping routines for host controllers that have
special DMA requirements, such as alignment contraints.

It is observed that work in PIO mode is slow and it's better
to align buffers properly before pass them to MUSB

Some ideas taken from ehci-tegra.c

Change-Id: Id6eeaa811063d408f121c79012aba921f26eb582
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: hcd: Add a dma_align flag

Some host controllers has special DMA requirements,
such as alignment contraints.
Added a flag dma_align for indicating this requirement

Change-Id: I06277ade030429a832e6db38cc695128a1033f08
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usbnet: dma alignment fix

Allow usb ethernet driver to be used with a controller
driver that does not support DMA to adresses not aligned
to a 4-byte boundary

Change-Id: I017163921792c888c1cffff2531de55ef7bdb7f3
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: musb: indicate DMA alignment requirement

The MUSB host controller requires DMA buffers to be aligned.
If DMA buffers are misaligned it will use (un)map_urb_for_dma
for re-aligning buffers.
This often happens with USB network adapters, where skbuff
alignment is often in the middle of a 4-byte dword.
Indicate host controller DMA alignment requirement for such cases

Change-Id: I8a03f392caff762e9b48b65d31a119fdd833ae69
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: ehci-omap: indicate DMA alignment requirement

The OMAP host controller requires DMA buffers to be aligned.
If DMA buffers are misaligned then DMA transfers may take more
time.
This often happens with USB network adapters, where skbuff
alignment is often in the middle of a 4-byte dword.
Indicate host controller DMA alignment requirement for such cases

Change-Id: Ic2191f3f339cb189b02218d43b6d432cfe136269
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: musb: Fix memory corruption

rx_count, the number of bytes in the rx fifo, may be larger than the
size of the transfer buffer. Make sure we don't overflow the transfer
buffer in that case.

Bug: 6497399
Change-Id: I5bcf6dd543f9da4ee22944aa6c41673f2cca4c1f
Signed-off-by: Benoit Goby <benoit@android.com>
OMAP: TILER: Add bounds checking on format inputs

Added bounds checking to validate incoming tiler format.

Change-Id: Icd791cc294ecb1838afb3f91451626debd59c29e
Signed-off-by: Andy Gross <andy.gross@ti.com>
OMAP: TILER: Make character driver creation configurable

The TILER code that creates the character driver code and
interacts with the userspace has been placed under the
kernel configuration option that controls the userspace,
so that the cdev creation is bypassed when userspace is
disabled.

Change-Id: I3d5d372433fc89e676e54088dc8af8bdb74b8007
Signed-off-by: Shivananda Hebbar <x0hebbar@ti.com>
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
OMAP4: TILER: Add variable alignment allocation API

Added tiler_alloc_block_area_aligned API to allow
for variable alignment when allocating when using the kernel
APIs.

Change-Id: I2f3c44675a3fa1b2c6dfef21ccdd9bcac2f1d0e5
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Tony Zlatinski <x0146664@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP4: TILER: Add offset parameter for allocation

Add offset parameter for use in tiler_alloc_block_area_aligned.
This allows a user to get a tiler allocation with a specific
alignment and offset.

Change-Id: I8b1b9dd17bc9def124ea92cbbede2f3c56823387
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Tony Zlatinski <x0146664@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP: TILER: validate input width and height

Add validation of input width and height to ensure that it does
not exceed maximum pixel width and height for the specific format.

Validate maximum length for 1D allocations.

Change-Id: I64b00f93a312ae715a040da28a0b0fe663afa9d8
Signed-off-by: Andy Gross <andy.gross@ti.com>
I2C: OMAP: Fix the crash in i2c remove

Should fix the crash at arch/arm/mach-omap2/omap_l3_noc.c
Increase wifi voltage, decrease startup delay (testing)