summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/Makefile12
-rw-r--r--arch/arm/mm/fault-armo.c25
-rw-r--r--arch/arm/mm/fault-armv.c2
-rw-r--r--arch/arm/mm/init.c22
-rw-r--r--arch/arm/mm/mm-arc.c76
-rw-r--r--arch/arm/mm/mm-armv.c71
-rw-r--r--arch/arm/mm/mm-ebsa110.c23
-rw-r--r--arch/arm/mm/mm-ebsa285.c128
-rw-r--r--arch/arm/mm/mm-nexuspci.c31
-rw-r--r--arch/arm/mm/mm-rpc.c56
-rw-r--r--arch/arm/mm/mm-tbox.c56
-rw-r--r--arch/arm/mm/mm-vnc.c32
-rw-r--r--arch/arm/mm/proc-arm2,3.S12
-rw-r--r--arch/arm/mm/proc-arm6,7.S12
14 files changed, 377 insertions, 181 deletions
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index be9be35f0..fc9809144 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -7,6 +7,7 @@
#
# Note 2! The CFLAGS definition is now in the main makefile...
+all: lib first_rule
ifeq ($(MACHINE),a5k)
MMARCH=arc
else
@@ -30,13 +31,14 @@ proc-arm2,3.o: ../lib/constants.h
proc-arm6,7.o: ../lib/constants.h
proc-sa110.o: ../lib/constants.h
-.PHONY: ../lib/constants.h
-../lib/constants.h:
- @$(MAKE) -C ../lib constants.h
-
-ifneq ($(CONFIG_BINUTILS_NEW),y)
%.o: %.S
+ifneq ($(CONFIG_BINUTILS_NEW),y)
$(CC) $(CFLAGS) -D__ASSEMBLY__ -E $< | tr ';$$' '\n#' > ..$@.tmp.s
$(CC) $(CFLAGS:-pipe=) -c -o $@ ..$@.tmp.s
$(RM) ..$@.tmp.s
+else
+ $(CC) $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $<
endif
+
+.PHONY: lib
+lib:; @$(MAKE) -C ../lib constants.h
diff --git a/arch/arm/mm/fault-armo.c b/arch/arm/mm/fault-armo.c
index 6e1024c30..9959eacb6 100644
--- a/arch/arm/mm/fault-armo.c
+++ b/arch/arm/mm/fault-armo.c
@@ -5,6 +5,7 @@
* Modifications for ARM processor (c) 1995, 1996 Russell King
*/
+#include <linux/config.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/head.h>
@@ -29,9 +30,21 @@
struct pgtable_cache_struct quicklists;
-void __bad_pte(pmd_t *pmd)
+void __bad_pmd(pmd_t *pmd)
{
printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd));
+#ifdef CONFIG_DEBUG_ERRORS
+ __backtrace();
+#endif
+ set_pmd(pmd, mk_pmd(BAD_PAGETABLE));
+}
+
+void __bad_pmd_kernel(pmd_t *pmd)
+{
+ printk("Bad pmd in pte_alloc_kernel: %08lx\n", pmd_val(*pmd));
+#ifdef CONFIG_DEBUG_ERRORS
+ __backtrace();
+#endif
set_pmd(pmd, mk_pmd(BAD_PAGETABLE));
}
@@ -65,7 +78,7 @@ pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset)
}
kfree (pte);
if (pmd_bad(*pmd)) {
- __bad_pte(pmd);
+ __bad_pmd(pmd);
return NULL;
}
return (pte_t *) pmd_page(*pmd) + offset;
@@ -145,11 +158,11 @@ good_area:
bad_area:
up(&mm->mmap_sem);
if (mode & FAULT_CODE_USER) {
-extern int console_loglevel;
-cli();
+//extern int console_loglevel;
+//cli();
tsk->tss.error_code = mode;
tsk->tss.trap_no = 14;
-console_loglevel = 9;
+//console_loglevel = 9;
printk ("%s: memory violation at pc=0x%08lx, lr=0x%08lx (bad address=0x%08lx, code %d)\n",
tsk->comm, regs->ARM_pc, regs->ARM_lr, addr, mode);
//#ifdef DEBUG
@@ -157,7 +170,7 @@ console_loglevel = 9;
c_backtrace (regs->ARM_fp, 0);
//#endif
force_sig(SIGSEGV, tsk);
-while (1);
+//while (1);
goto out;
}
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 051b336bf..370dbd28e 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -25,6 +25,8 @@
#define FAULT_CODE_READ 0x02
#define FAULT_CODE_USER 0x01
+#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
+
struct pgtable_cache_struct quicklists;
void __bad_pmd(pmd_t *pmd)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 36b118eb2..a674b578d 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -34,6 +34,22 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD];
extern char _etext, _stext, _edata, __bss_start, _end;
extern char __init_begin, __init_end;
+int do_check_pgt_cache(int low, int high)
+{
+ int freed = 0;
+ if(pgtable_cache_size > high) {
+ do {
+ if(pgd_quicklist)
+ free_pgd_slow(get_pgd_fast()), freed++;
+ if(pmd_quicklist)
+ free_pmd_slow(get_pmd_fast()), freed++;
+ if(pte_quicklist)
+ free_pte_slow(get_pte_fast()), freed++;
+ } while(pgtable_cache_size > low);
+ }
+ return freed;
+}
+
/*
* BAD_PAGE is the page that is used for page faults when linux
* is out-of-memory. Older versions of linux just did a
@@ -119,10 +135,10 @@ __initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_
memzero (empty_zero_page, PAGE_SIZE);
start_mem = setup_pagetables (start_mem, end_mem);
- flush_tlb_all ();
- update_mm_cache_all ();
+ flush_tlb_all();
+ update_memc_all();
- return free_area_init (start_mem, end_mem);
+ return free_area_init(start_mem, end_mem);
}
/*
diff --git a/arch/arm/mm/mm-arc.c b/arch/arm/mm/mm-arc.c
index ff447a6be..6bb92f037 100644
--- a/arch/arm/mm/mm-arc.c
+++ b/arch/arm/mm/mm-arc.c
@@ -5,4 +5,78 @@
*
* Copyright (C) 1998 Russell King
*/
-#include <asm/arch/mm-init.h>
+#include <linux/init.h>
+#include <asm/hardware.h>
+#include <asm/pgtable.h>
+
+unsigned long phys_screen_end;
+
+/*
+ * This routine needs more work to make it dynamically release/allocate mem!
+ */
+__initfunc(unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update))
+{
+ static int updated = 0;
+
+ if (updated)
+ return 0;
+
+ updated = update;
+
+ if (update) {
+ unsigned long address = log_start, offset;
+ pgd_t *pgdp;
+
+ kmem = (kmem + 3) & ~3;
+
+ pgdp = pgd_offset (&init_mm, address); /* +31 */
+ offset = SCREEN_START;
+ while (address < SCREEN1_END) {
+ unsigned long addr_pmd, end_pmd;
+ pmd_t *pmdp;
+
+ /* if (pgd_none (*pgdp)) alloc pmd */
+ pmdp = pmd_offset (pgdp, address); /* +0 */
+ addr_pmd = address & ~PGDIR_MASK; /* 088000 */
+ end_pmd = addr_pmd + SCREEN1_END - address; /* 100000 */
+ if (end_pmd > PGDIR_SIZE)
+ end_pmd = PGDIR_SIZE;
+
+ do {
+ unsigned long addr_pte, end_pte;
+ pte_t *ptep;
+
+ if (pmd_none (*pmdp)) {
+ pte_t *new_pte = (pte_t *)kmem;
+ kmem += PTRS_PER_PTE * BYTES_PER_PTR;
+ memzero (new_pte, PTRS_PER_PTE * BYTES_PER_PTR);
+ set_pmd (pmdp, mk_pmd(new_pte));
+ }
+
+ ptep = pte_offset (pmdp, addr_pmd); /* +11 */
+ addr_pte = addr_pmd & ~PMD_MASK; /* 088000 */
+ end_pte = addr_pte + end_pmd - addr_pmd; /* 100000 */
+ if (end_pte > PMD_SIZE)
+ end_pte = PMD_SIZE;
+
+ do {
+ set_pte (ptep, mk_pte(offset, PAGE_KERNEL));
+ addr_pte += PAGE_SIZE;
+ offset += PAGE_SIZE;
+ ptep++;
+ } while (addr_pte < end_pte);
+
+ pmdp++;
+ addr_pmd = (addr_pmd + PMD_SIZE) & PMD_MASK;
+ } while (addr_pmd < end_pmd);
+
+ address = (address + PGDIR_SIZE) & PGDIR_MASK;
+ pgdp ++;
+ }
+
+ phys_screen_end = offset;
+ flush_tlb_all ();
+ update_memc_all ();
+ }
+ return kmem;
+}
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
new file mode 100644
index 000000000..b229e8987
--- /dev/null
+++ b/arch/arm/mm/mm-armv.c
@@ -0,0 +1,71 @@
+/*
+ * arch/arm/mm/mm-armv.c
+ *
+ * Common routines for ARM v3 and v4 architectures.
+ *
+ * Copyright (C) 1998 Russell King
+ *
+ * Do not compile this file directly!
+ */
+
+#ifndef MAPPING
+#error MAPPING not defined - do not compile this file individually
+#endif
+
+static const struct mapping {
+ unsigned long virtual;
+ unsigned long physical;
+ unsigned long length;
+ int domain:4,
+ prot_read:1,
+ prot_write:1;
+} mapping[] __initdata = {
+ MAPPING
+};
+
+#define SIZEOFMAP (sizeof(mapping) / sizeof(mapping[0]))
+
+__initfunc(unsigned long setup_io_pagetables(unsigned long start_mem))
+{
+ const struct mapping *mp;
+ int i;
+
+ for (i = 0, mp = mapping; i < SIZEOFMAP; i++, mp++) {
+ unsigned long virtual, physical, length;
+ int prot;
+
+ virtual = mp->virtual;
+ physical = mp->physical;
+ length = mp->length;
+ prot = (mp->prot_read ? PTE_AP_READ : 0) | (mp->prot_write ? PTE_AP_WRITE : 0);
+
+ while ((virtual & 1048575 || physical & 1048575) && length >= PAGE_SIZE) {
+ alloc_init_page(&start_mem, virtual, physical, mp->domain, prot);
+ length -= PAGE_SIZE;
+ virtual += PAGE_SIZE;
+ physical += PAGE_SIZE;
+ }
+
+ prot = (mp->prot_read ? PMD_SECT_AP_READ : 0) |
+ (mp->prot_write ? PMD_SECT_AP_WRITE : 0);
+
+ while (length >= 1048576) {
+ alloc_init_section(&start_mem, virtual, physical, mp->domain, prot);
+ length -= 1048576;
+ virtual += 1048576;
+ physical += 1048576;
+ }
+
+ prot = (mp->prot_read ? PTE_AP_READ : 0) | (mp->prot_write ? PTE_AP_WRITE : 0);
+
+ while (length >= PAGE_SIZE) {
+ alloc_init_page(&start_mem, virtual, physical, mp->domain, prot);
+ length -= PAGE_SIZE;
+ virtual += PAGE_SIZE;
+ physical += PAGE_SIZE;
+ }
+ }
+
+ return start_mem;
+}
+
diff --git a/arch/arm/mm/mm-ebsa110.c b/arch/arm/mm/mm-ebsa110.c
index a937e098d..90865e0b6 100644
--- a/arch/arm/mm/mm-ebsa110.c
+++ b/arch/arm/mm/mm-ebsa110.c
@@ -1,26 +1,15 @@
/*
* arch/arm/mm/mm-ebsa110.c
*
- * Extra MM routines for the Archimedes architecture
+ * Extra MM routines for the EBSA-110 architecture
*
* Copyright (C) 1998 Russell King
*/
-
+#include <linux/init.h>
#include <asm/io.h>
-/* map in IO */
-void setup_io_pagetables(void)
-{
- unsigned long address = IO_START;
- int spi = IO_BASE >> PGDIR_SHIFT;
-
- pgd_val(swapper_pg_dir[spi-1]) = 0xc0000000 | PMD_TYPE_SECT |
- PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
+#define MAPPING \
+ { IO_BASE - PGDIR_SIZE , 0xc0000000 , PGDIR_SIZE , DOMAIN_IO, 0, 1 }, \
+ { IO_BASE , IO_START , IO_SIZE , DOMAIN_IO, 0, 1 }
- while (address < IO_START + IO_SIZE && address) {
- pgd_val(swapper_pg_dir[spi++]) = address | PMD_TYPE_SECT |
- PMD_DOMAIN(DOMAIN_IO) |
- PMD_SECT_AP_WRITE;
- address += PGDIR_SIZE;
- }
-}
+#include "mm-armv.c"
diff --git a/arch/arm/mm/mm-ebsa285.c b/arch/arm/mm/mm-ebsa285.c
index eb5d7152a..82bbce899 100644
--- a/arch/arm/mm/mm-ebsa285.c
+++ b/arch/arm/mm/mm-ebsa285.c
@@ -3,16 +3,48 @@
*
* Extra MM routines for the EBSA285 architecture
*
- * Copyright (C) 1998 Russell King
+ * Copyright (C) 1998 Russell King, Dave Gilbert.
*/
+#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
+#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/io.h>
#include <asm/proc/mm-init.h>
-
+
+/*
+ * These two functions convert PCI bus addresses to virtual addresses
+ * and back again.
+ */
+unsigned long __virt_to_bus(unsigned long res)
+{
+ if (res < PAGE_OFFSET || res >= 0xD0000000) {
+ printk("__virt_to_bus: invalid address 0x%08lx\n", res);
+#ifdef CONFIG_DEBUG_ERRORS
+ __backtrace();
+#endif
+ } else
+ res = (res - PAGE_OFFSET) + 0x10000000;
+
+ return res;
+}
+
+unsigned long __bus_to_virt(unsigned long res)
+{
+ if (res < 0x10000000 || res >= 0x20000000) {
+ printk("__bus_to_virt: invalid address 0x%08lx\n", res);
+#ifdef CONFIG_DEBUG_ERRORS
+ __backtrace();
+#endif
+ } else
+ res = (res - 0x10000000) + PAGE_OFFSET;
+
+ return res;
+}
+
/* Logical Physical
* 0xfff00000 0x40000000 X-Bus
* 0xffe00000 0x7c000000 PCI I/O space
@@ -23,75 +55,25 @@
* 0xf8000000 0x7b000000 PCI Config type 0
*/
-static struct mapping {
- unsigned long virtual;
- unsigned long physical;
- unsigned long length;
-} io_mapping[] = {
- /*
- * This is to allow us to fiddle with the EEPROM
- * This entry will go away in time
- */
- { 0xd8000000, 0x41000000, 0x00400000 },
-
- /*
- * These ones are so that we can fiddle
- * with the various cards (eg VGA)
- * until we're happy with them...
- */
- { 0xdc000000, 0x7c000000, 0x00100000 },
- { 0xe0000000, 0x80000000, 0x10000000 },
-
- { 0xf8000000, 0x7b000000, 0x01000000 }, /* Type 0 Config */
-
- { 0xf9000000, 0x7a000000, 0x01000000 }, /* Type 1 Config */
-
- { 0xfc000000, 0x79000000, 0x01000000 }, /* PCI IACK */
- { 0xfd000000, 0x78000000, 0x01000000 }, /* Outbound wflsh*/
- { 0xfe000000, 0x42000000, 0x01000000 }, /* CSR */
- { 0xffe00000, 0x7c000000, 0x00100000 }, /* PCI I/O */
- { 0xfff00000, 0x40000000, 0x00100000 }, /* X-Bus */
-};
-
-#define SIZEOFIO (sizeof(io_mapping) / sizeof(io_mapping[0]))
-
-/* map in IO */
-unsigned long setup_io_pagetables(unsigned long start_mem)
-{
- struct mapping *mp;
- int i;
-
- for (i = 0, mp = io_mapping; i < SIZEOFIO; i++, mp++) {
- while ((mp->virtual & 1048575 || mp->physical & 1048575) && mp->length >= PAGE_SIZE) {
- alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
- PTE_AP_WRITE);
-
- mp->length -= PAGE_SIZE;
- mp->virtual += PAGE_SIZE;
- mp->physical += PAGE_SIZE;
- }
-
- while (mp->length >= 1048576) {
-if (mp->virtual > 0xf0000000)
- alloc_init_section(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
- PMD_SECT_AP_WRITE);
-else
-alloc_init_section(&start_mem, mp->virtual, mp->physical, DOMAIN_USER, PMD_SECT_AP_WRITE | PMD_SECT_AP_READ);
-
- mp->length -= 1048576;
- mp->virtual += 1048576;
- mp->physical += 1048576;
- }
-
- while (mp->length >= PAGE_SIZE) {
- alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
- PTE_AP_WRITE);
-
- mp->length -= PAGE_SIZE;
- mp->virtual += PAGE_SIZE;
- mp->physical += PAGE_SIZE;
- }
- }
- return start_mem;
-}
+/*
+ * This is to allow us to fiddle with the EEPROM
+ * This entry will go away in time, once the fmu
+ * can mmap() the flash.
+ *
+ * These ones are so that we can fiddle
+ * with the various cards (eg VGA)
+ * until we're happy with them...
+ */
+#define MAPPING \
+ { 0xd8000000, 0x41000000, 0x00400000, DOMAIN_USER, 1, 1 }, /* EEPROM */ \
+ { 0xdc000000, 0x7c000000, 0x00100000, DOMAIN_USER, 1, 1 }, /* VGA */ \
+ { 0xe0000000, 0x80000000, 0x10000000, DOMAIN_USER, 1, 1 }, /* VGA */ \
+ { 0xf8000000, 0x7b000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* Type 0 Config */ \
+ { 0xf9000000, 0x7a000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* Type 1 Config */ \
+ { 0xfc000000, 0x79000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* PCI IACK */ \
+ { 0xfd000000, 0x78000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* Outbound wflsh*/ \
+ { 0xfe000000, 0x42000000, 0x01000000, DOMAIN_IO , 0, 1 }, /* CSR */ \
+ { 0xffe00000, 0x7c000000, 0x00100000, DOMAIN_IO , 0, 1 }, /* PCI I/O */ \
+ { 0xfff00000, 0x40000000, 0x00100000, DOMAIN_IO , 0, 1 }, /* X-Bus */
+#include "mm-armv.c"
diff --git a/arch/arm/mm/mm-nexuspci.c b/arch/arm/mm/mm-nexuspci.c
index 2bb2d0fab..a7407c130 100644
--- a/arch/arm/mm/mm-nexuspci.c
+++ b/arch/arm/mm/mm-nexuspci.c
@@ -4,25 +4,24 @@
*
* Extra MM routines for the NexusPCI architecture
*
+ * Copyright (C) 1998 Phil Blundell
* Copyright (C) 1998 Russell King
*/
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/pgtable.h>
+#include <asm/page.h>
#include <asm/io.h>
+#include <asm/proc/mm-init.h>
-/* map in IO */
-void setup_io_pagetables(void)
-{
- unsigned long address = IO_START;
- int spi = IO_BASE >> PGDIR_SHIFT;
-
- pgd_val(swapper_pg_dir[spi-1]) = 0xc0000000 | PMD_TYPE_SECT |
- PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE;
-
- while (address < IO_START + IO_SIZE && address) {
- pgd_val(swapper_pg_dir[spi++]) = address | PMD_TYPE_SECT |
- PMD_DOMAIN(DOMAIN_IO) |
- PMD_SECT_AP_WRITE;
- address += PGDIR_SIZE;
- }
-}
+#define MAPPING \
+ { 0xfff00000, 0x10000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffe00000, 0x20000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffc00000, 0x60000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xfe000000, 0x80000000, 0x00100000, DOMAIN_IO, 0, 1 }, \
+ { 0xfd000000, 0x88000000, 0x00100000, DOMAIN_IO, 0, 1 }
+#include "mm-armv.c"
diff --git a/arch/arm/mm/mm-rpc.c b/arch/arm/mm/mm-rpc.c
index f789b8f79..573a89b90 100644
--- a/arch/arm/mm/mm-rpc.c
+++ b/arch/arm/mm/mm-rpc.c
@@ -5,9 +5,9 @@
*
* Copyright (C) 1998 Russell King
*/
-
#include <linux/sched.h>
#include <linux/slab.h>
+#include <linux/init.h>
#include <asm/pgtable.h>
#include <asm/setup.h>
@@ -88,50 +88,10 @@ void init_dram_banks(struct param_struct *params)
current->tss.memmap = __virt_to_phys((unsigned long)swapper_pg_dir);
}
-static struct mapping {
- unsigned long virtual;
- unsigned long physical;
- unsigned long length;
-} io_mapping[] = {
- { SCREEN2_BASE, SCREEN_START, 2*1048576 }, /* VRAM */
- { IO_BASE, IO_START, IO_SIZE } /* IO space */
-};
-
-#define SIZEOFIO (sizeof(io_mapping) / sizeof(io_mapping[0]))
-
-/* map in IO */
-unsigned long setup_io_pagetables(unsigned long start_mem)
-{
- struct mapping *mp;
- int i;
-
- for (i = 0, mp = io_mapping; i < SIZEOFIO; i++, mp++) {
- while ((mp->virtual & 1048575 || mp->physical & 1048575) && mp->length >= PAGE_SIZE) {
- alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
- PTE_AP_WRITE);
-
- mp->length -= PAGE_SIZE;
- mp->virtual += PAGE_SIZE;
- mp->physical += PAGE_SIZE;
- }
-
- while (mp->length >= 1048576) {
- alloc_init_section(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
- PMD_SECT_AP_WRITE);
- mp->length -= 1048576;
- mp->virtual += 1048576;
- mp->physical += 1048576;
- }
-
- while (mp->length >= PAGE_SIZE) {
- alloc_init_page(&start_mem, mp->virtual, mp->physical, DOMAIN_IO,
- PTE_AP_WRITE);
-
- mp->length -= PAGE_SIZE;
- mp->virtual += PAGE_SIZE;
- mp->physical += PAGE_SIZE;
- }
- }
-
- return start_mem;
-}
+#define MAPPING \
+ { SCREEN2_BASE, SCREEN_START, 2*1048576, DOMAIN_IO, 0, 1 }, /* VRAM */ \
+ { IO_BASE, IO_START, IO_SIZE , DOMAIN_IO, 0, 1 } /* IO space */
+/*
+ * Include common routine to set up page tables
+ */
+#include "mm-armv.c"
diff --git a/arch/arm/mm/mm-tbox.c b/arch/arm/mm/mm-tbox.c
new file mode 100644
index 000000000..2cc5cc9e1
--- /dev/null
+++ b/arch/arm/mm/mm-tbox.c
@@ -0,0 +1,56 @@
+/*
+ * arch/arm/mm/mm-tbox.c
+ * from arch/arm/mm/mm-ebsa110.c
+ *
+ * Extra MM routines for the Tbox architecture
+ *
+ * Copyright (C) 1998 Phil Blundell
+ * Copyright (C) 1998 Russell King
+ */
+
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/proc/mm-init.h>
+
+
+/* Logical Physical
+ * 0xffff1000 0x00100000 DMA registers
+ * 0xffff2000 0x00200000 MPEG
+ * 0xffff3000 0x00300000 FPGA1 local control
+ * 0xffff4000 0x00400000 External serial
+ * 0xffff5000 0x00500000 Internal serial
+ * 0xffff6000 0x00600000 Parallel
+ * 0xffff7000 0x00700000 Interrupt control
+ * 0xffff8000 0x00800000 Computer video
+ * 0xffff9000 0x00900000 Control register 0
+ * 0xffffs000 0x00a00000 Control register 1
+ * 0xffffb000 0x00b00000 Control register 2
+ * 0xffffc000 0x00c00000 FPGA2 local control
+ * 0xffffd000 0x00d00000 Interrupt reset
+ * 0xffffe000 0x00e00000 MPEG DMA throttle
+ */
+
+#define MAPPING \
+ { 0xffff0000, 0x01000000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff1000, 0x00100000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff2000, 0x00200000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff3000, 0x00300000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff4000, 0x00400000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xfe000000, 0x00400000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff5000, 0x00500000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff6000, 0x00600000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff7000, 0x00700000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff8000, 0x00800000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffff9000, 0x00900000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffffa000, 0x00a00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffffb000, 0x00b00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffffc000, 0x00c00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffffd000, 0x00d00000, 0x00001000, DOMAIN_IO, 0, 1 }, \
+ { 0xffffe000, 0x00e00000, 0x00001000, DOMAIN_IO, 0, 1 }
+
+#include "mm-armv.c"
diff --git a/arch/arm/mm/mm-vnc.c b/arch/arm/mm/mm-vnc.c
new file mode 100644
index 000000000..eed49eb29
--- /dev/null
+++ b/arch/arm/mm/mm-vnc.c
@@ -0,0 +1,32 @@
+/*
+ * arch/arm/mm/mm-vnc.c
+ *
+ * Extra MM routines for the Corel VNC architecture
+ *
+ * Copyright (C) 1998 Russell King
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/io.h>
+#include <asm/proc/mm-init.h>
+
+/* Table describing the MMU translation mapping
+ * mainly used to set up the I/O mappings.
+ */
+#define MAPPING \
+ { 0xe0000000, DC21285_PCI_IO, 0x00100000, DOMAIN_IO, 0, 1 }, /* PCI I/O */ \
+ { 0xe0100000, DC21285_PCI_TYPE_0_CONFIG, 0x00f00000, DOMAIN_IO, 0, 1 }, /* Type 0 Config */ \
+ { 0xe1000000, DC21285_ARMCSR_BASE, 0x00100000, DOMAIN_IO, 0, 1 }, /* ARM CSR */ \
+ { 0xe1100000, DC21285_PCI_IACK, 0x00100000, DOMAIN_IO, 0, 1 }, /* PCI IACK */ \
+ { 0xe1300000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
+ { 0xe1400000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
+ { 0xe1500000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
+ { 0xe1600000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
+ { 0xe1700000, DC21285_OUTBOUND_WRITE_FLUSH, 0x00100000, DOMAIN_IO, 0, 1 }, /* Out wrflsh */ \
+ { 0xe1800000, DC21285_FLASH, 0x00800000, DOMAIN_IO, 0, 1 } /* Flash */
+
+#include "mm-armv.c"
diff --git a/arch/arm/mm/proc-arm2,3.S b/arch/arm/mm/proc-arm2,3.S
index 916bab104..86cab564a 100644
--- a/arch/arm/mm/proc-arm2,3.S
+++ b/arch/arm/mm/proc-arm2,3.S
@@ -123,7 +123,7 @@ Lconvertmemc: mov r3, r1, lsr #13 @
* address Address of fault.
* pte New PTE at address
* Purpose : Update the mapping for this address.
- * Notes : does the ARM3 run faster if you dont use the result in the next instruction?
+ * Notes : does the ARM3 run faster if you do not use the result in the next instruction?
*/
_arm2_3_update_cache:
tst r2, #PAGE_PRESENT
@@ -383,13 +383,13 @@ _arm3_proc_init:
mov r0, #0x001f0000
orr r0, r0, #0x0000ff00
orr r0, r0, #0x000000ff
- mcr p15, 0, r0, c3, c0
- mcr p15, 0, r0, c4, c0
+ mcr p15, 0, r0, c3, c0 @ ARM3 Cacheable
+ mcr p15, 0, r0, c4, c0 @ ARM3 Updateable
mov r0, #0
- mcr p15, 0, r0, c5, c0
+ mcr p15, 0, r0, c5, c0 @ ARM3 Disruptive
+ mcr p15, 0, r0, c1, c0 @ ARM3 Flush
mov r0, #3
- mcr p15, 0, r0, c1, c0
- mcr p15, 0, r0, c2, c0
+ mcr p15, 0, r0, c2, c0 @ ARM3 Control
movs pc, lr
/*
diff --git a/arch/arm/mm/proc-arm6,7.S b/arch/arm/mm/proc-arm6,7.S
index a853671fc..f4f4dfee9 100644
--- a/arch/arm/mm/proc-arm6,7.S
+++ b/arch/arm/mm/proc-arm6,7.S
@@ -347,12 +347,11 @@ _arm6_7_proc_fin:
*
* Purpose : Set a PMD and flush it out of any WB cache
*/
-_arm6_set_pmd: and r2, r1, #3
- teq r2, #2
- andeq r2, r1, #8
- orreq r1, r1, r2, lsl #1 @ Updatable = Cachable
+_arm6_set_pmd: and r2, r1, #11
teq r2, #1
- orreq r1, r1, #16 @ Updatable = 1 if Page table
+ teqne r2, #9
+ teqne r2, #10
+ orreq r1, r1, #16 @ Updatable = 1 if Page table/Cacheable section
str r1, [r0]
mov pc, lr
@@ -364,7 +363,8 @@ _arm6_set_pmd: and r2, r1, #3
*
* Purpose : Set a PMD and flush it out of any WB cache
*/
-_arm7_set_pmd: orr r1, r1, #16 @ Updatable bit is always set on ARM7
+_arm7_set_pmd: tst r1, #3
+ orrne r1, r1, #16 @ Updatable bit is always set on ARM7
str r1, [r0]
mov pc, lr