===== arch/ia64/sn/kernel/setup.c 1.48 vs edited ===== --- 1.48/arch/ia64/sn/kernel/setup.c 2005-01-22 14:57:15 -08:00 +++ edited/arch/ia64/sn/kernel/setup.c 2005-02-09 11:58:39 -08:00 @@ -3,39 +3,20 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1999,2001-2005 Silicon Graphics, Inc. All rights reserved. */ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include +#include +#include #include -#include #include -#include -#include -#include -#include +#include #include #include #include @@ -46,30 +27,22 @@ #include #include #include -#include +#include #include "xtalk/xwidgetdev.h" #include "xtalk/hubdev.h" -#include - DEFINE_PER_CPU(struct pda_s, pda_percpu); -#define MAX_PHYS_MEMORY (1UL << 49) /* 1 TB */ - -lboard_t *root_lboard[MAX_COMPACT_NODES]; - +/* bte.h has circular dependencies with nodepda.h, so declare this here */ extern void bte_init_node(nodepda_t *, cnodeid_t); -extern void sn_timer_init(void); -extern unsigned long last_time_offset; +/* Used in the idle loop to toggle LEDs */ extern void (*ia64_mark_idle) (int); -extern void snidle(int); -extern unsigned char acpi_kbd_controller_present; unsigned long sn_rtc_cycles_per_second; - EXPORT_SYMBOL(sn_rtc_cycles_per_second); +/* Partition-wide id & serial number */ partid_t sn_partid = -1; EXPORT_SYMBOL(sn_partid); char sn_system_serial_number_string[128]; @@ -78,32 +51,8 @@ EXPORT_SYMBOL(sn_partition_serial_number); short physical_node_map[MAX_PHYSNODE_ID]; - EXPORT_SYMBOL(physical_node_map); -int numionodes; - -static void sn_init_pdas(char **); -static void scan_for_ionodes(void); - -static nodepda_t *nodepdaindr[MAX_COMPACT_NODES]; - -/* - * The format of "screen_info" is strange, and due to early i386-setup - * code. This is just enough to make the console code think we're on a - * VGA color display. - */ -struct screen_info sn_screen_info = { - .orig_x = 0, - .orig_y = 0, - .orig_video_mode = 3, - .orig_video_cols = 80, - .orig_video_ega_bx = 3, - .orig_video_lines = 25, - .orig_video_isVGA = 1, - .orig_video_points = 16 -}; - /* * This is here so we can use the CMOS detection in ide-probe.c to * determine what drives are present. In theory, we don't need this @@ -118,49 +67,31 @@ char drive_info[4 * 16]; #endif -/* - * Get nasid of current cpu early in boot before nodepda is initialized - */ -static int -boot_get_nasid(void) -{ - int nasid; - - if (ia64_sn_get_sapic_info(get_sapicid(), &nasid, NULL, NULL)) - BUG(); - return nasid; -} - -/* - * This routine can only be used during init, since - * smp_boot_data is an init data structure. - * We have to use smp_boot_data.cpu_phys_id to find - * the physical id of the processor because the normal - * cpu_physical_id() relies on data structures that - * may not be initialized yet. +/** + * pxm_to_nasid - early PXM to nasid lookup routine + * @pxm: proximity domain to map + * + * Return the nasid of the given @pxm using the data provided by ACPI or -1 if + * one isn't found. */ - static int __init pxm_to_nasid(int pxm) { int i; int nid; nid = pxm_to_nid_map[pxm]; - for (i = 0; i < num_node_memblks; i++) { - if (node_memblk[i].nid == nid) { + for (i = 0; i < num_node_memblks; i++) + if (node_memblk[i].nid == nid) return NASID_GET(node_memblk[i].start_paddr); - } - } + return -1; } /** * early_sn_setup - early setup routine for SN platforms * - * Sets up an initial console to aid debugging. Intended primarily - * for bringup. See start_kernel() in init/main.c. + * Find the SAL entry points so that the console can be used during early boot. */ - void __init early_sn_setup(void) { efi_system_table_t *efi_systab; @@ -171,30 +102,27 @@ int i, j; /* - * Parse enough of the SAL tables to locate the SAL entry point. Since, console - * IO on SN2 is done via SAL calls, early_printk won't work without this. - * - * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. - * Any changes to those file may have to be made hereas well. + * Parse enough of the SAL tables to locate the SAL entry point. Since, + * console IO on SN2 is done via SAL calls, early_printk won't work + * without this. */ efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); config_tables = __va(efi_systab->tables); for (i = 0; i < efi_systab->nr_tables; i++) { - if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == - 0) { - sal_systab = __va(config_tables[i].table); - p = (char *)(sal_systab + 1); - for (j = 0; j < sal_systab->entry_count; j++) { - if (*p == SAL_DESC_ENTRY_POINT) { - ep = (struct ia64_sal_desc_entry_point - *)p; - ia64_sal_handler_init(__va - (ep->sal_proc), - __va(ep->gp)); - return; - } - p += SAL_DESC_SIZE(*p); + /* Skip over non-SAL tables */ + if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID)) + continue; + + sal_systab = __va(config_tables[i].table); + p = (char *)(sal_systab + 1); + for (j = 0; j < sal_systab->entry_count; j++) { + if (*p == SAL_DESC_ENTRY_POINT) { + ep = (struct ia64_sal_desc_entry_point *)p; + ia64_sal_handler_init(__va(ep->sal_proc), + __va(ep->gp)); + return; } + p += SAL_DESC_SIZE(*p); } } /* Uh-oh, SAL not available?? */ @@ -202,15 +130,14 @@ } extern int platform_intr_list[]; -extern nasid_t master_nasid; static int shub_1_1_found __initdata; -/* - * sn_check_for_wars +/** + * is_shub_1_1 - nasid is SHub 1.1 based? + * @nasid: nasid to check * - * Set flag for enabling shub specific wars + * Simply check if a given nasid has a SHub 1.1 hub chip. */ - static inline int __init is_shub_1_1(int nasid) { unsigned long id; @@ -223,188 +150,28 @@ return rev <= 2; } -static void __init sn_check_for_wars(void) -{ - int cnode; - - if (is_shub2()) { - /* none yet */ - } else { - for_each_online_node(cnode) { - if (is_shub_1_1(cnodeid_to_nasid(cnode))) - shub_1_1_found = 1; - } - } -} - /** - * sn_setup - SN platform setup routine - * @cmdline_p: kernel command line + * sn_check_for_wars - set the global shub_1_1_found flag if needed * - * Handles platform setup for SN machines. This includes determining - * the RTC frequency (via a SAL call), initializing secondary CPUs, and - * setting up per-node data areas. The console is also initialized here. + * SHub 1.1 chips need additional code enabled if present. */ -void __init sn_setup(char **cmdline_p) +static void __init sn_check_for_wars(void) { - long status, ticks_per_sec, drift; - int pxm; - int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); - extern void sn_cpu_init(void); - - /* - * If the generic code has enabled vga console support - lets - * get rid of it again. This is a kludge for the fact that ACPI - * currtently has no way of informing us if legacy VGA is available - * or not. - */ -#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) - if (conswitchp == &vga_con) { - printk(KERN_DEBUG "SGI: Disabling VGA console\n"); -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#else - conswitchp = NULL; -#endif /* CONFIG_DUMMY_CONSOLE */ - } -#endif /* def(CONFIG_VT) && def(CONFIG_VGA_CONSOLE) */ - - MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY; - - memset(physical_node_map, -1, sizeof(physical_node_map)); - for (pxm = 0; pxm < MAX_PXM_DOMAINS; pxm++) - if (pxm_to_nid_map[pxm] != -1) - physical_node_map[pxm_to_nasid(pxm)] = - pxm_to_nid_map[pxm]; - - /* - * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard - * support here so we don't have to listen to failed keyboard probe - * messages. - */ - if ((major < 2 || (major == 2 && minor <= 9)) && - acpi_kbd_controller_present) { - printk(KERN_INFO "Disabling legacy keyboard support as prom " - "is too old and doesn't provide FADT\n"); - acpi_kbd_controller_present = 0; - } - - printk("SGI SAL version %x.%02x\n", major, minor); - - /* - * Confirm the SAL we're running on is recent enough... - */ - if ((major < SN_SAL_MIN_MAJOR) || (major == SN_SAL_MIN_MAJOR && - minor < SN_SAL_MIN_MINOR)) { - printk(KERN_ERR "This kernel needs SGI SAL version >= " - "%x.%02x\n", SN_SAL_MIN_MAJOR, SN_SAL_MIN_MINOR); - panic("PROM version too old\n"); - } - - master_nasid = boot_get_nasid(); - - status = - ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, - &drift); - if (status != 0 || ticks_per_sec < 100000) { - printk(KERN_WARNING - "unable to determine platform RTC clock frequency, guessing.\n"); - /* PROM gives wrong value for clock freq. so guess */ - sn_rtc_cycles_per_second = 1000000000000UL / 30000UL; - } else - sn_rtc_cycles_per_second = ticks_per_sec; - - platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR; - - /* - * we set the default root device to /dev/hda - * to make simulation easy - */ - ROOT_DEV = Root_HDA1; - - /* - * Create the PDAs and NODEPDAs for all the cpus. - */ - sn_init_pdas(cmdline_p); - - ia64_mark_idle = &snidle; - - /* - * For the bootcpu, we do this here. All other cpus will make the - * call as part of cpu_init in slave cpu initialization. - */ - sn_cpu_init(); + int cnode; -#ifdef CONFIG_SMP - init_smp_config(); -#endif - screen_info = sn_screen_info; + if (is_shub2()) + return; - sn_timer_init(); + for_each_online_node(cnode) + if (is_shub_1_1(cnodeid_to_nasid(cnode))) + shub_1_1_found = 1; } -/** - * sn_init_pdas - setup node data areas - * - * One time setup for Node Data Area. Called by sn_setup(). +/* + * Used to setup per-node areas, the addr is then copied to the pda, then we + * can free this list. */ -static void __init sn_init_pdas(char **cmdline_p) -{ - cnodeid_t cnode; - - memset(pda->cnodeid_to_nasid_table, -1, - sizeof(pda->cnodeid_to_nasid_table)); - for_each_online_node(cnode) - pda->cnodeid_to_nasid_table[cnode] = - pxm_to_nasid(nid_to_pxm_map[cnode]); - - numionodes = num_online_nodes(); - scan_for_ionodes(); - - /* - * Allocate & initalize the nodepda for each node. - */ - for_each_online_node(cnode) { - nodepdaindr[cnode] = - alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); - memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); - memset(nodepdaindr[cnode]->phys_cpuid, -1, - sizeof(nodepdaindr[cnode]->phys_cpuid)); - } - - /* - * Allocate & initialize nodepda for TIOs. For now, put them on node 0. - */ - for (cnode = num_online_nodes(); cnode < numionodes; cnode++) { - nodepdaindr[cnode] = - alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t)); - memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); - } - - /* - * Now copy the array of nodepda pointers to each nodepda. - */ - for (cnode = 0; cnode < numionodes; cnode++) - memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, - sizeof(nodepdaindr)); - - /* - * Set up IO related platform-dependent nodepda fields. - * The following routine actually sets up the hubinfo struct - * in nodepda. - */ - for_each_online_node(cnode) { - bte_init_node(nodepdaindr[cnode], cnode); - } - - /* - * Initialize the per node hubdev. This includes IO Nodes and - * headless/memless nodes. - */ - for (cnode = 0; cnode < numionodes; cnode++) { - hubdev_init_node(nodepdaindr[cnode], cnode); - } -} +static nodepda_t *nodepdaindr[MAX_COMPACT_NODES] __initdata; /** * sn_cpu_init - initialize per-cpu data areas @@ -425,11 +192,12 @@ int cnode; int i; u64 shubtype, nasid_bitmask, nasid_shift; - static int wars_have_been_checked; memset(pda, 0, sizeof(pda)); + if (ia64_sn_get_hub_info(0, &shubtype, &nasid_bitmask, &nasid_shift)) BUG(); + pda->shub2 = (u8)shubtype; pda->nasid_bitmask = (u16)nasid_bitmask; pda->nasid_shift = (u8)nasid_shift; @@ -448,53 +216,51 @@ if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice)) BUG(); - for (i=0; i < MAX_NUMNODES; i++) { + for (i = 0; i < MAX_NUMNODES; i++) if (nodepdaindr[i]) { nodepdaindr[i]->phys_cpuid[cpuid].nasid = nasid; nodepdaindr[i]->phys_cpuid[cpuid].slice = slice; nodepdaindr[i]->phys_cpuid[cpuid].subnode = subnode; } - } cnode = nasid_to_cnodeid(nasid); pda->p_nodepda = nodepdaindr[cnode]; - pda->led_address = - (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); + pda->led_address = (typeof(pda->led_address)) + (LED0 + (slice << LED_CPU_SHIFT)); pda->led_state = LED_ALWAYS_SET; pda->hb_count = HZ / 2; pda->hb_state = 0; pda->idle_flag = 0; - if (cpuid != 0) { + /* Copy per-cpu node->nasid table from CPU 0 */ + if (cpuid != 0) memcpy(pda->cnodeid_to_nasid_table, pdacpu(0)->cnodeid_to_nasid_table, sizeof(pda->cnodeid_to_nasid_table)); - } /* - * Check for WARs. - * Only needs to be done once, on BSP. - * Has to be done after loop above, because it uses pda.cnodeid_to_nasid_table[i]. - * Has to be done before assignment below. + * Check for WARs. Only needs to be done once, on BSP. */ - if (!wars_have_been_checked) { + if (cpuid == 0) sn_check_for_wars(); - wars_have_been_checked = 1; - } + pda->shub_1_1_found = shub_1_1_found; /* * Set up addresses of PIO/MEM write status registers. */ { - u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; - u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, - SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; + u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, + SH1_PIO_WRITE_STATUS_1, 0}; + u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, + SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; u64 *pio; pio = is_shub1() ? pio1 : pio2; - pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]); - pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0; + pda->pio_write_status_addr = (volatile unsigned long *) + LOCAL_MMR_ADDR(pio[slice]); + pda->pio_write_status_val = is_shub1() ? + SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0; } /* @@ -502,20 +268,24 @@ */ if (local_node_data->active_cpu_count++ == 0 && is_shub1()) { int buddy_nasid; - buddy_nasid = - cnodeid_to_nasid(numa_node_id() == - num_online_nodes() - 1 ? 0 : numa_node_id() + 1); - pda->pio_shub_war_cam_addr = - (volatile unsigned long *)GLOBAL_MMR_ADDR(nasid, - SH1_PI_CAM_CONTROL); + buddy_nasid = cnodeid_to_nasid(numa_node_id() == + num_online_nodes() - 1 ? + 0 : numa_node_id() + 1); + pda->pio_shub_war_cam_addr = (volatile unsigned long *) + GLOBAL_MMR_ADDR(nasid, SH1_PI_CAM_CONTROL); } } -/* - * Scan klconfig for ionodes. Add the nasids to the - * physical_node_map and the pda and increment numionodes. - */ +/* I/O node data */ +lboard_t *root_lboard[MAX_COMPACT_NODES]; +int numionodes; +/** + * scan_for_ionodes - I/O node discovery & initialization + * + * Scan klconfig for ionodes. Add the nasids to the physical_node_map and the + * pda and increment numionodes. + */ static void __init scan_for_ionodes(void) { int nasid = 0; @@ -537,23 +307,20 @@ BUG(); /* All nodes must have klconfig tables! */ } cnodeid = nasid_to_cnodeid(nasid); - root_lboard[cnodeid] = (lboard_t *) - NODE_OFFSET_TO_LBOARD((nasid), - ((kl_config_hdr_t - *) (klgraph_header))-> - ch_board_info); + root_lboard[cnodeid] = NODE_OFFSET_TO_LBOARD(nasid, + ((kl_config_hdr_t *)(klgraph_header))->ch_board_info); } /* Scan headless/memless IO Nodes. */ for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { - /* if there's no nasid, don't try to read the klconfig on the node */ + /* skip non-existent nasids */ if (physical_node_map[nasid] == -1) continue; brd = find_lboard_any((lboard_t *) root_lboard[nasid_to_cnodeid(nasid)], KLTYPE_SNIA); if (brd) { - brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */ + brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */ if (!brd) continue; } @@ -576,7 +343,7 @@ /* Scan for TIO nodes. */ for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { - /* if there's no nasid, don't try to read the klconfig on the node */ + /* skip non-existent nasids */ if (physical_node_map[nasid] == -1) continue; brd = find_lboard_any((lboard_t *) @@ -598,13 +365,180 @@ } -int -nasid_slice_to_cpuid(int nasid, int slice) +/** + * sn_init_pdas - setup sn2 specific per-cpu and per-node data areas + * + * Initialize various per-cpu and per-node tables and structures for sn2. + * Also call out to some specific per-hub initialization routines. + */ +static void __init sn_init_pdas(void) { - long cpu; - - for (cpu=0; cpu < NR_CPUS; cpu++) - if (nodepda->phys_cpuid[cpu].nasid == nasid && nodepda->phys_cpuid[cpu].slice == slice) + cnodeid_t cnode; + + memset(pda->cnodeid_to_nasid_table, -1, + sizeof(pda->cnodeid_to_nasid_table)); + + /* + * node->nasid lookup table, copied to other per-cpu areas in + * sn_cpu_init + */ + for_each_online_node(cnode) + pda->cnodeid_to_nasid_table[cnode] = + pxm_to_nasid(nid_to_pxm_map[cnode]); + + numionodes = num_online_nodes(); + scan_for_ionodes(); + + /* + * Allocate & initalize the nodepda for each node. + */ + for_each_online_node(cnode) { + nodepdaindr[cnode] = alloc_bootmem_node(NODE_DATA(cnode), + sizeof(nodepda_t)); + memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); + memset(nodepdaindr[cnode]->phys_cpuid, -1, + sizeof(nodepdaindr[cnode]->phys_cpuid)); + } + + /* + * Allocate & initialize nodepda for TIOs. They're on node 0 right + * now, but should be allocated on the nearest node. + */ + for (cnode = num_online_nodes(); cnode < numionodes; cnode++) { + nodepdaindr[cnode] = alloc_bootmem_node(NODE_DATA(0), + sizeof(nodepda_t)); + memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); + } + + /* + * Now copy the array of nodepda pointers to each nodepda. + */ + for (cnode = 0; cnode < numionodes; cnode++) + memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, + sizeof(nodepdaindr)); + + /* + * Set up IO related platform-dependent nodepda fields. + * The following routine actually sets up the hubinfo struct + * in nodepda. + */ + for_each_online_node(cnode) + bte_init_node(nodepdaindr[cnode], cnode); + + /* + * Initialize the per node hubdev. This includes IO Nodes and + * headless/memless nodes. + */ + for (cnode = 0; cnode < numionodes; cnode++) + hubdev_init_node(nodepdaindr[cnode], cnode); +} + +/** + * sn_setup - SN platform setup routine + * @cmdline_p: kernel command line + * + * Handles platform setup for SN machines. This includes determining + * the RTC frequency (via a SAL call), initializing secondary CPUs, and + * setting up per-node data areas. The console is also initialized here. + */ +void __init sn_setup(char **cmdline_p) +{ + long status, ticks_per_sec, drift; + int pxm; + int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); + + /* + * If the generic code has enabled vga console support - lets + * get rid of it again. This is a kludge for the fact that ACPI + * currtently has no way of informing us if legacy VGA is available + * or not. + */ +#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) + if (conswitchp == &vga_con) { + printk(KERN_DEBUG "SGI: Disabling VGA console\n"); +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#else + conswitchp = NULL; +#endif /* CONFIG_DUMMY_CONSOLE */ + } +#endif /* def(CONFIG_VT) && def(CONFIG_VGA_CONSOLE) */ + + MAX_DMA_ADDRESS = ~0UL; /* IOMMU lets us DMA anywhere */ + + memset(physical_node_map, -1, sizeof(physical_node_map)); + + for (pxm = 0; pxm < MAX_PXM_DOMAINS; pxm++) + if (pxm_to_nid_map[pxm] != -1) + physical_node_map[pxm_to_nasid(pxm)] = + pxm_to_nid_map[pxm]; + + printk("SGI SAL version %x.%02x\n", major, minor); + + /* + * Confirm the SAL we're running on is recent enough... + */ + if ((major < SN_SAL_MIN_MAJOR) || (major == SN_SAL_MIN_MAJOR && + minor < SN_SAL_MIN_MINOR)) { + printk(KERN_ERR "This kernel needs SGI SAL version >= " + "%x.%02x\n", SN_SAL_MIN_MAJOR, SN_SAL_MIN_MINOR); + panic("PROM version too old\n"); + } + + status = ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, + &ticks_per_sec, &drift); + + if (status != 0 || ticks_per_sec < 100000) { + /* PROM gives wrong value for clock freq. so guess */ + sn_rtc_cycles_per_second = 1000000000000UL / 30000UL; + printk(KERN_WARNING "unable to determine platform RTC clock " + "frequency, using %ld.\n", sn_rtc_cycles_per_second); + } else + sn_rtc_cycles_per_second = ticks_per_sec; + + platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR; + + /* + * we set the default root device to /dev/hda + * to make simulation easy + */ + ROOT_DEV = Root_HDA1; + + /* + * Create the PDAs and NODEPDAs for all the cpus. + */ + sn_init_pdas(); + + ia64_mark_idle = &snidle; + + /* + * For the bootcpu, we do this here. All other cpus will make the + * call as part of cpu_init in slave cpu initialization. + */ + sn_cpu_init(); + +#ifdef CONFIG_SMP + init_smp_config(); +#endif + sn_timer_init(); +} + +/** + * nasid_slice_to_cpuid - find a CPU given a nasid and slice + * @nasid: nasid to check + * @slice: slice to check + * + * Each slice on a nasid should contain a CPU. Thus function returns the + * CPU id of the CPU that should be on @nasid, @slice. If one isn't found, + * the function returns -1. + */ +int nasid_slice_to_cpuid(int nasid, int slice) +{ + int cpu; + + for_each_cpu(cpu) + if (nodepda->phys_cpuid[cpu].nasid == nasid && + nodepda->phys_cpuid[cpu].slice == slice) return cpu; return -1; ===== arch/ia64/sn/kernel/io_init.c 1.9 vs edited ===== --- 1.9/arch/ia64/sn/kernel/io_init.c 2005-01-11 16:22:08 -08:00 +++ edited/arch/ia64/sn/kernel/io_init.c 2005-02-09 09:55:32 -08:00 @@ -21,7 +21,6 @@ #include char master_baseio_wid; -nasid_t master_nasid = INVALID_NASID; /* Partition Master */ struct slab_info { struct hubdev_info hubdev; ===== include/asm-ia64/sn/clksupport.h 1.10 vs edited ===== --- 1.10/include/asm-ia64/sn/clksupport.h 2004-10-11 13:04:12 -07:00 +++ edited/include/asm-ia64/sn/clksupport.h 2005-02-09 11:47:10 -08:00 @@ -25,4 +25,6 @@ #define rtc_time() (*RTC_COUNTER_ADDR) +extern void sn_timer_init(void); + #endif /* _ASM_IA64_SN_CLKSUPPORT_H */ ===== include/asm-ia64/sn/leds.h 1.8 vs edited ===== --- 1.8/include/asm-ia64/sn/leds.h 2004-12-10 13:04:21 -08:00 +++ edited/include/asm-ia64/sn/leds.h 2005-02-09 11:45:19 -08:00 @@ -18,6 +18,8 @@ #define LED_CPU_ACTIVITY 0x02 #define LED_ALWAYS_SET 0x00 +void snidle(int state); + /* * Basic macros for flashing the LEDS on an SGI SN. */