summaryrefslogtreecommitdiffstats
path: root/include/dma.h
Commit message (Collapse)AuthorAgeFilesLines
* dma: allocate 32-byte aligned buffers by defaultAhmad Fatoum2021-06-241-1/+6
| | | | | | | | | | | | | If dma_alloc() is really used for streaming-dma between cache-incoherent masters, it should return cache-line aligned buffers, so we don't risk invalidating shared cache lines. Bump up the default alignment to 32-bytes. This doesn't affect ARM, as it defines its own implementation with 64-byte buffers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619045055.779-20-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* RISC-V: add cacheless HAS_DMA supportAhmad Fatoum2021-03-231-0/+1
| | | | | | | | Define some stubs, so we can get virtio MMIO working on RISC-V in QEMU. As we don't yet have MMU support, this is sufficient. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: add SPDX GPL-2.0-only license tags where applicableRoland Hieber2020-02-171-3/+1
| | | | | | | | Interpret "GPLv2" as "GPLv2 only". Signed-off-by: Roland Hieber <rohieb@rohieb.name> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Adopt DMA mask concept from LinuxAndrey Smirnov2018-08-311-1/+11
| | | | | | | | | | In order to be able to detect cases where DMA isn't capable of reaching every memory address, port the concept of DMA mask, dma_set_mask() function and add appropriate check to dma_mapping_error(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: Add prototypes for dma mapping functionsSascha Hauer2018-03-291-0/+12
| | | | | | | | | | | Right now we only have the dma_sync_single_* functions, but no functions for actually mapping a pointer. The mapping functions become necessary when casting a pointer to unsigned long to get a dma address is not enough. (I'm not even going so far that we'll add IOMMU support, but on some architectures we need a place where we can check if a pointer is DMA mappable at all) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: Use dma_addr_t as type for DMA addressesSascha Hauer2018-03-291-2/+2
| | | | | | | DMA addresses are not necessarily the same as unsigned long. Fix the type for the dma_sync_single_* operations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* implement dma_alloc_writecombineSascha Hauer2015-08-071-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: move DMA alloc functions to dma.hLucas Stach2015-03-061-0/+2
| | | | | | | | | | This better separates the DMA from the MMU functionality. Also move all drivers that only depends on asm/mmu.h for the alloc functions over to the common header. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: add streaming DMA opsLucas Stach2015-03-061-0/+11
| | | | | | | | This will allow us to implement cache maintenance in a platform agnostic way. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blackfin, mips, openrisc, ppc, sandbox, x86: add generic dma_alloc, dma_free ↵Marc Kleine-Budde2012-06-301-0/+30
inlines Some drivers call dma_inv_range() on buffers, on arm these buffers must be cache line aligned. This patch introduces a generic dma_alloc, dma_free. Archs can implement in their own functions in "asm/dma.h" and add a: #define dma_alloc dma_alloc #define dma_free dma_free On all other archs the generic versions, which translate into xmalloc and free are used. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>