setup.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #include <linux/config.h>
  9. #include <linux/module.h>
  10. #include <linux/init.h>
  11. #include <linux/delay.h>
  12. #include <linux/kernel.h>
  13. #include <linux/kdev_t.h>
  14. #include <linux/string.h>
  15. #include <linux/tty.h>
  16. #include <linux/console.h>
  17. #include <linux/timex.h>
  18. #include <linux/sched.h>
  19. #include <linux/ioport.h>
  20. #include <linux/mm.h>
  21. #include <linux/serial.h>
  22. #include <linux/irq.h>
  23. #include <linux/bootmem.h>
  24. #include <linux/mmzone.h>
  25. #include <linux/interrupt.h>
  26. #include <linux/acpi.h>
  27. #include <linux/compiler.h>
  28. #include <linux/sched.h>
  29. #include <linux/root_dev.h>
  30. #include <linux/nodemask.h>
  31. #include <linux/pm.h>
  32. #include <asm/io.h>
  33. #include <asm/sal.h>
  34. #include <asm/machvec.h>
  35. #include <asm/system.h>
  36. #include <asm/processor.h>
  37. #include <asm/sn/arch.h>
  38. #include <asm/sn/addrs.h>
  39. #include <asm/sn/pda.h>
  40. #include <asm/sn/nodepda.h>
  41. #include <asm/sn/sn_cpuid.h>
  42. #include <asm/sn/simulator.h>
  43. #include <asm/sn/leds.h>
  44. #include <asm/sn/bte.h>
  45. #include <asm/sn/shub_mmr.h>
  46. #include <asm/sn/clksupport.h>
  47. #include <asm/sn/sn_sal.h>
  48. #include <asm/sn/geo.h>
  49. #include "xtalk/xwidgetdev.h"
  50. #include "xtalk/hubdev.h"
  51. #include <asm/sn/klconfig.h>
  52. DEFINE_PER_CPU(struct pda_s, pda_percpu);
  53. #define MAX_PHYS_MEMORY (1UL << 49) /* 1 TB */
  54. lboard_t *root_lboard[MAX_COMPACT_NODES];
  55. extern void bte_init_node(nodepda_t *, cnodeid_t);
  56. extern void sn_timer_init(void);
  57. extern unsigned long last_time_offset;
  58. extern void (*ia64_mark_idle) (int);
  59. extern void snidle(int);
  60. extern unsigned char acpi_kbd_controller_present;
  61. unsigned long sn_rtc_cycles_per_second;
  62. EXPORT_SYMBOL(sn_rtc_cycles_per_second);
  63. DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
  64. EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
  65. partid_t sn_partid = -1;
  66. EXPORT_SYMBOL(sn_partid);
  67. char sn_system_serial_number_string[128];
  68. EXPORT_SYMBOL(sn_system_serial_number_string);
  69. u64 sn_partition_serial_number;
  70. EXPORT_SYMBOL(sn_partition_serial_number);
  71. u8 sn_partition_id;
  72. EXPORT_SYMBOL(sn_partition_id);
  73. u8 sn_system_size;
  74. EXPORT_SYMBOL(sn_system_size);
  75. u8 sn_sharing_domain_size;
  76. EXPORT_SYMBOL(sn_sharing_domain_size);
  77. u8 sn_coherency_id;
  78. EXPORT_SYMBOL(sn_coherency_id);
  79. u8 sn_region_size;
  80. EXPORT_SYMBOL(sn_region_size);
  81. short physical_node_map[MAX_PHYSNODE_ID];
  82. EXPORT_SYMBOL(physical_node_map);
  83. int numionodes;
  84. static void sn_init_pdas(char **);
  85. static void scan_for_ionodes(void);
  86. static nodepda_t *nodepdaindr[MAX_COMPACT_NODES];
  87. /*
  88. * The format of "screen_info" is strange, and due to early i386-setup
  89. * code. This is just enough to make the console code think we're on a
  90. * VGA color display.
  91. */
  92. struct screen_info sn_screen_info = {
  93. .orig_x = 0,
  94. .orig_y = 0,
  95. .orig_video_mode = 3,
  96. .orig_video_cols = 80,
  97. .orig_video_ega_bx = 3,
  98. .orig_video_lines = 25,
  99. .orig_video_isVGA = 1,
  100. .orig_video_points = 16
  101. };
  102. /*
  103. * This is here so we can use the CMOS detection in ide-probe.c to
  104. * determine what drives are present. In theory, we don't need this
  105. * as the auto-detection could be done via ide-probe.c:do_probe() but
  106. * in practice that would be much slower, which is painful when
  107. * running in the simulator. Note that passing zeroes in DRIVE_INFO
  108. * is sufficient (the IDE driver will autodetect the drive geometry).
  109. */
  110. #ifdef CONFIG_IA64_GENERIC
  111. extern char drive_info[4 * 16];
  112. #else
  113. char drive_info[4 * 16];
  114. #endif
  115. /*
  116. * Get nasid of current cpu early in boot before nodepda is initialized
  117. */
  118. static int
  119. boot_get_nasid(void)
  120. {
  121. int nasid;
  122. if (ia64_sn_get_sapic_info(get_sapicid(), &nasid, NULL, NULL))
  123. BUG();
  124. return nasid;
  125. }
  126. /*
  127. * This routine can only be used during init, since
  128. * smp_boot_data is an init data structure.
  129. * We have to use smp_boot_data.cpu_phys_id to find
  130. * the physical id of the processor because the normal
  131. * cpu_physical_id() relies on data structures that
  132. * may not be initialized yet.
  133. */
  134. static int __init pxm_to_nasid(int pxm)
  135. {
  136. int i;
  137. int nid;
  138. nid = pxm_to_nid_map[pxm];
  139. for (i = 0; i < num_node_memblks; i++) {
  140. if (node_memblk[i].nid == nid) {
  141. return NASID_GET(node_memblk[i].start_paddr);
  142. }
  143. }
  144. return -1;
  145. }
  146. /**
  147. * early_sn_setup - early setup routine for SN platforms
  148. *
  149. * Sets up an initial console to aid debugging. Intended primarily
  150. * for bringup. See start_kernel() in init/main.c.
  151. */
  152. void __init early_sn_setup(void)
  153. {
  154. efi_system_table_t *efi_systab;
  155. efi_config_table_t *config_tables;
  156. struct ia64_sal_systab *sal_systab;
  157. struct ia64_sal_desc_entry_point *ep;
  158. char *p;
  159. int i, j;
  160. /*
  161. * Parse enough of the SAL tables to locate the SAL entry point. Since, console
  162. * IO on SN2 is done via SAL calls, early_printk won't work without this.
  163. *
  164. * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c.
  165. * Any changes to those file may have to be made hereas well.
  166. */
  167. efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab);
  168. config_tables = __va(efi_systab->tables);
  169. for (i = 0; i < efi_systab->nr_tables; i++) {
  170. if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) ==
  171. 0) {
  172. sal_systab = __va(config_tables[i].table);
  173. p = (char *)(sal_systab + 1);
  174. for (j = 0; j < sal_systab->entry_count; j++) {
  175. if (*p == SAL_DESC_ENTRY_POINT) {
  176. ep = (struct ia64_sal_desc_entry_point
  177. *)p;
  178. ia64_sal_handler_init(__va
  179. (ep->sal_proc),
  180. __va(ep->gp));
  181. return;
  182. }
  183. p += SAL_DESC_SIZE(*p);
  184. }
  185. }
  186. }
  187. /* Uh-oh, SAL not available?? */
  188. printk(KERN_ERR "failed to find SAL entry point\n");
  189. }
  190. extern int platform_intr_list[];
  191. extern nasid_t master_nasid;
  192. static int shub_1_1_found __initdata;
  193. /*
  194. * sn_check_for_wars
  195. *
  196. * Set flag for enabling shub specific wars
  197. */
  198. static inline int __init is_shub_1_1(int nasid)
  199. {
  200. unsigned long id;
  201. int rev;
  202. if (is_shub2())
  203. return 0;
  204. id = REMOTE_HUB_L(nasid, SH1_SHUB_ID);
  205. rev = (id & SH1_SHUB_ID_REVISION_MASK) >> SH1_SHUB_ID_REVISION_SHFT;
  206. return rev <= 2;
  207. }
  208. static void __init sn_check_for_wars(void)
  209. {
  210. int cnode;
  211. if (is_shub2()) {
  212. /* none yet */
  213. } else {
  214. for_each_online_node(cnode) {
  215. if (is_shub_1_1(cnodeid_to_nasid(cnode)))
  216. sn_hub_info->shub_1_1_found = 1;
  217. }
  218. }
  219. }
  220. /**
  221. * sn_setup - SN platform setup routine
  222. * @cmdline_p: kernel command line
  223. *
  224. * Handles platform setup for SN machines. This includes determining
  225. * the RTC frequency (via a SAL call), initializing secondary CPUs, and
  226. * setting up per-node data areas. The console is also initialized here.
  227. */
  228. void __init sn_setup(char **cmdline_p)
  229. {
  230. long status, ticks_per_sec, drift;
  231. int pxm;
  232. int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();
  233. extern void sn_cpu_init(void);
  234. /*
  235. * If the generic code has enabled vga console support - lets
  236. * get rid of it again. This is a kludge for the fact that ACPI
  237. * currtently has no way of informing us if legacy VGA is available
  238. * or not.
  239. */
  240. #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
  241. if (conswitchp == &vga_con) {
  242. printk(KERN_DEBUG "SGI: Disabling VGA console\n");
  243. #ifdef CONFIG_DUMMY_CONSOLE
  244. conswitchp = &dummy_con;
  245. #else
  246. conswitchp = NULL;
  247. #endif /* CONFIG_DUMMY_CONSOLE */
  248. }
  249. #endif /* def(CONFIG_VT) && def(CONFIG_VGA_CONSOLE) */
  250. MAX_DMA_ADDRESS = PAGE_OFFSET + MAX_PHYS_MEMORY;
  251. memset(physical_node_map, -1, sizeof(physical_node_map));
  252. for (pxm = 0; pxm < MAX_PXM_DOMAINS; pxm++)
  253. if (pxm_to_nid_map[pxm] != -1)
  254. physical_node_map[pxm_to_nasid(pxm)] =
  255. pxm_to_nid_map[pxm];
  256. /*
  257. * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard
  258. * support here so we don't have to listen to failed keyboard probe
  259. * messages.
  260. */
  261. if ((major < 2 || (major == 2 && minor <= 9)) &&
  262. acpi_kbd_controller_present) {
  263. printk(KERN_INFO "Disabling legacy keyboard support as prom "
  264. "is too old and doesn't provide FADT\n");
  265. acpi_kbd_controller_present = 0;
  266. }
  267. printk("SGI SAL version %x.%02x\n", major, minor);
  268. /*
  269. * Confirm the SAL we're running on is recent enough...
  270. */
  271. if ((major < SN_SAL_MIN_MAJOR) || (major == SN_SAL_MIN_MAJOR &&
  272. minor < SN_SAL_MIN_MINOR)) {
  273. printk(KERN_ERR "This kernel needs SGI SAL version >= "
  274. "%x.%02x\n", SN_SAL_MIN_MAJOR, SN_SAL_MIN_MINOR);
  275. panic("PROM version too old\n");
  276. }
  277. master_nasid = boot_get_nasid();
  278. status =
  279. ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec,
  280. &drift);
  281. if (status != 0 || ticks_per_sec < 100000) {
  282. printk(KERN_WARNING
  283. "unable to determine platform RTC clock frequency, guessing.\n");
  284. /* PROM gives wrong value for clock freq. so guess */
  285. sn_rtc_cycles_per_second = 1000000000000UL / 30000UL;
  286. } else
  287. sn_rtc_cycles_per_second = ticks_per_sec;
  288. platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR;
  289. /*
  290. * we set the default root device to /dev/hda
  291. * to make simulation easy
  292. */
  293. ROOT_DEV = Root_HDA1;
  294. /*
  295. * Create the PDAs and NODEPDAs for all the cpus.
  296. */
  297. sn_init_pdas(cmdline_p);
  298. ia64_mark_idle = &snidle;
  299. /*
  300. * For the bootcpu, we do this here. All other cpus will make the
  301. * call as part of cpu_init in slave cpu initialization.
  302. */
  303. sn_cpu_init();
  304. #ifdef CONFIG_SMP
  305. init_smp_config();
  306. #endif
  307. screen_info = sn_screen_info;
  308. sn_timer_init();
  309. /*
  310. * set pm_power_off to a SAL call to allow
  311. * sn machines to power off. The SAL call can be replaced
  312. * by an ACPI interface call when ACPI is fully implemented
  313. * for sn.
  314. */
  315. pm_power_off = ia64_sn_power_down;
  316. }
  317. /**
  318. * sn_init_pdas - setup node data areas
  319. *
  320. * One time setup for Node Data Area. Called by sn_setup().
  321. */
  322. static void __init sn_init_pdas(char **cmdline_p)
  323. {
  324. cnodeid_t cnode;
  325. memset(pda->cnodeid_to_nasid_table, -1,
  326. sizeof(pda->cnodeid_to_nasid_table));
  327. for_each_online_node(cnode)
  328. pda->cnodeid_to_nasid_table[cnode] =
  329. pxm_to_nasid(nid_to_pxm_map[cnode]);
  330. numionodes = num_online_nodes();
  331. scan_for_ionodes();
  332. /*
  333. * Allocate & initalize the nodepda for each node.
  334. */
  335. for_each_online_node(cnode) {
  336. nodepdaindr[cnode] =
  337. alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
  338. memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
  339. memset(nodepdaindr[cnode]->phys_cpuid, -1,
  340. sizeof(nodepdaindr[cnode]->phys_cpuid));
  341. }
  342. /*
  343. * Allocate & initialize nodepda for TIOs. For now, put them on node 0.
  344. */
  345. for (cnode = num_online_nodes(); cnode < numionodes; cnode++) {
  346. nodepdaindr[cnode] =
  347. alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t));
  348. memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
  349. }
  350. /*
  351. * Now copy the array of nodepda pointers to each nodepda.
  352. */
  353. for (cnode = 0; cnode < numionodes; cnode++)
  354. memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr,
  355. sizeof(nodepdaindr));
  356. /*
  357. * Set up IO related platform-dependent nodepda fields.
  358. * The following routine actually sets up the hubinfo struct
  359. * in nodepda.
  360. */
  361. for_each_online_node(cnode) {
  362. bte_init_node(nodepdaindr[cnode], cnode);
  363. }
  364. /*
  365. * Initialize the per node hubdev. This includes IO Nodes and
  366. * headless/memless nodes.
  367. */
  368. for (cnode = 0; cnode < numionodes; cnode++) {
  369. hubdev_init_node(nodepdaindr[cnode], cnode);
  370. }
  371. }
  372. /**
  373. * sn_cpu_init - initialize per-cpu data areas
  374. * @cpuid: cpuid of the caller
  375. *
  376. * Called during cpu initialization on each cpu as it starts.
  377. * Currently, initializes the per-cpu data area for SNIA.
  378. * Also sets up a few fields in the nodepda. Also known as
  379. * platform_cpu_init() by the ia64 machvec code.
  380. */
  381. void __init sn_cpu_init(void)
  382. {
  383. int cpuid;
  384. int cpuphyid;
  385. int nasid;
  386. int subnode;
  387. int slice;
  388. int cnode;
  389. int i;
  390. static int wars_have_been_checked;
  391. memset(pda, 0, sizeof(pda));
  392. if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift,
  393. &sn_system_size, &sn_sharing_domain_size, &sn_partition_id,
  394. &sn_coherency_id, &sn_region_size))
  395. BUG();
  396. sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2;
  397. /*
  398. * The boot cpu makes this call again after platform initialization is
  399. * complete.
  400. */
  401. if (nodepdaindr[0] == NULL)
  402. return;
  403. cpuid = smp_processor_id();
  404. cpuphyid = get_sapicid();
  405. if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice))
  406. BUG();
  407. for (i=0; i < MAX_NUMNODES; i++) {
  408. if (nodepdaindr[i]) {
  409. nodepdaindr[i]->phys_cpuid[cpuid].nasid = nasid;
  410. nodepdaindr[i]->phys_cpuid[cpuid].slice = slice;
  411. nodepdaindr[i]->phys_cpuid[cpuid].subnode = subnode;
  412. }
  413. }
  414. cnode = nasid_to_cnodeid(nasid);
  415. pda->p_nodepda = nodepdaindr[cnode];
  416. pda->led_address =
  417. (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT));
  418. pda->led_state = LED_ALWAYS_SET;
  419. pda->hb_count = HZ / 2;
  420. pda->hb_state = 0;
  421. pda->idle_flag = 0;
  422. if (cpuid != 0) {
  423. memcpy(pda->cnodeid_to_nasid_table,
  424. pdacpu(0)->cnodeid_to_nasid_table,
  425. sizeof(pda->cnodeid_to_nasid_table));
  426. }
  427. /*
  428. * Check for WARs.
  429. * Only needs to be done once, on BSP.
  430. * Has to be done after loop above, because it uses pda.cnodeid_to_nasid_table[i].
  431. * Has to be done before assignment below.
  432. */
  433. if (!wars_have_been_checked) {
  434. sn_check_for_wars();
  435. wars_have_been_checked = 1;
  436. }
  437. sn_hub_info->shub_1_1_found = shub_1_1_found;
  438. /*
  439. * Set up addresses of PIO/MEM write status registers.
  440. */
  441. {
  442. u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0};
  443. u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1,
  444. SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3};
  445. u64 *pio;
  446. pio = is_shub1() ? pio1 : pio2;
  447. pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]);
  448. pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0;
  449. }
  450. /*
  451. * WAR addresses for SHUB 1.x.
  452. */
  453. if (local_node_data->active_cpu_count++ == 0 && is_shub1()) {
  454. int buddy_nasid;
  455. buddy_nasid =
  456. cnodeid_to_nasid(numa_node_id() ==
  457. num_online_nodes() - 1 ? 0 : numa_node_id() + 1);
  458. pda->pio_shub_war_cam_addr =
  459. (volatile unsigned long *)GLOBAL_MMR_ADDR(nasid,
  460. SH1_PI_CAM_CONTROL);
  461. }
  462. }
  463. /*
  464. * Scan klconfig for ionodes. Add the nasids to the
  465. * physical_node_map and the pda and increment numionodes.
  466. */
  467. static void __init scan_for_ionodes(void)
  468. {
  469. int nasid = 0;
  470. lboard_t *brd;
  471. /* Setup ionodes with memory */
  472. for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
  473. char *klgraph_header;
  474. cnodeid_t cnodeid;
  475. if (physical_node_map[nasid] == -1)
  476. continue;
  477. cnodeid = -1;
  478. klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid));
  479. if (!klgraph_header) {
  480. if (IS_RUNNING_ON_SIMULATOR())
  481. continue;
  482. BUG(); /* All nodes must have klconfig tables! */
  483. }
  484. cnodeid = nasid_to_cnodeid(nasid);
  485. root_lboard[cnodeid] = (lboard_t *)
  486. NODE_OFFSET_TO_LBOARD((nasid),
  487. ((kl_config_hdr_t
  488. *) (klgraph_header))->
  489. ch_board_info);
  490. }
  491. /* Scan headless/memless IO Nodes. */
  492. for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
  493. /* if there's no nasid, don't try to read the klconfig on the node */
  494. if (physical_node_map[nasid] == -1)
  495. continue;
  496. brd = find_lboard_any((lboard_t *)
  497. root_lboard[nasid_to_cnodeid(nasid)],
  498. KLTYPE_SNIA);
  499. if (brd) {
  500. brd = KLCF_NEXT_ANY(brd); /* Skip this node's lboard */
  501. if (!brd)
  502. continue;
  503. }
  504. brd = find_lboard_any(brd, KLTYPE_SNIA);
  505. while (brd) {
  506. pda->cnodeid_to_nasid_table[numionodes] =
  507. brd->brd_nasid;
  508. physical_node_map[brd->brd_nasid] = numionodes;
  509. root_lboard[numionodes] = brd;
  510. numionodes++;
  511. brd = KLCF_NEXT_ANY(brd);
  512. if (!brd)
  513. break;
  514. brd = find_lboard_any(brd, KLTYPE_SNIA);
  515. }
  516. }
  517. /* Scan for TIO nodes. */
  518. for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
  519. /* if there's no nasid, don't try to read the klconfig on the node */
  520. if (physical_node_map[nasid] == -1)
  521. continue;
  522. brd = find_lboard_any((lboard_t *)
  523. root_lboard[nasid_to_cnodeid(nasid)],
  524. KLTYPE_TIO);
  525. while (brd) {
  526. pda->cnodeid_to_nasid_table[numionodes] =
  527. brd->brd_nasid;
  528. physical_node_map[brd->brd_nasid] = numionodes;
  529. root_lboard[numionodes] = brd;
  530. numionodes++;
  531. brd = KLCF_NEXT_ANY(brd);
  532. if (!brd)
  533. break;
  534. brd = find_lboard_any(brd, KLTYPE_TIO);
  535. }
  536. }
  537. }
  538. int
  539. nasid_slice_to_cpuid(int nasid, int slice)
  540. {
  541. long cpu;
  542. for (cpu=0; cpu < NR_CPUS; cpu++)
  543. if (nodepda->phys_cpuid[cpu].nasid == nasid && nodepda->phys_cpuid[cpu].slice == slice)
  544. return cpu;
  545. return -1;
  546. }