]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ppc/platforms/lite5200.c
[PATCH] ppc32: Adds support for the LITE5200B dev board
[linux-2.6-omap-h63xx.git] / arch / ppc / platforms / lite5200.c
index d44cc991179fddef3afbbdbe697b63726d8f53d7..d91efe1dc2d1e2ee2cf654be2f3c42446836e69c 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * arch/ppc/platforms/lite5200.c
- *
  * Platform support file for the Freescale LITE5200 based on MPC52xx.
  * A maximum of this file should be moved to syslib/mpc52xx_?????
  * so that new platform based on MPC52xx need a minimal platform file
@@ -36,6 +34,7 @@
 #include <asm/mpc52xx.h>
 #include <asm/ppc_sys.h>
 #include <asm/machdep.h>
+#include <asm/pci-bridge.h>
 
 #include <syslib/mpc52xx_pci.h>
 
@@ -70,12 +69,32 @@ lite5200_show_cpuinfo(struct seq_file *m)
 }
 
 #ifdef CONFIG_PCI
+#ifdef CONFIG_LITE5200B
+static int
+lite5200_map_irq(struct pci_dev *dev, unsigned char idsel,
+                   unsigned char pin)
+{
+       static char pci_irq_table[][4] =
+       /*
+        *      PCI IDSEL/INTPIN->INTLINE
+        *        A             B             C             D
+        */
+       {
+               {MPC52xx_IRQ0, MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3},
+               {MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3, MPC52xx_IRQ0},
+       };
+
+       const long min_idsel = 24, max_idsel = 25, irqs_per_slot = 4;
+       return PCI_IRQ_TABLE_LOOKUP;
+}
+#else /* Original Lite */
 static int
 lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
 {
        return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1;
 }
 #endif
+#endif
 
 static void __init
 lite5200_setup_cpu(void)
@@ -129,11 +148,17 @@ lite5200_setup_cpu(void)
        out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP);
        out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d);
 
-       /* IRQ[0-3] setup : IRQ0     - Level Active Low  */
-       /*                  IRQ[1-3] - Level Active High */
+       /* IRQ[0-3] setup */
        intr_ctrl = in_be32(&intr->ctrl);
        intr_ctrl &= ~0x00ff0000;
-       intr_ctrl |=  0x00c00000;
+#ifdef CONFIG_LITE5200B
+       /* IRQ[0-3] Level Active Low */
+       intr_ctrl |=  0x00ff0000;
+#else
+       /* IRQ0 Level Active Low
+        * IRQ[1-3] Level Active High */
+       intr_ctrl |=  0x00c00000;
+#endif
        out_be32(&intr->ctrl, intr_ctrl);
 
        /* Unmap reg zone */
@@ -196,8 +221,10 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
        mpc52xx_set_bat();
 
        /* No ISA bus by default */
+#ifdef CONFIG_PCI
        isa_io_base             = 0;
        isa_mem_base            = 0;
+#endif
 
        /* Powersave */
        /* This is provided as an example on how to do it. But you