x86: move smp_found_config
[linux-2.6/mini2440.git] / arch / x86 / mach-visws / mpparse.c
bloba2fb78c0d154ef19f1fbb58874840ae5bab8b5ca
2 #include <linux/init.h>
3 #include <linux/smp.h>
5 #include <asm/smp.h>
6 #include <asm/io.h>
8 #include "cobalt.h"
9 #include "mach_apic.h"
11 extern unsigned int __cpuinitdata maxcpus;
14 * The Visual Workstation is Intel MP compliant in the hardware
15 * sense, but it doesn't have a BIOS(-configuration table).
16 * No problem for Linux.
19 static void __init MP_processor_info (struct mpc_config_processor *m)
21 int ver, logical_apicid;
22 physid_mask_t apic_cpus;
24 if (!(m->mpc_cpuflag & CPU_ENABLED))
25 return;
27 logical_apicid = m->mpc_apicid;
28 printk(KERN_INFO "%sCPU #%d %u:%u APIC version %d\n",
29 m->mpc_cpuflag & CPU_BOOTPROCESSOR ? "Bootup " : "",
30 m->mpc_apicid,
31 (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
32 (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
33 m->mpc_apicver);
35 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR)
36 boot_cpu_physical_apicid = m->mpc_apicid;
38 ver = m->mpc_apicver;
39 if ((ver >= 0x14 && m->mpc_apicid >= 0xff) || m->mpc_apicid >= 0xf) {
40 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
41 m->mpc_apicid, MAX_APICS);
42 return;
45 apic_cpus = apicid_to_cpu_present(m->mpc_apicid);
46 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
48 * Validate version
50 if (ver == 0x0) {
51 printk(KERN_ERR "BIOS bug, APIC version is 0 for CPU#%d! "
52 "fixing up to 0x10. (tell your hw vendor)\n",
53 m->mpc_apicid);
54 ver = 0x10;
56 apic_version[m->mpc_apicid] = ver;
59 void __init find_smp_config(void)
61 struct mpc_config_processor *mp = phys_to_virt(CO_CPU_TAB_PHYS);
62 unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS));
64 if (ncpus > CO_CPU_MAX) {
65 printk(KERN_WARNING "find_visws_smp: got cpu count of %d at %p\n",
66 ncpus, mp);
68 ncpus = CO_CPU_MAX;
71 if (ncpus > maxcpus)
72 ncpus = maxcpus;
74 #ifdef CONFIG_X86_LOCAL_APIC
75 smp_found_config = 1;
76 #endif
77 while (ncpus--)
78 MP_processor_info(mp++);
80 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
83 void __init get_smp_config (void)