mpparse.c 2.0 KB

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