void __cpuinit per_cpu_init(void) { int cpu = smp_processor_id(); int slice = LOCAL_HUB_L(PI_CPU_NUM); cnodeid_t cnode = get_compact_nodeid(); struct hub_data *hub = hub_data(cnode); struct slice_data *si = hub->slice + slice; int i; if (test_and_set_bit(slice, &hub->slice_map)) return; clear_c0_status(ST0_IM); per_hub_init(cnode); for (i = 0; i < LEVELS_PER_SLICE; i++) si->level_to_irq[i] = -1; /* * We use this so we can find the local hub's data as fast as only * possible. */ cpu_data[cpu].data = si; cpu_time_init(); install_ipi(); /* Install our NMI handler if symmon hasn't installed one. */ install_cpu_nmi_handler(cputoslice(cpu)); set_c0_status(SRB_DEV0 | SRB_DEV1); }
void __cpuinit per_cpu_init(void) { int cpu = smp_processor_id(); int slice = LOCAL_HUB_L(PI_CPU_NUM); cnodeid_t cnode = get_compact_nodeid(); struct hub_data *hub = hub_data(cnode); struct slice_data *si = hub->slice + slice; int i; if (test_and_set_bit(slice, &hub->slice_map)) return; clear_c0_status(ST0_IM); per_hub_init(cnode); for (i = 0; i < LEVELS_PER_SLICE; i++) si->level_to_irq[i] = -1; /* */ cpu_data[cpu].data = si; cpu_time_init(); install_ipi(); /* */ install_cpu_nmi_handler(cputoslice(cpu)); set_c0_status(SRB_DEV0 | SRB_DEV1); }
void sgi_master_io_infr_init(void) { cnodeid_t cnode; init_hcl(); /* Sets up the hwgraph compatibility layer */ /* * Initialize platform-dependent vertices in the hwgraph: * module * node * cpu * memory * slot * hub * router * xbow */ io_module_init(); /* Use to be called module_init() .. */ klhwg_add_all_modules(hwgraph_root); klhwg_add_all_nodes(hwgraph_root); for (cnode = 0; cnode < numnodes; cnode++) { extern void per_hub_init(cnodeid_t); per_hub_init(cnode); } /* We can do headless hub cnodes here .. */ /* Initialize ICE for TIO Nodes. */ for (cnode = numnodes; cnode < numionodes; cnode++) { extern void per_ice_init(cnodeid_t); per_ice_init(cnode); } /* * * Our IO Infrastructure drivers are in place .. * Initialize the whole IO Infrastructure .. xwidget/device probes. * */ init_all_devices(); pci_bus_to_hcl_cvlink(); #ifdef CONFIG_KDB { extern void kdba_io_init(void); kdba_io_init(); } #endif }
void __init per_cpu_init(void) { int cpu = smp_processor_id(); int slice = LOCAL_HUB_L(PI_CPU_NUM); cnodeid_t cnode = get_compact_nodeid(); struct hub_data *hub = hub_data(cnode); struct slice_data *si = hub->slice + slice; int i; if (test_and_set_bit(slice, &hub->slice_map)) return; clear_c0_status(ST0_IM); for (i = 0; i < LEVELS_PER_SLICE; i++) si->level_to_irq[i] = -1; /* * Some interrupts are reserved by hardware or by software convention. * Mark these as reserved right away so they won't be used accidently * later. */ for (i = 0; i <= BASE_PCI_IRQ; i++) { __set_bit(i, si->irq_alloc_mask); LOCAL_HUB_S(PI_INT_PEND_MOD, i); } __set_bit(IP_PEND0_6_63, si->irq_alloc_mask); LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63); for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) { __set_bit(i, si->irq_alloc_mask + 1); LOCAL_HUB_S(PI_INT_PEND_MOD, i); } LOCAL_HUB_L(PI_INT_PEND0); /* * We use this so we can find the local hub's data as fast as only * possible. */ cpu_data[cpu].data = si; cpu_time_init(); install_ipi(); /* Install our NMI handler if symmon hasn't installed one. */ install_cpu_nmi_handler(cputoslice(cpu)); set_c0_status(SRB_DEV0 | SRB_DEV1); per_hub_init(cnode); }
void __init sgi_master_io_infr_init(void) { cnodeid_t cnode; if (init_hcl() < 0) { /* Sets up the hwgraph compatibility layer */ printk("sgi_master_io_infr_init: Cannot init hcl\n"); return; } /* * Initialize platform-dependent vertices in the hwgraph: * module * node * cpu * memory * slot * hub * router * xbow */ io_module_init(); /* Use to be called module_init() .. */ klhwg_add_all_modules(hwgraph_root); klhwg_add_all_nodes(hwgraph_root); for (cnode = 0; cnode < numionodes; cnode++) { extern void per_hub_init(cnodeid_t); per_hub_init(cnode); } /* * * Our IO Infrastructure drivers are in place .. * Initialize the whole IO Infrastructure .. xwidget/device probes. * */ init_all_devices(); pci_bus_to_hcl_cvlink(); }
void sgi_master_io_infr_init(void) { int cnode; extern int maxnodes; /* * Do any early init stuff .. einit_tbl[] etc. */ DBG("--> sgi_master_io_infr_init: calling init_hcl().\n"); init_hcl(); /* Sets up the hwgraph compatibility layer with devfs */ /* * initialize the Linux PCI to xwidget vertexes .. */ DBG("--> sgi_master_io_infr_init: calling pci_bus_cvlink_init().\n"); pci_bus_cvlink_init(); /* * Hack to provide statically initialzed klgraph entries. */ DBG("--> sgi_master_io_infr_init: calling klgraph_hack_init()\n"); klgraph_hack_init(); /* * This is the Master CPU. Emulate mlsetup and main.c in Irix. */ DBG("--> sgi_master_io_infr_init: calling mlreset(0).\n"); mlreset(0); /* Master .. */ /* * allowboot() is called by kern/os/main.c in main() * Emulate allowboot() ... * per_cpu_init() - only need per_hub_init() * cpu_io_setup() - Nothing to do. * */ DBG("--> sgi_master_io_infr_init: calling sn_mp_setup().\n"); sn_mp_setup(); DBG("--> sgi_master_io_infr_init: calling per_hub_init(0).\n"); for (cnode = 0; cnode < maxnodes; cnode++) { per_hub_init(cnode); } /* We can do headless hub cnodes here .. */ /* * io_init[] stuff. * * Get SGI IO Infrastructure drivers to init and register with * each other etc. */ DBG("--> sgi_master_io_infr_init: calling hubspc_init()\n"); hubspc_init(); DBG("--> sgi_master_io_infr_init: calling pciba_init()\n"); pciba_init(); DBG("--> sgi_master_io_infr_init: calling pciio_init()\n"); pciio_init(); DBG("--> sgi_master_io_infr_init: calling pcibr_init()\n"); pcibr_init(); DBG("--> sgi_master_io_infr_init: calling xtalk_init()\n"); xtalk_init(); DBG("--> sgi_master_io_infr_init: calling xbow_init()\n"); xbow_init(); DBG("--> sgi_master_io_infr_init: calling xbmon_init()\n"); xbmon_init(); DBG("--> sgi_master_io_infr_init: calling pciiox_init()\n"); pciiox_init(); DBG("--> sgi_master_io_infr_init: calling usrpci_init()\n"); usrpci_init(); DBG("--> sgi_master_io_infr_init: calling ioc3_init()\n"); ioc3_init(); /* * * Our IO Infrastructure drivers are in place .. * Initialize the whole IO Infrastructure .. xwidget/device probes. * */ DBG("--> sgi_master_io_infr_init: Start Probe and IO Initialization\n"); initialize_io(); DBG("--> sgi_master_io_infr_init: Setting up SGI IO Links for Linux PCI\n"); pci_bus_to_hcl_cvlink(); DBG("--> Leave sgi_master_io_infr_init: DONE setting up SGI Links for PCI\n"); }