summaryrefslogtreecommitdiffstats
path: root/drivers/dma/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* dma: align barebox DMA coherency setting with kernel'sAhmad Fatoum2024-01-111-0/+1
| | | | | | | | | | | | | | ARM platforms that have cache-coherent peripherals should select OF_DMA_COHERENCY. These same platforms may run into issues if kernel DT is changed to assume cache coherency, while barebox DT wasn't. Therefore add a fixup that fixes up barebox dma-coherent setting into the kernel's. That way we only have to make sure that Linux and barebox are in-sync regarding CONFIG_ARCH_DMA_DEFAULT_COHERENT. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240110160112.4134162-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: add DMA API debugging supportAhmad Fatoum2023-12-051-0/+1
| | | | | | | | | | | | | | | | | For DMA_FROM_DEVICE, calling dma_sync_single_for_cpu before arch_sync_dma_for_device has been called is wrong: - Memory region is dirty in CPU cache - Device writes packet into region - CPU cache lines are written back - Buffer memory is corrupted In order to spot such issues, let's add a new CONFIG_DMA_API_DEBUG that will warn about mismatch in order. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231129061758.1781732-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: factor out dma map generic implementations into fileAhmad Fatoum2023-12-051-0/+1
| | | | | | | | | In preparation for adding optional debugging code for the DMA mapping API, move the definition out of the header file into a source file. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231129061758.1781732-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: rework dma_sync_single_for_*() interfaceDenis Orlov2023-06-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a lot of code handles dma_addr_t values as if they actually hold CPU addresses. However, this is not always true. For example, MIPS architecture requires an explicit conversion from the physical address space to some virtual address space segment to get a valid CPU-side pointer. Another issue is that DMA ranges that may be specified in a device tree will not work this way. To get from a virtual address to a dma handle and vice versa we need to add/subtract some offset, which is calculated from "dma-ranges" property. Only dma_map_single() was doing this, but dma_sync_single_for_*() also should. Improve the interface by adding 'struct device' as the first argument to the dma_sync_single_for_*(). This allows to do cpu_to_dma/dma_to_cpu() conversions in common code and call into arch-specific code with proper cpu-side addresses. To make things more clear, make the virtual address argument of those arch-side functions be properly represented with a void* type. Apply the required changes in device drivers that use the affected functions, making them pass the appropriate device pointer. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230604215002.20240-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: migrate "GPL-2.0" license identifiers to SPDX 2.0Roland Hieber2021-11-221-1/+1
| | | | | | | | | | "GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier "GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>. Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: add missing SPDX-License-IdentifierAhmad Fatoum2021-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | This adds the suitable SPDX-License-Identifier to all files in drivers/ that previously lacked one. To aid manual inspection, following heuristics can be used: * No changes outside of comments/whitespace: git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)' * -or-later come in pairs: git show --inter-hunk-context=19 HEAD | \ perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }' Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: move dma_map/unmap_single from ARM to common codeAhmad Fatoum2021-03-041-0/+1
| | | | | | | | | | | | | | There's nothing ARM specific about these functions. Move them to a common location, so other arches can use them as well. This also fixes a bug on ARM MMU=n configurations: Previously these two functions these functions only respected dma-ranges translation when compiled with MMU support. DMA address translation is applicable regardless of CPU use of MMU though. Now, dma-ranges should be respected unconditionally. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: add mxs-apbh-dma driverWolfram Sang2012-06-301-0/+1
Based on the U-Boot version. Changed to kernel style register layout, added MX23 support, made MMU aware and adapted to barebox. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>