diff mbox series

[v3,3/5] m68k - add MMIO ioremap support for mvme147

Message ID 20220713025601.22584-4-schmitzmic@gmail.com (mailing list archive)
State Deferred
Headers show
Series Convert m68k MVME147 WD33C93 SCSI driver to DMA API | expand

Commit Message

Michael Schmitz July 13, 2022, 2:55 a.m. UTC
Converting the mvme147 SCSI driver to the DMA API requires use of
ioremap() in order to get the kernel virtual address of the WD
chip registers.

Add support for transparent mapping of the mvme147 MMIO region to
arch/m68k/mm/kmap.c to enable use of ioremap() in that driver.

Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@gmail.com
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 arch/m68k/mm/kmap.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index 7594a945732b..2bcede2af902 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -185,6 +185,13 @@  void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
 			return (void __iomem *)physaddr;
 	}
 #endif
+#ifdef CONFIG_MVME147
+	if (MACH_IS_MVME147) {
+		if (physaddr >= 0xe0000000 && cacheflag == IOMAP_NOCACHE_SER)
+			return (void __iomem *)physaddr;
+	}
+#endif
+
 #ifdef CONFIG_COLDFIRE
 	if (__cf_internalio(physaddr))
 		return (void __iomem *) physaddr;
@@ -308,6 +315,10 @@  void iounmap(void __iomem *addr)
 	if (MACH_IS_VIRT && (unsigned long)addr >= 0xff000000)
 		return;
 #endif
+#ifdef CONFIG_MVME147
+	if (MACH_IS_MVME147 && (unsigned long)addr >= 0xe000000)
+		return;
+#endif
 #ifdef CONFIG_COLDFIRE
 	if (cf_internalio(addr))
 		return;