Commit 33f2ac54 authored by Huacai Chen's avatar Huacai Chen Committed by Paul Burton

MIPS: Loongon64: DMA functions cleanup

Split the common dma.c which shared by Loongson-2E and Loongson-2F,
since the code in 'common' directory is assumed be shared by all 64bit
Loongson platforms (but Loongson-3 doesn't use it now). By the way,
Loongson-2E and Loongson-2F have already dropped 32bit kernel support,
so CONFIG_64BIT isn't needed.
Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/20302/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhuacai@gmail.com>
parent 5b394b2d
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \ obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
bonito-irq.o mem.o machtype.o platform.o serial.o bonito-irq.o mem.o machtype.o platform.o serial.o
obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_CPU_LOONGSON2) += dma.o
# #
# Serial port support # Serial port support
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
# Makefile for Lemote Fuloong2e mini-PC board. # Makefile for Lemote Fuloong2e mini-PC board.
# #
obj-y += irq.o reset.o obj-y += irq.o reset.o dma.o
// 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)
{
return dma_addr & 0x7fffffff;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for lemote loongson2f family machines # Makefile for lemote loongson2f family machines
# #
obj-y += clock.o machtype.o irq.o reset.o ec_kb3310b.o obj-y += clock.o machtype.o irq.o reset.o dma.o ec_kb3310b.o
# #
# Suspend Support # Suspend Support
......
...@@ -8,11 +8,7 @@ dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) ...@@ -8,11 +8,7 @@ dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr) 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) if (dma_addr > 0x8fffffff)
return dma_addr; return dma_addr;
return dma_addr & 0x0fffffff; return dma_addr & 0x0fffffff;
#else
return dma_addr & 0x7fffffff;
#endif
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment