dma-mapping: introduce DMA range map, supplanting dma_pfn_offset
The new field 'dma_range_map' in struct device is used to facilitate the use of single or multiple offsets between mapping regions of cpu addrs and dma addrs. It subsumes the role of "dev->dma_pfn_offset" which was only capable of holding a single uniform offset and had no region bounds checking. The function of_dma_get_range() has been modified so that it takes a single argument -- the device node -- and returns a map, NULL, or an error code. The map is an array that holds the information regarding the DMA regions. Each range entry contains the address offset, the cpu_start address, the dma_start address, and the size of the region. of_dma_configure() is the typical manner to set range offsets but there are a number of ad hoc assignments to "dev->dma_pfn_offset" in the kernel driver code. These cases now invoke the function dma_direct_set_offset(dev, cpu_addr, dma_addr, size). Signed-off-by:Jim Quinlan <james.quinlan@broadcom.com> [hch: various interface cleanups] Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Mathieu Poirier <mathieu.poirier@linaro.org> Tested-by:
Mathieu Poirier <mathieu.poirier@linaro.org> Tested-by:
Nathan Chancellor <natechancellor@gmail.com>
Showing
- arch/arm/include/asm/dma-direct.h 4 additions, 5 deletionsarch/arm/include/asm/dma-direct.h
- arch/arm/mach-keystone/keystone.c 8 additions, 9 deletionsarch/arm/mach-keystone/keystone.c
- arch/arm/mach-omap1/include/mach/memory.h 4 additions, 0 deletionsarch/arm/mach-omap1/include/mach/memory.h
- arch/sh/drivers/pci/pcie-sh7786.c 5 additions, 4 deletionsarch/sh/drivers/pci/pcie-sh7786.c
- arch/x86/pci/sta2x11-fixup.c 4 additions, 2 deletionsarch/x86/pci/sta2x11-fixup.c
- drivers/acpi/arm64/iort.c 4 additions, 2 deletionsdrivers/acpi/arm64/iort.c
- drivers/base/core.c 2 additions, 0 deletionsdrivers/base/core.c
- drivers/gpu/drm/sun4i/sun4i_backend.c 7 additions, 1 deletiondrivers/gpu/drm/sun4i/sun4i_backend.c
- drivers/iommu/io-pgtable-arm.c 1 addition, 1 deletiondrivers/iommu/io-pgtable-arm.c
- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c 8 additions, 1 deletiondrivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c 9 additions, 2 deletionsdrivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
- drivers/of/address.c 32 additions, 41 deletionsdrivers/of/address.c
- drivers/of/device.c 27 additions, 17 deletionsdrivers/of/device.c
- drivers/of/of_private.h 6 additions, 5 deletionsdrivers/of/of_private.h
- drivers/of/unittest.c 24 additions, 10 deletionsdrivers/of/unittest.c
- drivers/remoteproc/remoteproc_core.c 23 additions, 1 deletiondrivers/remoteproc/remoteproc_core.c
- drivers/staging/media/sunxi/cedrus/cedrus_hw.c 8 additions, 2 deletionsdrivers/staging/media/sunxi/cedrus/cedrus_hw.c
- include/linux/device.h 2 additions, 2 deletionsinclude/linux/device.h
- include/linux/dma-direct.h 47 additions, 6 deletionsinclude/linux/dma-direct.h
- include/linux/dma-mapping.h 8 additions, 1 deletioninclude/linux/dma-mapping.h
Loading
Please register or sign in to comment