From d7cdc9e8ac82c43fdcd4fde6b5b53d2dcba7f707 Mon Sep 17 00:00:00 2001
From: Paul Mundt <lethal@linux-sh.org>
Date: Wed, 27 Sep 2006 15:16:42 +0900
Subject: sh: ioremap() overhaul.

ioremap() overhaul. Add support for transparent PMB mapping, get rid of
p3_ioremap(), etc. Also drop ioremap() and iounmap() routines from the
machvec, as everyone can use the generic ioremap() API instead. For PCI
memory apertures and other special cases, use the pci_iomap() API, as
boards are already required to get the mapping right there.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---
 include/asm-sh/landisk/iodata_landisk.h |  3 +++
 include/asm-sh/mmu.h                    | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

(limited to 'include')

diff --git a/include/asm-sh/landisk/iodata_landisk.h b/include/asm-sh/landisk/iodata_landisk.h
index 7189d3a363..9db3cdfe67 100644
--- a/include/asm-sh/landisk/iodata_landisk.h
+++ b/include/asm-sh/landisk/iodata_landisk.h
@@ -74,5 +74,8 @@ extern int landisk_ledparam;    /* from setup.c */
 extern int landisk_buzzerparam; /* from setup.c */
 extern int landisk_arch;        /* from setup.c */
 
+#define __IO_PREFIX landisk
+#include <asm/io_generic.h>
+
 #endif  /* __ASM_SH_IODATA_LANDISK_H */
 
diff --git a/include/asm-sh/mmu.h b/include/asm-sh/mmu.h
index 91c8846342..ec09589fa6 100644
--- a/include/asm-sh/mmu.h
+++ b/include/asm-sh/mmu.h
@@ -50,6 +50,8 @@ typedef unsigned long mm_context_t;
 
 #define PMB_NO_ENTRY		(-1)
 
+struct pmb_entry;
+
 struct pmb_entry {
 	unsigned long vpn;
 	unsigned long ppn;
@@ -60,16 +62,23 @@ struct pmb_entry {
 	 * PMB_NO_ENTRY to search for a free one
 	 */
 	int entry;
+
+	struct pmb_entry *next;
+	/* Adjacent entry link for contiguous multi-entry mappings */
+	struct pmb_entry *link;
 };
 
 /* arch/sh/mm/pmb.c */
 int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
 		    unsigned long flags, int *entry);
-void set_pmb_entry(struct pmb_entry *pmbe);
+int set_pmb_entry(struct pmb_entry *pmbe);
 void clear_pmb_entry(struct pmb_entry *pmbe);
 struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
 			    unsigned long flags);
 void pmb_free(struct pmb_entry *pmbe);
+long pmb_remap(unsigned long virt, unsigned long phys,
+	       unsigned long size, unsigned long flags);
+void pmb_unmap(unsigned long addr);
 
 #endif /* __MMU_H */
 
-- 
cgit v1.2.2