mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
arm: dma-mapping: Add support for CONFIG_IOMMU_DMA
Prepare for future changes to enable CONFIG_IOMMU_DMA by defining the necessary arch hooks. Change-Id: Ic21d5fc752d86d34a7384c339a02087e4e40182f Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
This commit is contained in:
parent
1c0ece4496
commit
c4c1c2cd7c
2 changed files with 14 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ config ARM
|
|||
select ARCH_HAS_DEBUG_VIRTUAL if MMU
|
||||
select ARCH_HAS_DEVMEM_IS_ALLOWED
|
||||
select ARCH_HAS_DMA_COHERENT_TO_PFN if SWIOTLB
|
||||
select ARCH_HAS_DMA_PREP_COHERENT if IOMMU_DMA
|
||||
select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
|
||||
select ARCH_HAS_ELF_RANDOMIZE
|
||||
select ARCH_HAS_FORTIFY_SOURCE
|
||||
|
|
@ -20,8 +21,8 @@ config ARM
|
|||
select ARCH_HAS_SET_MEMORY
|
||||
select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
|
||||
select ARCH_HAS_STRICT_MODULE_RWX if MMU
|
||||
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if SWIOTLB
|
||||
select ARCH_HAS_SYNC_DMA_FOR_CPU if SWIOTLB
|
||||
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if SWIOTLB || IOMMU_DMA
|
||||
select ARCH_HAS_SYNC_DMA_FOR_CPU if SWIOTLB || IOMMU_DMA
|
||||
select ARCH_HAS_TEARDOWN_DMA_OPS if MMU
|
||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||
select ARCH_HAVE_CUSTOM_GPIO_H
|
||||
|
|
@ -121,6 +122,7 @@ config ARM
|
|||
select REFCOUNT_FULL
|
||||
select RTC_LIB
|
||||
select SYS_SUPPORTS_APM_EMULATION
|
||||
select IOMMU_DMA if IOMMU_SUPPORT
|
||||
# Above selects are sorted alphabetically; please add new ones
|
||||
# according to that. Thanks.
|
||||
help
|
||||
|
|
|
|||
|
|
@ -2606,7 +2606,7 @@ void arch_teardown_dma_ops(struct device *dev)
|
|||
arm_teardown_iommu_dma_ops(dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
#if defined(CONFIG_SWIOTLB) || defined(CONFIG_IOMMU_DMA)
|
||||
void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
|
||||
size_t size, enum dma_data_direction dir)
|
||||
{
|
||||
|
|
@ -2620,7 +2620,9 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
|
|||
__dma_page_dev_to_cpu(phys_to_page(paddr), paddr & (PAGE_SIZE - 1),
|
||||
size, dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
|
||||
dma_addr_t dma_addr)
|
||||
{
|
||||
|
|
@ -2641,3 +2643,10 @@ void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
|||
__arm_dma_free(dev, size, cpu_addr, dma_handle, attrs, false);
|
||||
}
|
||||
#endif /* CONFIG_SWIOTLB */
|
||||
|
||||
#ifdef CONFIG_IOMMU_DMA
|
||||
void arch_dma_prep_coherent(struct page *page, size_t size)
|
||||
{
|
||||
__dma_page_cpu_to_dev(page, 0, size, DMA_BIDIRECTIONAL);
|
||||
}
|
||||
#endif /* CONFIG_IOMMU_DMA */
|
||||
|
|
|
|||
Loading…
Reference in a new issue