mpparse.c 1.9 KB

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