mpspec_def.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. #ifndef ASM_X86__MPSPEC_DEF_H
  2. #define ASM_X86__MPSPEC_DEF_H
  3. /*
  4. * Structure definitions for SMP machines following the
  5. * Intel Multiprocessing Specification 1.1 and 1.4.
  6. */
  7. /*
  8. * This tag identifies where the SMP configuration
  9. * information is.
  10. */
  11. #define SMP_MAGIC_IDENT (('_'<<24) | ('P'<<16) | ('M'<<8) | '_')
  12. #ifdef CONFIG_X86_32
  13. # define MAX_MPC_ENTRY 1024
  14. # define MAX_APICS 256
  15. #else
  16. # if NR_CPUS <= 255
  17. # define MAX_APICS 255
  18. # else
  19. # define MAX_APICS 32768
  20. # endif
  21. #endif
  22. struct intel_mp_floating {
  23. char mpf_signature[4]; /* "_MP_" */
  24. unsigned int mpf_physptr; /* Configuration table address */
  25. unsigned char mpf_length; /* Our length (paragraphs) */
  26. unsigned char mpf_specification;/* Specification version */
  27. unsigned char mpf_checksum; /* Checksum (makes sum 0) */
  28. unsigned char mpf_feature1; /* Standard or configuration ? */
  29. unsigned char mpf_feature2; /* Bit7 set for IMCR|PIC */
  30. unsigned char mpf_feature3; /* Unused (0) */
  31. unsigned char mpf_feature4; /* Unused (0) */
  32. unsigned char mpf_feature5; /* Unused (0) */
  33. };
  34. #define MPC_SIGNATURE "PCMP"
  35. struct mp_config_table {
  36. char mpc_signature[4];
  37. unsigned short mpc_length; /* Size of table */
  38. char mpc_spec; /* 0x01 */
  39. char mpc_checksum;
  40. char mpc_oem[8];
  41. char mpc_productid[12];
  42. unsigned int mpc_oemptr; /* 0 if not present */
  43. unsigned short mpc_oemsize; /* 0 if not present */
  44. unsigned short mpc_oemcount;
  45. unsigned int mpc_lapic; /* APIC address */
  46. unsigned int reserved;
  47. };
  48. /* Followed by entries */
  49. #define MP_PROCESSOR 0
  50. #define MP_BUS 1
  51. #define MP_IOAPIC 2
  52. #define MP_INTSRC 3
  53. #define MP_LINTSRC 4
  54. /* Used by IBM NUMA-Q to describe node locality */
  55. #define MP_TRANSLATION 192
  56. #define CPU_ENABLED 1 /* Processor is available */
  57. #define CPU_BOOTPROCESSOR 2 /* Processor is the BP */
  58. #define CPU_STEPPING_MASK 0x000F
  59. #define CPU_MODEL_MASK 0x00F0
  60. #define CPU_FAMILY_MASK 0x0F00
  61. struct mpc_config_processor {
  62. unsigned char mpc_type;
  63. unsigned char mpc_apicid; /* Local APIC number */
  64. unsigned char mpc_apicver; /* Its versions */
  65. unsigned char mpc_cpuflag;
  66. unsigned int mpc_cpufeature;
  67. unsigned int mpc_featureflag; /* CPUID feature value */
  68. unsigned int mpc_reserved[2];
  69. };
  70. struct mpc_config_bus {
  71. unsigned char mpc_type;
  72. unsigned char mpc_busid;
  73. unsigned char mpc_bustype[6];
  74. };
  75. /* List of Bus Type string values, Intel MP Spec. */
  76. #define BUSTYPE_EISA "EISA"
  77. #define BUSTYPE_ISA "ISA"
  78. #define BUSTYPE_INTERN "INTERN" /* Internal BUS */
  79. #define BUSTYPE_MCA "MCA"
  80. #define BUSTYPE_VL "VL" /* Local bus */
  81. #define BUSTYPE_PCI "PCI"
  82. #define BUSTYPE_PCMCIA "PCMCIA"
  83. #define BUSTYPE_CBUS "CBUS"
  84. #define BUSTYPE_CBUSII "CBUSII"
  85. #define BUSTYPE_FUTURE "FUTURE"
  86. #define BUSTYPE_MBI "MBI"
  87. #define BUSTYPE_MBII "MBII"
  88. #define BUSTYPE_MPI "MPI"
  89. #define BUSTYPE_MPSA "MPSA"
  90. #define BUSTYPE_NUBUS "NUBUS"
  91. #define BUSTYPE_TC "TC"
  92. #define BUSTYPE_VME "VME"
  93. #define BUSTYPE_XPRESS "XPRESS"
  94. #define MPC_APIC_USABLE 0x01
  95. struct mpc_config_ioapic {
  96. unsigned char mpc_type;
  97. unsigned char mpc_apicid;
  98. unsigned char mpc_apicver;
  99. unsigned char mpc_flags;
  100. unsigned int mpc_apicaddr;
  101. };
  102. struct mpc_config_intsrc {
  103. unsigned char mpc_type;
  104. unsigned char mpc_irqtype;
  105. unsigned short mpc_irqflag;
  106. unsigned char mpc_srcbus;
  107. unsigned char mpc_srcbusirq;
  108. unsigned char mpc_dstapic;
  109. unsigned char mpc_dstirq;
  110. };
  111. enum mp_irq_source_types {
  112. mp_INT = 0,
  113. mp_NMI = 1,
  114. mp_SMI = 2,
  115. mp_ExtINT = 3
  116. };
  117. #define MP_IRQDIR_DEFAULT 0
  118. #define MP_IRQDIR_HIGH 1
  119. #define MP_IRQDIR_LOW 3
  120. #define MP_APIC_ALL 0xFF
  121. struct mpc_config_lintsrc {
  122. unsigned char mpc_type;
  123. unsigned char mpc_irqtype;
  124. unsigned short mpc_irqflag;
  125. unsigned char mpc_srcbusid;
  126. unsigned char mpc_srcbusirq;
  127. unsigned char mpc_destapic;
  128. unsigned char mpc_destapiclint;
  129. };
  130. #define MPC_OEM_SIGNATURE "_OEM"
  131. struct mp_config_oemtable {
  132. char oem_signature[4];
  133. unsigned short oem_length; /* Size of table */
  134. char oem_rev; /* 0x01 */
  135. char oem_checksum;
  136. char mpc_oem[8];
  137. };
  138. /*
  139. * Default configurations
  140. *
  141. * 1 2 CPU ISA 82489DX
  142. * 2 2 CPU EISA 82489DX neither IRQ 0 timer nor IRQ 13 DMA chaining
  143. * 3 2 CPU EISA 82489DX
  144. * 4 2 CPU MCA 82489DX
  145. * 5 2 CPU ISA+PCI
  146. * 6 2 CPU EISA+PCI
  147. * 7 2 CPU MCA+PCI
  148. */
  149. enum mp_bustype {
  150. MP_BUS_ISA = 1,
  151. MP_BUS_EISA,
  152. MP_BUS_PCI,
  153. MP_BUS_MCA,
  154. };
  155. #endif /* ASM_X86__MPSPEC_DEF_H */