fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / ppc / syslib / m8260_setup.c
index bfa66a2..15f0d73 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  arch/ppc/syslib/m8260_setup.c
- *
  *  Copyright (C) 1995  Linus Torvalds
  *  Adapted from 'alpha' version by Gary Thomas
  *  Modified by Cort Dougan (cort@cs.nmt.edu)
@@ -8,7 +6,6 @@
  *  Further modified for generic 8xx and 8260 by Dan.
  */
 
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -16,6 +13,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/initrd.h>
+#include <linux/root_dev.h>
 #include <linux/seq_file.h>
 #include <linux/irq.h>
 
@@ -23,7 +21,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/mpc8260.h>
-#include <asm/immap_cpm2.h>
+#include <asm/cpm2.h>
 #include <asm/machdep.h>
 #include <asm/bootinfo.h>
 #include <asm/time.h>
 
 unsigned char __res[sizeof(bd_t)];
 
-extern void cpm2_reset(void);
-extern void m8260_find_bridges(void);
+extern void pq2_find_bridges(void);
+extern void pq2pci_init_irq(void);
 extern void idma_pci9_init(void);
 
+/* Place-holder for board-specific init */
+void __attribute__ ((weak)) __init
+m82xx_board_setup(void)
+{
+}
+
 static void __init
 m8260_setup_arch(void)
 {
@@ -49,12 +53,17 @@ m8260_setup_arch(void)
        idma_pci9_init();
 #endif
 #ifdef CONFIG_PCI_8260
-       m8260_find_bridges();
+       pq2_find_bridges();
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
        if (initrd_start)
                ROOT_DEV = Root_RAM0;
 #endif
+
+       identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME,
+                               in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET));
+
+       m82xx_board_setup();
 }
 
 /* The decrementer counts at the system (internal) clock frequency
@@ -159,18 +168,18 @@ m8260_show_cpuinfo(struct seq_file *m)
 static void __init
 m8260_init_IRQ(void)
 {
-       int i;
-
-        for ( i = 0 ; i < NR_SIU_INTS ; i++ )
-                irq_desc[i].handler = &cpm2_pic;
+       cpm2_init_IRQ();
 
        /* Initialize the default interrupt mapping priorities,
         * in case the boot rom changed something on us.
         */
-       cpm2_immr->im_intctl.ic_sicr = 0;
        cpm2_immr->im_intctl.ic_siprr = 0x05309770;
-       cpm2_immr->im_intctl.ic_scprrh = 0x05309770;
-       cpm2_immr->im_intctl.ic_scprrl = 0x05309770;
+
+#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS))
+       /* Initialize stuff for the 82xx CPLD IC and install demux  */
+       pq2pci_init_irq();
+#endif
+
 }
 
 /*
@@ -202,7 +211,7 @@ m8260_map_io(void)
        io_block_mapping(IO_VIRT_ADDR, IO_PHYS_ADDR, 0x10000000, _PAGE_IO);
 }
 
-/* Place-holder for board-specific init */
+/* Place-holder for board-specific ppc_md hooking */
 void __attribute__ ((weak)) __init
 m82xx_board_init(void)
 {
@@ -241,9 +250,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                strcpy(cmd_line, (char *)(r6+KERNELBASE));
        }
 
-       /* Call back for board-specific settings. */
-       m82xx_board_init();
-
        ppc_md.setup_arch               = m8260_setup_arch;
        ppc_md.show_cpuinfo             = m8260_show_cpuinfo;
        ppc_md.init_IRQ                 = m8260_init_IRQ;
@@ -259,4 +265,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 
        ppc_md.find_end_of_memory       = m8260_find_end_of_memory;
        ppc_md.setup_io_mappings        = m8260_map_io;
+
+       /* Call back for board-specific settings and overrides. */
+       m82xx_board_init();
 }