diff -urN -X /home/arm/dontdiff_tml_arm /home/download/kernels/linux-2.4.19-rmk2-vanilla/drivers/pcmcia/psion_etna.h linux-2.4.19-rmk2/drivers/pcmcia/psion_etna.h
diff -urN -X /home/arm/dontdiff_tml_arm /home/download/kernels/linux-2.4.19-rmk2-vanilla/drivers/pcmcia/psion_etna.h linux-2.4.19-rmk2/drivers/pcmcia/psion_etna.h
--- /home/download/kernels/linux-2.4.19-rmk2-vanilla/drivers/pcmcia/psion_etna.h	1969-12-31 16:00:00.000000000 -0800
+++ linux-2.4.19-rmk2/drivers/pcmcia/psion_etna.h	2002-10-06 14:29:29.000000000 -0700
@@ -0,0 +1,175 @@
+#include <asm/arch/psionw-power.h>
+
+extern void debug_gpio(void);
+
+#define GET_ETNA_UNKNOWN_0	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_0)
+#define GET_ETNA_UNKNOWN_1	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_1)
+#define GET_ETNA_UNKNOWN_2	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_2)
+#define GET_ETNA_UNKNOWN_3	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_3)
+#define GET_ETNA_UNKNOWN_4	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_4)
+#define GET_ETNA_UNKNOWN_5	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_5)
+#define GET_ETNA_INT_STATUS	__raw_readb(ETNA_V_BASE + ETNA_INT_STATUS)
+#define GET_ETNA_INT_MASK	__raw_readb(ETNA_V_BASE + ETNA_INT_MASK)
+#define GET_ETNA_INT_CLEAR	__raw_readb(ETNA_V_BASE + ETNA_INT_CLEAR)
+#define GET_ETNA_SKT_STATUS	__raw_readb(ETNA_V_BASE + ETNA_SKT_STATUS)
+#define GET_ETNA_SKT_CFG	__raw_readb(ETNA_V_BASE + ETNA_SKT_CFG)
+#define GET_ETNA_SKT_WAKE1	__raw_readb(ETNA_V_BASE + ETNA_SKT_WAKE1)
+#define GET_ETNA_SKT_ACTIVE	__raw_readb(ETNA_V_BASE + ETNA_SKT_ACTIVE)
+#define GET_ETNA_UNKNOWN_E	__raw_readb(ETNA_V_BASE + ETNA_UNKNOWN_E)
+#define GET_ETNA_SKT_WAKE2	__raw_readb(ETNA_V_BASE + ETNA_SKT_WAKE2)
+
+//#define ETNA_DEBUG 1
+
+#ifdef ETNA_DEBUG
+#define DEBUG_ETNA(x...)		printk(x)
+
+#define DEBUG_ETNA_REG(desc, p)		printk("ETNA: %s: Port 0x%08x = 0x%02x\n", \
+						(desc), \
+						skt->regbase + (p), \
+						__raw_readb(skt->regbase + (p)))
+
+#define DEBUG_CF1_REG(desc, p)		printk("CF: %s: Port 0x%08x = 0x%02x\n", \
+						(desc), \
+						CF1_V_BASE + CF_ATTR_BASE + (p), \
+						__raw_readl(CF1_V_BASE + CF_ATTR_BASE + (p)))
+
+#define DEBUG_READ_TEST(desc)		printk("CF: %s: Port 0x3f6 = 0x%02x\n", (desc), CF1_INB(0x3f6))
+
+#else
+#define DEBUG_ETNA(x...)		do { ; } while(0)
+#define DEBUG_ETNA_REG(desc,p)		do { ; } while(0)
+#define DEBUG_CF1_REG(desc,p)		do { ; } while(0)
+#define DEBUG_READ_TEST(desc)		do { ; } while(0)
+#endif
+
+#define CF1_READB(p)			(*(volatile u8 *)(CF1_V_BASE + CF_ATTR_BASE + (p)))
+#define CF1_WRITEB(v,p)			(*(volatile u8 *)(CF1_V_BASE + CF_ATTR_BASE + (p)) = (v))
+
+#define CF1_READL(p)			__raw_readl(CF1_V_BASE + CF_ATTR_BASE + (p))
+#define CF1_WRITEL(v,p)			__raw_writel((v), CF1_V_BASE + CF_ATTR_BASE + (p))
+
+#define CF1_INB(p)			(*(volatile uint8_t *)(CF1_V_BASE + CF_IO8_BASE + (p)))
+#define CF1_INW(p)			(*(volatile uint32_t *)(CF1_V_BASE + CF_IO16_BASE + (p)) & 0xffff)
+
+#define CF1_MEM_READB(p)		(*(volatile u8 *)(CF1_V_BASE + CF_MEM_BASE + (p)))
+#define CF1_MEM_READL(p)		__raw_readl(CF1_V_BASE + CF_MEM_BASE + (p))
+
+#define CF_DEF_CONFIG	0x1		/* Use the first one the CF card */
+
+#define PCISR		0x06		/* PC card int status reg */
+#define PCIMR		0x07		/* PC card int mask reg */
+#define PCICR		0x08		/* PC card int clear reg */
+
+
+/*
+ * Sets up the ETNA hardware
+ */
+static __inline__
+void etna_init_hw(void)
+{
+	int cfg;
+	unsigned long flags;
+
+	save_flags_cli(flags);
+
+#if defined(CONFIG_PSIONW_5MXPRO24MB) | defined(CONFIG_PSIONW_5MXPRO32MB)
+	/* Set the memory wait states to PCMCIA */
+	// FIXME5MX: Should be checked...
+	psionw_writel(0x93930002, MEMCFG1);
+#endif
+
+	/* Clear the door switch interrupt (not in use) */
+	psionw_writel(1, MCEOI);
+
+	/* Power up the CF card */
+	cfg = psionw_readb(PBDR);
+	DEBUG_ETNA("PBDR = 0x%x\n", cfg);
+	if (cfg & PBDR_VPCEN) {
+		DEBUG_ETNA("Clearing no CF power bit in PBDR\n");
+		psionw_writeb(cfg & ~PBDR_VPCEN, PBDR);
+	}
+
+	/* Wake up the socket */
+	__raw_writeb(0x88, ETNA_V_BASE + ETNA_WAKE_1);
+	__raw_writeb(0x10, ETNA_V_BASE + ETNA_WAKE_2);
+
+	/* Configure the ETNA socket */
+	__raw_writeb(0x41, ETNA_V_BASE + ETNA_SKT_CTRL);
+
+	/* Activate the socket */
+	__raw_writeb(0x66, ETNA_V_BASE + ETNA_SKT_ACTIVE);
+
+	restore_flags(flags);
+}
+
+/*
+ * Sets the CF card configuration to selected value.
+ */
+static __inline__
+void etna_set_cf(int cf_config)
+{
+	int loops;
+
+	//static int count = 0;
+	//count++;
+	//cpu_cache_clean_invalidate_all();
+	//printk("XXX\n");
+ again:
+	loops = 0;
+
+	DEBUG_ETNA("ETNA: Restoring selected card configuration to: 0x%x\n", cf_config);
+
+	while (CF1_READB(CF_CUR_CFG) != cf_config) {
+		loops++;
+
+		/* Clear pending interrupts for both sockets at CCSR */
+		CF1_WRITEB(0, 0x202);
+
+		/* Restore the selected card configuration */
+		CF1_WRITEB(cf_config, 0x200);
+
+		mdelay(100);
+
+		if (loops > 20) {
+			printk("ETNA: Unable to restore card configuration: 0x%02x != 0x%02x\n",
+			       CF1_READB(CF_CUR_CFG), cf_config);
+			return;
+		}
+	}
+
+	/*
+	 * Did the configuration stay?
+	 */
+	while (CF1_READB(CF_CUR_CFG) != cf_config) {
+		//printk("XXX etna_cf_called total %d times\n", count);
+		printk("XXX Trying again\n");
+		goto again;
+	}
+}
+
+/*
+ * Initializes the ETNA hardware. Any previous card configuration
+ * is lost. Needed on 5mx Pro when booting without Epoc. Called
+ * from ide.h
+ */
+static __inline__ 
+void etna_cold_init(void)
+{
+	printk("ETNA: CompactFlash PCMCIA controller hard init\n");
+
+	/* Turn on the power if it is not already on */
+	start_pump(1);
+	mdelay(30);	/* Needed for some cards */
+	etna_init_hw();
+
+	/* Set the card configuration */
+	etna_set_cf(CF_DEF_CONFIG);
+
+	/* Clear the ETNA interrupts */
+	__raw_writeb(0x01, ETNA_V_BASE + ETNA_INT_CLEAR);
+
+	/* Turn on ETNA interrupt */
+	__raw_writeb(0x01, ETNA_V_BASE + ETNA_INT_MASK);
+
+	//enable_irq(IRQ_EINT1);
+}
