x86/PCI: sta2x11: use default DMA address translation
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Thu, 7 Nov 2019 15:06:45 +0000 (16:06 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 11 Nov 2019 09:52:19 +0000 (10:52 +0100)
commite380a0394c36a3a878c858418d5dd7f5f195b6fc
tree03b188c0d608d1c8c78cd7f0a4d867351f9f8cb0
parentb12d66278dd627cbe1ea7c000aa4715aaf8830c8
x86/PCI: sta2x11: use default DMA address translation

The devices found behind this PCIe chip have unusual DMA mapping
constraints as there is an AMBA interconnect placed in between them and
the different PCI endpoints. The offset between physical memory
addresses and AMBA's view is provided by reading a PCI config register,
which is saved and used whenever DMA mapping is needed.

It turns out that this DMA setup can be represented by properly setting
'dma_pfn_offset', 'dma_bus_mask' and 'dma_mask' during the PCI device
enable fixup. And ultimately allows us to get rid of this device's
custom DMA functions.

Aside from the code deletion and DMA setup, sta2x11_pdev_to_mapping() is
moved to avoid warnings whenever CONFIG_PM is not enabled.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/x86/Kconfig
arch/x86/include/asm/device.h
arch/x86/include/asm/dma-direct.h [deleted file]
arch/x86/pci/sta2x11-fixup.c