Skip to contentSkip to conversation

m68k: use ColdFire MMU read/write bit flags when ioremapping

PATCH New [email protected] 1 participant 1 message Dec 22, 2011 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH v4 23/35 m68k: use ColdFire MMU read/write bit flags when ioremapping

From: Greg Ungerer <[email protected]>

The ColdFire MMU has separate read and write bits, unlike the Motorola m68k MMU which has a single read-only bit.

Define a _PAGE_READWRITE value for the Motorola MMU, which is 0, so we can unconditionaly include that in the page table entry bits when setting up ioremapped pages.

---

This is a re-working to avoid using a #ifdef. Seems much nice this way.

 arch/m68k/include/asm/motorola_pgtable.h |    1 +
 arch/m68k/mm/kmap.c                      |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/m68k/include/asm/motorola_pgtable.h +1 -0
index 45bd3f5..e0fdd4d 100644
@@ -8,6 +8,7 @@
 #define _PAGE_PRESENT	0x001
 #define _PAGE_SHORT	0x002
 #define _PAGE_RONLY	0x004
+#define _PAGE_READWRITE	0x000
 #define _PAGE_ACCESSED	0x008
 #define _PAGE_DIRTY	0x010
 #define _PAGE_SUPER	0x080	/* 68040 supervisor only */
arch/m68k/mm/kmap.c +2 -1
index 6934584..1cc2bed 100644
@@ -171,7 +171,8 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla
 			break;
 		}
 	} else {
-		physaddr |= (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY);
+		physaddr |= (_PAGE_PRESENT | _PAGE_ACCESSED |
+			     _PAGE_DIRTY | _PAGE_READWRITE);
 		switch (cacheflag) {
 		case IOMAP_NOCACHE_SER:
 		case IOMAP_NOCACHE_NONSER:
Signature · 1 line
1.7.0.4