Merge with Linux 2.5.73.
[linux-2.6/linux-mips.git] / arch / ia64 / sn / io / platform_init / irix_io_init.c
blob25dbcef02d3410e8ce7eb844d1250a2e24a383b5
1 /* $Id$
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
8 */
10 #include <linux/types.h>
11 #include <linux/config.h>
12 #include <linux/slab.h>
13 #include <asm/sn/sgi.h>
14 #include <asm/sn/io.h>
15 #include <asm/sn/sn_cpuid.h>
16 #include <asm/sn/klconfig.h>
17 #include <asm/sn/sn_private.h>
18 #include <linux/smp.h>
19 #include <asm/sn/simulator.h>
21 extern void init_all_devices(void);
22 extern void klhwg_add_all_modules(vertex_hdl_t);
23 extern void klhwg_add_all_nodes(vertex_hdl_t);
25 extern vertex_hdl_t hwgraph_root;
26 extern void io_module_init(void);
27 extern int pci_bus_to_hcl_cvlink(void);
28 extern void mlreset(void);
30 /* #define DEBUG_IO_INIT 1 */
31 #ifdef DEBUG_IO_INIT
32 #define DBG(x...) printk(x)
33 #else
34 #define DBG(x...)
35 #endif /* DEBUG_IO_INIT */
38 * This routine is responsible for the setup of all the IRIX hwgraph style
39 * stuff that's been pulled into linux. It's called by sn_pci_find_bios which
40 * is called just before the generic Linux PCI layer does its probing (by
41 * platform_pci_fixup aka sn_pci_fixup).
43 * It is very IMPORTANT that this call is only made by the Master CPU!
47 void
48 irix_io_init(void)
50 cnodeid_t cnode;
53 * This is the Master CPU. Emulate mlsetup and main.c in Irix.
55 mlreset();
58 * Initialize platform-dependent vertices in the hwgraph:
59 * module
60 * node
61 * cpu
62 * memory
63 * slot
64 * hub
65 * router
66 * xbow
69 io_module_init(); /* Use to be called module_init() .. */
70 klhwg_add_all_modules(hwgraph_root);
71 klhwg_add_all_nodes(hwgraph_root);
73 for (cnode = 0; cnode < numnodes; cnode++) {
74 extern void per_hub_init(cnodeid_t);
75 per_hub_init(cnode);
78 /* We can do headless hub cnodes here .. */
82 * Our IO Infrastructure drivers are in place ..
83 * Initialize the whole IO Infrastructure .. xwidget/device probes.
86 init_all_devices();
87 pci_bus_to_hcl_cvlink();