mpparse.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. /*
  10. * Various Linux-internal data structures created from the
  11. * MP-table.
  12. */
  13. int apic_version [MAX_APICS];
  14. int pic_mode;
  15. unsigned long mp_lapic_addr;
  16. /* Processor that is doing the boot up */
  17. unsigned int boot_cpu_physical_apicid = -1U;
  18. /* Bitmask of physically existing CPUs */
  19. physid_mask_t phys_cpu_present_map;
  20. unsigned int __initdata maxcpus = NR_CPUS;
  21. /*
  22. * The Visual Workstation is Intel MP compliant in the hardware
  23. * sense, but it doesn't have a BIOS(-configuration table).
  24. * No problem for Linux.
  25. */
  26. static void __init MP_processor_info (struct mpc_config_processor *m)
  27. {
  28. int ver, logical_apicid;
  29. physid_mask_t apic_cpus;
  30. if (!(m->mpc_cpuflag & CPU_ENABLED))
  31. return;
  32. logical_apicid = m->mpc_apicid;
  33. printk(KERN_INFO "%sCPU #%d %ld:%ld APIC version %d\n",
  34. m->mpc_cpuflag & CPU_BOOTPROCESSOR ? "Bootup " : "",
  35. m->mpc_apicid,
  36. (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
  37. (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
  38. m->mpc_apicver);
  39. if (m->mpc_cpuflag & CPU_BOOTPROCESSOR)
  40. boot_cpu_physical_apicid = m->mpc_apicid;
  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. apic_cpus = apicid_to_cpu_present(m->mpc_apicid);
  48. physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
  49. /*
  50. * Validate version
  51. */
  52. if (ver == 0x0) {
  53. printk(KERN_ERR "BIOS bug, APIC version is 0 for CPU#%d! "
  54. "fixing up to 0x10. (tell your hw vendor)\n",
  55. m->mpc_apicid);
  56. ver = 0x10;
  57. }
  58. apic_version[m->mpc_apicid] = ver;
  59. }
  60. void __init find_smp_config(void)
  61. {
  62. struct mpc_config_processor *mp = phys_to_virt(CO_CPU_TAB_PHYS);
  63. 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);
  67. ncpus = CO_CPU_MAX;
  68. }
  69. if (ncpus > maxcpus)
  70. ncpus = maxcpus;
  71. smp_found_config = 1;
  72. while (ncpus--)
  73. MP_processor_info(mp++);
  74. mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
  75. }
  76. void __init get_smp_config (void)
  77. {
  78. }