Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / arch / mips / sgi-ip27 / ip27-init.c
index ad1e86b..3305fa9 100644 (file)
@@ -6,7 +6,6 @@
  * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
  * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
@@ -48,6 +47,9 @@ cnodeid_t     cpuid_to_compact_node[MAXCPUS];
 
 EXPORT_SYMBOL(nasid_to_compact_node);
 
+struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
+EXPORT_SYMBOL_GPL(sn_cpu_info);
+
 extern void pcibr_setup(cnodeid_t);
 
 extern void xtalk_probe_node(cnodeid_t nid);
@@ -56,12 +58,12 @@ static void __init per_hub_init(cnodeid_t cnode)
 {
        struct hub_data *hub = hub_data(cnode);
        nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
+       int i;
 
        cpu_set(smp_processor_id(), hub->h_cpus);
 
        if (test_and_set_bit(cnode, hub_init_mask))
                return;
-
        /*
         * Set CRB timeout at 5ms, (< PI timeout of 10ms)
         */
@@ -88,9 +90,27 @@ static void __init per_hub_init(cnodeid_t cnode)
                __flush_cache_all();
        }
 #endif
+
+       /*
+        * Some interrupts are reserved by hardware or by software convention.
+        * Mark these as reserved right away so they won't be used accidently
+        * later.
+        */
+       for (i = 0; i <= BASE_PCI_IRQ; i++) {
+               __set_bit(i, hub->irq_alloc_mask);
+               LOCAL_HUB_CLR_INTR(INT_PEND0_BASELVL + i);
+       }
+
+       __set_bit(IP_PEND0_6_63, hub->irq_alloc_mask);
+       LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63);
+
+       for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) {
+               __set_bit(i, hub->irq_alloc_mask);
+               LOCAL_HUB_CLR_INTR(INT_PEND1_BASELVL + i);
+       }
 }
 
-void __init per_cpu_init(void)
+void __cpuinit per_cpu_init(void)
 {
        int cpu = smp_processor_id();
        int slice = LOCAL_HUB_L(PI_CPU_NUM);
@@ -104,29 +124,11 @@ void __init per_cpu_init(void)
 
        clear_c0_status(ST0_IM);
 
+       per_hub_init(cnode);
+
        for (i = 0; i < LEVELS_PER_SLICE; i++)
                si->level_to_irq[i] = -1;
 
-       /*
-        * Some interrupts are reserved by hardware or by software convention.
-        * Mark these as reserved right away so they won't be used accidently
-        * later.
-        */
-       for (i = 0; i <= BASE_PCI_IRQ; i++) {
-               __set_bit(i, si->irq_alloc_mask);
-               LOCAL_HUB_S(PI_INT_PEND_MOD, i);
-       }
-
-       __set_bit(IP_PEND0_6_63, si->irq_alloc_mask);
-       LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63);
-
-       for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) {
-               __set_bit(i, si->irq_alloc_mask + 1);
-               LOCAL_HUB_S(PI_INT_PEND_MOD, i);
-       }
-
-       LOCAL_HUB_L(PI_INT_PEND0);
-
        /*
         * We use this so we can find the local hub's data as fast as only
         * possible.
@@ -140,8 +142,6 @@ void __init per_cpu_init(void)
        install_cpu_nmi_handler(cputoslice(cpu));
 
        set_c0_status(SRB_DEV0 | SRB_DEV1);
-
-       per_hub_init(cnode);
 }
 
 /*
@@ -194,16 +194,13 @@ static inline void ioc3_eth_init(void)
        ioc3->eier = 0;
 }
 
-extern void ip27_setup_console(void);
-extern void ip27_time_init(void);
 extern void ip27_reboot_setup(void);
 
-void __init plat_setup(void)
+void __init plat_mem_setup(void)
 {
        hubreg_t p, e, n_mode;
        nasid_t nid;
 
-       ip27_setup_console();
        ip27_reboot_setup();
 
        /*
@@ -230,7 +227,7 @@ void __init plat_setup(void)
         */
        n_mode = LOCAL_HUB_L(NI_STATUS_REV_ID) & NSRI_MORENODES_MASK;
        printk("Machine is in %c mode.\n", n_mode ? 'N' : 'M');
-#ifdef CONFIG_SGI_SN0_N_MODE
+#ifdef CONFIG_SGI_SN_N_MODE
        if (!n_mode)
                panic("Kernel compiled for M mode.");
 #else
@@ -243,6 +240,4 @@ void __init plat_setup(void)
        per_cpu_init();
 
        set_io_port_base(IO_BASE);
-
-       board_time_init = ip27_time_init;
 }