mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-24 20:39:47 +07:00
e905086e6b
Provide phys_to_dma/dma_to_phys helpers, everything else is generic. Signed-off-by: Christoph Hellwig <hch@lst.de> Patchwork: https://patchwork.linux-mips.org/patch/19545/ Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David Daney <david.daney@cavium.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Tom Bogendoerfer <tsbogend@alpha.franken.de> Cc: Huacai Chen <chenhc@lemote.com> Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org
19 lines
417 B
C
19 lines
417 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <linux/dma-direct.h>
|
|
|
|
dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
|
|
{
|
|
return paddr | 0x80000000;
|
|
}
|
|
|
|
phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr)
|
|
{
|
|
#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
|
|
if (dma_addr > 0x8fffffff)
|
|
return dma_addr;
|
|
return dma_addr & 0x0fffffff;
|
|
#else
|
|
return dma_addr & 0x7fffffff;
|
|
#endif
|
|
}
|