2018-06-20 15:11:15 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/dma-direct.h>
|
|
|
|
|
2020-08-17 23:34:03 +08:00
|
|
|
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
|
2018-06-20 15:11:15 +08:00
|
|
|
{
|
|
|
|
return paddr | 0x80000000;
|
|
|
|
}
|
|
|
|
|
2020-09-08 23:56:22 +08:00
|
|
|
phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dma_addr)
|
2018-06-20 15:11:15 +08:00
|
|
|
{
|
|
|
|
if (dma_addr > 0x8fffffff)
|
|
|
|
return dma_addr;
|
|
|
|
return dma_addr & 0x0fffffff;
|
|
|
|
}
|