aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-gadget.h
AgeCommit message (Collapse)AuthorFilesLines
2022-05-19usb: cdns3: allocate TX FIFO size according to composite EP numberFrank Li1-3/+6
Some devices have USB compositions which may require multiple endpoints. To get better performance, need bigger CDNS3_EP_BUF_SIZE. But bigger CDNS3_EP_BUF_SIZE may exceed total hardware FIFO size when multiple endpoints. By introducing the check_config() callback, calculate CDNS3_EP_BUF_SIZE. Move CDNS3_EP_BUF_SIZE into cnds3_device: ep_buf_size Combine CDNS3_EP_ISO_SS_BURST and CDNS3_EP_ISO_HS_MULT into cnds3_device:ep_iso_burst Using a simple algorithm to calculate ep_buf_size. ep_buf_size = ep_iso_burst = (onchip_buffers - 2k) / (number of IN EP + 1). Test at 8qxp: Gadget ep_buf_size RNDIS: 5 RNDIS+ACM: 3 Mass Storage + NCM + ACM 2 Previous CDNS3_EP_BUF_SIZE is 4, RNDIS + ACM will be failure because exceed FIFO memory. Acked-by: Peter Chen <[email protected]> Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-04-12usb: cdns3: Optimize DMA request buffer allocationSanket Parmar1-0/+2
dma_alloc_coherent() might fail on the platform with a small DMA region. To avoid such failure in cdns3_prepare_aligned_request_buf(), dma_alloc_coherent() is replaced with dma_alloc_noncoherent() to allocate aligned request buffer of dynamic length. Reported-by: Aswath Govindraju <[email protected]> Signed-off-by: Sanket Parmar <[email protected]> Signed-off-by: Peter Chen <[email protected]>
2021-04-12usb: cdns3: Use dma_pool_* api to alloc trb poolSanket Parmar1-0/+1
Allocation of DMA coherent memory in atomic context using dma_alloc_coherent() might fail on platforms with smaller DMA region. To fix it, dma_alloc_coherent() is replaced with dma_pool API to allocate a smaller chunk of DMA coherent memory for TRB rings. Reported-by: Aswath Govindraju <[email protected]> Signed-off-by: Sanket Parmar <[email protected]> Signed-off-by: Peter Chen <[email protected]>
2020-12-29usb: cdns3: Change file names for cdns3 driver.Pawel Laszczak1-0/+1368
Patch adds prefix cdns3- to all file names related only to cdns3 driver. Signed-off-by: Pawel Laszczak <[email protected]> Signed-off-by: Peter Chen <[email protected]>