linux/arch/loongarch
Jianmin Lv c78c43fe7d LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA
Use _DMA defined in ACPI spec for translation between
DMA address and CPU address, and implement acpi_arch_dma_setup
for initializing dev->dma_range_map, where acpi_dma_get_range
is called for parsing _DMA.

e.g.
If we have two dma ranges:
cpu address      dma address    size         offset
0x200080000000   0x2080000000   0x400000000  0x1fe000000000
0x400080000000   0x4080000000   0x400000000  0x3fc000000000

_DMA for pci devices should be declared in host bridge as
flowing:

Name (_DMA, ResourceTemplate() {
        QWordMemory (ResourceProducer,
            PosDecode,
            MinFixed,
            MaxFixed,
            NonCacheable,
            ReadWrite,
            0x0,
            0x4080000000,
            0x447fffffff,
            0x3fc000000000,
            0x400000000,
            ,
            ,
            )

        QWordMemory (ResourceProducer,
            PosDecode,
            MinFixed,
            MaxFixed,
            NonCacheable,
            ReadWrite,
            0x0,
            0x2080000000,
            0x247fffffff,
            0x1fe000000000,
            0x400000000,
            ,
            ,
            )
    })

Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-09-24 18:39:21 +02:00
..
boot
configs LoongArch: Update Loongson-3 default config file 2022-08-12 13:10:11 +08:00
include LoongArch: Fix section mismatch due to acpi_os_ioremap() 2022-09-03 18:01:27 +08:00
kernel LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA 2022-09-24 18:39:21 +02:00
lib LoongArch: Improve dump_tlb() output messages 2022-09-03 18:01:27 +08:00
mm LoongArch: mm: Remove the unneeded result variable 2022-09-03 18:01:27 +08:00
pci LoongArch: Add PCI controller support 2022-08-12 13:10:11 +08:00
vdso LoongArch: Fix build warnings in VDSO 2022-08-25 19:34:59 +08:00
Kbuild
Kconfig LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA 2022-09-24 18:39:21 +02:00
Kconfig.debug LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
Makefile LoongArch: Add PCI controller support 2022-08-12 13:10:11 +08:00