mpspec_def.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_MPSPEC_DEF_H
  3. #define _ASM_X86_MPSPEC_DEF_H
  4. /*
  5. * Structure definitions for SMP machines following the
  6. * Intel Multiprocessing Specification 1.1 and 1.4.
  7. */
  8. /*
  9. * This tag identifies where the SMP configuration
  10. * information is.
  11. */
  12. #define SMP_MAGIC_IDENT (('_'<<24) | ('P'<<16) | ('M'<<8) | '_')
  13. #ifdef CONFIG_X86_32
  14. # define MAX_MPC_ENTRY 1024
  15. #endif
  16. /* Intel MP Floating Pointer Structure */
  17. struct mpf_intel {
  18. char signature[4]; /* "_MP_" */
  19. unsigned int physptr; /* Configuration table address */
  20. unsigned char length; /* Our length (paragraphs) */
  21. unsigned char specification; /* Specification version */
  22. unsigned char checksum; /* Checksum (makes sum 0) */
  23. unsigned char feature1; /* Standard or configuration ? */
  24. unsigned char feature2; /* Bit7 set for IMCR|PIC */
  25. unsigned char feature3; /* Unused (0) */
  26. unsigned char feature4; /* Unused (0) */
  27. unsigned char feature5; /* Unused (0) */
  28. };
  29. #define MPC_SIGNATURE "PCMP"
  30. struct mpc_table {
  31. char signature[4];
  32. unsigned short length; /* Size of table */
  33. char spec; /* 0x01 */
  34. char checksum;
  35. char oem[8];
  36. char productid[12];
  37. unsigned int oemptr; /* 0 if not present */
  38. unsigned short oemsize; /* 0 if not present */
  39. unsigned short oemcount;
  40. unsigned int lapic; /* APIC address */
  41. unsigned int reserved;
  42. };
  43. /* Followed by entries */
  44. #define MP_PROCESSOR 0
  45. #define MP_BUS 1
  46. #define MP_IOAPIC 2
  47. #define MP_INTSRC 3
  48. #define MP_LINTSRC 4
  49. /* Used by IBM NUMA-Q to describe node locality */
  50. #define MP_TRANSLATION 192
  51. #define CPU_ENABLED 1 /* Processor is available */
  52. #define CPU_BOOTPROCESSOR 2 /* Processor is the boot CPU */
  53. #define CPU_STEPPING_MASK 0x000F
  54. #define CPU_MODEL_MASK 0x00F0
  55. #define CPU_FAMILY_MASK 0x0F00
  56. struct mpc_cpu {
  57. unsigned char type;
  58. unsigned char apicid; /* Local APIC number */
  59. unsigned char apicver; /* Its versions */
  60. unsigned char cpuflag;
  61. unsigned int cpufeature;
  62. unsigned int featureflag; /* CPUID feature value */
  63. unsigned int reserved[2];
  64. };
  65. struct mpc_bus {
  66. unsigned char type;
  67. unsigned char busid;
  68. unsigned char bustype[6];
  69. };
  70. /* List of Bus Type string values, Intel MP Spec. */
  71. #define BUSTYPE_EISA "EISA"
  72. #define BUSTYPE_ISA "ISA"
  73. #define BUSTYPE_INTERN "INTERN" /* Internal BUS */
  74. #define BUSTYPE_MCA "MCA" /* Obsolete */
  75. #define BUSTYPE_VL "VL" /* Local bus */
  76. #define BUSTYPE_PCI "PCI"
  77. #define BUSTYPE_PCMCIA "PCMCIA"
  78. #define BUSTYPE_CBUS "CBUS"
  79. #define BUSTYPE_CBUSII "CBUSII"
  80. #define BUSTYPE_FUTURE "FUTURE"
  81. #define BUSTYPE_MBI "MBI"
  82. #define BUSTYPE_MBII "MBII"
  83. #define BUSTYPE_MPI "MPI"
  84. #define BUSTYPE_MPSA "MPSA"
  85. #define BUSTYPE_NUBUS "NUBUS"
  86. #define BUSTYPE_TC "TC"
  87. #define BUSTYPE_VME "VME"
  88. #define BUSTYPE_XPRESS "XPRESS"
  89. #define MPC_APIC_USABLE 0x01
  90. struct mpc_ioapic {
  91. unsigned char type;
  92. unsigned char apicid;
  93. unsigned char apicver;
  94. unsigned char flags;
  95. unsigned int apicaddr;
  96. };
  97. struct mpc_intsrc {
  98. unsigned char type;
  99. unsigned char irqtype;
  100. unsigned short irqflag;
  101. unsigned char srcbus;
  102. unsigned char srcbusirq;
  103. unsigned char dstapic;
  104. unsigned char dstirq;
  105. };
  106. enum mp_irq_source_types {
  107. mp_INT = 0,
  108. mp_NMI = 1,
  109. mp_SMI = 2,
  110. mp_ExtINT = 3
  111. };
  112. #define MP_IRQPOL_DEFAULT 0x0
  113. #define MP_IRQPOL_ACTIVE_HIGH 0x1
  114. #define MP_IRQPOL_RESERVED 0x2
  115. #define MP_IRQPOL_ACTIVE_LOW 0x3
  116. #define MP_IRQPOL_MASK 0x3
  117. #define MP_IRQTRIG_DEFAULT 0x0
  118. #define MP_IRQTRIG_EDGE 0x4
  119. #define MP_IRQTRIG_RESERVED 0x8
  120. #define MP_IRQTRIG_LEVEL 0xc
  121. #define MP_IRQTRIG_MASK 0xc
  122. #define MP_APIC_ALL 0xFF
  123. struct mpc_lintsrc {
  124. unsigned char type;
  125. unsigned char irqtype;
  126. unsigned short irqflag;
  127. unsigned char srcbusid;
  128. unsigned char srcbusirq;
  129. unsigned char destapic;
  130. unsigned char destapiclint;
  131. };
  132. #define MPC_OEM_SIGNATURE "_OEM"
  133. struct mpc_oemtable {
  134. char signature[4];
  135. unsigned short length; /* Size of table */
  136. char rev; /* 0x01 */
  137. char checksum;
  138. char mpc[8];
  139. };
  140. /*
  141. * Default configurations
  142. *
  143. * 1 2 CPU ISA 82489DX
  144. * 2 2 CPU EISA 82489DX neither IRQ 0 timer nor IRQ 13 DMA chaining
  145. * 3 2 CPU EISA 82489DX
  146. * 4 2 CPU MCA 82489DX
  147. * 5 2 CPU ISA+PCI
  148. * 6 2 CPU EISA+PCI
  149. * 7 2 CPU MCA+PCI
  150. */
  151. enum mp_bustype {
  152. MP_BUS_ISA = 1,
  153. MP_BUS_EISA,
  154. MP_BUS_PCI,
  155. };
  156. #endif /* _ASM_X86_MPSPEC_DEF_H */