History log of /linux-master/drivers/usb/musb/musb_dma.h
Revision Date Author Comments
# d4255ac3 07-Aug-2023 Yue Haibing <yuehaibing@huawei.com>

usb: musb: Remove unused function declarations

Commit 32fee1df5110 ("usb: musb: remove unused davinci support")
removed these implementations but leave declaration.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20230807140928.35932-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d119cd95 31-Oct-2022 Lukas Bulwahn <lukas.bulwahn@gmail.com>

usb: musb: remove left-over after USB_TI_CPPI_DMA removal

Commit 32fee1df5110 ("usb: musb: remove unused davinci support") removes
the config USB_TI_CPPI_DMA, but misses some left-over references in
drivers/usb/musb/musb_dma.h.

Remove the left-over dependent on this removed config.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20221031085426.17175-1-lukas.bulwahn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6814c73f 04-Apr-2020 Nishad Kamdar <nishadkamdar@gmail.com>

USB: musb: Use the correct style for SPDX License Identifier

This patch corrects the SPDX License Identifier style in
header files related to USB Dual Role (OTG-ready) Controller Drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used).

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Link: https://lore.kernel.org/r/20200404104952.GA6575@nishad
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# edce6177 15-Jan-2020 Min Guo <min.guo@mediatek.com>

usb: musb: Add noirq type of dma create interface

Add noirq type of dma create interface for platform which do not
have dedicated DMA interrupt line, move musbhsdma macro definition
to musb_dma.h

Signed-off-by: Min Guo <min.guo@mediatek.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Link: https://lore.kernel.org/r/20200115132547.364-22-b-liu@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dc8fca6c 21-May-2018 Bin Liu <b-liu@ti.com>

usb: musb: remove duplicated quirks flag

Both musb_io and musb_platform_ops in struct musb define a quirks flag
for the same purpose. Let's remove the one in struct musb_io, and use
that in struct musb_platform_ops instead.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a9762b70 09-Mar-2018 Arnd Bergmann <arnd@arndb.de>

usb: musb: remove blackfin port

The blackfin architecture is getting removed, so we can clean up
all the special cases in the musb driver.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Aaron Wu <aaron.wu@analog.com>
Acked-by: Bin Liu <b-liu@ti.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
[arnd: adding in fixups from Aaron and Stephen]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# 21b650c2 06-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: musb: Remove redundant license text

Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Acked-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 050dc900 06-Feb-2017 Alexandre Bailon <abailon@baylibre.com>

usb: musb: dma: Add a DMA completion platform callback

Currently, the CPPI 4.1 driver is not completely generic and
only works on DSPS. This is because of IRQ management.
Add a callback to dma_controller that could be invoked on DMA completion
to acknowledge the IRQ.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7f6283ed 01-May-2015 Tony Lindgren <tony@atomide.com>

usb: musb: Set up function pointers for DMA

Set up function pointers for DMA so get closer to
being able to build in all the DMA engines.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# f8e9f34f 01-May-2015 Tony Lindgren <tony@atomide.com>

usb: musb: Fix up DMA related macros

Pass struct musb to tusb_dma_omap() and is_cppi_enabled(),
and add macros for the other DMA controllers. Populate the
platform specific quirks with the DMA type and use it during
runtime.

Note that platform glue layers with no custom DMA code are
tagged with MUSB_DMA_INVENTRA which may have a chance of
working. Looks like the defconfigs for these use PIO_ONLY,
so this should not break existing configs.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# ff3fcac9 26-May-2014 Daniel Mack <zonque@gmail.com>

usb: musb: introduce dma_channel.rx_packet_done

The musb/cppi41 glue layer is capable of handling transactions that span
over more than one USB packet by reloading the DMA descriptors
partially. An urb is considered completed when either its transfer
buffer has been filled entirely (actual_length ==
transfer_buffer_length) or if a packet in the stream has less bytes than
the endpoint's wMaxPacketSize.

Once one of the above conditions is met, musb_dma_completion() is called
from cppi41_trans_done(). However, the final decision whether or not to
return the urb to its owner is made by the core and its determination of
the variable 'done' in musb_host_rx(). This code has currently no way of
knowing what the size of the last packet was, and whether or not to
give back the urb due to a short read.

Fix this by introducing a new boolean flag in 'struct dma_channel', and
set it from musb_cppi41.c. If set, it will make the core do what the
DMA layer decided and complete the urb.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 9b3452d1 19-Jun-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: musb dma: add cppi41 dma driver

This driver is currently used by musb' cppi41 couter part. I may merge
both dma engine user of musb at some point but not just yet.

The driver seems to work in RX/TX mode in host mode, tested on mass
storage. I increaed the size of the TX / RX transfers and waited for the
core code to cancel a transfers and it seems to recover.

v2..3:
- use mall transfers on RX side and check data toggle.
- use rndis mode on tx side so we haveon interrupt for 4096 transfers.
- remove custom "transferred" hack and use dmaengine_tx_status() to
compute the total amount of data that has been transferred.
- cancel transfers and reclaim descriptors

v1..v2:
- RX path added
- dma mode 0 & 1 is working
- device tree nodes re-created.

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# a6a20885 19-Jun-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: musb: provide empty dma_controller_create() in PIO mode

Add a dma_controller_create() returning NULL so a few ifdefs can
dropped.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 66c01883 19-Jun-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: musb: dma: merge ->start/stop into create/destroy

The core code creates a controller and immediately after that it calls
the ->start() callback. This one might drop an error but nobody cares.
The same thing happens in the destroy corner: First ->stop() called
followed by destroy callback. So why not merge those two into the same
function since there is no difference.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 260eba39 19-Jun-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: musb: replace ifndef with ifdef for CONFIG_MUSB_PIO_ONLY

The ifdef reads somehow better than an ifndef

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 41ac7b3a 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

usb: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 07a67bbb 09-Aug-2012 Shubhrajyoti D <shubhrajyoti@ti.com>

usb: musb: Make dma_controller_create __devinit

dma_controller_create is called only from musb_init_controller
which is __devint so annotate dma_controller_create also with
__devint.

fixes the warn

WARNING: vmlinux.o(.devinit.text+0x6fa8): Section mismatch in reference from the function musb_init_controller() to the function .init.text:dma_controller_create()
The function __devinit musb_init_controller() references
a function __init dma_controller_create().
If dma_controller_create is only used by musb_init_controller then
annotate dma_controller_create with a matching annotation.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 5f5761cb 03-Jan-2011 Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>

usb: musb: introduce api for dma code to check compatibility with usb request

Gadget MUSB driver handles dma mappings in musb_gadget_queue(). Where as it is
possible for dma code to reject the usb request later at ->channel_program()
called from txstate()/rxstate()

For example ->channel_program in tusb6010_omap.c:

static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
u8 rndis_mode, dma_addr_t dma_addr, u32 len)
{
...
if (unlikely(dma_addr & 0x1) || (len < 32) || (len > packet_sz))
return false;
...
if (dma_addr & 0x2)
return false;
...
}

In this case, usb request will be handled in PIO mode which renders dma mapping
operations unnecessary.

This patch adds an api to allow dma code to indicate incompatibility with usb
request. Gadget musb driver call this api, if available, before dma mappings to
avoid any unnecessary mapping operations.

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 9720faec 16-Nov-2009 Sonic Zhang <sonic.zhang@analog.com>

USB: musb: add work around for Blackfin anomaly 05000456

Only allow USE_MODE1 when the Blackfin part is not affected by anomaly
05000456 (USB Receive Interrupt Is Not Generated in DMA Mode 1) since we
can't support the mode in that case.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 550a7375 23-Jul-2008 Felipe Balbi <felipe.balbi@nokia.com>

USB: Add MUSB and TUSB support

This patch adds support for MUSB and TUSB controllers
integrated into omap2430 and davinci. It also adds support
for external tusb6010 controller.

Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>