• Jianmin Lv's avatar
    LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA · c78c43fe
    Jianmin Lv authored
    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: default avatarHuacai Chen <chenhuacai@loongson.cn>
    Signed-off-by: default avatarJianmin Lv <lvjianmin@loongson.cn>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    c78c43fe
Kconfig 12.4 KB