diff -urN -X /home/arm/dontdiff_tml_arm /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/arch/arm/mach-psionw/irq.c linux-2.4.18-rmk2/arch/arm/mach-psionw/irq.c
--- /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/arch/arm/mach-psionw/irq.c	Tue Mar 19 12:27:46 2002
+++ linux-2.4.18-rmk2/arch/arm/mach-psionw/irq.c	Tue Mar 19 12:04:32 2002
@@ -59,26 +59,6 @@
 	psionw_writel(intmr, INTENC);
 }
 
-static void
-unmask_lcd_int(void)
-{
-	unsigned int lcderr;
-
-	printk("LCD interrupt\n");
-
-	lcderr = psionw_readl(LCDCTL);
-	lcderr &= ~LCDCTL_DONE;	// Clear bit 3, done mask
-	lcderr &= ~LCDCTL_NEXT;	// Clear bit 4, next mask
-	lcderr &= ~LCDCTL_ERR;	// Clear bit 5, error mask
-	psionw_writel(lcderr, LCDCTL);
-	lcderr = psionw_readl(LCDST);
-	lcderr |= LCDST_NEXT;	// Set next frame
-	lcderr &= ~LCDST_BER;	// Clear bus error
-	lcderr &= ~LCDST_ABC;	// Clear AC bias
-	lcderr &= ~LCDST_FUF;	// Clear FIFO underflow
-	psionw_writel(lcderr, LCDST);
-}
-
 #ifdef CONFIG_PCMCIA_ETNA
 static void
 mask_etna_irq(unsigned int irq)
@@ -99,8 +79,12 @@
 		schedule_task(&etna_int_task);
 	}
 
-	/* Disable Etna interrupt until we're done */
-	etna_writeb(0, ETNA_INT_MASK);
+	/* 
+	 * You would assume that we need to disable Etna interrupt 
+	 * until we're done? Nope, that causes delays in waking up
+	 * the card for 16-bit writes in etna_outsw_ide.
+	 */
+	//etna_writeb(0, ETNA_INT_MASK);
 
 	/* Clear the Etna interrupt */
 	etna_writeb(ETNA_CLEAR_MASK, ETNA_INT_CLEAR);
@@ -130,41 +114,19 @@
 mask_ack_irq_int(unsigned int irq)
 {
 	switch (irq) {
-	case IRQ_EXTFIQ:
-		//printk("Received FIQ EXTFIQ irq %d\n", irq);
-		break;
-	case IRQ_BLINT:
-		psionw_writel(1, BLEOI);
-		//printk("Received and cleared FIQ BLINT irq %d\n", irq);
-		break;
-	case IRQ_WEINT:
-		psionw_writel(1, TEOI);
-		//printk("Received and cleared FIQ WEINT irq %d\n", irq);
-		break;
-	case IRQ_MCINT:
-		psionw_writel(1, MCEOI);
-		//printk("Received and cleared FIQ MCINT ir %d\n", irq);
-		break;
 	case IRQ_CSINT:
 		psionw_writel(1, COEOI);
 		printk("Received and cleared CSINT irq %d\n", irq);
 		break;
-	case IRQ_EINT1:
-		/* Never get here; Handled by the ETNA driver */
-		break;
 	case IRQ_EINT2:
 		psionw_writel(1, E2EOI);
 		printk("Received and cleared EINT2 irq %d\n", irq);
 		break;
-	case IRQ_EINT3:
-		/* Never get here; Handled by the touchpad driver */
-		break;
 	case IRQ_TC1OI:
 		psionw_writel(1, TC1EOI);
 		break;
 	case IRQ_TC2OI:
-		psionw_writel(1, TC2EOI);
-		/* Cleared here, handled by the timer */
+		psionw_writel(1, TC2EOI); /* Cleared here, handled in timer */
 		break;
 	case IRQ_RTCMI:
 		psionw_writel(1, RTCEOI);
@@ -173,17 +135,6 @@
 		psionw_writel(1, TEOI);
 		printk("Received and cleared TINT irq %d\n", irq);
 		break;
-	case IRQ_UART1:
-		/* Never get here; Handled in the serial driver */
-		break;
-	case IRQ_UART2:
-		/* Never get here; UMSEOI is cleared in the serial driver */
-		break;
-	case IRQ_LCDINT:
-		unmask_lcd_int();
-		break;
-	case IRQ_SSEOTI:
-		break;
 	}
 }
 
@@ -226,7 +177,6 @@
 	psionw_writel(0, TC2EOI);
 	psionw_writel(0, RTCEOI);
 	psionw_writel(0, TEOI);
-	unmask_lcd_int();
 	psionw_writel(0, UMSEOI);
 	psionw_writel(0, SSCR0);
 
diff -urN -X /home/arm/dontdiff_tml_arm /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/drivers/pcmcia/psion_etna.c linux-2.4.18-rmk2/drivers/pcmcia/psion_etna.c
--- /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/drivers/pcmcia/psion_etna.c	Tue Mar 19 12:27:46 2002
+++ linux-2.4.18-rmk2/drivers/pcmcia/psion_etna.c	Tue Mar 19 12:15:49 2002
@@ -531,9 +531,11 @@
 
 	/* Turn on the power if it is not already on */
 	start_pump();
-
+	mdelay(30);	/* Needed for some cards */
 	etna_init_hw();
-	mdelay(10);
+	mdelay(30);
+
+	/* Restore the card configuration */
 	etna_set_cf(cur_cfg);
 
 	if (CF1_READB(CF_CUR_CFG) != cur_cfg) {
diff -urN -X /home/arm/dontdiff_tml_arm /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/drivers/pcmcia/psion_etna.h linux-2.4.18-rmk2/drivers/pcmcia/psion_etna.h
--- /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/drivers/pcmcia/psion_etna.h	Tue Mar 19 12:27:47 2002
+++ linux-2.4.18-rmk2/drivers/pcmcia/psion_etna.h	Tue Mar 19 12:16:14 2002
@@ -1,7 +1,20 @@
 #include <asm/arch/psionw-power.h>
 
+#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
 
@@ -111,12 +124,11 @@
 
 	/* Turn on the power if it is not already on */
 	start_pump();
-
+	mdelay(30);	/* Needed for some cards */
 	etna_init_hw();
+	mdelay(30);
 
-	/* This is needed here for IDE with root on CompactFlash, but why? */
-	mdelay(20);
-	
+	/* Set the card configuration */
 	etna_set_cf(CF_DEF_CONFIG);
 
 	/* Clear the ETNA interrupts */
diff -urN -X /home/arm/dontdiff_tml_arm /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/drivers/video/psionwfb.c linux-2.4.18-rmk2/drivers/video/psionwfb.c
--- /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/drivers/video/psionwfb.c	Tue Mar 19 12:27:47 2002
+++ linux-2.4.18-rmk2/drivers/video/psionwfb.c	Sat Mar 16 13:37:33 2002
@@ -39,6 +39,7 @@
 #include <asm/mach-types.h>
 
 #include <asm/hardware/psionw.h>
+#include <asm/arch/irqs.h>
 #include <asm/arch/psionw-power.h>
 
 #include "psionwfb.h"
@@ -409,10 +410,34 @@
 	// Add power management stuff here
 }
 
+/*
+ * LCD Interrupt handler
+ */
+static void
+psionwfb_handle_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+	unsigned int lcderr;
+
+	printk("LCD interrupt\n");
+
+	lcderr = psionw_readl(LCDCTL);
+	lcderr &= ~LCDCTL_DONE;	// Clear bit 3, done mask
+	lcderr &= ~LCDCTL_NEXT;	// Clear bit 4, next mask
+	lcderr &= ~LCDCTL_ERR;	// Clear bit 5, error mask
+	psionw_writel(lcderr, LCDCTL);
+	lcderr = psionw_readl(LCDST);
+	lcderr |= LCDST_NEXT;	// Set next frame
+	lcderr &= ~LCDST_BER;	// Clear bus error
+	lcderr &= ~LCDST_ABC;	// Clear AC bias
+	lcderr &= ~LCDST_FUF;	// Clear FIFO underflow
+	psionw_writel(lcderr, LCDST);
+}
+
+
 int __init
 psionwfb_init(void)
 {
-	int err = -ENOMEM;
+	int err = -ENOMEM, ret = 0;
 
 	cfb = kmalloc(sizeof (*cfb) + sizeof (struct display), GFP_KERNEL);
 	if (!cfb)
@@ -479,6 +504,12 @@
 	psionw_lcd_init_hw();
 	psionw_lcd_enable();
 
+	ret = request_irq(IRQ_LCDINT, psionwfb_handle_irq, SA_INTERRUPT, "psionwfb", NULL);
+
+	if (ret) {
+		printk(KERN_ERR "psionwfb: request_irq failed: %d\n", ret);
+	}
+
 	psionwfb_set_var(&cfb->fb.var, -1, &cfb->fb);
 	err = register_framebuffer(&cfb->fb);
 
diff -urN -X /home/arm/dontdiff_tml_arm /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/include/asm-arm/arch-psionw/io.h linux-2.4.18-rmk2/include/asm-arm/arch-psionw/io.h
--- /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/include/asm-arm/arch-psionw/io.h	Tue Mar 19 12:27:47 2002
+++ linux-2.4.18-rmk2/include/asm-arm/arch-psionw/io.h	Tue Mar 19 12:08:35 2002
@@ -46,7 +46,7 @@
  * Epoc boot EEPROM reading. Writing would be dangerous, as there is
  * no known alternate boot method.
  */
-#define psion_br_read(p)        (*(volatile u8 *)(PSION_V_BR + (p)))
+#define psion_br_read(p)	(*(volatile u8 *)(PSION_V_BR + (p)))
 
 /*
  * Epoc boot flash reading. Writing would be dangerous, as there is
@@ -58,22 +58,36 @@
 static __inline__ void
 etna_status_check(void)
 {
-	int status, loops;
+	int cardint, loops = 0;
 
-	loops = 0;
-
-	psionw_writeb(psionw_readb(PDDR) | PDDR_ETNA_ERR, PDDR);
-	status = psionw_readb(PDDR_ETNA_ERR) & PDDR_ETNA_ERR;
-	while (!status) {
+	/*
+	 * We need a delay between an interrupt and a 16-bit write.
+	 * Otherwise we get tons of ide status=0x58 errors and a
+	 * corrupted disk. The delay time needed depends on the card
+	 * and needs to be somewhere between 300 and 1500. Ideally we
+	 * would test some register to detect whether the card is 
+	 * ready or not, but so far no luck finding what to test.
+	 */
+	cardint = etna_readb(ETNA_INT_MASK);
+	if (cardint & 0x1) {
+		udelay(1500);	/* Depends on the card */
+		return;
+	}
+
+	/*
+	 * Some extra checking. This should not happen, and maybe we can leave this out
+	 */
+	while(!(cardint & 0x1)) {
 		loops++;
-		udelay(500);
+		etna_writeb(0x01, ETNA_INT_MASK);
+		udelay(1500);	/* Depends on the card */
+		printk("ETNA: Error: cardint = 0x%x\n", cardint);
+		cardint = etna_readb(ETNA_INT_MASK);
 		if (loops > 4) {
-			printk("ETNA: Write seems to be failing with PDDR = 0x%x\n",
-				psionw_readb(PDDR));
+			printk("ETNA: Write seems to be failing with cardint = 0%02x\n",
+			       cardint);
 			return;
 		}
-		psionw_writeb(psionw_readb(PDDR) | PDDR_ETNA_ERR, PDDR);
-		status = psionw_readb(PDDR) & PDDR_ETNA_ERR;
 	}
 }
 
@@ -121,7 +135,7 @@
 			INSW_DEBUG("  +<-- 0x%08x\n", val);
 			((unsigned short *) to)[i - 1] = (unsigned short) (val & 0xffff);
 			((unsigned short *) to)[i] = (unsigned short) (val >> 16);
-			INSW_DEBUG("     +<-- flush to[%d] = 0x%04x  to[%d] = 0x%04x\n", i - 1, 
+			INSW_DEBUG("	 +<-- flush to[%d] = 0x%04x  to[%d] = 0x%04x\n", i - 1, 
 				   ((unsigned short *) to)[i - 1], i,
 				   ((unsigned short *) to)[i]);
 		}
@@ -130,7 +144,7 @@
 	if (len & 0x1) {
 		val = __raw_readl(CF1_V_BASE + CF_IO16_BASE + port);
 		((unsigned short *) to)[len - 1] = (unsigned short) (val & 0xffff);
-		INSW_DEBUG("     +<-- flush to[%d] = 0x%04x\n", len - 1, 
+		INSW_DEBUG("	 +<-- flush to[%d] = 0x%04x\n", len - 1, 
 			   ((unsigned short *) to)[i - 1]);
 	}
 }
@@ -182,13 +196,13 @@
 
 		if (i & 0x1) {
 			__raw_writel( ((val<<16) | prev), CF1_V_BASE+CF_IO16_BASE+port);
-			OUTSW_DEBUG("     +--> flush 0x%08x\n", ((val<<16) | prev));
+			OUTSW_DEBUG("	  +--> flush 0x%08x\n", ((val<<16) | prev));
 		}
 		prev = val;
 	}
 	if (len & 0x1) {
 		__raw_writel( (val), CF1_V_BASE+CF_IO16_BASE+port);
-		OUTSW_DEBUG("     +--> flush 0x%08x\n", (val));
+		OUTSW_DEBUG("	  +--> flush 0x%08x\n", (val));
 	}
 }
 
@@ -197,12 +211,12 @@
 #define outl(v,p)		printk("Error: Unsupported outl called 0x%x\n", (p))
 
 #define inb(p)			({ unsigned int __v =__raw_readb(CF1_V_BASE + CF_IO8_BASE + (p)); __v; })
-#define inw(p)		        ({ unsigned int __v =__raw_readl(CF1_V_BASE + CF_IO16_BASE + (p)) & 0xffff; __v; })
+#define inw(p)			({ unsigned int __v =__raw_readl(CF1_V_BASE + CF_IO16_BASE + (p)) & 0xffff; __v; })
 #define inl(p)			printk("Error: Unsupported inl called 0x%x\n", (p))
 
 #define outsb(p,d,l)		__raw_writesb(CF1_V_BASE + CF_IO8_BASE + p,d,l)
 #define outsw(p,d,l)		etna_outsw_direct(p,d,l)
-#define outsl(p,d,l)	        printk("Error: Unsupported outsl called 0x%x\n", (p))
+#define outsl(p,d,l)		printk("Error: Unsupported outsl called 0x%x\n", (p))
 
 #define insb(p,d,l)		__raw_readsb(CF1_V_BASE + CF_IO8_BASE + p,d,l)
 #define insw(p,d,l)		etna_insw_direct(p,d,l)
diff -urN -X /home/arm/dontdiff_tml_arm /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/include/asm-arm/arch-psionw/irqs.h linux-2.4.18-rmk2/include/asm-arm/arch-psionw/irqs.h
--- /disk3/kernels/linux-2.4.18-rmk2-5mx2-vanilla/include/asm-arm/arch-psionw/irqs.h	Tue Mar 19 12:27:47 2002
+++ linux-2.4.18-rmk2/include/asm-arm/arch-psionw/irqs.h	Sat Mar 16 13:32:51 2002
@@ -44,8 +44,7 @@
  * mask_ack_irq_int1
  */
 #define INT1_IRQS			(0x0000ffff)
-////#define INT1_ACK_IRQS			(0x00004f5f)
-#define INT1_ACK_IRQS			(0x00004f50)
+#define INT1_ACK_IRQS			(0x00000f50)
 
 #define NR_IRQS                         16
 
