Index: cpu/mpc8xx/interrupts.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/cpu/mpc8xx/interrupts.c,v
retrieving revision 1.1.1.1
diff -p -u -r1.1.1.1 interrupts.c
--- cpu/mpc8xx/interrupts.c	25 Oct 2002 20:52:57 -0000	1.1.1.1
+++ cpu/mpc8xx/interrupts.c	29 Nov 2002 14:39:47 -0000
@@ -37,15 +37,16 @@ unsigned decrementer_count;		/* count va
 /*
  * CPM interrupt vector functions.
  */
-struct	cpm_action {
+struct	interrupt_action {
 	 interrupt_handler_t *handler;
 	 void *arg;
 };
 
-static struct cpm_action cpm_vecs[CPMVEC_NR];
+static struct interrupt_action cpm_vecs[CPMVEC_NR];
+static struct interrupt_action irq_vecs[NR_IRQS];
 
 static void cpm_interrupt_init (void);
-static void cpm_interrupt(int irq, struct pt_regs * regs);
+static void cpm_interrupt(void * regs);
 
 /****************************************************************************/
 
@@ -98,12 +99,13 @@ int interrupt_init(void)
 
 	decrementer_count = get_tbclk() / CFG_HZ;
 
-	cpm_interrupt_init();
+	/* disable all interrupts                                            */
+	immr->im_siu_conf.sc_simask = 0;
 
-	/* disable all interrupts except for the CPM interrupt */
-	immr->im_siu_conf.sc_simask = 1 << (31-CPM_INTERRUPT);
+        /* Configure CPM interrupts */
+	cpm_interrupt_init();
 
-	set_dec (decrementer_count);
+        set_dec (decrementer_count);
 
 	set_msr (get_msr() | MSR_EE);
 
@@ -152,18 +154,14 @@ void external_interrupt(struct pt_regs *
 		}
 	}
 
-	switch (irq) {
-	case CPM_INTERRUPT:
-		cpm_interrupt (irq, regs);
-		break;
-	default:
+	if (irq_vecs[irq].handler != NULL) {
+		irq_vecs[irq].handler(irq_vecs[irq].arg);
+	} else {
 		printf ("\nBogus External Interrupt IRQ %d Vector %ld\n",
 			irq, vec);
 		/* turn off the bogus interrupt to avoid it from now */
 		simask &= ~v_bit;
-		break;
 	}
-
 	/*
 	 * Re-Enable old Interrupt Mask
 	 */
@@ -176,7 +174,7 @@ void external_interrupt(struct pt_regs *
  * CPM interrupt handler
  */
 static void
-cpm_interrupt(int irq, struct pt_regs * regs)
+cpm_interrupt(void *regs)
 {
 	volatile immap_t *immr = (immap_t *)CFG_IMMR;
 	uint	vec;
@@ -213,39 +211,70 @@ cpm_error_interrupt (void *dummy)
 }
 
 /****************************************************************************/
-
 /*
- * Install and free a CPM interrupt handler.
+ * Install and free an interrupt handler
  */
-
-void
-irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
+void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg)
 {
 	volatile immap_t *immr = (immap_t *)CFG_IMMR;
 
-	if (cpm_vecs[vec].handler != NULL) {
+        if ((vec & CPMVEC_OFFSET) != 0) {
+            /* CPM interrupt                                                 */
+            vec &= 0xffff;
+            if (cpm_vecs[vec].handler != NULL) {
 		printf ("CPM interrupt 0x%x replacing 0x%x\n",
 			(uint)handler, (uint)cpm_vecs[vec].handler);
-	}
-	cpm_vecs[vec].handler = handler;
-	cpm_vecs[vec].arg     = arg;
-	immr->im_cpic.cpic_cimr |= (1 << vec);
+            }
+            cpm_vecs[vec].handler = handler;
+            cpm_vecs[vec].arg     = arg;
+            immr->im_cpic.cpic_cimr |= (1 << vec);
 #if 0
-	printf ("Install CPM interrupt for vector %d ==> %p\n", vec, handler);
+            printf ("Install CPM interrupt for vector %d ==> %p\n", vec, handler);
 #endif
+        }
+        else {
+            /* SIU interrupt                                                 */
+            if (irq_vecs[vec].handler != NULL) {
+                printf ("SIU interrupt %d 0x%x replacing 0x%x\n", vec,
+			(uint)handler, (uint)cpm_vecs[vec].handler);
+            }
+            irq_vecs[vec].handler = handler;
+            irq_vecs[vec].arg     = arg;
+            immr->im_siu_conf.sc_simask |= 1 << (31-vec);
+#if 0
+            printf ("Install SIU interrupt for vector %d ==> %p\n", vec, handler);
+#endif
+        }
+        
+
 }
 
 void
 irq_free_handler(int vec)
 {
 	volatile immap_t *immr = (immap_t *)CFG_IMMR;
+
+        if ((vec & CPMVEC_OFFSET) != 0) {
+            /* CPM interrupt                                                 */
+            vec &= 0xffff;
+#if 0
+            printf ("Free CPM interrupt for vector %d ==> %p\n",
+                    vec, cpm_vecs[vec].handler);
+#endif
+            immr->im_cpic.cpic_cimr &= ~(1 << vec);
+            cpm_vecs[vec].handler = NULL;
+            cpm_vecs[vec].arg     = NULL;
+        }
+        else {
+            /* SIU interrupt                                                 */
 #if 0
-	printf ("Free CPM interrupt for vector %d ==> %p\n",
-		vec, cpm_vecs[vec].handler);
+            printf ("Free CPM interrupt for vector %d ==> %p\n",
+                    vec, cpm_vecs[vec].handler);
 #endif
-	immr->im_cpic.cpic_cimr &= ~(1 << vec);
-	cpm_vecs[vec].handler = NULL;
-	cpm_vecs[vec].arg     = NULL;
+            immr->im_siu_conf.sc_simask &= ~(1 << (31 - vec));
+            irq_vecs[vec].handler = NULL;
+            irq_vecs[vec].arg     = NULL;
+        }
 }
 
 /****************************************************************************/
@@ -273,6 +302,11 @@ cpm_interrupt_init (void)
 	irq_install_handler(CPMVEC_ERROR, cpm_error_interrupt, NULL);
 
 	immr->im_cpic.cpic_cicr |= CICR_IEN;
+
+        /*
+         * Install the cpm interrupt handler
+         */
+        irq_install_handler (CPM_INTERRUPT, cpm_interrupt, NULL);
 }
 
 /****************************************************************************/
Index: include/commproc.h
===================================================================
RCS file: /cvsroot/u-boot/u-boot/include/commproc.h,v
retrieving revision 1.4
diff -p -u -r1.4 commproc.h
--- include/commproc.h	21 Nov 2002 23:11:51 -0000	1.4
+++ include/commproc.h	29 Nov 2002 14:39:50 -0000
@@ -1583,35 +1583,36 @@ typedef struct hdlc_pram_s {
  * priority and SCC1 == SCCa, etc...).
  */
 #define CPMVEC_NR		32
-#define	CPMVEC_PIO_PC15		((ushort)0x1f)
-#define	CPMVEC_SCC1		((ushort)0x1e)
-#define	CPMVEC_SCC2		((ushort)0x1d)
-#define	CPMVEC_SCC3		((ushort)0x1c)
-#define	CPMVEC_SCC4		((ushort)0x1b)
-#define	CPMVEC_PIO_PC14		((ushort)0x1a)
-#define	CPMVEC_TIMER1		((ushort)0x19)
-#define	CPMVEC_PIO_PC13		((ushort)0x18)
-#define	CPMVEC_PIO_PC12		((ushort)0x17)
-#define	CPMVEC_SDMA_CB_ERR	((ushort)0x16)
-#define CPMVEC_IDMA1		((ushort)0x15)
-#define CPMVEC_IDMA2		((ushort)0x14)
-#define CPMVEC_TIMER2		((ushort)0x12)
-#define CPMVEC_RISCTIMER	((ushort)0x11)
-#define CPMVEC_I2C		((ushort)0x10)
-#define	CPMVEC_PIO_PC11		((ushort)0x0f)
-#define	CPMVEC_PIO_PC10		((ushort)0x0e)
-#define CPMVEC_TIMER3		((ushort)0x0c)
-#define	CPMVEC_PIO_PC9		((ushort)0x0b)
-#define	CPMVEC_PIO_PC8		((ushort)0x0a)
-#define	CPMVEC_PIO_PC7		((ushort)0x09)
-#define CPMVEC_TIMER4		((ushort)0x07)
-#define	CPMVEC_PIO_PC6		((ushort)0x06)
-#define	CPMVEC_SPI		((ushort)0x05)
-#define	CPMVEC_SMC1		((ushort)0x04)
-#define	CPMVEC_SMC2		((ushort)0x03)
-#define	CPMVEC_PIO_PC5		((ushort)0x02)
-#define	CPMVEC_PIO_PC4		((ushort)0x01)
-#define	CPMVEC_ERROR		((ushort)0x00)
+#define CPMVEC_OFFSET           0x00010000
+#define	CPMVEC_PIO_PC15		((ushort)0x1f | CPMVEC_OFFSET)
+#define	CPMVEC_SCC1		((ushort)0x1e | CPMVEC_OFFSET)
+#define	CPMVEC_SCC2		((ushort)0x1d | CPMVEC_OFFSET)
+#define	CPMVEC_SCC3		((ushort)0x1c | CPMVEC_OFFSET)
+#define	CPMVEC_SCC4		((ushort)0x1b | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC14		((ushort)0x1a | CPMVEC_OFFSET)
+#define	CPMVEC_TIMER1		((ushort)0x19 | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC13		((ushort)0x18 | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC12		((ushort)0x17 | CPMVEC_OFFSET)
+#define	CPMVEC_SDMA_CB_ERR	((ushort)0x16 | CPMVEC_OFFSET)
+#define CPMVEC_IDMA1		((ushort)0x15 | CPMVEC_OFFSET)
+#define CPMVEC_IDMA2		((ushort)0x14 | CPMVEC_OFFSET)
+#define CPMVEC_TIMER2		((ushort)0x12 | CPMVEC_OFFSET)
+#define CPMVEC_RISCTIMER	((ushort)0x11 | CPMVEC_OFFSET)
+#define CPMVEC_I2C		((ushort)0x10 | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC11		((ushort)0x0f | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC10		((ushort)0x0e | CPMVEC_OFFSET)
+#define CPMVEC_TIMER3		((ushort)0x0c | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC9		((ushort)0x0b | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC8		((ushort)0x0a | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC7		((ushort)0x09 | CPMVEC_OFFSET)
+#define CPMVEC_TIMER4		((ushort)0x07 | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC6		((ushort)0x06 | CPMVEC_OFFSET)
+#define	CPMVEC_SPI		((ushort)0x05 | CPMVEC_OFFSET)
+#define	CPMVEC_SMC1		((ushort)0x04 | CPMVEC_OFFSET)
+#define	CPMVEC_SMC2		((ushort)0x03 | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC5		((ushort)0x02 | CPMVEC_OFFSET)
+#define	CPMVEC_PIO_PC4		((ushort)0x01 | CPMVEC_OFFSET)
+#define	CPMVEC_ERROR		((ushort)0x00 | CPMVEC_OFFSET)
 
 extern void irq_install_handler(int vec, void (*handler)(void *), void *dev_id);
 
