vserver 1.9.3
[linux-2.6.git] / arch / ppc / platforms / lite5200.c
index 043040d..db6ea44 100644 (file)
@@ -36,6 +36,8 @@
 #include <asm/mpc52xx.h>
 
 
+extern int powersave_nap;
+
 /* Board data given by U-Boot */
 bd_t __res;
 EXPORT_SYMBOL(__res);  /* For modules */
@@ -64,25 +66,55 @@ struct ocp_def board_ocp[] = {
                .vendor         = OCP_VENDOR_INVALID
        }
 };
-       
+
 
 /* ======================================================================== */
 /* Platform specific code                                                   */
 /* ======================================================================== */
 
 static int
-icecube_show_cpuinfo(struct seq_file *m)
+lite5200_show_cpuinfo(struct seq_file *m)
 {
        seq_printf(m, "machine\t\t: Freescale LITE5200\n");
        return 0;
 }
 
 static void __init
-icecube_setup_arch(void)
+lite5200_setup_cpu(void)
 {
+       struct mpc52xx_intr *intr;
+
+       u32 intr_ctrl;
+
+       /* Map zones */
+       intr = (struct mpc52xx_intr *)
+               ioremap(MPC52xx_INTR,sizeof(struct mpc52xx_intr));
+
+       if (!intr) {
+               printk("lite5200.c: Error while mapping INTR during lite5200_setup_cpu\n");
+               goto unmap_regs;
+       }
+
+       /* IRQ[0-3] setup : IRQ0     - Level Active Low  */
+       /*                  IRQ[1-3] - Level Active High */
+       intr_ctrl = in_be32(&intr->ctrl);
+       intr_ctrl &= ~0x00ff0000;
+       intr_ctrl |=  0x00c00000;
+       out_be32(&intr->ctrl, intr_ctrl);
+
+       /* Unmap reg zone */
+unmap_regs:
+       if (intr) iounmap(intr);
+}
 
+static void __init
+lite5200_setup_arch(void)
+{
        /* Add board OCP definitions */
        mpc52xx_add_board_devices(board_ocp);
+
+       /* CPU & Port mux setup */
+       lite5200_setup_cpu();
 }
 
 void __init
@@ -110,7 +142,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                        initrd_end = r5 + KERNELBASE;
                }
 #endif
-       
+
                /* Load the command line */
                if (r6) {
                        *(char *)(r7+KERNELBASE) = 0;
@@ -120,14 +152,17 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 
        /* BAT setup */
        mpc52xx_set_bat();
-       
+
        /* No ISA bus AFAIK */
        isa_io_base             = 0;
        isa_mem_base            = 0;
 
+       /* Powersave */
+       powersave_nap = 1;      /* We allow this platform to NAP */
+
        /* Setup the ppc_md struct */
-       ppc_md.setup_arch       = icecube_setup_arch;
-       ppc_md.show_cpuinfo     = icecube_show_cpuinfo;
+       ppc_md.setup_arch       = lite5200_setup_arch;
+       ppc_md.show_cpuinfo     = lite5200_show_cpuinfo;
        ppc_md.show_percpuinfo  = NULL;
        ppc_md.init_IRQ         = mpc52xx_init_irq;
        ppc_md.get_irq          = mpc52xx_get_irq;
@@ -138,12 +173,12 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
        ppc_md.restart          = mpc52xx_restart;
        ppc_md.power_off        = mpc52xx_power_off;
        ppc_md.halt             = mpc52xx_halt;
-       
-               /* No time keeper on the IceCube */
+
+               /* No time keeper on the LITE5200 */
        ppc_md.time_init        = NULL;
        ppc_md.get_rtc_time     = NULL;
        ppc_md.set_rtc_time     = NULL;
-       
+
        ppc_md.calibrate_decr   = mpc52xx_calibrate_decr;
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
        ppc_md.progress         = mpc52xx_progress;