usb-musb: Enabling fifo double buffering for gadget mode
1. Enable the endpoint fifo double buffering for gadget
mode to increase the performance
2. Increase the number of cppidma bd to 128
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
1. Enable the endpoint fifo double buffering for gadget
mode to increase the performance
2. Increase the number of cppidma bd to 128
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Fixes for cppi41 rmmod issue
The cppi41 dma is common module for multi musb instances,
the cppi41 deinitialization will be done as part of
platform exit.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
The cppi41 dma is common module for multi musb instances,
the cppi41 deinitialization will be done as part of
platform exit.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: workaround patch for babble condition
1) During the babble condition occured in host mode
the musb controller removes the session bit and drives
drvvbus to low and musb controller stops working.
2) This patch workaround this issue by restarting the musb
controller by performing usbotgss controller reset, restart
usb phy, enable all interrupts and then starts the musb
session.
3) Since musb controller shutdown during babble, the
disconnect event generated through software to notify
the associated class driver of connected that
musb is not operational.
3) The procfs entry is added to simulate the babble
condition interrupt through software
usage: echo 'b' > /proc/driver/musb_hdrc.0 or 1
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
1) During the babble condition occured in host mode
the musb controller removes the session bit and drives
drvvbus to low and musb controller stops working.
2) This patch workaround this issue by restarting the musb
controller by performing usbotgss controller reset, restart
usb phy, enable all interrupts and then starts the musb
session.
3) Since musb controller shutdown during babble, the
disconnect event generated through software to notify
the associated class driver of connected that
musb is not operational.
3) The procfs entry is added to simulate the babble
condition interrupt through software
usage: echo 'b' > /proc/driver/musb_hdrc.0 or 1
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: CPPI4.1 Tx/Rx DMA Teardown Fixes
This patch fixes the teardown fixes for tx/rx dma channels.
During tx/rx dma channel teardown, the completion BDs from
the tx/rx completion queues must need to removed and recycled
to the BD free pool.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch fixes the teardown fixes for tx/rx dma channels.
During tx/rx dma channel teardown, the completion BDs from
the tx/rx completion queues must need to removed and recycled
to the BD free pool.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Fix multiple define of AUTOREQ and TD reg offset
Fixes multiple definitions of AUTOREQ and TEARDOWN register offset
by adding similar field inside 'struct cppi41'. This is needed as
different platforms has different offsets.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Fixes multiple definitions of AUTOREQ and TEARDOWN register offset
by adding similar field inside 'struct cppi41'. This is needed as
different platforms has different offsets.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Adding BD interrupt enable feature
Adding BD interrupt enable feature available in CPPI41 DMA on TI81xx
platform. This feature is not supported in AM35x/DA8x.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Adding BD interrupt enable feature available in CPPI41 DMA on TI81xx
platform. This feature is not supported in AM35x/DA8x.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: teardown descriptor cleanup
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Drop const for rx/tx_comp_q
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Adding support for TI81XX platform
TI81x platform has two musb controller and has CPPI4.1 DMA engine.
Changes:
- Changes done for Kconfig/Makefile for ti81xx usb support
- Adds the ti81xx.c musb platform file
- Multi-musb controller support at usb-musb.c
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
TI81x platform has two musb controller and has CPPI4.1 DMA engine.
Changes:
- Changes done for Kconfig/Makefile for ti81xx usb support
- Adds the ti81xx.c musb platform file
- Multi-musb controller support at usb-musb.c
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: fixes for DBG -> dev_dbg
v3.0 has changed DBG to dev_dbg.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
v3.0 has changed DBG to dev_dbg.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Update usb_cppi41_info to support multi-ctrl
Changed usb_cppi41_info to an array of two such element to support
multi-controller scenarios.
Also updated the required changed in am35x.c
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Changed usb_cppi41_info to an array of two such element to support
multi-controller scenarios.
Also updated the required changed in am35x.c
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Make cppi41_info as a part of struct cppi41
Added cppi41_info in 'struct cppi41' so that each cppi41 instance
can provide their data and thus supporting multi controller.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Added cppi41_info in 'struct cppi41' so that each cppi41 instance
can provide their data and thus supporting multi controller.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: General cleanup
Changes:
- Removed the hard coded constants for size by adding 'size'
field into cppi41 strcuture
- Added q_num and q_mgr as required to support multi-controller
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Changes:
- Removed the hard coded constants for size by adding 'size'
field into cppi41 strcuture
- Added q_num and q_mgr as required to support multi-controller
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: nop: support for multi-nop tranceiver
Modified the nop driver to support multi nop transceiver.
Changes:
- Global xceiv to xceiv[2]
- nop transceiver regiser/deregiser based on musb->id
- Changes to other glue layers
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Modified the nop driver to support multi nop transceiver.
Changes:
- Global xceiv to xceiv[2]
- nop transceiver regiser/deregiser based on musb->id
- Changes to other glue layers
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Changes required in procfs for multi-musb controller
Updated procfs part of code to support multi-musb procfs entries
based on musb->id field.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Updated procfs part of code to support multi-musb procfs entries
based on musb->id field.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Adding musb->id to support multi-musb controller
Added musb->id field to differenciate two controllers.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Added musb->id field to differenciate two controllers.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: gadget: Read ep0 fifo only if rxcount is non zero
Fixes the read_fifo call with '0' rxcount.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Fixes the read_fifo call with '0' rxcount.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: modular fix
Changes:
- Moved global defines to cppi41.c/cppi41_dma.c
- Platform files to fill those global defines.
- Added EXPORT_SYMBOL
- REVISIT: am35x: _put commented
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Changes:
- Moved global defines to cppi41.c/cppi41_dma.c
- Platform files to fill those global defines.
- Added EXPORT_SYMBOL
- REVISIT: am35x: _put commented
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
AM3517: musb: undo pm changes affecting musb
musb becomes unusable due to below pm patch in AM3517.
------------------------------------------------
commit 53f18cf6026bc6a0152ea445f6b54de7fbea1b3c
Author: Tero Kristo <tero.kristo@nokia.com>
OMAP3: PM: Enable system control module autoidle
------------------------------------------------
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb becomes unusable due to below pm patch in AM3517.
------------------------------------------------
commit 53f18cf6026bc6a0152ea445f6b54de7fbea1b3c
Author: Tero Kristo <tero.kristo@nokia.com>
OMAP3: PM: Enable system control module autoidle
------------------------------------------------
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: teardown fix from Ravi
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: device fix from Ravi
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: fix IO_ADDRESS related issue on AM35x
IO_ADDRESS for AM35x MUSB doesn't work and thus CPPI41 programming
also fails.
Fixing this by ioremapping MUSB complete address space (~32K) and
updating CPPI41 related memory base with this mappings.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
IO_ADDRESS for AM35x MUSB doesn't work and thus CPPI41 programming
also fails.
Fixing this by ioremapping MUSB complete address space (~32K) and
updating CPPI41 related memory base with this mappings.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: AM35x: Add CPPI4.1 DMA support
Adding CPPI4.1 DMA support for musb driver.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Adding CPPI4.1 DMA support for musb driver.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: change number of DMA BLOCK from 4 to 1
Number of DMA block is different for different platforms.
Changing this to '1' for AM3517 platform.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Number of DMA block is different for different platforms.
Changing this to '1' for AM3517 platform.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
AM3517: musb: fix iperf failure issue
As we get DMA completion interrupt even when data is in FIFO.
Fixing the issue by adding delay before calling dma completion.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
As we get DMA completion interrupt even when data is in FIFO.
Fixing the issue by adding delay before calling dma completion.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi: ISO IN fixes for CPPI DMA
ISO doesn't work without this patch as CPPI DMA is not even
programmed for ISO IN transfer.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
ISO doesn't work without this patch as CPPI DMA is not even
programmed for ISO IN transfer.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: fix MODE_REG compatibility among platforms
AM3517 has seperate Tx and Rx MODE registers whereas OMAPL137/DA8x
has only one registers for both Rx and Tx modes.
Solving this difference by adding TX_MODE and RX_MODE registers
seperately which are actually same in case of OMAPL137/DA8x but
different for AM3517.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
AM3517 has seperate Tx and Rx MODE registers whereas OMAPL137/DA8x
has only one registers for both Rx and Tx modes.
Solving this difference by adding TX_MODE and RX_MODE registers
seperately which are actually same in case of OMAPL137/DA8x but
different for AM3517.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: procfs: add cppi41 related checks
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: Remove platform definitions from cppi41_dma.h
cppi41_dma.h should have common definitions as it would be used
by multiple platforms. As different platform can have different
register layouts so it's better to remove these definitions and
let them come from platform file at plat/usb.h
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41_dma.h should have common definitions as it would be used
by multiple platforms. As different platform can have different
register layouts so it's better to remove these definitions and
let them come from platform file at plat/usb.h
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: fix channel program for actual len
actual length has to be zero at the start of new dma programming.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
actual length has to be zero at the start of new dma programming.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: fix macro definition in cppi41.h
Macros definitions for number of queue managers and DMA blocks are
defined in cppi41.h only so use them instead of defining in other
files and using unnecessary extern.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Macros definitions for number of queue managers and DMA blocks are
defined in cppi41.h only so use them instead of defining in other
files and using unnecessary extern.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: fix scheduler table init in dma_block_init()
scheduler table init programming is unreliable using for loops so
fixing this by using scheduler table entries.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
scheduler table init programming is unreliable using for loops so
fixing this by using scheduler table entries.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: fix RGN0 memory alloc in queue_mgr_init()
queue_mgr_init() is currently allocating memory only for RGN1 and
expecting RGN0 memory to be allocated in platform files.
Normally RGN0 is only used so updating queue_mgr_init() to allocate
RGN0 memory.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
queue_mgr_init() is currently allocating memory only for RGN1 and
expecting RGN0 memory to be allocated in platform files.
Normally RGN0 is only used so updating queue_mgr_init() to allocate
RGN0 memory.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: add cppi41_exit() to free up the memories
Adding cppi41_exit() to free up the allocated memories.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Adding cppi41_exit() to free up the allocated memories.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: fixes to support new musb arch
Changes:
- __init to __devinit
- rename create/destroy functions
- channels maxlen
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Changes:
- __init to __devinit
- rename create/destroy functions
- channels maxlen
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
cppi41: Move CPPI41 core to musb temporarily
This is to ease our development effort and collaboration on Davinci
and OMAP35x family musb drivers.
This would be reverted back once the cppi41 drivers are accepted in
mainline and all confusion are cleared out.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This is to ease our development effort and collaboration on Davinci
and OMAP35x family musb drivers.
This would be reverted back once the cppi41 drivers are accepted in
mainline and all confusion are cleared out.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: cppi41: adding musb CPPI41 DMA support
Texas Instruments CPPI 4.1 DMA support for the MUSBMHRDC driver.
The code makes use of the accelerated "generic RNDIS" DMA mode, falling back to
the transparent (packet per transfer) mode if the hardware restrictions prevent
it from using the accelerated mode.
Update:
- has update for is_cppi41_enabled() due to musb changes
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Texas Instruments CPPI 4.1 DMA support for the MUSBMHRDC driver.
The code makes use of the accelerated "generic RNDIS" DMA mode, falling back to
the transparent (packet per transfer) mode if the hardware restrictions prevent
it from using the accelerated mode.
Update:
- has update for is_cppi41_enabled() due to musb changes
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
cppi41: adding CPPI4.1 DMA support
Add support for Texas Instuments Communication Port Programming Interface 4.1
(CPPI 4.1) used on OMAP-L137/DA830.
At this moment, only the DMA controller and queue manager are supported.
Support for the buffer manager is lacking but this chip doesn't have it anyway.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Add support for Texas Instuments Communication Port Programming Interface 4.1
(CPPI 4.1) used on OMAP-L137/DA830.
At this moment, only the DMA controller and queue manager are supported.
Support for the buffer manager is lacking but this chip doesn't have it anyway.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: pm: disbale autosuspend in default mode
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
USB: musb: NAK timeout scheme on bulk TX endpoint
Fixes endpoint starvation issue when more than one bulk QH is
multiplexed on the reserved bulk TX endpoint.
This patch sets the NAK timeout interval for such QHs, and when
a timeout triggers the next QH will be scheduled.
This scheme doesn't work for devices which are connected to a
high to full speed tree (transaction translator) as there is
no NAK timeout interrupt from the musb controller from such
devices.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Fixes endpoint starvation issue when more than one bulk QH is
multiplexed on the reserved bulk TX endpoint.
This patch sets the NAK timeout interval for such QHs, and when
a timeout triggers the next QH will be scheduled.
This scheme doesn't work for devices which are connected to a
high to full speed tree (transaction translator) as there is
no NAK timeout interrupt from the musb controller from such
devices.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Add workqueue for URB giveback
Current musb host driver does the giveback of completed urb first and
then start the next request. This is significantly affecting the streaming
from an USB camera wherein we observe huge delay between the two IN tokens
from musb host. This is due to the fact that UVC driver is doing decoding
and further processing in giveback context.
The patch tries to defer the giveback part to a workqueue and continues
with the start of new request in completion path.
the giveback workqueue has only succesfull completed URBs, it is safe to
giveback URBs without taking musb spinlocks.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Current musb host driver does the giveback of completed urb first and
then start the next request. This is significantly affecting the streaming
from an USB camera wherein we observe huge delay between the two IN tokens
from musb host. This is due to the fact that UVC driver is doing decoding
and further processing in giveback context.
The patch tries to defer the giveback part to a workqueue and continues
with the start of new request in completion path.
the giveback workqueue has only succesfull completed URBs, it is safe to
giveback URBs without taking musb spinlocks.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: select fifo_mode at runtime
OMAP35x han an errata restricting active endpoints to use either
first 8K or next 8K of FIFO space while this issue has been
fixed in OMAP3630.
This issue requires the OMAP35x platform to use fifo_mode=5 but
OMAP3630 and AM35x can use fifo_mode=4 which utilises entire 16K
of FIFO.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
OMAP35x han an errata restricting active endpoints to use either
first 8K or next 8K of FIFO space while this issue has been
fixed in OMAP3630.
This issue requires the OMAP35x platform to use fifo_mode=5 but
OMAP3630 and AM35x can use fifo_mode=4 which utilises entire 16K
of FIFO.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Fixes for DTM tests.
Fixes all the DTM tests except mini6sendrecv tests.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Fixes all the DTM tests except mini6sendrecv tests.
Signed-off-by: Ravi B <ravibabu@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: kill unwanted messages
Remives below messages:
musb_bus_suspend 2285: trying to suspend as a_wait_bcon while active
....
....
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Remives below messages:
musb_bus_suspend 2285: trying to suspend as a_wait_bcon while active
....
....
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Add back old musb procfs file
Procfs file is removed from musb and an equivalent debugfs is
expected to replace it.
Adding the old file back to retain the debug functionalities untill
we get debugfs equivalent in mainline.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Procfs file is removed from musb and an equivalent debugfs is
expected to replace it.
Adding the old file back to retain the debug functionalities untill
we get debugfs equivalent in mainline.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: Inform user when gadget cable is disconnected
Currently we don't see any message to inform user that gadget cable is
successfully disconnected leading to suspicion if everything is fine at
driver therefore adding an informative print message in gadget
disconnect path.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Currently we don't see any message to inform user that gadget cable is
successfully disconnected leading to suspicion if everything is fine at
driver therefore adding an informative print message in gadget
disconnect path.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
musb: disable PING on status phase of control transfer
PING token is not mandatory in status phase of control transfer
so some high speed USB sticks doesn't support this.If such devices
are connected to MUSB then they would not respond to PING token
causing delayed or failed enumeration.
Fixing this issue by disabling PING token in status phase of control
transfers.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
PING token is not mandatory in status phase of control transfer
so some high speed USB sticks doesn't support this.If such devices
are connected to MUSB then they would not respond to PING token
causing delayed or failed enumeration.
Fixing this issue by disabling PING token in status phase of control
transfers.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Revert: "musb: otg timer cleanup"
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Revert "musb: make initial HNP roleswitch work (v2)"
This reverts commit 1de00dae8036dfee44ebea2c38f942fb6072e0b7.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This reverts commit 1de00dae8036dfee44ebea2c38f942fb6072e0b7.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Revert: "musb: support disconnect after HNP roleswitch"
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: implement runtime is_inventra_dma/is_cppi_enabled/tusb_dma_omap
Now we can implement the three helpers below in runtime method:
is_inventra_dma/is_cppi_enabled/tusb_dma_omap
so we can build all hw glue drivers, dma drivers and musb_hdrc into
one single binary image to support musb on mulitple machines.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Now we can implement the three helpers below in runtime method:
is_inventra_dma/is_cppi_enabled/tusb_dma_omap
so we can build all hw glue drivers, dma drivers and musb_hdrc into
one single binary image to support musb on mulitple machines.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: pass musb pointer to is_cppi_enabled helper
This patch passes musb pointer to is_cppi_enabled to
prepare for support of runtime is_cppi_enabled.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch passes musb pointer to is_cppi_enabled to
prepare for support of runtime is_cppi_enabled.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: pass musb pointer to tusb_dma_omap helper
This patch passes musb pointer to tusb_dma_omap to
prepare for support of runtime tusb_dma_omap.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch passes musb pointer to tusb_dma_omap to
prepare for support of runtime tusb_dma_omap.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: pass musb pointer to is_inventra_dma helper
This patch passes musb pointer to is_inventra_dma to
prepare for support runtime is_inventra_dma.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch passes musb pointer to is_inventra_dma to
prepare for support runtime is_inventra_dma.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: remove CONFIG_USB_*_DMA in source code of musb core driver
This patch uses the three helpers below:
is_inventra_dma/is_cppi_enabled/tusb_dma_omap
to replace the options of CONFIG_USB_*_DMA.
The method was applied in musb_host.c before(using
is_cppi_enabled & tusb_dma_omap to replace using
'ifdef CONFIG_USB_*_DMA', and don't introduce any
performance loss since compiler is smart enough to
handle this cases.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch uses the three helpers below:
is_inventra_dma/is_cppi_enabled/tusb_dma_omap
to replace the options of CONFIG_USB_*_DMA.
The method was applied in musb_host.c before(using
is_cppi_enabled & tusb_dma_omap to replace using
'ifdef CONFIG_USB_*_DMA', and don't introduce any
performance loss since compiler is smart enough to
handle this cases.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: introduce is_inventra_dma helper
This patch introduces is_inventra_dma helper, so that
we can remove dependency on CONFIG_USB_INVENTRA_DMA
in source file of musb core driver in later patches.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch introduces is_inventra_dma helper, so that
we can remove dependency on CONFIG_USB_INVENTRA_DMA
in source file of musb core driver in later patches.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: print dma type in runtime way
We will support multiple dma controller type in one single
musb core driver(binary), so print dma type by the
information from hw glue driver.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
We will support multiple dma controller type in one single
musb core driver(binary), so print dma type by the
information from hw glue driver.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: remove 'ifdef CONFIG_USB_INVENTRA_DMA' for comments only
This comments has said clearly that they are for Mentor(INVENTRA) DMA
controller, so remove this unnecessary ifdef to make code more clean.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This comments has said clearly that they are for Mentor(INVENTRA) DMA
controller, so remove this unnecessary ifdef to make code more clean.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: remove exit symbol to avoid using of ifdef in musb_g_rx
Remove one 'ifdef' and one 'exit' symbol to make code more cleaner.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Remove one 'ifdef' and one 'exit' symbol to make code more cleaner.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: remove duplicated define of tusb_dma_omap
tusb_dma_omap is defined in musb_dma.h already and same with
it in tusb6010.h, so remove the definition in tusb6010.h.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
tusb_dma_omap is defined in musb_dma.h already and same with
it in tusb6010.h, so remove the definition in tusb6010.h.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: support each dma controller driver built as module
This patch provides support for building each dma controller driver
as standalone module, and this modules can be built into one same
image and can be used by each hw glue driver.
HW glue driver has the knowledge of which type of dma controller will
be used, and can pass the knowledge into musb core driver via glue ops,
so we can take runtime method to support all hw controller and its dma
controller in one binary musb driver.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch provides support for building each dma controller driver
as standalone module, and this modules can be built into one same
image and can be used by each hw glue driver.
HW glue driver has the knowledge of which type of dma controller will
be used, and can pass the knowledge into musb core driver via glue ops,
so we can take runtime method to support all hw controller and its dma
controller in one binary musb driver.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: define DMA controller related flags and callbacks in glue ops
Each musb hw controller may use different DMA controller, so we
introduce dma controller related flags and callbacks in glue ops.
HW glue driver can provide its dma controller information to
musb core with this flags and callbacks, so we can make musb core
more generic and avoid to depend on the ugly macro below as far as
possible:
CONFIG_USB_INVENTRA_DMA
CONFIG_USB_TUSB_OMAP_DMA
CONFIG_USB_TI_CPPI_DMA
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Each musb hw controller may use different DMA controller, so we
introduce dma controller related flags and callbacks in glue ops.
HW glue driver can provide its dma controller information to
musb core with this flags and callbacks, so we can make musb core
more generic and avoid to depend on the ugly macro below as far as
possible:
CONFIG_USB_INVENTRA_DMA
CONFIG_USB_TUSB_OMAP_DMA
CONFIG_USB_TI_CPPI_DMA
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: same MUSB_OFFSET/musb_ep_select for all controller
The patch uses the information about hw endpoint register address
mapping from hw glue driver to implement MUSB_OFFSET/musb_ep_select
for different cases.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
The patch uses the information about hw endpoint register address
mapping from hw glue driver to implement MUSB_OFFSET/musb_ep_select
for different cases.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: pass musb pointer into musb_ep_select & MUSB_EP_OFFSET
This patche adds the paramer of musb pointer to musb_ep_select
and MUSB_EP_OFFSET, then we can pass musb into this two helpers
and can give corresponding implementation for flat mappings and
indexed mappings of hw endpoint register address using the information
from hw glue driver.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patche adds the paramer of musb pointer to musb_ep_select
and MUSB_EP_OFFSET, then we can pass musb into this two helpers
and can give corresponding implementation for flat mappings and
indexed mappings of hw endpoint register address using the information
from hw glue driver.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: simplify musb_ep_select&MUSB_EP_OFFSET for different hardware
In fact, for tusb, musb_ep_select and MUSB_EP_OFFSET are same with
that for indexed mapping, so merge the two cases to simplify
definition of the two helpers.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
In fact, for tusb, musb_ep_select and MUSB_EP_OFFSET are same with
that for indexed mapping, so merge the two cases to simplify
definition of the two helpers.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: same musb_readb/musb_writeb in single image to support multiple machines
This patch introduces musb_readb/musb_writeb function pointer,
so that we can use same musb_readb/musb_writeb in one single
binary image to help to support multiple machines.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch introduces musb_readb/musb_writeb function pointer,
so that we can use same musb_readb/musb_writeb in one single
binary image to help to support multiple machines.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: remove musb_in_tusb
Remove musb_in_tusb since no one may use it.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Remove musb_in_tusb since no one may use it.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: handle tusb fifo style by runtime method
This patch introduces MUSB_GLUE_TUSB_STYLE flag, which
can be used to handle tusb dependent things by runtime
method instead of previous static method.
This patch handles tusb fifo style according to the flag
of MUSB_GLUE_TUSB_STYLE passed from hw glue drivers.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch introduces MUSB_GLUE_TUSB_STYLE flag, which
can be used to handle tusb dependent things by runtime
method instead of previous static method.
This patch handles tusb fifo style according to the flag
of MUSB_GLUE_TUSB_STYLE passed from hw glue drivers.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: introduce flags field into musb_platform_ops
This patch introduces flags field into musb_platform_ops,
so we can handle hw glue difference in musb core driver
from the information of .flags, then we can remove the
ugly macros of hw glue related to help to make one image
working for multiple machines in later patches.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch introduces flags field into musb_platform_ops,
so we can handle hw glue difference in musb core driver
from the information of .flags, then we can remove the
ugly macros of hw glue related to help to make one image
working for multiple machines in later patches.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: pass fifo_mode from hw glue driver
Each hw controller may have different fifo configuraion,
so passing fifo_mode from hw glue is very reasonable.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Each hw controller may have different fifo configuraion,
so passing fifo_mode from hw glue is very reasonable.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: use platform_driver_register to register musb_hdrc driver
Since hw glue drivers may depend on musb_hdrc and musb_init will return
failure if no glue device is registered, this patch fixes the issue
by registering musb_hdrc driver first.
Also this patch replaces most of __init with __devinit to support
platform_driver_register.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Since hw glue drivers may depend on musb_hdrc and musb_init will return
failure if no glue device is registered, this patch fixes the issue
by registering musb_hdrc driver first.
Also this patch replaces most of __init with __devinit to support
platform_driver_register.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: use native read_fifo/write_fifo for each hw glue driver
This patch uses native read_fifo/write_fifo for each hw glue driver.
Musb core can always use musb->ops->*_fifo to do PIO, also removes
some ugly ifdef for musb_read_fifo/musb_write_fifo.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch uses native read_fifo/write_fifo for each hw glue driver.
Musb core can always use musb->ops->*_fifo to do PIO, also removes
some ugly ifdef for musb_read_fifo/musb_write_fifo.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: introduce read_fifo/write_fifo callback in glue ops
This patch introduces read_fifo/write_fifo callback in glue ops,
so that we can make musb in one single images working on multiple
boards.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch introduces read_fifo/write_fifo callback in glue ops,
so that we can make musb in one single images working on multiple
boards.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: support to compile hw glue layer driver as module
Obviously hw glue layer driver should be compiled as module,
which can help to build one single image to support multiple machines.
also merged
usb: musb: allow all hw glue modules built into one single image
This patch allows all hw glue drivers to be built into one single
image, so that we can support one single image to be run in multiple
machines.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Obviously hw glue layer driver should be compiled as module,
which can help to build one single image to support multiple machines.
also merged
usb: musb: allow all hw glue modules built into one single image
This patch allows all hw glue drivers to be built into one single
image, so that we can support one single image to be run in multiple
machines.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Sriramakrishnan A G <srk@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: export some symbols for glue driver access
Export this functions so that glue drivers can see them if glue drivers
are built as modules.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Export this functions so that glue drivers can see them if glue drivers
are built as modules.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
usb: musb: introduce get_hw_revision callback in glue ops
This patch introduces get_hw_revision callback in glue_ops,
and implement it in tusb glue driver, so tusb dma code can
get tusb revision via .get_hw_revision callback and we can
make glue drivers built as module easyly in later patches.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch introduces get_hw_revision callback in glue_ops,
and implement it in tusb glue driver, so tusb dma code can
get tusb revision via .get_hw_revision callback and we can
make glue drivers built as module easyly in later patches.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
usb: musb: remove extern qualifier from musb_debug.h header
This change removes confusing extern qualifier, which doesn't have any practical
sense there.
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@nokia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This change removes confusing extern qualifier, which doesn't have any practical
sense there.
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@nokia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: cleanup kconfig
The whole thing depends on USB_MUSB_HDRC, just add an 'if'.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
The whole thing depends on USB_MUSB_HDRC, just add an 'if'.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: trivial Kconfig cleanups
Shuffle the code a bit so the description is at the top.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Shuffle the code a bit so the description is at the top.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
musb: omap2430: avoid pm_runtime_disable()
These are handled by drivers core, and in a way that doesn't wake up the
devices.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
These are handled by drivers core, and in a way that doesn't wake up the
devices.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: remove a bit of indentation
And use dev instead of musb->controller.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
And use dev instead of musb->controller.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: trivial cleanup
enabled && driver || !enabled can be simplified to !enabled || driver.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
enabled && driver || !enabled can be simplified to !enabled || driver.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: fix pm_runtime mismatch
In musb_init_controller() there's a pm_runtime_put(), but there's no
pm_runtime_get(), which creates a mismatch that causes the driver to
sleep when it shouldn't.
This was introduced in 7acc619[1], but it wasn't triggered in my setup
until 18a2689[2] was merged to Linus' branch at point df0914[3]. IOW;
when PM is working as it was supposed to.
However, it seems most of the time this is used in a way that keeps the
counter above 0, so nobody noticed. Also, it seems to depend on the
configuration used in versions before 3.1, but not later (or in it).
I found the problem by loading isp1704_charger before any usb gadgets:
http://article.gmane.org/gmane.linux.kernel/1226122
All versions after 2.6.39 are affected.
[1] usb: musb: Idle path retention and offmode support for OMAP3
[2] OMAP2+: musb: hwmod adaptation for musb registration
[3] Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
Cc: stable@vger.kernel.org
Cc: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
In musb_init_controller() there's a pm_runtime_put(), but there's no
pm_runtime_get(), which creates a mismatch that causes the driver to
sleep when it shouldn't.
This was introduced in 7acc619[1], but it wasn't triggered in my setup
until 18a2689[2] was merged to Linus' branch at point df0914[3]. IOW;
when PM is working as it was supposed to.
However, it seems most of the time this is used in a way that keeps the
counter above 0, so nobody noticed. Also, it seems to depend on the
configuration used in versions before 3.1, but not later (or in it).
I found the problem by loading isp1704_charger before any usb gadgets:
http://article.gmane.org/gmane.linux.kernel/1226122
All versions after 2.6.39 are affected.
[1] usb: musb: Idle path retention and offmode support for OMAP3
[2] OMAP2+: musb: hwmod adaptation for musb registration
[3] Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
Cc: stable@vger.kernel.org
Cc: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: omap2430: fix compile warning
fix the following compile warning:
drivers/usb/musb/omap2430.c: In function 'musb_otg_notifier_work':
drivers/usb/musb/omap2430.c:279:3: warning: 'return' with a value, in
function returning void
drivers/usb/musb/omap2430.c:282:2: warning: 'return' with a value, in
function returning void
Signed-off-by: Felipe Balbi <balbi@ti.com>
fix the following compile warning:
drivers/usb/musb/omap2430.c: In function 'musb_otg_notifier_work':
drivers/usb/musb/omap2430.c:279:3: warning: 'return' with a value, in
function returning void
drivers/usb/musb/omap2430.c:282:2: warning: 'return' with a value, in
function returning void
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: fix pm_runtime calls while atomic
musb pm_runtime_get_sync call happens in intrrupt context on cable attach case
That can result in re-enabling the interrupts and cause side affects.
So move the code to a work queue.
Following is the error path hit on cable attach:
BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:802
in_atomic(): 0, irqs_disabled(): 0, pid: 18, name: irq/378-twl6030
Backtrace:
[<c00520f0>] (dump_backtrace+0x0/0x110) from [<c054f454>] (dump_stack+0x18/0x1c)
[<c054f43c>] (dump_stack+0x0/0x1c) from [<c007f59c>] (__might_sleep+0x130/0x134)
[<c007f46c>] (__might_sleep+0x0/0x134) from [<c02c2794>] (__pm_runtime_resume+0x94/0x98)
[<c02c2700>] (__pm_runtime_resume+0x0/0x98) from [<c033e7e4>] (musb_otg_notifications+0x9c/0x164)
[<c033e748>] (musb_otg_notifications+0x0/0x164) from [<c00b3df0>] (notifier_call_chain+0x4c/0x8c)
[<c00b3da4>] (notifier_call_chain+0x0/0x8c) from [<c00b44a8>] (__atomic_notifier_call_chain+0x40/0x54)
[<c00b4468>] (__atomic_notifier_call_chain+0x0/0x54) from [<c00b44dc>] (atomic_notifier_call_chain+0x20/0x28)
[<c00b44bc>] (atomic_notifier_call_chain+0x0/0x28) from [<c033f124>] (twl6030_usb_irq+0xc8/0xdc)
[<c033f05c>] (twl6030_usb_irq+0x0/0xdc) from [<c00d79f8>] (irq_thread_fn+0x24/0x40)
[<c00d79d4>] (irq_thread_fn+0x0/0x40) from [<c00d7b64>] (irq_thread+0x150/0x1d8)
[<c00d7a14>] (irq_thread+0x0/0x1d8) from [<c00adf70>] (kthread+0x94/0x98)
[<c00adedc>] (kthread+0x0/0x98) from [<c0094388>] (do_exit+0x0/0x720)
Tested with:
MUSB Device mode: Cold boot / Hot plug
MUSB Host mode: Cold boot / Hot plug
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
musb pm_runtime_get_sync call happens in intrrupt context on cable attach case
That can result in re-enabling the interrupts and cause side affects.
So move the code to a work queue.
Following is the error path hit on cable attach:
BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:802
in_atomic(): 0, irqs_disabled(): 0, pid: 18, name: irq/378-twl6030
Backtrace:
[<c00520f0>] (dump_backtrace+0x0/0x110) from [<c054f454>] (dump_stack+0x18/0x1c)
[<c054f43c>] (dump_stack+0x0/0x1c) from [<c007f59c>] (__might_sleep+0x130/0x134)
[<c007f46c>] (__might_sleep+0x0/0x134) from [<c02c2794>] (__pm_runtime_resume+0x94/0x98)
[<c02c2700>] (__pm_runtime_resume+0x0/0x98) from [<c033e7e4>] (musb_otg_notifications+0x9c/0x164)
[<c033e748>] (musb_otg_notifications+0x0/0x164) from [<c00b3df0>] (notifier_call_chain+0x4c/0x8c)
[<c00b3da4>] (notifier_call_chain+0x0/0x8c) from [<c00b44a8>] (__atomic_notifier_call_chain+0x40/0x54)
[<c00b4468>] (__atomic_notifier_call_chain+0x0/0x54) from [<c00b44dc>] (atomic_notifier_call_chain+0x20/0x28)
[<c00b44bc>] (atomic_notifier_call_chain+0x0/0x28) from [<c033f124>] (twl6030_usb_irq+0xc8/0xdc)
[<c033f05c>] (twl6030_usb_irq+0x0/0xdc) from [<c00d79f8>] (irq_thread_fn+0x24/0x40)
[<c00d79d4>] (irq_thread_fn+0x0/0x40) from [<c00d7b64>] (irq_thread+0x150/0x1d8)
[<c00d7a14>] (irq_thread+0x0/0x1d8) from [<c00adf70>] (kthread+0x94/0x98)
[<c00adedc>] (kthread+0x0/0x98) from [<c0094388>] (do_exit+0x0/0x720)
Tested with:
MUSB Device mode: Cold boot / Hot plug
MUSB Host mode: Cold boot / Hot plug
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: drop ARCH dependency
musb core driver and tusb6010 glue layer don't
depend on anything which is ARCH-specific. It
builds fine on x86 and ARM. Dropping the dependency
so we can compile-test on linux-next.
Signed-off-by: Felipe Balbi <balbi@ti.com>
musb core driver and tusb6010 glue layer don't
depend on anything which is ARCH-specific. It
builds fine on x86 and ARM. Dropping the dependency
so we can compile-test on linux-next.
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: headers cleanup
Remove a few unnecessary headers from a
few files.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Remove a few unnecessary headers from a
few files.
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: allow building USB_MUSB_TUSB6010 as a module
Commit 1376d92f9 "usb: musb: allow musb and glue layers to be modules"
made the USB_MUSB_TUSB6010 option modular, but actually building
the driver as a module does not work, so various randconfig builds
actually fail. This changes all code that depends on the
option to also check for modular builds, and exports the necessary
symbols.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Commit 1376d92f9 "usb: musb: allow musb and glue layers to be modules"
made the USB_MUSB_TUSB6010 option modular, but actually building
the driver as a module does not work, so various randconfig builds
actually fail. This changes all code that depends on the
option to also check for modular builds, and exports the necessary
symbols.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: use a Kconfig choice to pick the right DMA method
The logic to allow only one DMA driver in MUSB is currently
flawed, because it also allows picking no DMA driver at all
and also not selecting PIO mode.
Using a choice statement makes this foolproof for now and
also simplifies the Makefile.
Unfortunately, we will have to revisit this when we start
supporting multiple ARM platforms in a single kernel binary,
because at that point we will actually need to select
multiple DMA drivers and pick the right one at run-time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
The logic to allow only one DMA driver in MUSB is currently
flawed, because it also allows picking no DMA driver at all
and also not selecting PIO mode.
Using a choice statement makes this foolproof for now and
also simplifies the Makefile.
Unfortunately, we will have to revisit this when we start
supporting multiple ARM platforms in a single kernel binary,
because at that point we will actually need to select
multiple DMA drivers and pick the right one at run-time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: omap2+: save and restore OTG_INTERFSEL
we need to save and restore OTG_INTERFSEL register
else we will be unable to function on resume after
OFF mode.
Reported-by: Devaraj Rangasamy <dev@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
we need to save and restore OTG_INTERFSEL register
else we will be unable to function on resume after
OFF mode.
Reported-by: Devaraj Rangasamy <dev@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: omap2+: fix context api's
RxFifoSz, TxFifoSz, RxFifoAddr, TxFifoAddr
are all indexed registers.
So before doing a context save or restore, INDEX register
should be set, then only one gets to the right register offset.
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
RxFifoSz, TxFifoSz, RxFifoAddr, TxFifoAddr
are all indexed registers.
So before doing a context save or restore, INDEX register
should be set, then only one gets to the right register offset.
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: musb: ux500: optimize DMA callback routine
Skip the use of work queue and call musb_dma_completion() directly from
DMA callback context.
Here follows measurements on a Snowball board with ondemand governor active.
Performance using work queue:
(105 MB) copied, 6.23758 s, 16.8 MB/s
(105 MB) copied, 5.7151 s, 18.3 MB/s
(105 MB) copied, 5.83583 s, 18.0 MB/s
(105 MB) copied, 5.93611 s, 17.7 MB/s
Performance without work queue
(105 MB) copied, 5.62173 s, 18.7 MB/s
(105 MB) copied, 5.61811 s, 18.7 MB/s
(105 MB) copied, 5.57817 s, 18.8 MB/s
(105 MB) copied, 5.58549 s, 18.8 MB/s
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Skip the use of work queue and call musb_dma_completion() directly from
DMA callback context.
Here follows measurements on a Snowball board with ondemand governor active.
Performance using work queue:
(105 MB) copied, 6.23758 s, 16.8 MB/s
(105 MB) copied, 5.7151 s, 18.3 MB/s
(105 MB) copied, 5.83583 s, 18.0 MB/s
(105 MB) copied, 5.93611 s, 17.7 MB/s
Performance without work queue
(105 MB) copied, 5.62173 s, 18.7 MB/s
(105 MB) copied, 5.61811 s, 18.7 MB/s
(105 MB) copied, 5.57817 s, 18.8 MB/s
(105 MB) copied, 5.58549 s, 18.8 MB/s
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: gadget: rename usb_gadget_driver::speed to max_speed
This commit renames the “speed” field of the usb_gadget_driver
structure to “max_speed”. This is so that to make it more
apparent that the field represents the maximum speed gadget
driver can support.
This also make the field look more like fields with the same
name in usb_gadget and usb_composite_driver structures. All
of those represent the *maximal* speed given entity supports.
After this commit, there are the following fields in various
structures:
* usb_gadget::speed - the current connection speed,
* usb_gadget::max_speed - maximal speed UDC supports,
* usb_gadget_driver::max_speed - maximal speed gadget driver
supports, and
* usb_composite_driver::max_speed - maximal speed composite
gadget supports.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit renames the “speed” field of the usb_gadget_driver
structure to “max_speed”. This is so that to make it more
apparent that the field represents the maximum speed gadget
driver can support.
This also make the field look more like fields with the same
name in usb_gadget and usb_composite_driver structures. All
of those represent the *maximal* speed given entity supports.
After this commit, there are the following fields in various
structures:
* usb_gadget::speed - the current connection speed,
* usb_gadget::max_speed - maximal speed UDC supports,
* usb_gadget_driver::max_speed - maximal speed gadget driver
supports, and
* usb_composite_driver::max_speed - maximal speed composite
gadget supports.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
usb: gadget: replace usb_gadget::is_dualspeed with max_speed
This commit replaces usb_gadget's is_dualspeed field with
a max_speed field.
[ balbi@ti.com : Fixed DWC3 driver ]
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit replaces usb_gadget's is_dualspeed field with
a max_speed field.
[ balbi@ti.com : Fixed DWC3 driver ]
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
treewide: Fix comment and string typo 'bufer'
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
arm:omap:am33xx: Add TSC driver board hookup
Also enable the driver config option in defconfig
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Also enable the driver config option in defconfig
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
AM335X: add touchscreen driver of AM335X
This patch adds all the necessary changes to
add touchscreen driver present inside am335x.
The controller is a 4/5/8 wire resistive panel that is
directly fed to the ADC.
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch adds all the necessary changes to
add touchscreen driver present inside am335x.
The controller is a 4/5/8 wire resistive panel that is
directly fed to the ADC.
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
AM335X: CPSW fix for recursive locking
This patch is added to remove recursive locking seen in
cpsw deinitializing function. spin_lock_irqsave() is called
recursively with same resource in both cpdma_chan_stop and
__cpdma_chan_process functions which leads to recursive locking
and so multiple locking is removed.
Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch is added to remove recursive locking seen in
cpsw deinitializing function. spin_lock_irqsave() is called
recursively with same resource in both cpdma_chan_stop and
__cpdma_chan_process functions which leads to recursive locking
and so multiple locking is removed.
Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
AM335X: CPSW pinmux configuration. (SOC related)
This patch adds cpsw pinmux configuration for different boards
Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Conflicts:
arch/arm/mach-omap2/devices.c
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
This patch adds cpsw pinmux configuration for different boards
Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Conflicts:
arch/arm/mach-omap2/devices.c
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
arm:omap:am33xx: reset support
Global cold reset on machine reboot
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Global cold reset on machine reboot
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>