basic modification from way back
[powerpc.git] / arch / powerpc / platforms / embedded6xx / kvme080.c
index 6f904ca..e53e1de 100644 (file)
 #include <linux/mc146818rtc.h>
 
 #include <asm/time.h>
-#include <asm/i8259.h>
-#include <asm/udbg.h>
 #include <asm/mpic.h>
-
-static unsigned char *nvram_base = (unsigned char *)NULL;
-static ssize_t nvram_size = 0;
+#include <asm/mpc10x.h>
+#include <asm/pci-bridge.h>
 
 static int __init
 kvme080_probe(void)
@@ -41,6 +38,8 @@ kvme080_setup_pci(struct device_node *dnp)
        struct pci_controller *hose;
        int *bus_range;
 
+       printk("Adding PCI host bridge %s\n", dnp->full_name);
+
        bus_range = (int *) get_property(dnp, "bus-range", &len);
        if (bus_range == NULL || len < 2 * sizeof(int))
                printk(KERN_WARNING "Can't get bus-range for %s, assume"
@@ -55,7 +54,7 @@ kvme080_setup_pci(struct device_node *dnp)
        hose->first_busno = bus_range ? bus_range[0] : 0;
        hose->last_busno = bus_range ? bus_range[1] : 0xff;
        hose->set_cfg_type = 1;
-       setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
+       setup_indirect_pci(hose, 0xfcc00000, 0xfce00000);
 
        printk(KERN_INFO "Found PCI host bridge %s", dnp->full_name);
 
@@ -86,16 +85,6 @@ kvme080_setup_arch(void)
        for (dnp = NULL; (dnp=of_find_node_by_type(dnp,"pci")) != NULL;)
                kvme080_setup_pci(dnp);
 
-       dnp = of_find_node_by_type(NULL, "nvram");
-       if (dnp) {
-               prop = of_get_address(dnp, 0, &size, NULL);
-               paddr = (phys_addr_t)of_translate_address(dnp, prop);
-               if (paddr != (phys_addr_t)OF_BAD_ADDR) {
-                       nvram_size = (ssize_t) size;
-                       nvram_base = ioremap(paddr, nvram_size);
-               }
-       }
-
        printk(KERN_INFO "Etin Systems KVME080 Board\n");
        printk(KERN_INFO "Port by Sangmoon Kim (dogoil@etinsys.com)\n");
 }
@@ -118,12 +107,24 @@ kvme080_init_IRQ(void)
 
        mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET, 0, 0,
                          "EPIC");
+       BUG_ON(mpic == NULL);
 
        prop = (u32 *)get_property(dnp, "serial-mode", &size);
        if (prop != NULL)
                mpic_set_serial_int(mpic, *(u32 *)prop);
 
+       /* PCI IRQs */
        mpic_assign_isu(mpic, 0, paddr + 0x10200);
+
+       /* I2C */
+       mpic_assign_isu(mpic, 1, paddr + 0x11020);
+
+       /* ttyS0 */
+       mpic_assign_isu(mpic, 2, paddr + 0x11120);
+
+       /* ttyS1 */
+       mpic_assign_isu(mpic, 3, paddr + 0x11140);
+
        mpic_init(mpic);
 }