patch-2.3.49 linux/include/asm-arm/arch-nexuspci/irq.h

Next file: linux/include/asm-arm/arch-nexuspci/irqs.h
Previous file: linux/include/asm-arm/arch-nexuspci/io.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.48/linux/include/asm-arm/arch-nexuspci/irq.h linux/include/asm-arm/arch-nexuspci/irq.h
@@ -1,42 +1,62 @@
 /*
  * include/asm-arm/arch-nexuspci/irq.h
  *
- * Copyright (C) 1998 Philip Blundell
- *
- * Changelog:
- *   22-08-1998	RMK	Restructured IRQ routines
+ * Copyright (C) 1998, 1999, 2000 Philip Blundell
  */
 
 #include <asm/io.h>
 
 #define fixup_irq(x) (x)
 
-#define INTCONT		0xffe00000
-
 extern unsigned long soft_irq_mask;
 
-static void nexuspci_mask_irq(unsigned int irq)
+static const unsigned char irq_cmd[] =
+{
+	INTCONT_IRQ_DUART,
+	INTCONT_IRQ_PLX,
+	INTCONT_IRQ_D,
+	INTCONT_IRQ_C,
+	INTCONT_IRQ_B,
+	INTCONT_IRQ_A,
+	INTCONT_IRQ_SYSERR
+};
+
+static void ftvpci_mask_irq(unsigned int irq)
 {
-	writel((irq << 1), INTCONT);
+	__raw_writel(irq_cmd[irq], INTCONT_BASE);
 	soft_irq_mask &= ~(1<<irq);
 }
 
-static void nexuspci_unmask_irq(unsigned int irq)
+static void ftvpci_unmask_irq(unsigned int irq)
 {
-	writel((irq << 1) + 1, INTCONT);
 	soft_irq_mask |= (1<<irq);
+	__raw_writel(irq_cmd[irq] | 1, INTCONT_BASE);
 }
  
 static __inline__ void irq_init_irq(void)
 {
 	unsigned int i;
+
+	/* Mask all FIQs */
+	__raw_writel(INTCONT_FIQ_PLX, INTCONT_BASE);
+	__raw_writel(INTCONT_FIQ_D, INTCONT_BASE);
+	__raw_writel(INTCONT_FIQ_C, INTCONT_BASE);
+	__raw_writel(INTCONT_FIQ_B, INTCONT_BASE);
+	__raw_writel(INTCONT_FIQ_A, INTCONT_BASE);
+	__raw_writel(INTCONT_FIQ_SYSERR, INTCONT_BASE);
+
 	/* Disable all interrupts initially. */
 	for (i = 0; i < NR_IRQS; i++) {
-		irq_desc[i].valid	= 1;
-		irq_desc[i].probe_ok	= 1;
-		irq_desc[i].mask_ack	= nexuspci_mask_irq;
-		irq_desc[i].mask	= nexuspci_mask_irq;
-		irq_desc[i].unmask	= nexuspci_unmask_irq;
-		mask_irq(i);
-	}
+		if (i >= FIRST_IRQ && i <= LAST_IRQ) {
+			irq_desc[i].valid	= 1;
+			irq_desc[i].probe_ok	= 1;
+			irq_desc[i].mask_ack	= ftvpci_mask_irq;
+			irq_desc[i].mask	= ftvpci_mask_irq;
+			irq_desc[i].unmask	= ftvpci_unmask_irq;
+			ftvpci_mask_irq(i);
+		} else {
+			irq_desc[i].valid	= 0;
+			irq_desc[i].probe_ok	= 0;
+		}	
+	}		
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)