diff -uNr linux/Makefile linux-2.4.7/Makefile
--- linux/Makefile	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/Makefile	Wed Apr 17 02:55:34 2002
@@ -1,11 +1,12 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 7
-EXTRAVERSION =-rmk2
+EXTRAVERSION =-rmk2-stanson0
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+#ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+ARCH := arm
 
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
@@ -16,9 +17,9 @@
 FINDHPATH	= $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net
 
 HOSTCC  	= gcc
-HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS	= -Wall -Wstrict-prototypes -fomit-frame-pointer
 
-CROSS_COMPILE 	=
+CROSS_COMPILE 	= arm-linux-
 
 #
 # Include the make variables (CC, etc...)
diff -uNr linux/arch/arm/Makefile linux-2.4.7/arch/arm/Makefile
--- linux/arch/arm/Makefile	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/Makefile	Tue Nov 27 02:15:46 2001
@@ -124,6 +124,9 @@
 
 ifeq ($(CONFIG_ARCH_CLPS711X),y)
 TEXTADDR	 = 0xc0018000
+ifeq ($(CONFIG_CLPS7110_PSION),y)
+TEXTADDR	 = 0xc0038000
+endif
 MACHINE		 = clps711x
 endif
 
diff -uNr linux/arch/arm/config.in linux-2.4.7/arch/arm/config.in
--- linux/arch/arm/config.in	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/config.in	Mon Feb 11 05:36:58 2002
@@ -106,10 +106,17 @@
 fi
 endmenu
 
-mainmenu_option next_comment
-comment 'CLPS711X/EP721X Implementations'
-dep_bool '  P720T' CONFIG_ARCH_P720T $CONFIG_ARCH_CLPS711X
-endmenu
+if [ "$CONFIG_ARCH_CLPS711X" = "y" ]; then
+   mainmenu_option next_comment
+   comment 'CLPS711X/EP721X Implementations'
+   dep_bool '  P720T' CONFIG_ARCH_P720T $CONFIG_ARCH_CLPS7111
+   dep_bool '  CL-PS7110 based' CONFIG_ARCH_CLPS7110 $CONFIG_ARCH_CLPS711X
+   if [ "$CONFIG_ARCH_CLPS7110" = "y" ]; then
+      dep_bool '    Psion Series 5' CONFIG_CLPS7110_PSION $CONFIG_ARCH_CLPS7110
+      dep_bool '    Geofox' CONFIG_CLPS7110_GEOFOX $CONFIG_ARCH_CLPS7110
+   fi
+   endmenu
+fi
 
 # Definitions to make life easier
 if [ "$CONFIG_ARCH_ARCA5K" = "y" -o \
@@ -158,14 +165,15 @@
 comment 'Processor Type'
 
 # Firstly, figure out what processor architecture version we should be using.
-if [ "$CONFIG_ARCH_RPC"        = "y" -o "$CONFIG_ARCH_CLPS7500" = "y" ]; then
+if [ "$CONFIG_ARCH_RPC"        = "y" -o "$CONFIG_ARCH_CLPS7500" = "y" -o \
+     "$CONFIG_ARCH_CLPS7110"   = "y" ]; then
    define_bool CONFIG_CPU_32v3 y
 else
    define_bool CONFIG_CPU_32v3 n
 fi
 if [ "$CONFIG_ARCH_EBSA110"    = "y" -o "$CONFIG_FOOTBRIDGE"    = "y" -o \
      "$CONFIG_ARCH_TBOX"       = "y" -o "$CONFIG_ARCH_SHARK"    = "y" -o \
-     "$CONFIG_ARCH_NEXUSPCI"   = "y" -o "$CONFIG_ARCH_CLPS711X" = "y" -o \
+     "$CONFIG_ARCH_NEXUSPCI"   = "y" -o "$CONFIG_ARCH_P720T"    = "y" -o \
      "$CONFIG_ARCH_INTEGRATOR" = "y" -o "$CONFIG_ARCH_SA1100"   = "y" -o \
      "$CONFIG_ARCH_L7200"      = "y" -o "$CONFIG_ARCH_ANAKIN"	= "y" ]; then
    define_bool CONFIG_CPU_32v4 y
@@ -185,7 +193,7 @@
 fi
 
 # ARM710
-if [ "$CONFIG_ARCH_CLPS7500" = "y" ]; then
+if [ "$CONFIG_ARCH_CLPS7500" = "y" -o "$CONFIG_ARCH_CLPS7110" = "y" ]; then
    define_bool CONFIG_CPU_ARM710 y
 else
    if [ "$CONFIG_ARCH_RPC" = "y" ]; then
@@ -196,7 +204,7 @@
 fi
 
 # ARM720T
-if [ "$CONFIG_ARCH_CLPS711X" = "y" -o "$CONFIG_ARCH_L7200" = "y" ]; then
+if [ "$CONFIG_ARCH_P720T" = "y" -o "$CONFIG_ARCH_L7200" = "y" ]; then
    define_bool CONFIG_CPU_ARM720T y
 else
    if [ "$CONFIG_ARCH_INTEGRATOR" = "y" ]; then
@@ -260,6 +268,7 @@
 #fi
 
 # Select various configuration options depending on the machine type
+#if [ "$CONFIG_ARCH_SA1100" = "y" -o "$CONFIG_CLPS7110_PSION" = "y" ]; then
 if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
    define_bool CONFIG_DISCONTIGMEM y
 else
@@ -335,6 +344,7 @@
      "$CONFIG_ARCH_PERSONAL_SERVER" = "y" -o \
      "$CONFIG_ARCH_CATS" = "y" -o            \
      "$CONFIG_ARCH_P720T" = "y" -o	     \
+     "$CONFIG_ARCH_CLPS7110" = "y" -o	     \
      "$CONFIG_ARCH_ANAKIN" = "y" ]; then
    string 'Default kernel command string' CONFIG_CMDLINE ""
 fi
diff -uNr linux/arch/arm/kernel/arch.c linux-2.4.7/arch/arm/kernel/arch.c
--- linux/arch/arm/kernel/arch.c	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/kernel/arch.c	Thu Nov 29 01:59:39 2001
@@ -146,12 +146,7 @@
 	INITIRQ(genarch_init_irq)
 MACHINE_END
 #endif
-#ifdef CONFIG_ARCH_CLPS7110
-MACHINE_START(CLPS7110, "CL-PS7110")
-	MAINTAINER("Werner Almesberger")
-	INITIRQ(genarch_init_irq)
-MACHINE_END
-#endif
+
 #ifdef CONFIG_ARCH_ETOILE
 MACHINE_START(ETOILE, "Etoile")
 	MAINTAINER("Alex de Vries")
diff -uNr linux/arch/arm/kernel/debug-armv.S linux-2.4.7/arch/arm/kernel/debug-armv.S
--- linux/arch/arm/kernel/debug-armv.S	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/kernel/debug-armv.S	Thu Aug  9 06:12:32 2001
@@ -269,13 +269,13 @@
 
 #elif defined(CONFIG_ARCH_CLPS711X)
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
 		.macro	addruart,rx
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1			@ MMU enabled?
-		moveq	\rx, #CLPS7111_PHYS_BASE
-		movne	\rx, #CLPS7111_VIRT_BASE
+		moveq	\rx, #CLPS711X_PHYS_BASE
+		movne	\rx, #CLPS711X_VIRT_BASE
 #ifndef CONFIG_DEBUG_CLPS711X_UART2
 		add	\rx, \rx, #0x0000	@ UART1
 #else
diff -uNr linux/arch/arm/kernel/entry-armv.S linux-2.4.7/arch/arm/kernel/entry-armv.S
--- linux/arch/arm/kernel/entry-armv.S	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/kernel/entry-armv.S	Tue Nov 27 02:53:03 2001
@@ -454,17 +454,19 @@
 
 #elif defined(CONFIG_ARCH_CLPS711X)
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
 		.macro	disable_fiq
 		.endm
 
+#if !defined(CONFIG_ARCH_CLPS7110)
 #if (INTSR2 - INTSR1) != (INTMR2 - INTMR1)
 #error INTSR stride != INTMR stride
 #endif
+#endif
 
 		.macro	get_irqnr_and_base, irqnr, stat, base, mask
-		mov	\base, #CLPS7111_BASE
+		mov	\base, #CLPS711X_BASE
 		ldr	\stat, [\base, #INTSR1]
 		ldr	\mask, [\base, #INTMR1]
 		mov	\irqnr, #4
@@ -473,12 +475,14 @@
 		movs	\stat, \stat, lsr #4
 		bne	1001f
 
+#if !defined(CONFIG_ARCH_CLPS7110)
 		add	\base, \base, #INTSR2 - INTSR1
 		ldr	\stat, [\base, #INTSR1]
 		ldr	\mask, [\base, #INTMR1]
 		mov	\irqnr, #16
 		mov	\mask, \mask, lsl #16
 		and	\stat, \stat, \mask, lsr #16
+#endif
 
 1001:		tst	\stat, #255
 		addeq	\irqnr, \irqnr, #8
diff -uNr linux/arch/arm/kernel/head-armv.S linux-2.4.7/arch/arm/kernel/head-armv.S
--- linux/arch/arm/kernel/head-armv.S	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/kernel/head-armv.S	Sun Feb  3 19:24:13 2002
@@ -184,12 +184,12 @@
 #ifdef CONFIG_ALIGNMENT_TRAP
 		orr	r0, r0, #2			@ ...........A.
 #endif
+
 		bic	r2, r0, #2			@ Clear 'A' bit
 		stmia	r8, {r0, r2}			@ Save control register values
 		b	SYMBOL_NAME(start_kernel)
 
 
-
 /*
  * Setup the initial page tables.  We only setup the barest
  * amount which are required to get the kernel running, which
@@ -210,8 +210,16 @@
 		 * Clear the 16K level 1 swapper page table
 		 */
 		mov	r0, r4
+#if defined(CONFIG_CLPS7110_PSION)
+		/* Clear 8K level 2 table too */
+		sub	r0, r0, #0x2000
+#endif
 		mov	r3, #0
+#if defined(CONFIG_CLPS7110_PSION)
+		add	r2, r0, #0x6000
+#else
 		add	r2, r0, #0x4000
+#endif
 1:		str	r3, [r0], #4
 		str	r3, [r0], #4
 		str	r3, [r0], #4
@@ -219,6 +227,70 @@
 		teq	r0, r2
 		bne	1b
 
+#if defined(CONFIG_CLPS7110_PSION)
+
+		/* calculate physical address from virtual
+		 * see also __virt_to_phys() in 
+		 * include/asm-arm/arch-clps711x/memory.h */
+		.macro	v2phys, virt, phys
+		bic	\phys, \virt, #0x3f000000
+		bic	\phys, \phys, #0x00f80000	@ phys = virt & 0xc007ffff
+		tst	\virt, #0x00200000
+		orrne	\phys, \phys, #0x00200000 << 3	@ phys |= ((virt & 0x00200000) << 3)
+		tst	\virt, #0x00100000
+		orrne	\phys, \phys, #0x00100000 << 2	@ phys |= ((virt & 0x00100000) << 2)
+		tst	\virt, #0x00080000
+		orrne	\phys, \phys, #0x00080000 << 1	@ phys |= ((virt & 0x00080000) << 1)
+		.endm
+
+		/* for Psion S5 we also need a 8 tables for level 2
+		 * descriptors, this region will be used also by
+		 * alloc_init_page, so there will be sequence of
+		 * processor table, kernel table, processor table, etc...
+		 * we fill only processor tables, kernel tables will be
+		 * filled by paging_init() */
+
+		sub	r0, r4, #0x2000
+
+		/* and fill it with info about first 4MB as pages */
+		mov	r2, #TEXTADDR & 0xff000000
+		and	r11, r8, #0x000c		@ C & B flags for page
+		tst	r8, #0x0400
+		orrne	r11, r11, #0x0550
+		tst	r8, #0x0c00
+		orrne	r11, r11, #0x0aa0		@ access permissions
+		orr	r11, r11, #0x2			@ small page
+1:
+		v2phys	r2, r3				@ get physical address
+		orr	r3, r3, r11			@ set flags
+		str	r3, [r0], #4			@ write descriptor
+		add	r2, r2, #0x1000			@ next page
+		tst	r0, #0x00ff
+		tsteq	r0, #0x0300			@ if done with processor table
+		addeq	r0, r0, #0x0400			@ skip kernel table
+		teq	r0, r4
+		bne	1b
+
+		/*
+		 * Now setup the level 1 descriptors for our kernel
+		 * mapped region.  We round TEXTADDR down to the
+		 * nearest megabyte boundary.
+		 */
+		and	r2, r8, #0x01e0			@ Domain
+		orr	r2, r2, #0x0011			@ Page descriptor
+		sub	r0, r4, #0x2000			@ L2 page tables
+		orr	r3, r0, r2
+		add	r0, r4, #(TEXTADDR & 0xff000000) >> 18 @ start of kernel
+		str	r3, [r0], #4			@ KERNEL + 0MB
+		add	r3, r3, #0x0800
+		str	r3, [r0], #4			@ KERNEL + 1MB
+		add	r3, r3, #0x0800
+		str	r3, [r0], #4			@ KERNEL + 2MB
+		add	r3, r3, #0x0800
+		str	r3, [r0]			@ KERNEL + 3MB
+
+#else /* defined(CONFIG_CLPS7110_PSION) */
+
 		/*
 		 * Create identity mapping for first MB of kernel to
 		 * cater for the MMU enable.  This identity mapping
@@ -257,6 +329,8 @@
 		add	r3, r8, r2			@ flags + rambase
 		str	r3, [r0]
 
+#endif /* defined(CONFIG_CLPS7110_PSION) */
+
 		bic	r8, r8, #0x0c			@ turn off cacheable
 							@ and bufferable bits
 #ifdef CONFIG_DEBUG_LL
@@ -420,3 +494,4 @@
 2:		ldmib	r4, {r5, r6, r7}		@ found, get results
 		mov	r7, r7, lsr #18			@ pagetable byte offset
 		mov	pc, lr
+
diff -uNr linux/arch/arm/kernel/setup.c linux-2.4.7/arch/arm/kernel/setup.c
--- linux/arch/arm/kernel/setup.c	Fri Aug  3 05:39:58 2001
+++ linux-2.4.7/arch/arm/kernel/setup.c	Sun Dec  2 03:17:16 2001
@@ -72,6 +72,7 @@
 char elf_platform[ELF_PLATFORM_SIZE];
 char saved_command_line[COMMAND_LINE_SIZE];
 
+//static struct meminfo meminfo __initdata = { 0, };
 static struct meminfo meminfo __initdata = { 0, };
 static struct proc_info_item proc_info;
 static const char *machine_name;
diff -uNr linux/arch/arm/mach-clps711x/Makefile linux-2.4.7/arch/arm/mach-clps711x/Makefile
--- linux/arch/arm/mach-clps711x/Makefile	Fri Aug  3 05:39:59 2001
+++ linux-2.4.7/arch/arm/mach-clps711x/Makefile	Tue Nov 27 03:04:24 2001
@@ -11,7 +11,7 @@
 
 # Object file lists.
 
-obj-y			:= irq.o mm.o
+obj-y			:= irq.o
 obj-m			:=
 obj-n			:=
 obj-			:=
@@ -19,7 +19,9 @@
 export-objs		:= leds-p720t.o
 
 leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
-obj-$(CONFIG_ARCH_P720T) += p720t.o
+leds-$(CONFIG_CLPS7110_PSION) += psion_s5-leds.o
+obj-$(CONFIG_ARCH_P720T) += p720t.o p720t-mm.o
+obj-$(CONFIG_ARCH_CLPS7110) += clps7110.o clps7110-mm.o
 obj-$(CONFIG_LEDS)	+= $(leds-y)
 
 include $(TOPDIR)/Rules.make
diff -uNr linux/arch/arm/mach-clps711x/clps7110-mm.c linux-2.4.7/arch/arm/mach-clps711x/clps7110-mm.c
--- linux/arch/arm/mach-clps711x/clps7110-mm.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/arch/arm/mach-clps711x/clps7110-mm.c	Wed Apr 17 07:21:13 2002
@@ -0,0 +1,56 @@
+/*
+ *  linux/arch/arm/mach-clps711x/clps7110-mm.c
+ *
+ *  Extra MM routines for the Psion Series 5
+ *
+ *  Copyright (C) Andrew Kozin AKA Stanson <stanson@chat.ru>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+ 
+#include <asm/mach/map.h>
+
+#include <asm/hardware/clps711x.h>
+#include <asm/arch/syspld.h>
+
+static struct map_desc clps7110_io_desc[] __initdata = {
+#if defined(CONFIG_PCMCIA_ETNA)
+ { ETNA_VIRT_BASE, ETNA_PHYS_BASE, ETNA_SIZE, DOMAIN_IO, 0, 1},
+#endif
+ { CLPS711X_VIRT_BASE, CLPS711X_PHYS_BASE, 1048576, DOMAIN_IO, 0, 1 },
+ LAST_DESC
+};
+
+void __init clps7110_map_io(void)
+{
+	iotable_init(clps7110_io_desc);
+}
+ 
+void clps7110_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size)
+{
+	int i;
+
+	for (i = 0; i < MAX_NR_ZONES; i++) {
+		zone_size[i] -= zhole_size[i];
+		zhole_size[i] = 0;
+	}
+}
diff -uNr linux/arch/arm/mach-clps711x/clps7110.c linux-2.4.7/arch/arm/mach-clps711x/clps7110.c
--- linux/arch/arm/mach-clps711x/clps7110.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/arch/arm/mach-clps711x/clps7110.c	Sun Dec  2 06:16:40 2001
@@ -0,0 +1,102 @@
+/*
+ *  linux/arch/arm/mach-clps711x/psion_s5.c
+ *
+ *  Copyright (C) 2001 Andrew Kozin AKA Stanson <stanson@chat.ru>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/string.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/page.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+#include <asm/hardware/clps711x.h>
+
+extern void clps711x_init_irq(void);
+extern void clps7110_map_io(void);
+
+#define SET_TAG_MEM(_tag,_start,_size)	\
+	{_tag = tag_next(_tag);\
+	_tag->hdr.tag = ATAG_MEM;\
+	_tag->hdr.size = tag_size(tag_mem32);\
+	_tag->u.mem.size = (_size);\
+	_tag->u.mem.start = (_start);}
+
+static void __init
+clps7110_fixup(struct machine_desc *desc, struct param_struct *params,
+	    char **cmdline, struct meminfo *mi)
+{
+	struct tag *tag = (struct tag *)params;
+
+	tag->hdr.tag = ATAG_CORE;
+	tag->hdr.size = tag_size(tag_core);
+	tag->u.core.flags = 0;
+	tag->u.core.pagesize = PAGE_SIZE;
+	tag->u.core.rootdev = 0x0100;
+
+	SET_TAG_MEM(tag, 0xc0000000, 0x00080000);
+	SET_TAG_MEM(tag, 0xc0100000, 0x00080000);
+	SET_TAG_MEM(tag, 0xc0400000, 0x00080000);
+	SET_TAG_MEM(tag, 0xc0500000, 0x00080000);
+
+	SET_TAG_MEM(tag, 0xc1000000, 0x00080000);
+	SET_TAG_MEM(tag, 0xc1100000, 0x00080000);
+	SET_TAG_MEM(tag, 0xc1400000, 0x00080000);
+	SET_TAG_MEM(tag, 0xc1500000, 0x00080000);
+
+	SET_TAG_MEM(tag, 0xd0000000, 0x00080000);
+	SET_TAG_MEM(tag, 0xd0100000, 0x00080000);
+	SET_TAG_MEM(tag, 0xd0400000, 0x00080000);
+	SET_TAG_MEM(tag, 0xd0500000, 0x00080000);
+
+	SET_TAG_MEM(tag, 0xd1000000, 0x00080000);
+	SET_TAG_MEM(tag, 0xd1100000, 0x00080000);
+	SET_TAG_MEM(tag, 0xd1400000, 0x00080000);
+	SET_TAG_MEM(tag, 0xd1500000, 0x00080000);
+
+	tag = tag_next(tag);
+	tag->hdr.tag = ATAG_NONE;
+	tag->hdr.size = 0;
+}
+
+MACHINE_START(CLPS7110, "CL-PS7110")
+	MAINTAINER("Werner Almesberger")
+	BOOT_MEM(0xc0000000, 0x80000000, 0xff000000)
+	BOOT_PARAMS(0xc0023000)
+	FIXUP(clps7110_fixup)
+	MAPIO(clps7110_map_io)
+	INITIRQ(clps711x_init_irq)
+MACHINE_END
+
+static int clps7110_hw_init(void)
+{
+	/*
+	 * Power down as much as possible in case we don't
+	 * have the drivers loaded.
+	 */
+	return 0;
+}
+
+__initcall(clps7110_hw_init);
+
diff -uNr linux/arch/arm/mach-clps711x/irq.c linux-2.4.7/arch/arm/mach-clps711x/irq.c
--- linux/arch/arm/mach-clps711x/irq.c	Fri Aug  3 05:39:59 2001
+++ linux-2.4.7/arch/arm/mach-clps711x/irq.c	Tue Nov 27 02:38:16 2001
@@ -24,7 +24,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
 static void mask_irq_int1(unsigned int irq)
 {
@@ -62,6 +62,24 @@
 	clps_writel(intmr1, INTMR1);
 }
 
+
+#ifdef CONFIG_PCMCIA_ETNA
+static void mask_etna_irq(unsigned int irq)
+{
+	mask_irq_int1(irq);
+	ETNA_INT_MASK = 0;
+	ETNA_INT_CLEAR = ETNA_CF_IRQ;
+}
+
+static void unmask_etna_irq(unsigned int irq)
+{
+	ETNA_INT_MASK = ETNA_CF_IRQ;
+	unmask_irq_int1(irq);
+}
+#endif
+
+#if !defined(CONFIG_ARCH_CLPS7110)
+
 static void mask_irq_int2(unsigned int irq)
 {
 	u32 intmr2;
@@ -93,6 +111,8 @@
 	clps_writel(intmr2, INTMR2);
 }
 
+#endif /* !defined(CONFIG_ARCH_CLPS7110) */
+
 void __init clps711x_init_irq(void)
 {
 	unsigned int i;
@@ -107,6 +127,7 @@
 			irq_desc[i].mask	= mask_irq_int1;
 			irq_desc[i].unmask	= unmask_irq_int1;
 		}
+#if !defined(CONFIG_ARCH_CLPS7110)
 		if (INT2_IRQS & (1 << i)) {
 		        irq_desc[i].valid	= 1;
 			irq_desc[i].probe_ok	= 1;
@@ -116,13 +137,17 @@
 			irq_desc[i].mask	= mask_irq_int2;
 			irq_desc[i].unmask	= unmask_irq_int2;
 		}			
+#endif
 	}
 
 	/*
 	 * Disable interrupts
 	 */
 	clps_writel(0, INTMR1);
+
+#if !defined(CONFIG_ARCH_CLPS7110)
 	clps_writel(0, INTMR2);
+#endif
 
 	/*
 	 * Clear down any pending interrupts
@@ -134,5 +159,14 @@
 	clps_writel(0, TEOI);
 	clps_writel(0, UMSEOI);
 	clps_writel(0, SYNCIO);
+
+#if !defined(CONFIG_ARCH_CLPS7110)
 	clps_writel(0, KBDEOI);
+#endif
+
+#ifdef CONFIG_PCMCIA_ETNA
+	irq_desc[IRQ_EINT1].mask_ack = mask_etna_irq;
+	irq_desc[IRQ_EINT1].unmask = unmask_etna_irq;
+#endif
+
 }
diff -uNr linux/arch/arm/mach-clps711x/mm.c linux-2.4.7/arch/arm/mach-clps711x/mm.c
--- linux/arch/arm/mach-clps711x/mm.c	Fri Aug  3 05:39:59 2001
+++ linux-2.4.7/arch/arm/mach-clps711x/mm.c	Thu Jan  1 03:00:00 1970
@@ -1,49 +0,0 @@
-/*
- *  linux/arch/arm/mach-clps711x/mm.c
- *
- *  Extra MM routines for the ARM Integrator board
- *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-
-#include <asm/hardware.h>
-#include <asm/pgtable.h>
-#include <asm/page.h>
- 
-#include <asm/mach/map.h>
-
-#include <asm/hardware/clps7111.h>
-#include <asm/arch/syspld.h>
-
-/*
- * Logical      Physical
- */
- 
-static struct map_desc p720t_io_desc[] __initdata = {
- { SYSPLD_VIRT_BASE, SYSPLD_PHYS_BASE, 1048576, DOMAIN_IO, 0, 1},
- { 0xfe400000, 0x10400000, 1048576, DOMAIN_IO, 0, 1},
- { CLPS7111_VIRT_BASE, CLPS7111_PHYS_BASE, 1048576, DOMAIN_IO, 0, 1 },
- LAST_DESC
-};
-
-void __init p720t_map_io(void)
-{
-	iotable_init(p720t_io_desc);
-}
diff -uNr linux/arch/arm/mach-clps711x/p720t-leds.c linux-2.4.7/arch/arm/mach-clps711x/p720t-leds.c
--- linux/arch/arm/mach-clps711x/p720t-leds.c	Fri Aug  3 05:39:59 2001
+++ linux-2.4.7/arch/arm/mach-clps711x/p720t-leds.c	Thu Aug  9 06:13:03 2001
@@ -28,7 +28,7 @@
 #include <asm/system.h>
 #include <asm/mach-types.h>
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 #include <asm/hardware/ep7212.h>
 
 static void p720t_leds_event(led_event_t ledevt)
diff -uNr linux/arch/arm/mach-clps711x/p720t-mm.c linux-2.4.7/arch/arm/mach-clps711x/p720t-mm.c
--- linux/arch/arm/mach-clps711x/p720t-mm.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/arch/arm/mach-clps711x/p720t-mm.c	Thu Aug  9 06:12:52 2001
@@ -0,0 +1,49 @@
+/*
+ *  linux/arch/arm/mach-clps711x/mm.c
+ *
+ *  Extra MM routines for the ARM Integrator board
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+ 
+#include <asm/mach/map.h>
+
+#include <asm/hardware/clps711x.h>
+#include <asm/arch/syspld.h>
+
+/*
+ * Logical      Physical
+ */
+ 
+static struct map_desc p720t_io_desc[] __initdata = {
+ { SYSPLD_VIRT_BASE, SYSPLD_PHYS_BASE, 1048576, DOMAIN_IO, 0, 1},
+ { 0xfe400000, 0x10400000, 1048576, DOMAIN_IO, 0, 1},
+ { CLPS711X_VIRT_BASE, CLPS711X_PHYS_BASE, 1048576, DOMAIN_IO, 0, 1 },
+ LAST_DESC
+};
+
+void __init p720t_map_io(void)
+{
+	iotable_init(p720t_io_desc);
+}
diff -uNr linux/arch/arm/mach-clps711x/psion_s5-leds.c linux-2.4.7/arch/arm/mach-clps711x/psion_s5-leds.c
--- linux/arch/arm/mach-clps711x/psion_s5-leds.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/arch/arm/mach-clps711x/psion_s5-leds.c	Fri Aug 10 02:49:54 2001
@@ -0,0 +1,66 @@
+/*
+ *  linux/arch/arm/mach-clps711x/psion_s5-leds.c
+ *
+ *  Integrator LED control routines
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/leds.h>
+#include <asm/system.h>
+#include <asm/mach-types.h>
+
+#include <asm/hardware/clps711x.h>
+
+static void psion_s5_leds_event(led_event_t ledevt)
+{
+	unsigned long flags;
+	u32 pddr;
+
+	local_irq_save(flags);
+	switch(ledevt) {
+	case led_idle_start:
+		break;
+
+	case led_idle_end:
+		break;
+
+	case led_timer:
+		pddr = clps_readb(PDDR);
+		clps_writeb(pddr ^ 0x10, PDDR);
+		break;
+
+	default:
+		break;
+	}
+
+	local_irq_restore(flags);
+}
+
+static int __init leds_init(void)
+{
+	if (machine_is_psion_s5())
+		leds_event = psion_s5_leds_event;
+
+	return 0;
+}
+
+__initcall(leds_init);
diff -uNr linux/arch/arm/mm/discontig.c linux-2.4.7/arch/arm/mm/discontig.c
--- linux/arch/arm/mm/discontig.c	Fri Aug  3 05:39:59 2001
+++ linux-2.4.7/arch/arm/mm/discontig.c	Thu Feb  7 23:04:43 2002
@@ -15,22 +15,34 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 
-#if NR_NODES != 4
-#error Fix Me Please
+#if defined(CONFIG_CLPS7110_PSION)
+  #if NR_NODES != 2
+  #error Fix Me Please
+  #endif
+#else
+  #if NR_NODES != 4
+  #error Fix Me Please
+  #endif
 #endif
-
 /*
  * Our node_data structure for discontigous memory.
  */
 
 static bootmem_data_t node_bootmem_data[NR_NODES];
 
+#if defined(CONFIG_CLPS7110_PSION)
+pg_data_t discontig_node_data[NR_NODES] = {
+  { bdata: &node_bootmem_data[0] },
+  { bdata: &node_bootmem_data[1] }
+};
+#else
 pg_data_t discontig_node_data[NR_NODES] = {
   { bdata: &node_bootmem_data[0] },
   { bdata: &node_bootmem_data[1] },
   { bdata: &node_bootmem_data[2] },
   { bdata: &node_bootmem_data[3] }
 };
+#endif
 
 EXPORT_SYMBOL(discontig_node_data);
 
diff -uNr linux/arch/arm/mm/init.c linux-2.4.7/arch/arm/mm/init.c
--- linux/arch/arm/mm/init.c	Fri Aug  3 05:39:59 2001
+++ linux-2.4.7/arch/arm/mm/init.c	Wed Apr 17 16:37:11 2002
@@ -35,9 +35,9 @@
 #include <asm/mach/map.h>
 
 #ifndef CONFIG_DISCONTIGMEM
-#define NR_NODES	1
+  #define NR_NODES	1
 #else
-#define NR_NODES	4
+  #define NR_NODES	4
 #endif
 
 #ifdef CONFIG_CPU_32
@@ -343,15 +343,21 @@
 	 * Register the kernel text and data with bootmem.
 	 * Note that this can only be in node 0.
 	 */
-	reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
+	reserve_bootmem_node(pgdat, __pa(&_stext), __pa(&_end) - __pa(&_stext));
 
 #ifdef CONFIG_CPU_32
+#if !defined(CONFIG_CLPS7110_PSION)
 	/*
 	 * Reserve the page tables.  These are already in use,
 	 * and can only be in node 0.
 	 */
 	reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
 			     PTRS_PER_PGD * sizeof(void *));
+#else
+	/* Reserve the Level 2 table */
+	reserve_bootmem_node(pgdat, __pa(swapper_pg_dir) - PAGE_SIZE * 2, 
+			     PTRS_PER_PGD * sizeof(void *) + PAGE_SIZE * 2);
+#endif
 #endif
 	/*
 	 * And don't forget to reserve the allocator bitmap,
@@ -384,6 +390,11 @@
 	 */
 	reserve_bootmem_node(pgdat, PHYS_OFFSET, __pa(swapper_pg_dir)-PHYS_OFFSET);
 #endif
+#ifdef CONFIG_ARCH_CLPS711X
+#include <asm/hardware/clps711x.h>
+        /* Reserve the video memory area */
+        reserve_bootmem_node(pgdat, CLPS711X_LCD_MEM_BASE, CLPS711X_LCD_MEM_SIZE);
+#endif
 }
 
 /*
@@ -589,13 +600,19 @@
 	initpages = &__init_end - &__init_begin;
 
 	high_memory = (void *)__va(meminfo.end);
+#if defined(CONFIG_CLPS7110_PSION)
+	max_mapnr   = (meminfo.end - PHYS_OFFSET) >> PAGE_SHIFT;
+#else
 	max_mapnr   = virt_to_page(high_memory) - mem_map;
-
+#endif
 	/*
 	 * We may have non-contiguous memory.
 	 */
+
+#if !defined(CONFIG_CLPS7110_PSION)
 	if (meminfo.nr_banks != 1)
 		create_memmap_holes(&meminfo);
+#endif
 
 	/* this will put all unused low memory onto the freelists */
 	for (node = 0; node < numnodes; node++)
@@ -610,15 +627,22 @@
 	 * Since our memory may not be contiguous, calculate the
 	 * real number of pages we have in this system
 	 */
-	printk(KERN_INFO "Memory:");
+	printk(KERN_INFO "Memory map:\n");
 
 	num_physpages = 0;
 	for (i = 0; i < meminfo.nr_banks; i++) {
 		num_physpages += meminfo.bank[i].size >> PAGE_SHIFT;
-		printk(" %ldMB", meminfo.bank[i].size >> 20);
+		printk(KERN_INFO "  bank %d: %lx - %lx, ", i,
+			meminfo.bank[i].start,
+			meminfo.bank[i].start + meminfo.bank[i].size);
+		if(meminfo.bank[i].size >> 20)
+			printk("%ldMB\n", meminfo.bank[i].size >> 20);
+		else
+			printk("%ldKB\n", meminfo.bank[i].size >> 10);
+			
 	}
 
-	printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
+	printk(KERN_INFO "%luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
 	printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
 		"%dK data, %dK init)\n",
 		(unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
diff -uNr linux/drivers/char/Makefile linux-2.4.7/drivers/char/Makefile
--- linux/drivers/char/Makefile	Fri Aug  3 05:40:00 2001
+++ linux-2.4.7/drivers/char/Makefile	Tue Nov 27 03:42:10 2001
@@ -81,6 +81,10 @@
   ifeq ($(CONFIG_KMI_KEYB),y)
     KEYBD    := amba_kmi_keyb.o
   endif
+  ifeq ($(CONFIG_CLPS7110_PSION),y)
+    KEYMAP   := keymap_psion.o
+#    KEYBD    := kbd_clps7110.o
+  endif
 endif
 
 ifeq ($(ARCH),sh)
@@ -262,3 +266,6 @@
 
 defkeymap.c: defkeymap.map
 	loadkeys --mktable defkeymap.map > defkeymap.c
+
+keymap_psion.c: keymap_psion.map
+	loadkeys --mktable keymap_psion.map > keymap_psion.c
diff -uNr linux/drivers/char/kbd_clps7110.c linux-2.4.7/drivers/char/kbd_clps7110.c
--- linux/drivers/char/kbd_clps7110.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/char/kbd_clps7110.c	Wed Jul 25 03:37:54 2001
@@ -0,0 +1,293 @@
+/*
+ * arch/arm/drivers/char/kbd_7110.c - Keyboard Driver for clps7110
+ *
+ * Copyright (C) Roger Gammans  1998
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <asm/arch/keyboard.h>
+#include <linux/tqueue.h>
+#include <linux/kbd_ll.h>
+#include <asm/spinlock.h>
+#include <linux/tty_flip.h>
+#include <linux/delay.h>
+#include <asm/arch/pm.h>
+
+#ifdef KB_DELAY
+unsigned int kbd_delay[] = KB_DELAY; 
+#endif
+
+static int keysdown = 0;
+
+static struct tq_struct kbdhw_task;
+
+struct tty_struct **tty;
+
+
+static void kbd_power(struct pm_device *dev,int state)
+{
+	/* @@@ add fancy power-saving features later */
+	pm_complete(dev,state);
+}
+
+
+static struct pm_device kbd_pm_dev =
+    { "keyboard", kbd_power, 1, { PM_KEYBOARD_IDLE_DEFAULT, } };
+
+/*
+ * The aim of this function is to remove 
+ * any old depressed keys which are now released from
+ * the table.
+ */
+ 
+void kbd7110_cleartable(void) {
+int key;
+int flags;
+unsigned int t;
+
+    for (key=0; key<NR_KEYCODES; key++) {
+         if (kbdstate[key].in) {
+             /*
+              * dont worry these ops are commutative and
+              * assoicative 
+              */
+             t = (jiffies - kbdstate[key].jif) & KB_JIFMASK; 
+             if (t>KB_DEB_JIFFY) {
+
+             /* Yes, the keboard could have changed in the meanwhile
+              * but it hardly matters, and there nothing we can
+              * do to remove the possibly of short key ups 
+              */
+						
+                 spin_lock_irqsave(&kbd_spinlock,flags);
+                 kbdstate[key].in= 0;
+                 keysdown--;
+                 /*printk("Releasing key:%x\n",key);*/
+                 spin_unlock_irqrestore(&kbd_spinlock,flags);
+                 handle_scancode(KBSCANCDE(key,KBUP));
+             }
+         }
+    }
+
+}
+
+
+
+static void kbd_press(int keycode) {
+
+   unsigned long flags;
+   unsigned char newpress = 0;
+
+   spin_lock_irqsave(&kbd_spinlock,flags);
+   if (!kbdstate[keycode].in) {
+       keysdown++; 
+       newpress = 1;
+       /*printk("Found key down: %x\n",keycode);*/
+   }
+
+  /*
+   * We approximate a retriggable monostable
+   * action.
+   */
+    
+    kbdstate[keycode].in=1;
+    spin_unlock_irqrestore(&kbd_spinlock,flags);
+   /* We only need to ensure keysdown consistent */
+  
+    kbdstate[keycode].jif = jiffies & KB_JIFMASK;
+    if (newpress) {
+	pm_activity(&kbd_pm_dev);
+	handle_scancode(KBSCANCDE(keycode,KBDOWN));
+    }
+}
+
+
+
+
+static void kbd7110_tick(void* dummy) {
+    int col,row;
+    int rowd;
+    int count=0;
+   
+    /*
+     * we first check to see if any keys are depressed
+     */
+#ifdef KBD_SUPPORTS_WIRE_OR
+    KB_COL(ALLROWS)
+    if (KB_ROW) 
+#endif
+        for(col=0; col<8; col++) {
+
+#ifdef KB_DISCHARGE
+            /*
+             * Discharge the output driver capacitatance
+             * in the keyboard matrix. (Yes it is significant..)
+             */
+            KB_COL(KB_DISCHARGE);
+#ifdef KB_DELAY
+            udelay(kbd_delay[8]);
+#endif
+#endif
+            KB_COL(col);
+#ifdef KB_DELAY
+	    udelay(kbd_delay[col]);
+#endif
+            rowd = KB_ROW;
+            if (rowd) {
+                for (row=0; row < KB_LASTROW; row++) {
+                    if (rowd & KB_ROWMASK(row)) {
+                        kbd_press(KEYCODE(row,col));
+			count++;
+		    }
+                }
+            }
+
+        };
+    
+    if (count!=keysdown) {
+        kbd7110_cleartable();
+    }
+
+   /*
+    * Re-queue ourselves
+    */
+   queue_task(&kbdhw_task,&tq_timer);
+}
+
+
+
+#ifdef CONFIG_VT
+void kbd7110_hw_init(void) { 
+#else
+void kbd_init(struct tty_struct **atty)   {
+  tty=atty;
+#endif
+
+  printk("Initialising keyboard\n");
+  pm_register(&kbd_pm_dev,1);
+  kbdhw_task.routine = kbd7110_tick;
+  kbdhw_task.sync = 0;
+  queue_task(&kbdhw_task,&tq_timer);
+
+}
+
+
+/*
+ * (the rest of the) Kernel interface functions..
+ */
+#ifndef CONFIG_VT
+   
+void handle_scancode(unsigned char code) {
+  /*
+   * Really simple just shove the scan code straight in the flip
+   * buffer for now..
+  */
+    if (*tty) {
+        tty_insert_flip_char(*tty,code,0); 
+        tty_schedule_flip(*tty);
+    } else printk("discarding scancode\n");
+}
+
+#else
+
+ /*
+  *  I was hoping to divorce the VT's keyboard handler but
+  *  it turn out to be harder than I'd hoped....
+  *  we'll re-instate this lot when the lcd driver get closer
+  *  to integration with the vt code.
+  *                                  RGG
+  */
+ 
+int kbd7110_translate(unsigned char scancode, unsigned char *keycode_p)
+{
+
+ /*
+  * We do this strangley to be more independent of 
+  * our headers..
+  */
+
+  *keycode_p = scancode & ~(KBDOWN | KBUP);
+
+  return 1;
+}
+
+#endif
+
+
+#if defined(CONFIG_VT) && defined(CONFIG_MAGIC_SYSRQ)
+extern int sysrq_pressed;
+#endif
+
+
+void kbd7110_arch_handler(unsigned char value, char up_flag)
+{
+#if defined(CONFIG_VT) && defined(CONFIG_MAGIC_SYSRQ)
+	if (value == 1) {
+		sysrq_pressed = !up_flag;
+		return;
+	}
+#endif
+	if (up_flag) return;
+	switch (value) {
+#ifdef KBD_ARCHKEY_2
+		case 2:
+			KBD_ARCHKEY_2;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_3
+		case 3:
+			KBD_ARCHKEY_3;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_4
+		case 4:
+			KBD_ARCHKEY_4;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_5
+		case 5:
+			KBD_ARCHKEY_5;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_6
+		case 6:
+			KBD_ARCHKEY_6;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_7
+		case 7:
+			KBD_ARCHKEY_7;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_8
+		case 8:
+			KBD_ARCHKEY_8;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_9
+		case 9:
+			KBD_ARCHKEY_9;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_10
+		case 10:
+			KBD_ARCHKEY_10;
+			break;
+#endif
+#ifdef KBD_ARCHKEY_11
+		case 11:
+			KBD_ARCHKEY_11;
+			break;
+#endif
+		default:
+			return;
+	}
+}
+
+
+void __init kbd_reset_setup(char *str, int *ints)
+{
+}
diff -uNr linux/drivers/char/kbd_psion.c linux-2.4.7/drivers/char/kbd_psion.c
--- linux/drivers/char/kbd_psion.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/char/kbd_psion.c	Wed Jul 25 03:37:54 2001
@@ -0,0 +1,170 @@
+/*
+ * kbd_psion.c - Psion-specific keyboard functions
+ *
+ * Written 1999 by Werner Almesberger
+ */
+
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <asm/system.h>
+#include <asm/hardware.h>
+#include <asm/keyboard.h>
+#include <asm/arch/pm.h>
+
+
+#ifdef CONFIG_MAGIC_SYSRQ
+unsigned char kbd7110_sysrq_xlate[] =
+    "\000" "6"    "5"    "4"    "3"    "2"    "1"    "\000"
+    "\000" "'"    "\000" "0"    "9"    "8"    "7"    "\000"
+    "\000" "y"    "t"    "r"    "e"    "w"    "q"    "\000"
+    "\000" "\012" "l"    "p"    "o"    "i"    "u"    "\000"
+    "\000" "g"    "f"    "d"    "s"    "a"    "\011" "\000"
+    "\000" "\000" "."    "m"    "k"    "j"    "h"    "\000"
+    "\000" "n"    "b"    "v"    "c"    "x"    "z"    "\000"
+    "\000" "\000" "\000" ","    "\000" " "    "\000";
+#endif
+
+
+void psion_off(void)
+{
+	pm_switch(PM_SWITCH_TOGGLE);
+}
+
+
+static void backlight_power(struct pm_device *dev,int state)
+{
+	if (state) HW_ELEN_PORT |= HW_ELEN_BIT;
+	else HW_ELEN_PORT &= ~HW_ELEN_BIT;
+	pm_complete(dev,state);
+}
+
+
+struct pm_device backlight_pm_dev =
+    { "backlight", backlight_power, 1, { PM_BACKLIGHT_IDLE_DEFAULT, } };
+
+
+void psion_toggle_backlight(void)
+{
+	pm_change(&backlight_pm_dev,!backlight_pm_dev.goal);
+}
+
+
+/*
+ * Contrast table. Upper four bits: output value, lower four bits: direction
+ * (0 = in = Z)
+ */
+
+#define V0 0
+#define V1 1
+#define VZ 0
+#define D0 1
+#define D1 1
+#define DZ 0
+
+#define C(a,b,c,d) \
+    ((V##a << 7) | (V##b << 6) | (V##c << 5) | (V##d << 4) | \
+     (D##a << 3) | (D##b << 2) | (D##c << 1) | D##d)
+    
+static __u8 contrast_table[] = {
+    C(1,1,1,1), C(1,1,1,Z), C(1,1,1,0), C(1,1,Z,1),	/*  1- 4 */
+    C(1,1,Z,Z), C(1,1,0,1), C(1,1,Z,0), C(1,Z,1,1),	/*  5- 8 */
+    C(1,1,0,0), C(1,Z,1,Z), C(1,Z,1,0), C(1,Z,Z,1),	/*  9-12 */
+    C(1,0,1,1), C(1,Z,Z,Z), C(1,Z,0,1), C(1,0,1,Z),	/* 13-16 */
+    C(1,0,1,0), C(1,0,Z,1), C(1,Z,0,0), C(Z,1,1,Z),	/* 17-20 */
+    C(1,0,Z,Z), C(1,0,0,1), C(1,0,Z,0), C(1,0,0,Z),	/* 21-24 */
+    C(Z,1,Z,Z), C(1,0,0,0), C(Z,1,Z,0), C(Z,1,0,Z),	/* 25-28 */
+    C(Z,1,0,0), C(Z,Z,1,Z), C(Z,Z,1,0), C(Z,Z,Z,1),	/* 29-32 */
+    C(0,1,1,0), C(0,1,Z,1), C(Z,Z,0,1), C(Z,0,1,Z),	/* 33-36 */
+    C(0,1,Z,Z), C(Z,Z,0,Z), C(0,1,Z,0), C(Z,Z,0,0),	/* 37-40 */
+    C(0,1,0,Z), C(Z,0,Z,Z), C(0,1,0,0), C(Z,0,Z,0),	/* 41-44 */
+    C(0,Z,1,0), C(0,Z,Z,1), C(Z,0,0,0), C(0,0,1,1),	/* 45-48 */
+    C(0,Z,Z,Z), C(0,Z,0,1), C(0,Z,Z,0), C(0,0,1,0),	/* 49-52 */
+    C(0,0,Z,1), C(0,Z,0,0), C(0,0,Z,Z), C(0,0,0,1),	/* 53-56 */
+    C(0,0,Z,0), C(0,0,0,Z), C(0,0,0,0)			/* 57-60 */
+};
+
+
+void psion_contrast(int increase)
+{
+	static int contrast = 24;
+
+	if (increase)
+		if (contrast == sizeof(contrast_table)-1) return;
+		else contrast++;
+	else if (!contrast) return;
+		else contrast--;
+	HW_VLD_PORT = (HW_VLD_PORT & ~HW_VLD_MASK) |
+	    ((contrast_table[contrast] >> 4) << HW_VLD_SHIFT);
+	HW_VLD_DIR = (HW_VLD_DIR & ~HW_VLD_MASK) |
+	    ((contrast_table[contrast] & 0xf) << HW_VLD_SHIFT);
+}
+
+
+int led_during_standby = 0;
+
+
+void psion_debug_power_led(void)
+{
+	led_during_standby = !led_during_standby;
+	printk("LED is %slit during CPU standby\n",
+	    led_during_standby ? "" : "NOT ");
+}
+
+
+#include <asm/irq.h>
+
+
+#if 0
+static void p_(const char *l)
+{
+   printk("%-10s CCSR=%02x PRR=%02x Sta=%02x ISR=%04x/%04x ETNA=0x%02x/0x%02x;0x%02x\n",l,
+     *(u8 *) PCMCIA_ATTR8(0x202),*(u8 *) PCMCIA_ATTR8(0x204),
+     *(u8 *) PCMCIA_IO8(0x3f6),IO_INTSR & 0xffff,IO_INTMR  &0xffff,
+     IO_ETNA_INT_STATUS,IO_ETNA_INT_MASK,__ETNAB(11));
+}
+
+static void pdc_irq(int irq,void *dev_id,struct pt_regs *regs)
+{
+   printk("YEEEEEEEEEAAAHHH!!! (0x%02x)\n",*(u8 *) PCMCIA_IO8(0x1f7));
+   IO_ETNA_INT_CLEAR = ETNA_CF_IRQ;
+}
+
+void psion_debug_cf(void)
+{
+    int i;
+
+printk("COR 0x%02x .. set to 2\n",*(u8 *) PCMCIA_ATTR8(0x200));
+     *(u8 *) PCMCIA_ATTR8(0x200) = 2;
+return;
+    if (request_irq(IRQ_EINT1,pdc_irq,0,"cf",NULL))
+	printk("IRQ: grr\n");
+    enable_irq(IRQ_EINT1);
+    printk("COR 0x%02x\n",*(u8 *) PCMCIA_ATTR8(0x200));
+    p_("---");
+    IO_ETNA_INT_CLEAR = ETNA_CF_IRQ;
+    IO_ETNA_INT_MASK = ETNA_CF_IRQ;
+    p_("ETNA");
+     *(u8 *) PCMCIA_ATTR8(0x200) = 0x42;
+    p_("COR=0x42");
+    *(u8 *) PCMCIA_ATTR8(0x202) = 0x40;
+    p_("CCSR=0x40");
+    *(u8 *) PCMCIA_ATTR8(0x204) = 2;
+    p_("PRR=2");
+    *(u8 *) PCMCIA_ATTR8(0x204) = 0;
+    p_("PRR=0");
+    *(u8 *) PCMCIA_IO8(0x3f6) = 0;
+    p_("DCR=0");
+    *(u8 *) PCMCIA_IO8(0x1f2) = 1;
+    p_("#sec=1");
+    *(u8 *) PCMCIA_IO8(0x1f3) = 0;
+    *(u8 *) PCMCIA_IO8(0x1f4) = 0;
+    *(u8 *) PCMCIA_IO8(0x1f5) = 0;
+    p_("LBA=0");
+    *(u8 *) PCMCIA_IO8(0x1f6) = 0xe0;
+    p_("CDH=0xe0");
+    *(u8 *) PCMCIA_IO8(0x1f7) = 0x20;
+    p_("CMD=0x20");
+    for (i = 0; i < 10; i++) p_("...");
+}
+#endif
diff -uNr linux/drivers/char/keymap_psion.c linux-2.4.7/drivers/char/keymap_psion.c
--- linux/drivers/char/keymap_psion.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/char/keymap_psion.c	Tue Nov 27 03:42:27 2001
@@ -0,0 +1,262 @@
+/* Do not edit this file! It was automatically generated by   */
+/*    loadkeys --mktable defkeymap.map > defkeymap.c          */
+
+#include <linux/types.h>
+#include <linux/keyboard.h>
+#include <linux/kd.h>
+
+u_short plain_map[NR_KEYS] = {
+	0xf200,	0xf036,	0xf035,	0xf034,	0xf033,	0xf032,	0xf031,	0xf10c,
+	0xf200,	0xf027,	0xf07f,	0xf030,	0xf039,	0xf038,	0xf037,	0xf10e,
+	0xf200,	0xfb79,	0xfb74,	0xfb72,	0xfb65,	0xfb77,	0xfb71,	0xf01b,
+	0xf200,	0xf201,	0xfb6c,	0xfb70,	0xfb6f,	0xfb69,	0xfb75,	0xfc03,
+	0xf200,	0xfb67,	0xfb66,	0xfb64,	0xfb73,	0xfb61,	0xf009,	0xfc02,
+	0xf200,	0xf600,	0xf02e,	0xfb6d,	0xfb6b,	0xfb6a,	0xfb68,	0xfc01,
+	0xf200,	0xfb6e,	0xfb62,	0xfb76,	0xfb63,	0xfb78,	0xfb7a,	0xfc00,
+	0xf200,	0xf602,	0xf601,	0xf02c,	0xf603,	0xf020,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+static u_short shift_map[NR_KEYS] = {
+	0xf200,	0xf05e,	0xf025,	0xf024,	0xf0a3,	0xf022,	0xf021,	0xf10c,
+	0xf200,	0xf07e,	0xf07f,	0xf029,	0xf028,	0xf02a,	0xf026,	0xf10e,
+	0xf200,	0xfb59,	0xfb54,	0xfb52,	0xfb45,	0xfb57,	0xfb51,	0xf01b,
+	0xf200,	0xf201,	0xfb4c,	0xfb50,	0xfb4f,	0xfb49,	0xfb55,	0xfc03,
+	0xf200,	0xfb47,	0xfb46,	0xfb44,	0xfb53,	0xfb41,	0xf009,	0xfc02,
+	0xf200,	0xf20b,	0xf03f,	0xfb4d,	0xfb4b,	0xfb4a,	0xfb48,	0xfc01,
+	0xf200,	0xfb4e,	0xfb42,	0xfb56,	0xfb43,	0xfb58,	0xfb5a,	0xfc00,
+	0xf200,	0xf602,	0xf601,	0xf02f,	0xf20a,	0xf020,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+static u_short altgr_map[NR_KEYS] = {
+	0xf200,	0xf03e,	0xf03c,	0xf040,	0xf05c,	0xf023,	0xf05f,	0xf10c,
+	0xf200,	0xf03a,	0xf060,	0xf07d,	0xf07b,	0xf05d,	0xf05b,	0xf10e,
+	0xf200,	0xf30c,	0xf07c,	0xfb72,	0xfb65,	0xfb77,	0xfb71,	0xff02,
+	0xf200,	0xf201,	0xf03b,	0xf03d,	0xf02d,	0xf02b,	0xf30d,	0xfc03,
+	0xf200,	0xfb67,	0xfb66,	0xfb64,	0xfb73,	0xfb61,	0xf207,	0xfc02,
+	0xf200,	0xf118,	0xff05,	0xff04,	0xfb6b,	0xfb6a,	0xfb68,	0xfc01,
+	0xf200,	0xfb6e,	0xfb62,	0xfb76,	0xfb63,	0xfb78,	0xfb7a,	0xfc00,
+	0xf200,	0xf117,	0xf114,	0xf200,	0xf119,	0xff03,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+static u_short ctrl_map[NR_KEYS] = {
+	0xf200,	0xf01e,	0xf200,	0xf200,	0xf01c,	0xf200,	0xf01f,	0xf10c,
+	0xf200,	0xf200,	0xf07f,	0xf200,	0xf200,	0xf01d,	0xf01b,	0xf10e,
+	0xf200,	0xf019,	0xf014,	0xf012,	0xf005,	0xf017,	0xf011,	0xf200,
+	0xf200,	0xf201,	0xf00c,	0xf010,	0xf00f,	0xf009,	0xf015,	0xfc03,
+	0xf200,	0xf007,	0xf006,	0xf004,	0xf013,	0xf001,	0xf009,	0xfc02,
+	0xf200,	0xf200,	0xf200,	0xf00d,	0xf00b,	0xf00a,	0xf008,	0xfc01,
+	0xf200,	0xf00e,	0xf002,	0xf016,	0xf003,	0xf018,	0xf01a,	0xfc00,
+	0xf200,	0xf602,	0xf601,	0xf200,	0xf200,	0xf020,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+static u_short shift_ctrl_map[NR_KEYS] = {
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf10c,
+	0xf200,	0xf200,	0xf07f,	0xf200,	0xf200,	0xf200,	0xf200,	0xf10e,
+	0xf200,	0xf019,	0xf014,	0xf012,	0xf005,	0xf017,	0xf011,	0xf200,
+	0xf200,	0xf201,	0xf00c,	0xf010,	0xf00f,	0xf009,	0xf015,	0xfc03,
+	0xf200,	0xf007,	0xf006,	0xf004,	0xf013,	0xf001,	0xf009,	0xfc02,
+	0xf200,	0xf200,	0xf200,	0xf00d,	0xf00b,	0xf00a,	0xf008,	0xfc01,
+	0xf200,	0xf00e,	0xf002,	0xf016,	0xf003,	0xf018,	0xf01a,	0xfc00,
+	0xf200,	0xf602,	0xf601,	0xf200,	0xf200,	0xf020,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+static u_short alt_map[NR_KEYS] = {
+	0xf200,	0xf505,	0xf504,	0xf503,	0xf502,	0xf501,	0xf500,	0xf10c,
+	0xf200,	0xf200,	0xf116,	0xf509,	0xf508,	0xf507,	0xf506,	0xf10e,
+	0xf200,	0xf879,	0xf874,	0xf872,	0xf865,	0xf877,	0xf871,	0xf81b,
+	0xf200,	0xf201,	0xf86c,	0xf870,	0xf86f,	0xf869,	0xf875,	0xfc03,
+	0xf200,	0xf867,	0xf866,	0xf864,	0xf873,	0xf861,	0xf009,	0xfc02,
+	0xf200,	0xf200,	0xf200,	0xf86d,	0xf86b,	0xf86a,	0xf868,	0xfc01,
+	0xf200,	0xf86e,	0xf862,	0xf876,	0xf863,	0xf878,	0xf87a,	0xfc00,
+	0xf200,	0xf602,	0xf601,	0xf200,	0xf200,	0xf020,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+static u_short ctrl_alt_map[NR_KEYS] = {
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf10c,
+	0xf200,	0xf200,	0xf07f,	0xf200,	0xf200,	0xf200,	0xf200,	0xf10e,
+	0xf200,	0xf819,	0xf814,	0xf812,	0xf805,	0xf817,	0xf811,	0xf200,
+	0xf200,	0xf201,	0xf80c,	0xf810,	0xf80f,	0xf809,	0xf815,	0xfc03,
+	0xf200,	0xf807,	0xf806,	0xf804,	0xf813,	0xf801,	0xf009,	0xfc02,
+	0xf200,	0xf200,	0xf200,	0xf80d,	0xf80b,	0xf80a,	0xf808,	0xfc01,
+	0xf200,	0xff0b,	0xff0a,	0xff09,	0xff08,	0xff07,	0xff06,	0xfc00,
+	0xf200,	0xf602,	0xf601,	0xff01,	0xf200,	0xf020,	0xf10d,	0xfc00,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,	0xf200,
+};
+
+ushort *key_maps[MAX_NR_KEYMAPS] = {
+	plain_map, shift_map, altgr_map, 0,
+	ctrl_map, shift_ctrl_map, 0, 0,
+	alt_map, 0, 0, 0,
+	ctrl_alt_map,	0
+};
+
+unsigned int keymap_count = 7;
+
+/*
+ * Philosophy: most people do not define more strings, but they who do
+ * often want quite a lot of string space. So, we statically allocate
+ * the default and allocate dynamically in chunks of 512 bytes.
+ */
+
+char func_buf[] = {
+	'\033', '[', '[', 'A', 0, 
+	'\033', '[', '[', 'B', 0, 
+	'\033', '[', '[', 'C', 0, 
+	'\033', '[', '[', 'D', 0, 
+	'\033', '[', '[', 'E', 0, 
+	'\033', '[', '1', '7', '~', 0, 
+	'\033', '[', '1', '8', '~', 0, 
+	'\033', '[', '1', '9', '~', 0, 
+	'\033', '[', '2', '0', '~', 0, 
+	'\033', '[', '2', '1', '~', 0, 
+	'\033', '[', '2', '3', '~', 0, 
+	'\033', '[', '2', '4', '~', 0, 
+	'\033', '[', '2', '5', '~', 0, 
+	'\033', '[', '2', '6', '~', 0, 
+	'\033', '[', '2', '8', '~', 0, 
+	'\033', '[', '2', '9', '~', 0, 
+	'\033', '[', '3', '1', '~', 0, 
+	'\033', '[', '3', '2', '~', 0, 
+	'\033', '[', '3', '3', '~', 0, 
+	'\033', '[', '3', '4', '~', 0, 
+	'\033', '[', '1', '~', 0, 
+	'\033', '[', '2', '~', 0, 
+	'\033', '[', '3', '~', 0, 
+	'\033', '[', '4', '~', 0, 
+	'\033', '[', '5', '~', 0, 
+	'\033', '[', '6', '~', 0, 
+	'\033', '[', 'M', 0, 
+	'\033', '[', 'P', 0, 
+};
+
+char *funcbufptr = func_buf;
+int funcbufsize = sizeof(func_buf);
+int funcbufleft = 0;          /* space left */
+
+char *func_table[MAX_NR_FUNC] = {
+	func_buf + 0,
+	func_buf + 5,
+	func_buf + 10,
+	func_buf + 15,
+	func_buf + 20,
+	func_buf + 25,
+	func_buf + 31,
+	func_buf + 37,
+	func_buf + 43,
+	func_buf + 49,
+	func_buf + 55,
+	func_buf + 61,
+	func_buf + 67,
+	func_buf + 73,
+	func_buf + 79,
+	func_buf + 85,
+	func_buf + 91,
+	func_buf + 97,
+	func_buf + 103,
+	func_buf + 109,
+	func_buf + 115,
+	func_buf + 120,
+	func_buf + 125,
+	func_buf + 130,
+	func_buf + 135,
+	func_buf + 140,
+	func_buf + 145,
+	0,
+	0,
+	func_buf + 149,
+	0,
+};
+
+struct kbdiacr accent_table[MAX_DIACR] = {
+	{'`', 'A', '\300'},	{'`', 'a', '\340'},
+	{'\'', 'A', '\301'},	{'\'', 'a', '\341'},
+	{'^', 'A', '\302'},	{'^', 'a', '\342'},
+	{'~', 'A', '\303'},	{'~', 'a', '\343'},
+	{'"', 'A', '\304'},	{'"', 'a', '\344'},
+	{'O', 'A', '\305'},	{'o', 'a', '\345'},
+	{'0', 'A', '\305'},	{'0', 'a', '\345'},
+	{'A', 'A', '\305'},	{'a', 'a', '\345'},
+	{'A', 'E', '\306'},	{'a', 'e', '\346'},
+	{',', 'C', '\307'},	{',', 'c', '\347'},
+	{'`', 'E', '\310'},	{'`', 'e', '\350'},
+	{'\'', 'E', '\311'},	{'\'', 'e', '\351'},
+	{'^', 'E', '\312'},	{'^', 'e', '\352'},
+	{'"', 'E', '\313'},	{'"', 'e', '\353'},
+	{'`', 'I', '\314'},	{'`', 'i', '\354'},
+	{'\'', 'I', '\315'},	{'\'', 'i', '\355'},
+	{'^', 'I', '\316'},	{'^', 'i', '\356'},
+	{'"', 'I', '\317'},	{'"', 'i', '\357'},
+	{'-', 'D', '\320'},	{'-', 'd', '\360'},
+	{'~', 'N', '\321'},	{'~', 'n', '\361'},
+	{'`', 'O', '\322'},	{'`', 'o', '\362'},
+	{'\'', 'O', '\323'},	{'\'', 'o', '\363'},
+	{'^', 'O', '\324'},	{'^', 'o', '\364'},
+	{'~', 'O', '\325'},	{'~', 'o', '\365'},
+	{'"', 'O', '\326'},	{'"', 'o', '\366'},
+	{'/', 'O', '\330'},	{'/', 'o', '\370'},
+	{'`', 'U', '\331'},	{'`', 'u', '\371'},
+	{'\'', 'U', '\332'},	{'\'', 'u', '\372'},
+	{'^', 'U', '\333'},	{'^', 'u', '\373'},
+	{'"', 'U', '\334'},	{'"', 'u', '\374'},
+	{'\'', 'Y', '\335'},	{'\'', 'y', '\375'},
+	{'T', 'H', '\336'},	{'t', 'h', '\376'},
+	{'s', 's', '\337'},	{'"', 'y', '\377'},
+	{'s', 'z', '\337'},	{'i', 'j', '\377'},
+};
+
+unsigned int accent_table_size = 68;
diff -uNr linux/drivers/char/keymap_psion.map linux-2.4.7/drivers/char/keymap_psion.map
--- linux/drivers/char/keymap_psion.map	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/char/keymap_psion.map	Wed Jul 25 03:37:54 2001
@@ -0,0 +1,233 @@
+# arch/arm/drivers/char/keymap_psion.map - UK (default) keyboard map
+#
+# Written 1998,1999 by Werner Almesberger
+#
+# based on keymap_geo.map, string and compose def's taken from 
+# drivers/char/defkeymap.map
+#
+# Special keys:
+# F13	REC		F14	STOP		F15	PLAY
+# F16	Contrast--	F17	Contrast++	F18	Backlight
+
+# Default kernel keymap. This uses 7 modifier combinations.
+keymaps 0-2,4-5,8,12
+
+	keycode	  1 = six		asciicircum
+alt	keycode	  1 = Console_6
+altgr	keycode	  1 = greater
+control	keycode	  1 = Control_asciicircum
+	keycode	  2 = five		percent
+alt	keycode	  2 = Console_5
+altgr	keycode	  2 = less
+	keycode	  3 = four		dollar
+alt	keycode	  3 = Console_4
+altgr	keycode	  3 = at
+	keycode	  4 = three		sterling
+alt	keycode	  4 = Console_3
+altgr	keycode	  4 = backslash
+control	keycode	  4 = Control_backslash
+	keycode	  5 = two		quotedbl
+alt	keycode	  5 = Console_2
+altgr	keycode	  5 = numbersign
+	keycode	  6 = one		exclam
+alt	keycode	  6 = Console_1
+altgr	keycode	  6 = underscore
+control	keycode	  6 = Control_underscore
+	keycode   7 = F13				# REC
+
+	keycode   8 = VoidSymbol
+	keycode	  9 = apostrophe	asciitilde
+altgr	keycode	  9 = colon
+	keycode	 10 = Delete
+alt	keycode	 10 = Remove
+altgr	keycode  10 = grave
+	keycode	 11 = zero		parenright
+alt	keycode	 11 = Console_10
+altgr	keycode  11 = braceright
+	keycode  12 = nine		parenleft
+alt	keycode	 12 = Console_9
+altgr	keycode  12 = braceleft
+	keycode  13 = eight		asterisk
+alt	keycode	 13 = Console_8
+altgr	keycode  13 = bracketright
+control	keycode  13 = Control_bracketright
+	keycode  14 = seven		ampersand
+alt	keycode	 14 = Console_7
+altgr	keycode  14 = bracketleft
+control	keycode  14 = Escape
+	keycode	 15 = F15				# PLAY
+
+	keycode  16 = VoidSymbol
+	keycode	 17 = y
+altgr	keycode  17 = KP_Multiply
+	keycode	 18 = t
+altgr	keycode	 18 = bar
+	keycode	 19 = r
+	keycode	 20 = e
+	keycode	 21 = w
+	keycode	 22 = q
+	keycode	 23 = Escape		Escape
+alt	keycode	 23 = Meta_Escape
+altgr	keycode  23 = 0xf02				# OFF
+
+	keycode  24 = VoidSymbol
+	keycode	 25 = Return
+	keycode  26 = l
+altgr	keycode  26 = semicolon
+	keycode  27 = p
+altgr	keycode  27 = equal
+	keycode  28 = o
+altgr	keycode  28 = minus
+	keycode  29 = i
+altgr	keycode  29 = plus
+	keycode  30 = u
+altgr	keycode  30 = KP_Divide
+	keycode	 31 = SAlt				# Menu
+
+	keycode  32 = VoidSymbol
+	keycode	 33 = g
+	keycode	 34 = f
+	keycode	 35 = d
+	keycode	 36 = s
+	keycode	 37 = a
+	keycode	 38 = Tab
+altgr	keycode	 38 = Caps_Lock
+	keycode	 39 = SControl
+
+	keycode  40 = VoidSymbol
+	keycode  41 = Down		Scroll_Backward
+altgr	keycode	 41 = Prior
+	keycode	 42 = period		question
+altgr	keycode  42 = 0xf05				# Contrast++
+	keycode	 43 = m
+altgr	keycode	 43 = 0xf04				# Contrast--
+	keycode	 44 = k
+	keycode	 45 = j
+	keycode	 46 = h
+	keycode	 47 = SAltGr				# Fn
+
+	keycode  48 = VoidSymbol
+	keycode	 49 = n
+control alt keycode 49 = 0xf0b				# Debug 5
+	keycode	 50 = b
+control alt keycode 50 = 0xf0a				# Debug 4
+	keycode	 51 = v
+control alt keycode 51 = 0xf09				# Debug 3
+	keycode	 52 = c
+control alt keycode 52 = 0xf08				# Debug 2
+	keycode	 53 = x
+control alt keycode 53 = 0xf07				# Debug 1
+	keycode	 54 = z
+control alt keycode 54 = 0xf06				# Debug 0
+	keycode	 55 = SShift
+
+	keycode  56 = VoidSymbol
+	keycode	 57 = Right
+altgr	keycode  57 = Select				# End
+	keycode  58 = Left
+altgr	keycode  58 = Find				# Home
+	keycode  59 = comma		slash
+control alt keycode 59 = 0xf01				# SysRq
+	keycode  60 = Up		Scroll_Forward
+altgr	keycode  60 = Next
+	keycode	 61 = space
+altgr	keycode  61 = 0xf03				# Backlight
+	keycode  62 = F14				# STOP
+	keycode  63 = SShift
+
+string F1 = "\033[[A"
+string F2 = "\033[[B"
+string F3 = "\033[[C"
+string F4 = "\033[[D"
+string F5 = "\033[[E"
+string F6 = "\033[17~"
+string F7 = "\033[18~"
+string F8 = "\033[19~"
+string F9 = "\033[20~"
+string F10 = "\033[21~"
+string F11 = "\033[23~"
+string F12 = "\033[24~"
+string F13 = "\033[25~"
+string F14 = "\033[26~"
+string F15 = "\033[28~"
+string F16 = "\033[29~"
+string F17 = "\033[31~"
+string F18 = "\033[32~"
+string F19 = "\033[33~"
+string F20 = "\033[34~"
+string Find = "\033[1~"
+string Insert = "\033[2~"
+string Remove = "\033[3~"
+string Select = "\033[4~"
+string Prior = "\033[5~"
+string Next = "\033[6~"
+string Macro = "\033[M"
+string Pause = "\033[P"
+compose '`' 'A' to 'À'
+compose '`' 'a' to 'à'
+compose '\'' 'A' to 'Á'
+compose '\'' 'a' to 'á'
+compose '^' 'A' to 'Â'
+compose '^' 'a' to 'â'
+compose '~' 'A' to 'Ã'
+compose '~' 'a' to 'ã'
+compose '"' 'A' to 'Ä'
+compose '"' 'a' to 'ä'
+compose 'O' 'A' to 'Å'
+compose 'o' 'a' to 'å'
+compose '0' 'A' to 'Å'
+compose '0' 'a' to 'å'
+compose 'A' 'A' to 'Å'
+compose 'a' 'a' to 'å'
+compose 'A' 'E' to 'Æ'
+compose 'a' 'e' to 'æ'
+compose ',' 'C' to 'Ç'
+compose ',' 'c' to 'ç'
+compose '`' 'E' to 'È'
+compose '`' 'e' to 'è'
+compose '\'' 'E' to 'É'
+compose '\'' 'e' to 'é'
+compose '^' 'E' to 'Ê'
+compose '^' 'e' to 'ê'
+compose '"' 'E' to 'Ë'
+compose '"' 'e' to 'ë'
+compose '`' 'I' to 'Ì'
+compose '`' 'i' to 'ì'
+compose '\'' 'I' to 'Í'
+compose '\'' 'i' to 'í'
+compose '^' 'I' to 'Î'
+compose '^' 'i' to 'î'
+compose '"' 'I' to 'Ï'
+compose '"' 'i' to 'ï'
+compose '-' 'D' to 'Ð'
+compose '-' 'd' to 'ð'
+compose '~' 'N' to 'Ñ'
+compose '~' 'n' to 'ñ'
+compose '`' 'O' to 'Ò'
+compose '`' 'o' to 'ò'
+compose '\'' 'O' to 'Ó'
+compose '\'' 'o' to 'ó'
+compose '^' 'O' to 'Ô'
+compose '^' 'o' to 'ô'
+compose '~' 'O' to 'Õ'
+compose '~' 'o' to 'õ'
+compose '"' 'O' to 'Ö'
+compose '"' 'o' to 'ö'
+compose '/' 'O' to 'Ø'
+compose '/' 'o' to 'ø'
+compose '`' 'U' to 'Ù'
+compose '`' 'u' to 'ù'
+compose '\'' 'U' to 'Ú'
+compose '\'' 'u' to 'ú'
+compose '^' 'U' to 'Û'
+compose '^' 'u' to 'û'
+compose '"' 'U' to 'Ü'
+compose '"' 'u' to 'ü'
+compose '\'' 'Y' to 'Ý'
+compose '\'' 'y' to 'ý'
+compose 'T' 'H' to 'Þ'
+compose 't' 'h' to 'þ'
+compose 's' 's' to 'ß'
+compose '"' 'y' to 'ÿ'
+compose 's' 'z' to 'ß'
+compose 'i' 'j' to 'ÿ'
diff -uNr linux/drivers/char/serial_clps711x.c linux-2.4.7/drivers/char/serial_clps711x.c
--- linux/drivers/char/serial_clps711x.c	Fri Aug  3 05:40:01 2001
+++ linux-2.4.7/drivers/char/serial_clps711x.c	Tue Nov 27 02:25:38 2001
@@ -55,9 +55,13 @@
 
 #include <linux/serial_core.h>
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
+#if defined(CONFIG_ARCH_CLPS7110)
+#define UART_NR		1
+#else
 #define UART_NR		2
+#endif
 
 #define SERIAL_CLPS711X_NAME	"ttyAM"
 #define SERIAL_CLPS711X_MAJOR	204
@@ -422,14 +426,16 @@
 		uartclk:	3686400,
 		fifosize:	16,
 		ops:		&clps711x_pops,
-	},
-	{
+	}
+#if !defined(CONFIG_ARCH_CLPS7110)
+	,{
 		iobase:		SYSCON2 - SYSCON1,
 		irq:		IRQ_UTXINT2, /* IRQ_URXINT2 */
 		uartclk:	3686400,
 		fifosize:	16,
 		ops:		&clps711x_pops,
 	}
+#endif
 };
 
 #ifdef CONFIG_SERIAL_CLPS711X_CONSOLE
diff -uNr linux/drivers/pcmcia/Config.in linux-2.4.7/drivers/pcmcia/Config.in
--- linux/drivers/pcmcia/Config.in	Fri Aug  3 05:40:02 2001
+++ linux-2.4.7/drivers/pcmcia/Config.in	Fri Aug 10 02:57:15 2001
@@ -25,5 +25,6 @@
 fi
 dep_tristate '  CLPS6700 support' CONFIG_PCMCIA_CLPS6700 $CONFIG_ARCH_CLPS711X $CONFIG_PCMCIA
 dep_tristate '  SA1100 support' CONFIG_PCMCIA_SA1100 $CONFIG_ARCH_SA1100 $CONFIG_PCMCIA
+dep_tristate '  Psion ETNA support' CONFIG_PCMCIA_ETNA $CONFIG_PCMCIA
 
 endmenu
diff -uNr linux/drivers/pcmcia/Makefile linux-2.4.7/drivers/pcmcia/Makefile
--- linux/drivers/pcmcia/Makefile	Fri Aug  3 05:40:02 2001
+++ linux-2.4.7/drivers/pcmcia/Makefile	Fri Aug 10 00:50:49 2001
@@ -55,6 +55,7 @@
 
 obj-$(CONFIG_PCMCIA_CLPS6700)	+= clps6700.o
 obj-$(CONFIG_PCMCIA_SA1100)	+= sa1100_cs.o
+obj-$(CONFIG_PCMCIA_ETNA)	+= clps711x_etna.o
 
 sa1100_cs-objs-y				:= sa1100_generic.o
 sa1100_cs-objs-$(CONFIG_SA1100_ASSABET)		+= sa1100_assabet.o
diff -uNr linux/drivers/pcmcia/clps6700.c linux-2.4.7/drivers/pcmcia/clps6700.c
--- linux/drivers/pcmcia/clps6700.c	Fri Aug  3 05:40:02 2001
+++ linux-2.4.7/drivers/pcmcia/clps6700.c	Thu Aug  9 06:11:34 2001
@@ -32,7 +32,7 @@
 #include <asm/page.h>
 
 #include <asm/arch/syspld.h>
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
diff -uNr linux/drivers/pcmcia/clps711x_etna.c linux-2.4.7/drivers/pcmcia/clps711x_etna.c
--- linux/drivers/pcmcia/clps711x_etna.c	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/pcmcia/clps711x_etna.c	Fri Aug 10 03:00:09 2001
@@ -0,0 +1,573 @@
+/*
+ * psion_etna.c - Psion-specific PCMCIA functions
+ * 
+ * Copyright (C) 2001 Tony Lindgren <tony@atomide.com>
+ * Copyright (C) 2001 Shane Nay <shane@place.org>
+ * 
+ * Contains code from the clps6700 driver for linux,
+ * Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * Contains code from the Psion 5 ETNA driver for linux, 
+ * Copyright (C) 1999 Werner Almesberger.
+ *
+ *
+ * TO DO LIST 20010516
+ * - What turns on the /dev/hda?
+ * - What triggers the card removal interrupt?
+ * - What's the purpose of the INT_EXTFIQ?
+ * - Can all the interrupt handling be moved to this driver?
+ * - The interrupt masks in irqs.h need to be checked for 
+ *   INT1_IRQS and INT1_ACK_IRQS
+ * - What's the purpose and order of ETNA_MEM_BASE and ETNA_REG_BASE?
+ * - What is Port B bit 0x80 what powers on the cf slot?
+ * - What's the PCIILR for 2.2 kernel?
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/malloc.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+#include <linux/proc_fs.h>
+#include <linux/spinlock.h>
+#include <linux/init.h>
+
+#include <linux/delay.h>
+
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/hardware.h>
+#include <asm/page.h>
+
+#include <asm/hardware/clps711x.h>
+
+#include <pcmcia/version.h>
+#include <pcmcia/cs_types.h>
+#include <pcmcia/ss.h>
+
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/bus_ops.h>
+
+#include "clps711x_etna.h"
+
+#define DEBUG 1
+
+MODULE_AUTHOR("Tony Lindgren");
+MODULE_DESCRIPTION("PSION ETNA PCMCIA socket driver");
+
+#define NR_ETNA		1
+
+struct etna_skt {
+	u_int			nr;
+	u_int			physbase;
+	u_int			regbase;
+	u_int			pmr;
+	u_int			cpcr;
+	u_int			cpcr_3v3;
+	u_int			cpcr_5v0;
+	u_int			cur_pmr;
+	u_int			cur_cicr;
+	u_int			cur_pcimr;
+	u_int			cur_cpcr;
+	void			(*handler)(void *, u_int);
+	void			*handler_info;
+
+	u_int			ev_pending;
+	spinlock_t		ev_lock;
+};
+
+static struct etna_skt *skts[NR_ETNA];
+
+
+static int etna_sock_init(u_int sock)
+{
+	struct etna_skt *skt = skts[sock];
+
+	printk("-1- We are in etna_sock_init\n");
+
+	skt->cur_cicr  = 0;
+	skt->cur_pmr   = skt->pmr;
+	skt->cur_pcimr = 0;
+	skt->cur_cpcr  = skt->cpcr;
+
+#ifdef DEBUG
+	printk("skt%d: sock_init()\n", sock);
+#endif
+	return 0;
+}
+
+static int etna_suspend(u_int sock)
+{
+	printk("We are in etna_suspend\n");
+	return 0;
+}
+
+static int etna_register_callback(u_int sock, void (*handler)(void *, u_int), 
+				  void *info)
+{
+	struct etna_skt *skt = skts[sock];
+
+	printk("-3- We are in etna_register_callback\n");
+
+#ifdef DEBUG
+	printk("skt%d: register_callback: %p (%p)\n", sock, handler, info);
+#endif
+
+	skt->handler_info = info;
+	skt->handler = handler;
+
+	return 0;
+}
+
+static int etna_inquire_socket(u_int sock, socket_cap_t *cap)
+{
+
+	printk("-2- We are in etna_inquire_socket\n");
+
+	cap->features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP | SS_CAP_MEM_ALIGN;
+	cap->irq_mask = 0;		/* available IRQs for this socket */
+	cap->map_size = PAGE_SIZE;	/* minimum mapping size */
+	cap->pci_irq  = 0;		/* PCI interrupt number */
+	cap->cb_dev   = NULL;
+	cap->bus      = NULL;
+	return 0;
+}
+
+
+static int __etna_get_status(struct etna_skt *skt)
+{
+	unsigned int v, val;
+
+	printk("--- We are in __etna_get_status\n");
+	
+	v = ETNA_INT_STATUS;
+	val = 0;
+
+	/* Force ready */
+	val &= ~SS_BATWARN;
+	val &= ~SS_BATDEAD;
+	val &= ~SS_XVCARD;
+	val |= SS_DETECT;
+	val |= SS_READY;
+	val |= SS_3VCARD;
+	
+	// Clear pending status. What sets this on?
+	val &= ~SS_PENDING;
+
+
+#ifdef DEBUG
+	printk("skt%d: PCIILR: %08x -> (%s %s %s %s %s %s)\n",
+		skt->nr, v,
+	        val & SS_READY   ? "rdy" : "---",
+	        val & SS_DETECT  ? "det" : "---",
+	        val & SS_BATWARN ? "bw"  : "--",
+		val & SS_BATDEAD ? "bd"  : "--",
+		val & SS_3VCARD  ? "3v"  : "--",
+		val & SS_XVCARD  ? "xv"  : "--");
+
+#endif
+	return val;
+}
+
+static int etna_get_status(u_int sock, u_int *valp)
+{
+	struct etna_skt *skt = skts[sock];
+	*valp = __etna_get_status(skt);
+	return 0; /* not used! */
+}
+
+static int etna_get_socket(u_int sock, socket_state_t *state)
+{
+	printk("We are in etna_get_socket\n");
+	return -EINVAL;
+}
+
+static int etna_set_socket(u_int sock, socket_state_t *state)
+{
+	struct etna_skt *skt = skts[sock];
+	unsigned long flags;
+	u_int cpcr = skt->cur_cpcr, pmr = skt->cur_pmr, cicr = skt->cur_cicr;
+	u_int pcimr = 0;
+
+	printk("We are in etna_set_socket with sock=%d\n", sock);
+	printk("skt->regbase = 0x%x\n", skt->regbase);
+
+
+	cicr &= ~(CICR_ENABLE | CICR_RESET | CICR_IOMODE);
+
+	if (state->flags & SS_PWR_AUTO)
+		pmr |= PMR_DCAR | PMR_PDCR;
+
+	/*
+	 * Note! We must NOT assert the Card Enable bit until reset has
+	 * been de-asserted.  Some cards indicate not ready, which then
+	 * hangs our next access.  (Bug in CLPS6700?)
+	 */
+
+	if (state->flags & SS_RESET)
+		cicr |= CICR_RESET | CICR_RESETOE;
+	else if (state->flags & SS_OUTPUT_ENA)
+		cicr |= CICR_ENABLE;
+
+	if (state->flags & SS_IOCARD) {
+		cicr |= CICR_IOMODE;
+
+
+	/* if (state->csc_mask & SS_STSCHG)*/
+
+	} else {
+		if (state->csc_mask & SS_BATDEAD)
+			pcimr |= PCM_BVD2;
+		if (state->csc_mask & SS_BATWARN)
+			pcimr |= PCM_BVD1;
+		if (state->csc_mask & SS_READY)
+			pcimr |= PCM_RDYL;
+	}
+
+	if (state->csc_mask & SS_DETECT)
+		pcimr |= PCM_CD1 | PCM_CD2;
+
+	switch (state->Vcc) {
+	case 0:				break;
+	case 33: cpcr |= skt->cpcr_3v3; pmr |= PMR_CPE; break;
+	case 50: cpcr |= skt->cpcr_5v0; pmr |= PMR_CPE; break;
+	default: return -EINVAL;
+	}
+
+#ifdef DEBUG
+	printk("skt%d: PMR: %04x, CPCR: %04x, CICR: %04x PCIMR: %04x "
+		"(Vcc = %d, flags = %c%c%c%c, csc = %c%c%c%c%c)\n",
+		sock, pmr, cpcr, cicr, pcimr, state->Vcc,
+		state->flags & SS_RESET      ? 'r' : '-',
+		state->flags & SS_PWR_AUTO   ? 'p' : '-',
+		state->flags & SS_IOCARD     ? 'i' : '-',
+		state->flags & SS_OUTPUT_ENA ? 'o' : '-',
+		state->csc_mask & SS_STSCHG  ? 's' : '-',
+		state->csc_mask & SS_BATDEAD ? 'd' : '-',
+		state->csc_mask & SS_BATWARN ? 'w' : '-',
+		state->csc_mask & SS_READY   ? 'r' : '-',
+		state->csc_mask & SS_DETECT  ? 'c' : '-');
+#endif
+
+	save_flags_cli(flags);
+
+	if (skt->cur_cpcr != cpcr) {
+		skt->cur_cpcr = cpcr;
+		////__raw_writel(skt->cur_cpcr, skt->regbase + CPCR);
+	}
+
+	if (skt->cur_pmr != pmr) {
+		skt->cur_pmr = pmr;
+		////__raw_writel(skt->cur_pmr, skt->regbase + PMR);
+	}
+	if (skt->cur_pcimr != pcimr) {
+		skt->cur_pcimr = pcimr;
+		////__raw_writel(skt->cur_pcimr, skt->regbase + PCIMR);
+	}
+	if (skt->cur_cicr != cicr) {
+		skt->cur_cicr = cicr;
+		////__raw_writel(skt->cur_cicr, skt->regbase + CICR);
+	}
+
+	restore_flags(flags);
+
+	return 0;
+}
+
+static int etna_get_io_map(u_int sock, struct pccard_io_map *io)
+{
+	return -EINVAL;
+}
+
+static int etna_set_io_map(u_int sock, struct pccard_io_map *io)
+{
+	printk("We are in etna_set_io_map\n");
+	printk("skt%d: iomap: %d: speed %d, flags %X start %X stop %X\n",
+		sock, io->map, io->speed, io->flags, io->start, io->stop);
+	return 0;
+}
+
+static int etna_get_mem_map(u_int sock, struct pccard_mem_map *mem)
+{
+	printk("We are in etna_get_mem_map\n");
+	return -EINVAL;
+}
+
+/*
+ * Set the memory map attributes for this socket.  (ie, mem->speed)
+ * Note that since we have SS_CAP_STATIC_MAP set, we don't need to do
+ * any mapping here at all; we just need to return the address (suitable
+ * for ioremap) to map the requested space in mem->sys_start.
+ *
+ * flags & MAP_ATTRIB indicates whether we want attribute space.
+ */
+static int etna_set_mem_map(u_int sock, struct pccard_mem_map *mem)
+{
+	struct etna_skt *skt = skts[sock];
+	u_int off;
+
+	if (mem->flags & MAP_ATTRIB)
+		off = ETNA_ATTRIB_BASE;
+	else
+		off = ETNA_MEM_BASE;	
+
+	mem->sys_start  = skt->physbase + off;
+	mem->sys_start += mem->card_start;
+
+        //printk("mem->sys_start=0x%x\n", mem->sys_start);
+
+	return 0;
+}
+
+static void etna_proc_setup(u_int sock, struct proc_dir_entry *base)
+{
+}
+
+static struct pccard_operations etna_operations = {
+	init:			etna_sock_init,
+	suspend:		etna_suspend,
+	register_callback:	etna_register_callback,
+	inquire_socket:		etna_inquire_socket,
+	get_status:		etna_get_status,
+	get_socket:		etna_get_socket,
+	set_socket:		etna_set_socket,
+	get_io_map:		etna_get_io_map,
+	set_io_map:		etna_set_io_map,
+	get_mem_map:		etna_get_mem_map,
+	set_mem_map:		etna_set_mem_map,
+	proc_setup:		etna_proc_setup
+};
+
+static void etna_bh(void *dummy)
+{
+	int i;
+
+	printk("We are in etna_bh\n");
+
+	for (i = 0; i < NR_ETNA; i++) {
+		struct etna_skt *skt = skts[i];
+		unsigned long flags;
+		u_int events;
+
+		if (!skt)
+			continue;
+
+		/*
+		 * Note!  We must read the pending event state
+		 * with interrupts disabled, otherwise we race
+		 * with our own interrupt routine!
+		 */
+		spin_lock_irqsave(&skt->ev_lock, flags);
+		events = skt->ev_pending;
+		skt->ev_pending = 0;
+		spin_unlock_irqrestore(&skt->ev_lock, flags);	
+
+		if (skt->handler && events)
+			skt->handler(skt->handler_info, events);
+	}
+}
+
+static struct tq_struct etna_task = {
+	routine:	etna_bh
+};
+
+static void etna_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct etna_skt *skt = dev_id;
+	u_int val, events;
+
+	printk("We are in etna_interrupt\n");
+
+	val = ETNA_INT_STATUS;
+	printk("Etna int status val = %d\n", val);
+	if (!val) {
+		printk("No card in slot\n");
+		return;
+	}
+
+	events = 0;
+	
+	/* Force socket ready for ETNA */
+	events |= SS_DETECT;
+	events |= SS_READY;
+
+	spin_lock(&skt->ev_lock);
+	skt->ev_pending |= events;
+	spin_unlock(&skt->ev_lock);
+	schedule_task(&etna_task);
+}
+
+
+static int __init etna_init_skt(int nr)
+{
+	struct etna_skt *skt;
+	int ret;
+
+	servinfo_t info;
+
+	printk("We are int etna_init_skt\n");
+
+	skt = kmalloc(sizeof(struct etna_skt), GFP_KERNEL);
+	if (!skt)
+		return -ENOMEM;
+
+	memset(skt, 0, sizeof(struct etna_skt));
+
+	spin_lock_init(&skt->ev_lock);
+
+	skt->nr       = nr;
+	skt->physbase = nr ? 0x50000000 : 0x40000000;
+	printk("skt->physbase=0x%x\n", skt->physbase);
+
+	skt->pmr      = PMR_AUTOIDLE | PMR_MCPE | PMR_CDWEAK;
+	skt->cpcr     = CPCR_PDIR(PCTL1|PCTL0);
+	skt->cpcr_3v3 = CPCR_PON(PCTL0);
+	skt->cpcr_5v0 = CPCR_PON(PCTL0);	// we only do 3v3
+
+	skt->cur_pmr  = skt->pmr;
+
+	//skt->regbase = (u_int)__ioremap(skt->physbase, PCMCIA_SIZE, 0);
+	//skt->regbase = PCMCIA_V_BASE;
+	//skt->regbase = (u_int)__ioremap(skt->physbase + CLPS6700_REG_BASE,
+	//				CLPS6700_REG_SIZE, 0);
+
+	skt->regbase = (u_int)__ioremap(skt->physbase + ETNA_IO_BASE,
+					ETNA_REG_SIZE, 0);
+
+	////skt->regbase = PCMCIA_V_BASE + ETNA_REG_BASE;
+
+	//skt->regbase = ETNA_V_BASE + ETNA_IO_BASE;
+	//skt->regbase = skt->physbase;
+
+	ret = -ENOMEM;
+	if (!skt->regbase)
+		goto err_free;
+
+	skts[nr] = skt;
+
+
+	/*
+	 * Here are the interrupts. See also arch/arm/mach-psionw/irq.c 
+	 * for the triggers.
+	 */
+
+	// This seems to work on insert, but don't know how to reset
+	//ret = request_irq(IRQ_EXTFIQ, etna_interrupt,
+	//		  SA_SHIRQ, "pcmcia", skt);
+
+	// No luck so far with this one
+	//ret = request_irq(IRQ_MCINT, etna_interrupt,
+	//	  SA_SHIRQ, "pcmcia", skt);
+
+	// This works on inserting the card
+	ret = request_irq(IRQ_EINT1, etna_interrupt,
+			  SA_SHIRQ, "pcmcia", skt);
+
+	// Let's get rid of this
+	//ret = request_irq(IRQ_TC1OI, etna_interrupt,
+	//		  SA_SHIRQ, "pcmcia", skt);
+
+	if (ret) {
+		printk(KERN_ERR "Psion ETNA: unable to grab irq%d (%d)\n",
+		       IRQ_EINT1, ret);
+		goto err_unmap;
+	}
+
+	printk("Trying to get some more info\n");
+	CardServices(GetCardServicesInfo, &info);
+
+	return 0;
+
+err_unmap:
+	iounmap((void *)skt->regbase);
+err_free:
+	kfree(skt);
+	skts[nr] = NULL;
+	return ret;
+}
+
+static void etna_free_resources(void)
+{
+	int i;
+	printk("We are in etna_free_resources\n");
+	for (i = NR_ETNA; i >= 0; i--) {
+		struct etna_skt *skt = skts[i];
+		skts[i] = NULL;
+		if (skt == NULL)
+			continue;
+		free_irq(IRQ_EINT1, skt);
+		iounmap((void *)skt->regbase);
+		kfree(skt);
+	}
+}
+
+static int __init etna_init(void)
+{
+	unsigned int v;
+	int err, nr;
+
+	u8 etna_orig;
+	unsigned int t1;
+
+	printk("We are in etna_init\n");
+	/*
+	 * FIXME5MX: Add power_check and parse_cis type card detection here
+	 */
+
+	/*
+	 * FIXME5MX: Don't know if this is necessary here
+	 */
+	/* Clear ETNA interrupts */
+	printk("ETNA_INT_STATUS=0x%x\n", ETNA_INT_STATUS);
+	ETNA_INT_MASK = 0;
+	ETNA_INT_CLEAR = ETNA_CF_IRQ;
+
+/*
+	t1 = clps_readl(TC1CTRL);
+	// These bits need to initialized to 0
+	t1 &= ~TC_BIT2;
+	t1 &= ~TC_BIT4;
+	t1 &= ~TC_BIT5;
+	//t1 &= ~TC_CLKSEL;		// 2Khz mode
+	t1 |= TC_CLKSEL;		// 512kHz mode
+	t1 &= ~TC_MODE;			// Free running mode
+        //t1 |= TC_MODE;		// Periodic mode
+	t1 |= TC_ENABLE;
+	clps_writel(t1, TC1CTRL);
+	clps_writel(5119, TC1LOAD);	// 512kHz / 100Hz - 1	
+*/
+
+	/*
+	 * FIXME5MX: Add pm_register stuff here
+	 */
+	
+	for (nr = 0; nr < NR_ETNA; nr++) {
+		err = etna_init_skt(nr);
+		if (err)
+			goto free;
+	}
+
+	err = register_ss_entry(nr, &etna_operations);
+	if (err)
+		goto free;
+
+	return 0;
+
+free:
+	/*
+	 * An error occurred.  Unmap and free all ETNA
+	 */
+	etna_free_resources();
+	return err;
+}
+
+static void __exit etna_exit(void)
+{
+	unregister_ss_entry(&etna_operations);
+	etna_free_resources();
+}
+
+module_init(etna_init);
+module_exit(etna_exit);
diff -uNr linux/drivers/pcmcia/clps711x_etna.h linux-2.4.7/drivers/pcmcia/clps711x_etna.h
--- linux/drivers/pcmcia/clps711x_etna.h	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/pcmcia/clps711x_etna.h	Fri Aug 10 01:05:07 2001
@@ -0,0 +1,100 @@
+/*
+ * Port B for CF card
+ */
+#define HW_VPCEN_PORT		PBDR /* Enables the power to the CF Card */
+#define HW_VPCEN_BIT		0x80
+
+/* The order of these may not be correct */
+#define ETNA_ATTRIB_BASE	0x00000000
+#define ETNA_IO_BASE		0x04000000
+
+#define ETNA_REG_BASE		0x08000000
+#define ETNA_MEM_BASE		0x0c000000
+
+#define ETNA_REG_SIZE		0x00005000
+
+//#define PCMCIA_BASE          0xf0000000      /* virtual */
+//#define PCMCIA_ATTR8(a)      (ETNA_V_BASE+0x00000000+(a))
+//#define PCIILR	0x2		/* PC Card Interrupt Input Level Register	*/
+//#define __ETNAB(off)		__raw_readb(ETNA_V_BASE + (off))
+
+/* ########## THESE ARE FROM THE SAMPLE DRIVER ########### */
+
+#define PCISR	0x0000		/* PC Card Interrupt Status Register		*/
+#define PCIMR	0x0400		/* PC Card Interrupt Mask Register		*/
+#define PCICR	0x0800		/* PC Card Interrupt Clear Register		*/
+#define PCIOSR	0x0c00		/* PC Card Interrupt Output Select Regsiter	*/
+#define PCIRR1	0x1000		/* PC Card Interrupt Reserved Register 1	*/
+#define PCIRR2	0x1400		/* PC Card Interrupt Reserved Register 2	*/
+#define PCIRR3	0x1800		/* PC Card Interrupt Reserved Register 3	*/
+#define PCIILR	0x1c00		/* PC Card Interrupt Input Level Register	*/
+#define SICR	0x2000		/* System Interface Configuration Register	*/
+#define CICR	0x2400		/* Card Interface Configuration Register	*/
+#define PMR	0x2800		/* Power Management Register			*/
+#define CPCR	0x2c00		/* Card Power Control Register			*/
+#define CITR0A	0x3000		/* Card Interface Timing Register 0A		*/
+#define CITR0B	0x3400		/* Card Interface Timing Register 0B		*/
+#define CITR1A	0x3800		/* Card Interface Timing Register 1A		*/
+#define CITR1B	0x3c00		/* Card Interface Timing Register 1B		*/
+#define DMACR	0x4000		/* DMA Control Register				*/
+#define DIR	0x4400		/* Device Information Register			*/
+
+#define PMR_AUTOIDLE	(1 << 0)	/* auto idle mode			*/
+#define PMR_FORCEIDLE	(1 << 1)	/* force idle mode			*/
+#define PMR_PDCS	(1 << 2)	/* Power down card on standby		*/
+#define PMR_PDCR	(1 << 3)	/* Power down card on removal		*/
+#define PMR_DCAR	(1 << 4)	/* Disable card access on removal	*/
+#define PMR_CPE		(1 << 5)	/* Card power enable			*/
+#define PMR_MCPE	(1 << 6)	/* Monitor card power enable		*/
+#define PMR_PDREQLSEL	(1 << 7)	/* If set, PDREQL is a GPIO pin		*/
+#define PMR_DISSTBY	(1 << 8)	/* Disable standby			*/
+#define PMR_ACCSTBY	(1 << 9)	/* Complete card accesses before standby*/
+#define PMR_CDUNPROT	(0 << 10)	/* Card detect inputs unprotected	*/
+#define PMR_CDPROT	(1 << 10)	/* Card detect inputs protected		*/
+#define PMR_CDWEAK	(2 << 10)	/* Weak pullup except in standby	*/
+#define PMR_CDWEAKAL	(3 << 10)	/* Weak pullup				*/
+
+#define CPCR_PON(x)	((x)&7)		/* PCTL[2:0] value when PMR_CPE = 1	*/
+#define CPCR_POFF(x)	(((x)&7)<<3)	/* PCTL[2:0] value when PMR_CPE = 0	*/
+#define CPCR_PDIR(x)	(((x)&7)<<6)	/* PCTL[2:0] direction			*/
+#define CPCR_CON(x)	(((x)&1)<<9)	/* GPIO value when PMR_CPE = 1		*/
+#define CPCR_COFF(x)	(((x)&1)<<10)	/* GPIO value when PMR_CPE = 0		*/
+#define CPCR_CDIR(x)	(((x)&1)<<11)	/* GPIO direction (PMR_PDREQLSEL = 1)	*/
+#define CPCR_VS(x)	(((x)&3)<<12)	/* VS[2:1] output value			*/
+#define CPCR_VSDIR(x)	(((x)&3)<<14)	/* VS[2:1] direction			*/
+
+#define PCTL0		(1 << 0)
+#define PCTL1		(1 << 1)
+#define PCTL2		(1 << 2)
+
+#define CICR_ASRTMR1	(1 << 0)	/* Timer 1 select for attribute read	*/
+#define CICR_ASWTMR1	(1 << 1)	/* Timer 1 select for attribute write	*/
+#define CICR_IOSRTMR1	(1 << 2)	/* Timer 1 select for IO read		*/
+#define CICR_IOSWTMR1	(1 << 3)	/* Timer 1 select for IO write		*/
+#define CICR_MEMSRTMR1	(1 << 4)	/* Timer 1 select for memory read	*/
+#define CICR_MEMSWTMR1	(1 << 5)	/* Timer 1 select for memory write	*/
+#define CICR_AUTOIOSZ	(1 << 6)	/* Auto size I/O accesses		*/
+#define CICR_CAW	(1 << 7)	/* Card access width			*/
+#define CICR_IOMODE	(1 << 8)	/* IO mode select			*/
+#define CICR_ENABLE	(1 << 10)	/* Card enable				*/
+#define CICR_RESETOE	(1 << 11)	/* Card reset output enable		*/
+#define CICR_RESET	(1 << 12)	/* Card reset				*/
+
+
+#define RD_FAIL		(1 << 14)
+#define WR_FAIL		(1 << 13)
+#define IDLE		(1 << 12)
+
+#define FFOTHLD		(1 << 11)
+#define PCM_RDYL	(1 << 10)
+#define PCM_WP		(1 << 9)
+#define PCTL		(1 << 8)
+
+#define PDREQ_L		(1 << 6)
+#define PCM_VS2		(1 << 5)
+#define PCM_VS1		(1 << 4)
+
+#define PCM_CD2		(1 << 3)
+#define PCM_CD1		(1 << 2)
+#define PCM_BVD2	(1 << 1)
+#define PCM_BVD1	(1 << 0)
diff -uNr linux/drivers/ssi/adc1213x.h linux-2.4.7/drivers/ssi/adc1213x.h
--- linux/drivers/ssi/adc1213x.h	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/drivers/ssi/adc1213x.h	Thu Aug  2 03:02:59 2001
@@ -0,0 +1,104 @@
+/*
+ * linux/include/asm-arm/arch-clps7110/adc1213x.h
+ *
+ * Written 1999 by Werner Almesberger
+ *
+ * NS ADC1213X interface
+ */
+
+#ifndef __ASM_ARCH_ADC1213X_H
+#define __ASM_ARCH_ADC1213X_H
+
+#include <linux/types.h>
+#include <asm/atomic.h>
+
+
+#define ADC1213X_CHANNELS	8	/* ADC12138 */
+
+/*
+ * All times are in microseconds.
+ *
+ * The following timing parameters depend on the environment:
+ *
+ * ADC1213X_T_CK	conversion clock cycle time
+ * ADC1213X_T_SK	serial data clock cycle time
+ */
+
+#define ADC1213X_T_C	(44*ADC1213X_T_CK)	/* Conversion Time */
+#define ADC1213X_T_A_6	(7*ADC1213X_T_CK)	/* Acquisition Time */
+#define ADC1213X_T_A_10	(11*ADC1213X_T_CK)
+#define ADC1213X_T_A_18	(19*ADC1213X_T_CK)
+#define ADC1213X_T_A_34	(35*ADC1213X_T_CK)
+#define ADC1213X_T_CAL	(4944*ADC1213X_T_CK)	/* Self-Calibration Time */
+#define ADC1213X_T_AZ	(76*ADC1213X_T_CK)	/* Auto-Zero Time */
+#define ADC1213X_T_DOR	(9*ADC1213X_T_SK)	/* DOR High Time */
+#define	ADC1213X_T_CONV	(8*ADC1213X_T_SK)	/* CONV valid time */
+#define ADC1213X_T_SPU	700			/* Software Power-Up Time */
+
+#define	ADC1213X_CONV(chan,flags)	(((chan) << 1) | (flags))
+#define ADC1213X_FLG_DIFF	0x00		/* Differential */
+#define ADC1213X_FLG_SNGL	0x01		/* Single-Ended */
+#define ADC1213X_FLG_12		0x00		/* 12/13 bit conversion */
+#define ADC1213X_FLG_16		0x80		/* 16/17 bit conversion */
+#define ADC1213X_FLG_LSB	0x20		/* LSB first */
+#define ADC1213X_FLG_MSB	0x00		/* MSB first */
+
+#define ADC12130_CMD(cmd)	((cmd & 0x03) | ((cmd & 0xf0) >> 2))
+
+#define ADC1213X_CAL		0x10		/* Auto Cal */
+#define	ADC1213X_AZ		0x90		/* Auto Zero */
+#define ADC1213X_PWUP		0x50		/* Power Up */
+#define ADC1213X_PWDN		0xd0		/* Power Down */
+#define ADC1213X_STATUS		0x30		/* Read Status Register */
+#define ADC1213X_DATA_U		0xb0		/* Data Out without Sign */
+#define ADC1213X_DATA_S		0xb1		/* Data Out with Sign */
+#define ADC1213X_ACQ6		0x70		/* Acquisition Time - 6 CCLK */
+#define ADC1213X_ACQ10		0x72		/* Acquisition Time - 10 CCLK */
+#define ADC1213X_ACQ18		0x71		/* Acquisition Time - 18 CCLK */
+#define ADC1213X_ACQ34		0x73		/* Acquisition Time - 34 CCLK */
+
+#define ADC1213X_CHAN0		0
+#define ADC1213X_CHAN1		1
+#define ADC1213X_CHAN2		4
+#define ADC1213X_CHAN3		5
+#define ADC1213X_CHAN4		2
+#define ADC1213X_CHAN5		3
+#define ADC1213X_CHAN6		6
+#define ADC1213X_CHAN7		7
+
+
+/*
+ * "before_adc" and "after_adc" are called before of after the ADC hardware
+ * does a conversion. "result" is called when the conversion result is
+ * available. If A and B are two requests and A < B means that A is enqueued
+ * before B, the following partial order applies:
+ *
+ * A->before_adc < A->after_adc	("after_adc" follows "before_adc")
+ * A->after_adc < B->before_adc	(requests don't overlap)
+ * A->after_adc < A->result	("result" is always last)
+ * A->result < B->result	(no reordering)
+ *
+ * However, note that you must NOT assume any of
+ *
+ * A->result < B->before_adc
+ * A->result < B->after_adc
+ *
+ * "before_adc", "before_adc", and "result" can be set to NULL if not used.
+ */
+
+struct adc_req {
+	/* ----- initialized by the user ----------------------------------- */
+	int channel;
+	void (*before_adc)(struct adc_req *req);
+	void (*after_adc)(struct adc_req *req);
+	void (*result)(struct adc_req *req,uint16_t data);
+	void *user;
+	/* ----- initialized by adc_request -------------------------------- */
+	struct adc_req *next;
+};
+
+
+void adc_request(struct adc_req *req);
+void adc_init(int cycles);
+
+#endif
diff -uNr linux/drivers/video/clps711xfb.c linux-2.4.7/drivers/video/clps711xfb.c
--- linux/drivers/video/clps711xfb.c	Fri Aug  3 05:40:03 2001
+++ linux-2.4.7/drivers/video/clps711xfb.c	Sun Dec  2 08:01:35 2001
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Framebuffer driver for the CLPS7111 and EP7212 processors.
+ *  Framebuffer driver for the CLPS711X and EP7212 processors.
  */
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -31,10 +31,13 @@
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
+
+#if defined(CONFIG_ARCH_P720T)
 #include <asm/arch/syspld.h>
+#endif
 
-static struct clps7111fb_info {
+static struct clps711xfb_info {
 	struct fb_info		fb;
 	int			currcon;
 } *cfb;
@@ -45,7 +48,7 @@
  *    Set a single color register. Return != 0 for invalid regno.
  */
 static int
-clps7111fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+clps711xfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 		     u_int transp, struct fb_info *info)
 {
 	unsigned int level, mask, shift, pal;
@@ -74,10 +77,10 @@
  * Set the colormap
  */
 static int
-clps7111fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
+clps711xfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
 		    struct fb_info *info)
 {
-	struct clps7111fb_info *cfb = (struct clps7111fb_info *)info;
+	struct clps711xfb_info *cfb = (struct clps711xfb_info *)info;
 	struct fb_cmap *dcmap = &fb_display[con].cmap;
 	int err = 0;
 
@@ -86,7 +89,7 @@
 		err = fb_alloc_cmap(dcmap, CMAP_SIZE, 0);
 
 	if (!err && con == cfb->currcon) {
-		err = fb_set_cmap(cmap, kspc, clps7111fb_setcolreg, &cfb->fb);
+		err = fb_set_cmap(cmap, kspc, clps711xfb_setcolreg, &cfb->fb);
 		dcmap = &cfb->fb.cmap;
 	}
 
@@ -100,7 +103,7 @@
  *    Set the User Defined Part of the Display
  */
 static int
-clps7111fb_set_var(struct fb_var_screeninfo *var, int con,
+clps711xfb_set_var(struct fb_var_screeninfo *var, int con,
 		   struct fb_info *info)
 {
 	struct display *display;
@@ -215,7 +218,7 @@
 	clps_writel(lcdcon, LCDCON);
 	clps_writel(syscon | SYSCON1_LCDEN, SYSCON1);
 
-	fb_set_cmap(&cfb->fb.cmap, 1, clps7111fb_setcolreg, &cfb->fb);
+	fb_set_cmap(&cfb->fb.cmap, 1, clps711xfb_setcolreg, &cfb->fb);
 
 	return 0;
 }
@@ -250,18 +253,18 @@
 	return 0;
 }
 
-static struct fb_ops clps7111fb_ops = {
+static struct fb_ops clps711xfb_ops = {
 	owner:		THIS_MODULE,
-	fb_set_var:	clps7111fb_set_var,
-	fb_set_cmap:	clps7111fb_set_cmap,
+	fb_set_var:	clps711xfb_set_var,
+	fb_set_cmap:	clps711xfb_set_cmap,
 	fb_get_fix:	gen_get_fix,
 	fb_get_var:	gen_get_var,
 	fb_get_cmap:	gen_get_cmap,
 };
 
-static int clps7111fb_switch(int con, struct fb_info *info)
+static int clps711xfb_switch(int con, struct fb_info *info)
 {
-	struct clps7111fb_info *cfb = (struct clps7111fb_info *)info;
+	struct clps711xfb_info *cfb = (struct clps711xfb_info *)info;
 	struct display *disp;
 	struct fb_cmap *cmap;
 
@@ -294,17 +297,17 @@
 	cfb->fb.var = disp->var;
 	cfb->fb.var.activate = FB_ACTIVATE_NOW;
 
-	clps7111fb_set_var(&cfb->fb.var, con, &cfb->fb);
+	clps711xfb_set_var(&cfb->fb.var, con, &cfb->fb);
 
 	return 0;
 }
 
-static int clps7111fb_updatevar(int con, struct fb_info *info)
+static int clps711xfb_updatevar(int con, struct fb_info *info)
 {
 	return -EINVAL;
 }
 
-static void clps7111fb_blank(int blank, struct fb_info *info)
+static void clps711xfb_blank(int blank, struct fb_info *info)
 {
 }
 
@@ -321,7 +324,7 @@
 
 	cfb->currcon		= -1;
 
-	strcpy(cfb->fb.fix.id, "clps7111");
+	strcpy(cfb->fb.fix.id, "clps711x");
 	cfb->fb.screen_base	= (void *)PAGE_OFFSET;
 	cfb->fb.fix.smem_start	= PAGE_OFFSET;
 	cfb->fb.fix.smem_len	= 0x14000;
@@ -337,11 +340,11 @@
 	cfb->fb.var.height	= -1;
 	cfb->fb.var.width	= -1;
 
-	cfb->fb.fbops		= &clps7111fb_ops;
+	cfb->fb.fbops		= &clps711xfb_ops;
 	cfb->fb.changevar	= NULL;
-	cfb->fb.switch_con	= clps7111fb_switch;
-	cfb->fb.updatevar	= clps7111fb_updatevar;
-	cfb->fb.blank		= clps7111fb_blank;
+	cfb->fb.switch_con	= clps711xfb_switch;
+	cfb->fb.updatevar	= clps711xfb_updatevar;
+	cfb->fb.blank		= clps711xfb_blank;
 	cfb->fb.flags		= FBINFO_FLAG_DEFAULT;
 	cfb->fb.disp		= (struct display *)(cfb + 1);
 
@@ -350,14 +353,17 @@
 	/*
 	 * Power up the LCD
 	 */
-	if (machine_is_p720t()) {
-		PLD_LCDEN = PLD_LCDEN_EN;
-		PLD_PWR |= (PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
-	}
+#if defined(CONFIG_ARCH_P720T)
+	PLD_LCDEN = PLD_LCDEN_EN;
+	PLD_PWR |= (PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
+#endif
 
-	clps7111fb_set_var(&cfb->fb.var, -1, &cfb->fb);
+	clps711xfb_set_var(&cfb->fb.var, -1, &cfb->fb);
 	err = register_framebuffer(&cfb->fb);
-
+	if(err < 0)
+		printk(KERN_ERR "clps711xfb.c: register_framebuffer failed\n");
+	else
+		printk(KERN_ERR "CLPS711X framebuffer\n");
 out:	return err;
 }
 
@@ -369,10 +375,10 @@
 	/*
 	 * Power down the LCD
 	 */
-	if (machine_is_p720t()) {
-		PLD_LCDEN = 0;
-		PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
-	}
+#if defined(CONFIG_ARCH_P720T)
+	PLD_LCDEN = 0;
+	PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON);
+#endif
 }
 
 #ifdef MODULE
diff -uNr linux/fs/proc/generic.c linux-2.4.7/fs/proc/generic.c
--- linux/fs/proc/generic.c	Fri Aug  3 05:39:18 2001
+++ linux-2.4.7/fs/proc/generic.c	Sun Feb 17 03:08:43 2002
@@ -359,7 +359,7 @@
 static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp)
 {
 	int	i;
-	
+
 	i = make_inode_number();
 	if (i < 0)
 		return -EAGAIN;
diff -uNr linux/include/asm-arm/arch-clps711x/dma.h linux-2.4.7/include/asm-arm/arch-clps711x/dma.h
--- linux/include/asm-arm/arch-clps711x/dma.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/dma.h	Wed Apr 17 16:42:28 2002
@@ -24,5 +24,9 @@
 
 #define MAX_DMA_CHANNELS	0
 
+void clps7110_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size);
+
+#define arch_adjust_zones(node,size,holes) clps7110_adjust_zones(node,size,holes)
+
 #endif /* _ASM_ARCH_DMA_H */
 
diff -uNr linux/include/asm-arm/arch-clps711x/etna.h linux-2.4.7/include/asm-arm/arch-clps711x/etna.h
--- linux/include/asm-arm/arch-clps711x/etna.h	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/include/asm-arm/arch-clps711x/etna.h	Fri Aug 10 00:02:24 2001
@@ -0,0 +1,43 @@
+/*
+ *  linux/include/asm-arm/arch-clps711x/etna.h
+ *
+ *  Psion Series 5 ETNA controller register definitions.
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_ARCH_ETNA_H
+#define __ASM_ARCH_ETNA_H
+
+#define ETNA_PHYS_BASE		(0x20000000)
+#define ETNA_SIZE		(0x00100000)
+
+#ifndef __ASSEMBLY__
+#include <asm/types.h>
+
+#define ETNA_REG(type,off)	(*(volatile type *)(ETNA_BASE + off))
+#else
+#define ETNA_REG(type,off)	(off)
+#endif
+
+#define	ETNA_CF_IRQ		0x01			/* Card Interrupt */
+
+#define ETNA_INT_STATUS		ETNA_REG(u8,  6)	/* Interrupt Status */
+#define ETNA_INT_MASK		ETNA_REG(u8,  7)	/* Interrupt Mask */
+#define ETNA_INT_CLEAR		ETNA_REG(u8,  8)	/* Interrupt Clear */
+#define ETNA_CONTROL		ETNA_REG(u8, 11)	/* CF control */
+
+#endif
diff -uNr linux/include/asm-arm/arch-clps711x/hardware.h linux-2.4.7/include/asm-arm/arch-clps711x/hardware.h
--- linux/include/asm-arm/arch-clps711x/hardware.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/hardware.h	Wed Apr 17 03:39:41 2002
@@ -22,14 +22,32 @@
 #ifndef __ASM_ARCH_HARDWARE_H
 #define __ASM_ARCH_HARDWARE_H
 
-#define CLPS7111_VIRT_BASE	0xff000000
-#define CLPS7111_BASE		CLPS7111_VIRT_BASE
+#define CLPS711X_VIRT_BASE	0xff000000
+#define CLPS711X_BASE		CLPS711X_VIRT_BASE
 
-#define EP7212_VIRT_BASE	CLPS7111_VIRT_BASE
-#define EP7212_BASE		CLPS7111_VIRT_BASE
+#define EP7212_VIRT_BASE	CLPS711X_VIRT_BASE
+#define EP7212_BASE		CLPS711X_VIRT_BASE
+
+#if defined(CONFIG_PCMCIA_ETNA)
+
+#define ETNA_VIRT_BASE		0xfe000000
+#define ETNA_BASE		ETNA_VIRT_BASE
+
+#include "etna.h"
+
+#define PCMCIA_VIRT_BASE	0xe0000000
+#define PCMCIA_BASE		PCMCIA_VIRT_BASE
+
+#define PCMCIA_SIZE		0x10000000	/* 4 areas of 64MB each */
+
+#endif /* defined(CONFIG_PCMCIA_ETNA) */
+
+#if defined(CONFIG_ARCH_P720T)
 
 #define SYSPLD_VIRT_BASE	0xfe000000
 #define SYSPLD_BASE		SYSPLD_VIRT_BASE
+
+#endif /* defined(CONFIG_ARCH_P720T) */
 
 #ifndef __ASSEMBLER__
 
diff -uNr linux/include/asm-arm/arch-clps711x/hw_psion.h linux-2.4.7/include/asm-arm/arch-clps711x/hw_psion.h
--- linux/include/asm-arm/arch-clps711x/hw_psion.h	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/include/asm-arm/arch-clps711x/hw_psion.h	Wed Nov 28 04:06:53 2001
@@ -0,0 +1,114 @@
+/*
+ * linux/include/asm/arch/hw_psion.h
+ *
+ * Written 1998,1999 by Werner Almesberger
+ *
+ * This file contains the hardware definitions of the Psion S5
+ */
+
+#ifndef __ASM_ARCH_HW_PSION_H
+#define __ASM_ARCH_HW_PSION_H
+
+/*
+ * Physical address of PCMCIA area. Actually it's CF, but they're accessed in
+ * the same way.
+ */
+
+#define PCMCIA_START		0x40000000
+
+/*
+ * LCD display size
+ */
+
+#define LCD_X_SIZE		640
+#define LCD_Y_SIZE		240
+
+/*
+ * Register/port usage
+ */
+
+/*
+ * Port B
+ *
+ * +--7--+--6--+--5--+--4--+--3--+--2--+--1--+--0--+
+ * |VPCEN|OPEN |VLDD3|VLDD2|VLDD1|VLDD0|EECLK|EECS |
+ * | out |in/ou|in/ou|in/ou|in/ou|in/ou| out | out |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ */
+
+#define HW_VLD_MASK		0x3c	/* Contrast control */
+#define HW_VLD_SHIFT		2
+#define HW_OPEN_BIT		0x40	/* Indicates that the case is open */
+#define HW_VPCEN_BIT		0x80	/* Enables the power to the CF Card */
+
+/*
+ * Port C
+ *
+ * +--7--+--6--+--5--+--4--+--3--+--2--+--1--+--0--+
+ * |ADICT|BBLD |IREN |ELEN |RSEN |PLED | DTR | RTS |
+ * | out | out | out | out | out | out | out | out |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ */
+
+#define HW_RTS_BIT		0x01	/* RS-232 RTS */
+#define HW_DTR_BIT		0x02	/* RS-232 DTR */
+#define HW_PLED_BIT		0x04	/* Disable power LED */
+#define HW_RSEN_BIT		0x08	/* Enable RS-232 driver */
+#define	HW_ELEN_BIT		0x10	/* Enable backlight */
+#define HW_IREN_BIT		0x20	/* Enable IR receiver */
+#define	HW_BBLD_BIT		0x40	/* Apply load to backup battery */
+#define	HW_ADICT_BIT		0x80	/* Set audio circuit to "dictaphone" */
+
+/*
+ * Port D
+ *
+ * +--7--+--6--+--5--+--4--+--3--+--2--+--1--+--0--+
+ * | X2  | VLL |TRIX2|SLED |DORSW| DON |AMPEN|CDEN |
+ * |in/ou| out | n/a | out | out | out | out | out |
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ */
+
+#define HW_CDEN_BIT		0x01	/* CODEC enable */
+#define HW_AMPEN_BIT		0x02	/* Audio Amplifier Enable */
+#define HW_DON_BIT		0x04	/* Display On */
+#define HW_SLED_BIT		0x10	/* Turns Status LED ON */
+#define HW_VLL_BIT		0x40	/* LCD Logic Rail */
+#define HW_X2_BIT		0x80	/* Pen Down Detect Line */
+
+/*
+ * Port E
+ *
+ * +--3--+--2--+--1--+--0--+
+ * |Y1EN |X1EN |Y2EN |X2EN |
+ * | out | out | out | out |
+ * +-----+-----+-----+-----+
+ */
+
+#define HW_X2EN_BIT		0x01	/* Digitiser X2 Drive */
+#define HW_Y2EN_BIT		0x02	/* Digitiser Y2 Drive */
+#define HW_X1EN_BIT		0x04	/* Digitiser X1 Drive */
+#define HW_Y1EN_BIT		0x08	/* Digitiser Y1 Drive */
+
+/*
+ * ADC channels
+ */
+
+#define ADC_DIG_X	ADC1213X_CHAN0	/* Digitiser Y */
+#define	ADC_DIG_Y	ADC1213X_CHAN1	/* Digitiser X */
+#define ADC_VBATT	ADC1213X_CHAN2	/* Primary Battery Voltage */
+#define ADC_VBACKUP	ADC1213X_CHAN3	/* Back-up Battery Voltage */
+#define	ADC_VREF	ADC1213X_CHAN4	/* Reference Voltage */
+#define	ADC_VPC		ADC1213X_CHAN5	/* Vpc/2 - CF power rail Voltage */
+#define	ADC_VDC		ADC1213X_CHAN6	/* DC in (/2.5) */
+#define	ADC_VPP		ADC1213X_CHAN7	/* VPP (/4) */
+
+/*
+ * ADC timing
+ */
+
+#define ADC1213X_T_CK	/*4*/5	/* SMPCLK, 256 kHz */
+#define ADC1213X_T_SK	/*8*/9	/* ADCCLK, 128 kHz */
+
+#define SSI_SPD      ADCS_256
+
+#endif
diff -uNr linux/include/asm-arm/arch-clps711x/irqs.h linux-2.4.7/include/asm-arm/arch-clps711x/irqs.h
--- linux/include/asm-arm/arch-clps711x/irqs.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/irqs.h	Wed Apr 17 03:39:12 2002
@@ -37,6 +37,11 @@
 #define INT1_IRQS			(0x0000fff0)
 #define INT1_ACK_IRQS			(0x00004f10)
 
+#if defined(CONFIG_ARCH_CLPS7110)
+
+#define NR_IRQS                         16
+
+#else
 /*
  * Interrupts from INTSR2
  */
@@ -51,3 +56,4 @@
 
 #define NR_IRQS                         30
 
+#endif
diff -uNr linux/include/asm-arm/arch-clps711x/memory.h linux-2.4.7/include/asm-arm/arch-clps711x/memory.h
--- linux/include/asm-arm/arch-clps711x/memory.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/memory.h	Wed Apr 17 03:39:11 2002
@@ -38,6 +38,55 @@
 #define PAGE_OFFSET	(0xc0000000UL)
 #define PHYS_OFFSET	(0xc0000000UL)
 
+#if defined(CONFIG_CLPS7110_PSION)
+
+/*
+ *  Psion Series 5 physical memory map
+ *
+ *  0xc0000000 size 512k
+ *  0xc0100000 size 512k
+ *  0xc0400000 size 512k
+ *  0xc0500000 size 512k
+ *  0xc1000000 size 512k
+ *  0xc1100000 size 512k
+ *  0xc1400000 size 512k
+ *  0xc1500000 size 512k
+ *  0xd0000000 size 512k
+ *  0xd0100000 size 512k
+ *  0xd0400000 size 512k
+ *  0xd0500000 size 512k
+ *  0xd1000000 size 512k
+ *  0xd1100000 size 512k
+ *  0xd1400000 size 512k
+ *  0xd1500000 size 512k
+ *
+ *  phys addr bits: 110n 000n 0n0n 0xxx xxxx xxxx xxxx xxxx
+ *  virt addr bits: 1100 0000 0nnn nxxx xxxx xxxx xxxx xxxx
+ */
+
+#define MEM_SIZE (0x00800000UL) /* 8 Mb for Psion S5 */
+
+#define __virt_to_phys__is_a_macro
+#define __virt_to_phys(x)	(((x) & 0xc007ffff) | \
+				(((x) & 0x00400000) << 6) | \
+				(((x) & 0x00200000) << 3) | \
+				(((x) & 0x00100000) << 2) | \
+				(((x) & 0x00080000) << 1))
+
+#define __phys_to_virt__is_a_macro
+#define __phys_to_virt(x)	(((x) & 0xc007ffff) | \
+				(((x) & 0x10000000) >> 6) | \
+				(((x) & 0x01000000) >> 3) | \
+				(((x) & 0x00400000) >> 2) | \
+				(((x) & 0x00100000) >> 1))
+
+/*
+ * __bidx_2_pidx makes page index from index to bootmem map
+ */
+#define __bidx_2_pidx(x) (__phys_to_virt((x) << PAGE_SHIFT) >> PAGE_SHIFT)
+
+#else
+
 /*
  * On integrator, the dram is contiguous
  */
@@ -46,6 +95,8 @@
 #define __phys_to_virt__is_a_macro
 #define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET)
 
+#endif
+
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
@@ -53,6 +104,7 @@
  * bus_to_virt: Used to convert an address for DMA operations
  *              to an address that the kernel can use.
  */
+
 #define __virt_to_bus__is_a_macro
 #define __virt_to_bus(x)	((x) - PAGE_OFFSET)
 #define __bus_to_virt__is_a_macro
diff -uNr linux/include/asm-arm/arch-clps711x/pcmcia.h linux-2.4.7/include/asm-arm/arch-clps711x/pcmcia.h
--- linux/include/asm-arm/arch-clps711x/pcmcia.h	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/include/asm-arm/arch-clps711x/pcmcia.h	Fri Aug 10 00:21:08 2001
@@ -0,0 +1,70 @@
+/*
+ * linux/include/asm/arch/pcmcia.h
+ *
+ * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
+ *
+ * This file contains definitions for the low-level Psion Series 5 kernel PCMCIA
+ * interface. Please see linux/Documentation/arm/SA1100/PCMCIA for details.
+ */
+
+#ifndef _ASM_ARCH_PCMCIA
+#define _ASM_ARCH_PCMCIA
+
+
+/* Ideally, we'd support up to MAX_SOCK sockets, but the SA-1100 only
+ * has support for two. This shows up in lots of hardwired ways, such
+ * as the fact that MECR only has enough bits to configure two sockets.
+ * Since it's so entrenched in the hardware, limiting the software
+ * in this way doesn't seem too terrible.
+ */
+#define PSION_S5_PCMCIA_MAX_SOCK   (1)
+
+
+#ifndef __ASSEMBLY__
+
+struct pcmcia_init {
+  void (*handler)(int irq, void *dev, struct pt_regs *regs);
+};
+
+struct pcmcia_state {
+  unsigned detect: 1,
+            ready: 1,
+             bvd1: 1,
+             bvd2: 1,
+           wrprot: 1,
+            vs_3v: 1,
+            vs_Xv: 1;
+};
+
+struct pcmcia_state_array {
+  unsigned int size;
+  struct pcmcia_state *state;
+};
+
+struct pcmcia_configure {
+  unsigned sock: 8,
+            vcc: 8,
+            vpp: 8,
+         output: 1,
+        speaker: 1,
+          reset: 1;
+};
+
+struct pcmcia_irq_info {
+  unsigned int sock;
+  unsigned int irq;
+};
+
+struct pcmcia_low_level {
+  int (*init)(struct pcmcia_init *);
+  int (*shutdown)(void);
+  int (*socket_state)(struct pcmcia_state_array *);
+  int (*get_irq_info)(struct pcmcia_irq_info *);
+  int (*configure_socket)(const struct pcmcia_configure *);
+};
+
+extern struct pcmcia_low_level *pcmcia_low_level;
+
+#endif  /* __ASSEMBLY__ */
+
+#endif
diff -uNr linux/include/asm-arm/arch-clps711x/system.h linux-2.4.7/include/asm-arm/arch-clps711x/system.h
--- linux/include/asm-arm/arch-clps711x/system.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/system.h	Wed Apr 17 04:02:24 2002
@@ -20,7 +20,7 @@
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
 static void arch_idle(void)
 {
diff -uNr linux/include/asm-arm/arch-clps711x/time.h linux-2.4.7/include/asm-arm/arch-clps711x/time.h
--- linux/include/asm-arm/arch-clps711x/time.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/time.h	Wed Apr 17 04:02:43 2002
@@ -19,12 +19,12 @@
  */
 #include <asm/system.h>
 #include <asm/leds.h>
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
 /*
  * IRQ handler for the timer
  */
-static void p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static void clps711x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	do_leds();
 	do_timer(regs);
@@ -37,7 +37,7 @@
  * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
  * 'tick' is usecs per jiffy.
  */
-static unsigned long p720t_gettimeoffset(void)
+static unsigned long clps711x_gettimeoffset(void)
 {
 	unsigned long hwticks;
 	hwticks = LATCH - (clps_readl(TC2D) & 0xffff);	/* since last underflow */
@@ -51,15 +51,20 @@
 {
 	unsigned int syscon;
 
-	gettimeoffset = p720t_gettimeoffset;
+	gettimeoffset = clps711x_gettimeoffset;
 
 	syscon = clps_readl(SYSCON1);
+#if defined(CONFIG_CLPS7110_PSION)
+	syscon |= SYSCON1_TC2M;
+	syscon &= ~SYSCON1_TC2S;	/* use 2KHz for lower power */
+#else
 	syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
+#endif
 	clps_writel(syscon, SYSCON1);
 
 	clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
 
-	timer_irq.handler = p720t_timer_interrupt;
+	timer_irq.handler = clps711x_timer_interrupt;
 
 	/* 
 	 * Make irqs happen for the system timer
diff -uNr linux/include/asm-arm/arch-clps711x/timex.h linux-2.4.7/include/asm-arm/arch-clps711x/timex.h
--- linux/include/asm-arm/arch-clps711x/timex.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/timex.h	Wed Apr 17 03:39:12 2002
@@ -20,4 +20,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#if defined(CONFIG_CLPS7110_PSION)
+#define CLOCK_TICK_RATE 2000	/* 2 KHz */
+#else
 #define CLOCK_TICK_RATE 512000
+#endif
diff -uNr linux/include/asm-arm/arch-clps711x/uncompress.h linux-2.4.7/include/asm-arm/arch-clps711x/uncompress.h
--- linux/include/asm-arm/arch-clps711x/uncompress.h	Fri Aug  3 05:40:04 2001
+++ linux-2.4.7/include/asm-arm/arch-clps711x/uncompress.h	Fri Aug 10 02:54:01 2001
@@ -19,15 +19,15 @@
  */
 #include <asm/arch/io.h>
 #include <asm/arch/hardware.h>
-#include <asm/hardware/clps7111.h>
+#include <asm/hardware/clps711x.h>
 
-#undef CLPS7111_BASE
-#define CLPS7111_BASE CLPS7111_PHYS_BASE
+#undef CLPS711X_BASE
+#define CLPS711X_BASE CLPS711X_PHYS_BASE
 
 #define __raw_readl(p)		(*(unsigned long *)(p))
 #define __raw_writel(v,p)	(*(unsigned long *)(p) = (v))
 
-#if 1
+#if defined(CONFIG_ARCH_P720T)
 #define SYSFLGx	SYSFLG2
 #define UARTDRx	UARTDR2
 #else
diff -uNr linux/include/asm-arm/hardware/clps7111.h linux-2.4.7/include/asm-arm/hardware/clps7111.h
--- linux/include/asm-arm/hardware/clps7111.h	Fri Aug  3 05:38:14 2001
+++ linux-2.4.7/include/asm-arm/hardware/clps7111.h	Thu Jan  1 03:00:00 1970
@@ -1,181 +0,0 @@
-/*
- *  linux/include/asm-arm/hardware/clps7111.h
- *
- *  This file contains the hardware definitions of the CLPS7111 internal
- *  registers.
- *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_HARDWARE_CLPS7111_H
-#define __ASM_HARDWARE_CLPS7111_H
-
-#define CLPS7111_PHYS_BASE	(0x80000000)
-
-#ifndef __ASSEMBLY__
-#define clps_readb(off)		__raw_readb(CLPS7111_BASE + (off))
-#define clps_readl(off)		__raw_readl(CLPS7111_BASE + (off))
-#define clps_writeb(val,off)	__raw_writeb(val, CLPS7111_BASE + (off))
-#define clps_writel(val,off)	__raw_writel(val, CLPS7111_BASE + (off))
-#endif
-
-#define PADR		(0x0000)
-#define PBDR		(0x0001)
-#define PDDR		(0x0003)
-#define PADDR		(0x0040)
-#define PBDDR		(0x0041)
-#define PDDDR		(0x0043)
-#define PEDR		(0x0080)
-#define PEDDR		(0x00c0)
-#define SYSCON1		(0x0100)
-#define SYSFLG1		(0x0140)
-#define MEMCFG1		(0x0180)
-#define MEMCFG2		(0x01c0)
-#define DRFPR		(0x0200)
-#define INTSR1		(0x0240)
-#define INTMR1		(0x0280)
-#define LCDCON		(0x02c0)
-#define TC2D		(0x0340)
-#define RTCDR		(0x0380)
-#define RTCMR		(0x03c0)
-#define PMPCON		(0x0400)
-#define CODR		(0x0440)
-#define UARTDR1		(0x0480)
-#define UBRLCR1		(0x04c0)
-#define SYNCIO		(0x0500)
-#define PALLSW		(0x0540)
-#define PALMSW		(0x0580)
-#define STFCLR		(0x05c0)
-#define BLEOI		(0x0600)
-#define MCEOI		(0x0640)
-#define TEOI		(0x0680)
-#define TC1EOI		(0x06c0)
-#define TC2EOI		(0x0700)
-#define RTCEOI		(0x0740)
-#define UMSEOI		(0x0780)
-#define COEOI		(0x07c0)
-#define HALT		(0x0800)
-#define STDBY		(0x0840)
-
-#define FBADDR		(0x1000)
-#define SYSCON2		(0x1100)
-#define SYSFLG2		(0x1140)
-#define INTSR2		(0x1240)
-#define INTMR2		(0x1280)
-#define UARTDR2		(0x1480)
-#define UBRLCR2		(0x14c0)
-#define SS2DR		(0x1500)
-#define SRXEOF		(0x1600)
-#define SS2POP		(0x16c0)
-#define KBDEOI		(0x1700)
-
-/* common bits: SYSCON1 / SYSCON2 */
-#define SYSCON_UARTEN		(1 << 8)
-
-#define SYSCON1_KBDSCAN(x)	((x) & 15)
-#define SYSCON1_KBDSCANMASK	(15)
-#define SYSCON1_TC1M		(1 << 4)
-#define SYSCON1_TC1S		(1 << 5)
-#define SYSCON1_TC2M		(1 << 6)
-#define SYSCON1_TC2S		(1 << 7)
-#define SYSCON1_UART1EN		SYSCON_UARTEN
-#define SYSCON1_BZTOG		(1 << 9)
-#define SYSCON1_BZMOD		(1 << 10)
-#define SYSCON1_DBGEN		(1 << 11)
-#define SYSCON1_LCDEN		(1 << 12)
-#define SYSCON1_CDENTX		(1 << 13)
-#define SYSCON1_CDENRX		(1 << 14)
-#define SYSCON1_SIREN		(1 << 15)
-#define SYSCON1_ADCKSEL(x)	(((x) & 3) << 16)
-#define SYSCON1_ADCKSEL_MASK	(3 << 16)
-#define SYSCON1_EXCKEN		(1 << 18)
-#define SYSCON1_WAKEDIS		(1 << 19)
-#define SYSCON1_IRTXM		(1 << 20)
-
-/* common bits: SYSFLG1 / SYSFLG2 */
-#define SYSFLG_UBUSY		(1 << 11)
-#define SYSFLG_URXFE		(1 << 22)
-#define SYSFLG_UTXFF		(1 << 23)
-
-#define SYSFLG1_MCDR		(1 << 0)
-#define SYSFLG1_DCDET		(1 << 1)
-#define SYSFLG1_WUDR		(1 << 2)
-#define SYSFLG1_WUON		(1 << 3)
-#define SYSFLG1_CTS		(1 << 8)
-#define SYSFLG1_DSR		(1 << 9)
-#define SYSFLG1_DCD		(1 << 10)
-#define SYSFLG1_UBUSY		SYSFLG_UBUSY
-#define SYSFLG1_NBFLG		(1 << 12)
-#define SYSFLG1_RSTFLG		(1 << 13)
-#define SYSFLG1_PFFLG		(1 << 14)
-#define SYSFLG1_CLDFLG		(1 << 15)
-#define SYSFLG1_URXFE		SYSFLG_URXFE
-#define SYSFLG1_UTXFF		SYSFLG_UTXFF
-#define SYSFLG1_CRXFE		(1 << 24)
-#define SYSFLG1_CTXFF		(1 << 25)
-#define SYSFLG1_SSIBUSY		(1 << 26)
-#define SYSFLG1_ID		(1 << 29)
-
-#define SYSFLG2_SSRXOF		(1 << 0)
-#define SYSFLG2_RESVAL		(1 << 1)
-#define SYSFLG2_RESFRM		(1 << 2)
-#define SYSFLG2_SS2RXFE		(1 << 3)
-#define SYSFLG2_SS2TXFF		(1 << 4)
-#define SYSFLG2_SS2TXUF		(1 << 5)
-#define SYSFLG2_CKMODE		(1 << 6)
-#define SYSFLG2_UBUSY		SYSFLG_UBUSY
-#define SYSFLG2_URXFE		SYSFLG_URXFE
-#define SYSFLG2_UTXFF		SYSFLG_UTXFF
-
-#define LCDCON_GSEN		(1 << 30)
-#define LCDCON_GSMD		(1 << 31)
-
-#define SYSCON2_SERSEL		(1 << 0)
-#define SYSCON2_KBD6		(1 << 1)
-#define SYSCON2_DRAMZ		(1 << 2)
-#define SYSCON2_KBWEN		(1 << 3)
-#define SYSCON2_SS2TXEN		(1 << 4)
-#define SYSCON2_PCCARD1		(1 << 5)
-#define SYSCON2_PCCARD2		(1 << 6)
-#define SYSCON2_SS2RXEN		(1 << 7)
-#define SYSCON2_UART2EN		SYSCON_UARTEN
-#define SYSCON2_SS2MAEN		(1 << 9)
-#define SYSCON2_OSTB		(1 << 12)
-#define SYSCON2_CLKENSL		(1 << 13)
-#define SYSCON2_BUZFREQ		(1 << 14)
-
-/* common bits: UARTDR1 / UARTDR2 */
-#define UARTDR_FRMERR		(1 << 8)
-#define UARTDR_PARERR		(1 << 9)
-#define UARTDR_OVERR		(1 << 10)
-
-/* common bits: UBRLCR1 / UBRLCR2 */
-#define UBRLCR_BAUD_MASK	((1 << 12) - 1)
-#define UBRLCR_BREAK		(1 << 12)
-#define UBRLCR_PRTEN		(1 << 13)
-#define UBRLCR_EVENPRT		(1 << 14)
-#define UBRLCR_XSTOP		(1 << 15)
-#define UBRLCR_FIFOEN		(1 << 16)
-#define UBRLCR_WRDLEN5		(0 << 17)
-#define UBRLCR_WRDLEN6		(1 << 17)
-#define UBRLCR_WRDLEN7		(2 << 17)
-#define UBRLCR_WRDLEN8		(3 << 17)
-#define UBRLCR_WRDLEN_MASK	(3 << 17)
-
-#define SYNCIO_SMCKEN		(1 << 13)
-#define SYNCIO_TXFRMEN		(1 << 14)
-
-#endif /* __ASM_HARDWARE_CLPS7111_H */
diff -uNr linux/include/asm-arm/hardware/clps711x.h linux-2.4.7/include/asm-arm/hardware/clps711x.h
--- linux/include/asm-arm/hardware/clps711x.h	Thu Jan  1 03:00:00 1970
+++ linux-2.4.7/include/asm-arm/hardware/clps711x.h	Wed Apr 17 03:43:22 2002
@@ -0,0 +1,190 @@
+/*
+ *  linux/include/asm-arm/hardware/clps7111.h
+ *
+ *  This file contains the hardware definitions of the CLPS711X internal
+ *  registers.
+ *
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_HARDWARE_CLPS711X_H
+#define __ASM_HARDWARE_CLPS711X_H
+
+#define CLPS711X_PHYS_BASE	(0x80000000)
+
+#define CLPS711X_LCD_MEM_BASE		(0xC0000000)
+#define CLPS711X_LCD_MEM_SIZE		(0x0001ffff) /* 128k */
+
+#ifndef __ASSEMBLY__
+#define clps_readb(off)		__raw_readb(CLPS711X_BASE + (off))
+#define clps_readl(off)		__raw_readl(CLPS711X_BASE + (off))
+#define clps_writeb(val,off)	__raw_writeb(val, CLPS711X_BASE + (off))
+#define clps_writel(val,off)	__raw_writel(val, CLPS711X_BASE + (off))
+#endif
+
+#define PADR		(0x0000)
+#define PBDR		(0x0001)
+#define PDDR		(0x0003)
+#define PADDR		(0x0040)
+#define PBDDR		(0x0041)
+#define PDDDR		(0x0043)
+#define PEDR		(0x0080)
+#define PEDDR		(0x00c0)
+#define SYSCON1		(0x0100)
+#define SYSFLG1		(0x0140)
+#define MEMCFG1		(0x0180)
+#define MEMCFG2		(0x01c0)
+#define DRFPR		(0x0200)
+#define INTSR1		(0x0240)
+#define INTMR1		(0x0280)
+#define LCDCON		(0x02c0)
+#define TC2D		(0x0340)
+#define RTCDR		(0x0380)
+#define RTCMR		(0x03c0)
+#define PMPCON		(0x0400)
+#define CODR		(0x0440)
+#define UARTDR1		(0x0480)
+#define UBRLCR1		(0x04c0)
+#define SYNCIO		(0x0500)
+#define PALLSW		(0x0540)
+#define PALMSW		(0x0580)
+#define STFCLR		(0x05c0)
+#define BLEOI		(0x0600)
+#define MCEOI		(0x0640)
+#define TEOI		(0x0680)
+#define TC1EOI		(0x06c0)
+#define TC2EOI		(0x0700)
+#define RTCEOI		(0x0740)
+#define UMSEOI		(0x0780)
+#define COEOI		(0x07c0)
+#define HALT		(0x0800)
+#define STDBY		(0x0840)
+
+
+/* common bits: SYSCON1 / SYSCON2 */
+#define SYSCON_UARTEN		(1 << 8)
+
+#define SYSCON1_KBDSCAN(x)	((x) & 15)
+#define SYSCON1_KBDSCANMASK	(15)
+#define SYSCON1_TC1M		(1 << 4)
+#define SYSCON1_TC1S		(1 << 5)
+#define SYSCON1_TC2M		(1 << 6)
+#define SYSCON1_TC2S		(1 << 7)
+#define SYSCON1_UART1EN		SYSCON_UARTEN
+#define SYSCON1_BZTOG		(1 << 9)
+#define SYSCON1_BZMOD		(1 << 10)
+#define SYSCON1_DBGEN		(1 << 11)
+#define SYSCON1_LCDEN		(1 << 12)
+#define SYSCON1_CDENTX		(1 << 13)
+#define SYSCON1_CDENRX		(1 << 14)
+#define SYSCON1_SIREN		(1 << 15)
+#define SYSCON1_ADCKSEL(x)	(((x) & 3) << 16)
+#define SYSCON1_ADCKSEL_MASK	(3 << 16)
+#define SYSCON1_EXCKEN		(1 << 18)
+#define SYSCON1_WAKEDIS		(1 << 19)
+#define SYSCON1_IRTXM		(1 << 20)
+
+/* common bits: SYSFLG1 / SYSFLG2 */
+#define SYSFLG_UBUSY		(1 << 11)
+#define SYSFLG_URXFE		(1 << 22)
+#define SYSFLG_UTXFF		(1 << 23)
+
+#define SYSFLG1_MCDR		(1 << 0)
+#define SYSFLG1_DCDET		(1 << 1)
+#define SYSFLG1_WUDR		(1 << 2)
+#define SYSFLG1_WUON		(1 << 3)
+#define SYSFLG1_CTS		(1 << 8)
+#define SYSFLG1_DSR		(1 << 9)
+#define SYSFLG1_DCD		(1 << 10)
+#define SYSFLG1_UBUSY		SYSFLG_UBUSY
+#define SYSFLG1_NBFLG		(1 << 12)
+#define SYSFLG1_RSTFLG		(1 << 13)
+#define SYSFLG1_PFFLG		(1 << 14)
+#define SYSFLG1_CLDFLG		(1 << 15)
+#define SYSFLG1_URXFE		SYSFLG_URXFE
+#define SYSFLG1_UTXFF		SYSFLG_UTXFF
+#define SYSFLG1_CRXFE		(1 << 24)
+#define SYSFLG1_CTXFF		(1 << 25)
+#define SYSFLG1_SSIBUSY		(1 << 26)
+#define SYSFLG1_ID		(1 << 29)
+
+#define LCDCON_GSEN		(1 << 30)
+#define LCDCON_GSMD		(1 << 31)
+
+#if !defined(CONFIG_ARCH_CLPS7110)
+
+#define FBADDR		(0x1000)
+#define SYSCON2		(0x1100)
+#define SYSFLG2		(0x1140)
+#define INTSR2		(0x1240)
+#define INTMR2		(0x1280)
+#define UARTDR2		(0x1480)
+#define UBRLCR2		(0x14c0)
+#define SS2DR		(0x1500)
+#define SRXEOF		(0x1600)
+#define SS2POP		(0x16c0)
+#define KBDEOI		(0x1700)
+
+#define SYSFLG2_SSRXOF		(1 << 0)
+#define SYSFLG2_RESVAL		(1 << 1)
+#define SYSFLG2_RESFRM		(1 << 2)
+#define SYSFLG2_SS2RXFE		(1 << 3)
+#define SYSFLG2_SS2TXFF		(1 << 4)
+#define SYSFLG2_SS2TXUF		(1 << 5)
+#define SYSFLG2_CKMODE		(1 << 6)
+#define SYSFLG2_UBUSY		SYSFLG_UBUSY
+#define SYSFLG2_URXFE		SYSFLG_URXFE
+#define SYSFLG2_UTXFF		SYSFLG_UTXFF
+
+
+#define SYSCON2_SERSEL		(1 << 0)
+#define SYSCON2_KBD6		(1 << 1)
+#define SYSCON2_DRAMZ		(1 << 2)
+#define SYSCON2_KBWEN		(1 << 3)
+#define SYSCON2_SS2TXEN		(1 << 4)
+#define SYSCON2_PCCARD1		(1 << 5)
+#define SYSCON2_PCCARD2		(1 << 6)
+#define SYSCON2_SS2RXEN		(1 << 7)
+#define SYSCON2_UART2EN		SYSCON_UARTEN
+#define SYSCON2_SS2MAEN		(1 << 9)
+#define SYSCON2_OSTB		(1 << 12)
+#define SYSCON2_CLKENSL		(1 << 13)
+#define SYSCON2_BUZFREQ		(1 << 14)
+
+#endif /* !defined(CONFIG_ARCH_CLPS7110) */
+
+/* common bits: UARTDR1 / UARTDR2 */
+#define UARTDR_FRMERR		(1 << 8)
+#define UARTDR_PARERR		(1 << 9)
+#define UARTDR_OVERR		(1 << 10)
+
+/* common bits: UBRLCR1 / UBRLCR2 */
+#define UBRLCR_BAUD_MASK	((1 << 12) - 1)
+#define UBRLCR_BREAK		(1 << 12)
+#define UBRLCR_PRTEN		(1 << 13)
+#define UBRLCR_EVENPRT		(1 << 14)
+#define UBRLCR_XSTOP		(1 << 15)
+#define UBRLCR_FIFOEN		(1 << 16)
+#define UBRLCR_WRDLEN5		(0 << 17)
+#define UBRLCR_WRDLEN6		(1 << 17)
+#define UBRLCR_WRDLEN7		(2 << 17)
+#define UBRLCR_WRDLEN8		(3 << 17)
+#define UBRLCR_WRDLEN_MASK	(3 << 17)
+
+#define SYNCIO_SMCKEN		(1 << 13)
+#define SYNCIO_TXFRMEN		(1 << 14)
+
+#endif /* __ASM_HARDWARE_CLPS711X_H */
diff -uNr linux/include/asm-arm/page.h linux-2.4.7/include/asm-arm/page.h
--- linux/include/asm-arm/page.h	Sun Aug 13 20:54:15 2000
+++ linux-2.4.7/include/asm-arm/page.h	Wed Apr 17 03:39:11 2002
@@ -91,8 +91,12 @@
 #define __va(x)			((void *)__phys_to_virt((unsigned long)(x)))
 
 #ifndef CONFIG_DISCONTIGMEM
+#if defined(CONFIG_CLPS7110_PSION)
+#define virt_to_page(kaddr)	(mem_map + ((((unsigned long)(kaddr)) - PAGE_OFFSET) >> PAGE_SHIFT))
+#else
 #define virt_to_page(kaddr)	(mem_map + (__pa(kaddr) >> PAGE_SHIFT) - \
 				 (PHYS_OFFSET >> PAGE_SHIFT))
+#endif
 #define VALID_PAGE(page)	((page - mem_map) < max_mapnr)
 #endif
 
diff -uNr linux/include/asm-arm/setup.h linux-2.4.7/include/asm-arm/setup.h
--- linux/include/asm-arm/setup.h	Fri Aug  3 05:40:05 2001
+++ linux-2.4.7/include/asm-arm/setup.h	Wed Apr 17 03:43:30 2002
@@ -246,7 +246,11 @@
 /*
  * Memory map description
  */
+#if defined(CONFIG_CLPS7110_PSION)
+#define NR_BANKS 16
+#else
 #define NR_BANKS 8
+#endif
 
 struct meminfo {
 	int nr_banks;
diff -uNr linux/mm/bootmem.c linux-2.4.7/mm/bootmem.c
--- linux/mm/bootmem.c	Fri Aug  3 05:39:23 2001
+++ linux-2.4.7/mm/bootmem.c	Wed Apr 17 17:46:33 2002
@@ -94,8 +94,12 @@
 	if (end > bdata->node_low_pfn)
 		BUG();
 	for (i = sidx; i < eidx; i++)
+#if 0
 		if (test_and_set_bit(i, bdata->node_bootmem_map))
 			printk("hm, page %08lx reserved twice.\n", i*PAGE_SIZE);
+#else
+		test_and_set_bit(i, bdata->node_bootmem_map);
+#endif
 }
 
 static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr, unsigned long size)
@@ -148,7 +152,6 @@
 	unsigned long areasize, preferred, incr;
 	unsigned long eidx = bdata->node_low_pfn - (bdata->node_boot_start >>
 							PAGE_SHIFT);
-
 	if (!size) BUG();
 
 	if (align & (align-1))
@@ -244,6 +247,22 @@
 
 	count = 0;
 	idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
+#if defined(CONFIG_CLPS7110_PSION)
+	{
+		struct page *p;
+
+		printk(KERN_INFO "Freeing pages...(%lx)\n",bdata->node_bootmem_map);
+		for (i = 0; i < idx; i++) {
+			if (!test_bit(i, bdata->node_bootmem_map)) {
+				p = page + __bidx_2_pidx(i);
+				count++;
+				ClearPageReserved(p);
+				set_page_count(p, 1);
+				__free_page(p);
+			}
+		}
+	}
+#else
 	for (i = 0; i < idx; i++, page++) {
 		if (!test_bit(i, bdata->node_bootmem_map)) {
 			count++;
@@ -252,6 +271,7 @@
 			__free_page(page);
 		}
 	}
+#endif
 	total += count;
 
 	/*
diff -uNr linux/mm/page_alloc.c linux-2.4.7/mm/page_alloc.c
--- linux/mm/page_alloc.c	Fri Aug  3 05:39:23 2001
+++ linux-2.4.7/mm/page_alloc.c	Wed Apr 17 17:47:15 2002
@@ -21,7 +21,7 @@
 int nr_swap_pages;
 int nr_active_pages;
 int nr_inactive_dirty_pages;
-pg_data_t *pgdat_list;
+pg_data_t *pgdat_list = 0;
 
 static char *zone_names[MAX_NR_ZONES] = { "DMA", "Normal", "HighMem" };
 static int zone_balance_ratio[MAX_NR_ZONES] = { 32, 128, 128, };
@@ -53,7 +53,8 @@
 /*
  * Temporary debugging check.
  */
-#define BAD_RANGE(zone,x) (((zone) != (x)->zone) || (((x)-mem_map) < (zone)->zone_start_mapnr) || (((x)-mem_map) >= (zone)->zone_start_mapnr+(zone)->size))
+//#define BAD_RANGE(zone,x) (((zone) != (x)->zone) || (((x)-mem_map) < (zone)->zone_start_mapnr) || (((x)-mem_map) >= (zone)->zone_start_mapnr+(zone)->size))
+#define BAD_RANGE(zone,x) ((zone) != (x)->zone)
 
 /*
  * Buddy system. Hairy. You really aren't expected to understand this
@@ -165,7 +166,9 @@
 		page += size;
 	}
 	if (BAD_RANGE(zone,page))
+	{
 		BUG();
+	}
 	return page;
 }
 
@@ -760,7 +763,7 @@
 	if (zholes_size)
 		for (i = 0; i < MAX_NR_ZONES; i++)
 			realtotalpages -= zholes_size[i];
-			
+
 	printk("On node %d totalpages: %lu\n", nid, realtotalpages);
 
 	memlist_init(&active_list);
@@ -782,7 +785,8 @@
 	*gmap = pgdat->node_mem_map = lmem_map;
 	pgdat->node_size = totalpages;
 	pgdat->node_start_paddr = zone_start_paddr;
-	pgdat->node_start_mapnr = (lmem_map - mem_map);
+//	pgdat->node_start_mapnr = (lmem_map - mem_map);
+	pgdat->node_start_mapnr = (lmem_map - NODE_MEM_MAP(nid));
 
 	/*
 	 * Initially all pages are reserved - free ones are freed
@@ -796,7 +800,8 @@
 		memlist_init(&p->list);
 	}
 
-	offset = lmem_map - mem_map;	
+//	offset = lmem_map - mem_map;	
+	offset = lmem_map - NODE_MEM_MAP(nid);	
 	for (j = 0; j < MAX_NR_ZONES; j++) {
 		zone_t *zone = pgdat->node_zones + j;
 		unsigned long mask;
@@ -840,7 +845,8 @@
 		freepages.min += mask;
 		freepages.low += mask*2;
 		freepages.high += mask*3;
-		zone->zone_mem_map = mem_map + offset;
+//		zone->zone_mem_map = mem_map + offset;
+		zone->zone_mem_map = NODE_MEM_MAP(nid) + offset;
 		zone->zone_start_mapnr = offset;
 		zone->zone_start_paddr = zone_start_paddr;
 
@@ -848,10 +854,15 @@
 			printk("BUG: wrong zone alignment, it will crash\n");
 
 		for (i = 0; i < size; i++) {
-			struct page *page = mem_map + offset + i;
+//			struct page *page = mem_map + offset + i;
+			struct page *page = NODE_MEM_MAP(nid) + offset + i;
 			page->zone = zone;
 			if (j != ZONE_HIGHMEM)
+#if defined(CONFIG_CLPS7110_PSION)
+				page->virtual = (void *)zone_start_paddr;
+#else
 				page->virtual = __va(zone_start_paddr);
+#endif
 			zone_start_paddr += PAGE_SIZE;
 		}
 
