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