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