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
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();
}
Exemple #3
0
/*
 * One-time setup for MP SN.
 * Allocate per-node data, slurp prom klconfig information and
 * convert it to hwgraph information.
 */
void
sn_mp_setup(void)
{
	cnodeid_t	cnode;
	extern int	maxnodes;
	cpuid_t		cpu;

	DBG("sn_mp_setup: Entered.\n");
	/*
	 * NODEPDA(x) Macro depends on nodepda
	 * subnodepda is also statically set to calias space which we 
	 * do not currently support yet .. just a hack for now.
	 */
#ifdef NUMA_BASE
        maxnodes = numnodes;
	DBG("sn_mp_setup(): maxnodes= %d  numnodes= %d\n", maxnodes,numnodes);
        printk("sn_mp_setup(): Allocating backing store for *Nodepdaindr[%2d] \n",
                maxnodes);

        /*
         * Initialize Nodpdaindr and per-node nodepdaindr array
         */
        *Nodepdaindr = (nodepda_t *) kmalloc(sizeof(nodepda_t *)*numnodes, GFP_KERNEL);
        for (cnode=0; cnode<maxnodes; cnode++) {
            Nodepdaindr[cnode] = (nodepda_t *) kmalloc(sizeof(struct nodepda_s),
                                                                GFP_KERNEL);
	    Synergy_da_indr[cnode * 2] = (synergy_da_t *) kmalloc(
		sizeof(synergy_da_t), GFP_KERNEL);
	    Synergy_da_indr[(cnode * 2) + 1] = (synergy_da_t *) kmalloc(
		sizeof(synergy_da_t), GFP_KERNEL);
            Nodepdaindr[cnode]->pernode_pdaindr = Nodepdaindr;
            subnodepda = &Nodepdaindr[cnode]->snpda[cnode];
        }
        nodepda = Nodepdaindr[0];
#else
        Nodepdaindr = (nodepda_t *) kmalloc(sizeof(struct nodepda_s), GFP_KERNEL);
        nodepda = Nodepdaindr[0];
        subnodepda = &Nodepdaindr[0]->snpda[0];

#endif /* NUMA_BASE */

	/*
	 * Before we let the other processors run, set up the platform specific
	 * stuff in the nodepda.
	 *
	 * ???? maxnodes set in mlreset .. who sets it now ????
	 * ???? cpu_node_probe() called in mlreset to set up the following:
	 *      compact_to_nasid_node[] - cnode id gives nasid
	 *      nasid_to_compact_node[] - nasid gives cnode id
	 *
	 *	do_cpumask() sets the following:
	 *      cpuid_to_compact_node[] - cpuid gives cnode id
	 *
	 *      nasid comes from gdap->g_nasidtable[]
	 *      ml/SN/promif.c
	 */

#ifdef CONFIG_IA64_SGI_SN1
	for (cpu = 0; cpu < smp_num_cpus; cpu++) {
		/* Skip holes in CPU space */
		if (cpu_enabled(cpu)) {
			init_platform_pda(cpu);
		}
	}
#endif
	for (cnode = 0; cnode < maxnodes; cnode++) {
		/*
		 * Set up platform-dependent nodepda fields.
		 * The following routine actually sets up the hubinfo struct
		 * in nodepda.
		 */
		DBG("sn_mp_io_setup: calling init_platform_nodepda(%2d)\n",cnode);
		init_platform_nodepda(Nodepdaindr[cnode], cnode);
	}
	/*
	 * Initialize platform-dependent vertices in the hwgraph:
	 *	module
	 *	node
	 *	cpu
	 *	memory
	 *	slot
	 *	hub
	 *	router
	 *	xbow
	 */

	DBG("sn_mp_io_setup: calling io_module_init()\n");
	io_module_init(); /* Use to be called module_init() .. */

	DBG("sn_mp_setup: calling klhwg_add_all_modules()\n");
	klhwg_add_all_modules(hwgraph_root);
	DBG("sn_mp_setup: calling klhwg_add_all_nodes()\n");
	klhwg_add_all_nodes(hwgraph_root);


	for (cnode = 0; cnode < maxnodes; cnode++) {

		/*
		 * This routine clears the Hub's Interrupt registers.
		 */
#ifdef CONFIG_IA64_SGI_SN1
		/*
		 * We need to move this intr_clear_all() routine 
		 * from SN/intr.c to a more appropriate file.
		 * Talk to Al Mayer.
		 */
                intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
		/* now init the hub */
	//	per_hub_init(cnode);
#endif
	}

#if defined(CONFIG_IA64_SGI_SYNERGY_PERF)
	synergy_perf_init();
#endif /* CONFIG_IA64_SGI_SYNERGY_PERF */
}