summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/mmu.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-12-20 12:29:03 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-20 12:48:50 +0100
commitd791e51e2db7a6ff12c4f0b191b7cdc57faefa0c (patch)
treefd5ef1eb6c8ecd3758770a8f4ccae8a023c0c616 /arch/arm/cpu/mmu.c
parentea6e7a4894841d33cbacbbfb15166d1e7c411a7c (diff)
downloadbarebox-d791e51e2db7a6ff12c4f0b191b7cdc57faefa0c.tar.gz
barebox-d791e51e2db7a6ff12c4f0b191b7cdc57faefa0c.tar.xz
device: Introduce dma_offset
For devices that do not have a 1:1 mapping between DMA and CPU we need a dma_offset. This adds dma_offset to struct device_d and starts honoring it in ARM dma_(un)map_single(). Also we add some comments to functions that would normally need a device argument to make the DMA <-> CPU translations device specific. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu/mmu.c')
-rw-r--r--arch/arm/cpu/mmu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 158b130b57..1f97c28ec6 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -491,6 +491,10 @@ void *dma_alloc_writecombine(size_t size, dma_addr_t *dma_handle)
void dma_sync_single_for_device(dma_addr_t address, size_t size,
enum dma_data_direction dir)
{
+ /*
+ * FIXME: This function needs a device argument to support non 1:1 mappings
+ */
+
if (dir == DMA_FROM_DEVICE) {
__dma_inv_range(address, address + size);
if (outer_cache.inv_range)