mpparse.c 2.0 KB

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