Skip to content

Commit

Permalink
sparc64: Enable 64-bit DMA
Browse files Browse the repository at this point in the history
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities
to use ATU for 64bit DMA.

Signed-off-by: Tushar Dave <[email protected]>
Reviewed-by: chris hyser <[email protected]>
Acked-by: Sowmini Varadhan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tndave authored and davem330 committed Nov 18, 2016
1 parent f08978b commit d30a6b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ config ARCH_ATU
bool
default y if SPARC64

config ARCH_DMA_ADDR_T_64BIT
bool
default y if ARCH_ATU

config IOMMU_HELPER
bool
default y if SPARC64
Expand Down
8 changes: 6 additions & 2 deletions arch/sparc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,12 @@ int dma_supported(struct device *dev, u64 device_mask)
struct iommu *iommu = dev->archdata.iommu;
u64 dma_addr_mask = iommu->dma_addr_mask;

if (device_mask >= (1UL << 32UL))
return 0;
if (device_mask > DMA_BIT_MASK(32)) {
if (iommu->atu)
dma_addr_mask = iommu->atu->dma_addr_mask;
else
return 0;
}

if ((device_mask & dma_addr_mask) == dma_addr_mask)
return 1;
Expand Down

0 comments on commit d30a6b8

Please sign in to comment.