Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / arch / ppc / platforms / 4xx / xilinx_ml403.c
blobbc3ace3762e78d6f3885df4ee325ec30140e7d57
1 /*
2 * Xilinx ML403 evaluation board initialization
4 * Author: Grant Likely <grant.likely@secretlab.ca>
6 * 2005-2007 (c) Secret Lab Technologies Ltd.
7 * 2002-2004 (c) MontaVista Software, Inc.
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
14 #include <linux/init.h>
15 #include <linux/irq.h>
16 #include <linux/tty.h>
17 #include <linux/serial.h>
18 #include <linux/serial_core.h>
19 #include <linux/serial_8250.h>
20 #include <linux/serialP.h>
21 #include <asm/io.h>
22 #include <asm/machdep.h>
24 #include <syslib/gen550.h>
25 #include <syslib/virtex_devices.h>
26 #include <platforms/4xx/xparameters/xparameters.h>
29 * As an overview of how the following functions (platform_init,
30 * ml403_map_io, ml403_setup_arch and ml403_init_IRQ) fit into the
31 * kernel startup procedure, here's a call tree:
33 * start_here arch/ppc/kernel/head_4xx.S
34 * early_init arch/ppc/kernel/setup.c
35 * machine_init arch/ppc/kernel/setup.c
36 * platform_init this file
37 * ppc4xx_init arch/ppc/syslib/ppc4xx_setup.c
38 * parse_bootinfo
39 * find_bootinfo
40 * "setup some default ppc_md pointers"
41 * MMU_init arch/ppc/mm/init.c
42 * *ppc_md.setup_io_mappings == ml403_map_io this file
43 * ppc4xx_map_io arch/ppc/syslib/ppc4xx_setup.c
44 * start_kernel init/main.c
45 * setup_arch arch/ppc/kernel/setup.c
46 * #if defined(CONFIG_KGDB)
47 * *ppc_md.kgdb_map_scc() == gen550_kgdb_map_scc
48 * #endif
49 * *ppc_md.setup_arch == ml403_setup_arch this file
50 * ppc4xx_setup_arch arch/ppc/syslib/ppc4xx_setup.c
51 * ppc4xx_find_bridges arch/ppc/syslib/ppc405_pci.c
52 * init_IRQ arch/ppc/kernel/irq.c
53 * *ppc_md.init_IRQ == ml403_init_IRQ this file
54 * ppc4xx_init_IRQ arch/ppc/syslib/ppc4xx_setup.c
55 * ppc4xx_pic_init arch/ppc/syslib/xilinx_pic.c
58 const char* virtex_machine_name = "ML403 Reference Design";
60 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
61 static volatile unsigned *powerdown_base =
62 (volatile unsigned *) XPAR_POWER_0_POWERDOWN_BASEADDR;
64 static void
65 xilinx_power_off(void)
67 local_irq_disable();
68 out_be32(powerdown_base, XPAR_POWER_0_POWERDOWN_VALUE);
69 while (1) ;
71 #endif
73 void __init
74 ml403_map_io(void)
76 ppc4xx_map_io();
78 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
79 powerdown_base = ioremap((unsigned long) powerdown_base,
80 XPAR_POWER_0_POWERDOWN_HIGHADDR -
81 XPAR_POWER_0_POWERDOWN_BASEADDR + 1);
82 #endif
85 void __init
86 ml403_setup_arch(void)
88 virtex_early_serial_map();
89 ppc4xx_setup_arch(); /* calls ppc4xx_find_bridges() */
91 /* Identify the system */
92 printk(KERN_INFO "Xilinx ML403 Reference System (Virtex-4 FX)\n");
95 /* Called after board_setup_irq from ppc4xx_init_IRQ(). */
96 void __init
97 ml403_init_irq(void)
99 ppc4xx_init_IRQ();
102 void __init
103 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
104 unsigned long r6, unsigned long r7)
106 ppc4xx_init(r3, r4, r5, r6, r7);
108 ppc_md.setup_arch = ml403_setup_arch;
109 ppc_md.setup_io_mappings = ml403_map_io;
110 ppc_md.init_IRQ = ml403_init_irq;
112 #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR)
113 ppc_md.power_off = xilinx_power_off;
114 #endif
116 #ifdef CONFIG_KGDB
117 ppc_md.early_serial_map = virtex_early_serial_map;
118 #endif