ia64/kvm: compilation fix. export account_system_vtime.
[pv_ops_mirror.git] / arch / ppc / platforms / 4xx / xilinx_ml300.c
blob6e522fefc26f779c17b62bbbd96ae5c7eba0169b
1 /*
2 * Xilinx ML300 evaluation board initialization
4 * Author: MontaVista Software, Inc.
5 * source@mvista.com
7 * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is licensed
9 * "as is" without any warranty of any kind, whether express or implied.
12 #include <linux/init.h>
13 #include <linux/irq.h>
14 #include <linux/tty.h>
15 #include <linux/serial.h>
16 #include <linux/serial_core.h>
17 #include <linux/serial_8250.h>
18 #include <linux/serialP.h>
19 #include <asm/io.h>
20 #include <asm/machdep.h>
22 #include <syslib/gen550.h>
23 #include <syslib/virtex_devices.h>
24 #include <platforms/4xx/xparameters/xparameters.h>
27 * As an overview of how the following functions (platform_init,
28 * ml300_map_io, ml300_setup_arch and ml300_init_IRQ) fit into the
29 * kernel startup procedure, here's a call tree:
31 * start_here arch/ppc/kernel/head_4xx.S
32 * early_init arch/ppc/kernel/setup.c
33 * machine_init arch/ppc/kernel/setup.c
34 * platform_init this file
35 * ppc4xx_init arch/ppc/syslib/ppc4xx_setup.c
36 * parse_bootinfo
37 * find_bootinfo
38 * "setup some default ppc_md pointers"
39 * MMU_init arch/ppc/mm/init.c
40 * *ppc_md.setup_io_mappings == ml300_map_io this file
41 * ppc4xx_map_io arch/ppc/syslib/ppc4xx_setup.c
42 * start_kernel init/main.c
43 * setup_arch arch/ppc/kernel/setup.c
44 * #if defined(CONFIG_KGDB)
45 * *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc
46 * #endif
47 * *ppc_md.setup_arch == ml300_setup_arch this file
48 * ppc4xx_setup_arch arch/ppc/syslib/ppc4xx_setup.c
49 * ppc4xx_find_bridges arch/ppc/syslib/ppc405_pci.c
50 * init_IRQ arch/ppc/kernel/irq.c
51 * *ppc_md.init_IRQ == ml300_init_IRQ this file
52 * ppc4xx_init_IRQ arch/ppc/syslib/ppc4xx_setup.c
53 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
56 const char* virtex_machine_name = "ML300 Reference Design";
58 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
59 static volatile unsigned *powerdown_base =
60 (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR;
62 static void
63 xilinx_power_off(void)
65 local_irq_disable();
66 out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE);
67 while (1) ;
69 #endif
71 void __init
72 ml300_map_io(void)
74 ppc4xx_map_io();
76 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
77 powerdown_base = ioremap((unsigned long) powerdown_base,
78 XPAR_POWER_0_POWERDOWN_HIGHADDR -
79 XPAR_POWER_0_POWERDOWN_BASEADDR + 1);
80 #endif
83 void __init
84 ml300_setup_arch(void)
86 virtex_early_serial_map();
87 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
89 /* Identify the system */
90 printk(KERN_INFO "Xilinx ML300 Reference System (Virtex-II Pro)\n");
93 /* Called after board_setup_irq from ppc4xx_init_IRQ(). */
94 void __init
95 ml300_init_irq(void)
97 ppc4xx_init_IRQ();
100 void __init
101 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
102 unsigned long r6, unsigned long r7)
104 ppc4xx_init(r3, r4, r5, r6, r7);
106 ppc_md.setup_arch = ml300_setup_arch;
107 ppc_md.setup_io_mappings = ml300_map_io;
108 ppc_md.init_IRQ = ml300_init_irq;
110 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
111 ppc_md.power_off = xilinx_power_off;
112 #endif
114 #ifdef CONFIG_KGDB
115 ppc_md.early_serial_map = virtex_early_serial_map;
116 #endif