mpspec_def.h 4.22 KB
Newer Older
1 2
#ifndef _ASM_X86_MPSPEC_DEF_H
#define _ASM_X86_MPSPEC_DEF_H
Linus Torvalds's avatar
Linus Torvalds committed
3 4 5 6 7 8 9 10

/*
 * Structure definitions for SMP machines following the
 * Intel Multiprocessing Specification 1.1 and 1.4.
 */

/*
 * This tag identifies where the SMP configuration
Thomas Gleixner's avatar
Thomas Gleixner committed
11
 * information is.
Linus Torvalds's avatar
Linus Torvalds committed
12
 */
Thomas Gleixner's avatar
Thomas Gleixner committed
13

14
#define SMP_MAGIC_IDENT	(('_'<<24) | ('P'<<16) | ('M'<<8) | '_')
Linus Torvalds's avatar
Linus Torvalds committed
15

Thomas Gleixner's avatar
Thomas Gleixner committed
16 17 18 19
#ifdef CONFIG_X86_32
# define MAX_MPC_ENTRY 1024
# define MAX_APICS      256
#else
20 21 22 23 24
# if NR_CPUS <= 255
#  define MAX_APICS     255
# else
#  define MAX_APICS   32768
# endif
Thomas Gleixner's avatar
Thomas Gleixner committed
25
#endif
Linus Torvalds's avatar
Linus Torvalds committed
26

27
struct intel_mp_floating {
Thomas Gleixner's avatar
Thomas Gleixner committed
28 29
	char mpf_signature[4];		/* "_MP_"			*/
	unsigned int mpf_physptr;	/* Configuration table address	*/
Linus Torvalds's avatar
Linus Torvalds committed
30 31 32
	unsigned char mpf_length;	/* Our length (paragraphs)	*/
	unsigned char mpf_specification;/* Specification version	*/
	unsigned char mpf_checksum;	/* Checksum (makes sum 0)	*/
Thomas Gleixner's avatar
Thomas Gleixner committed
33
	unsigned char mpf_feature1;	/* Standard or configuration ?	*/
Linus Torvalds's avatar
Linus Torvalds committed
34 35 36 37 38 39
	unsigned char mpf_feature2;	/* Bit7 set for IMCR|PIC	*/
	unsigned char mpf_feature3;	/* Unused (0)			*/
	unsigned char mpf_feature4;	/* Unused (0)			*/
	unsigned char mpf_feature5;	/* Unused (0)			*/
};

Thomas Gleixner's avatar
Thomas Gleixner committed
40 41
#define MPC_SIGNATURE "PCMP"

42
struct mpc_table {
Linus Torvalds's avatar
Linus Torvalds committed
43 44
	char mpc_signature[4];
	unsigned short mpc_length;	/* Size of table */
45 46 47 48
	char mpc_spec;			/* 0x01 */
	char mpc_checksum;
	char mpc_oem[8];
	char mpc_productid[12];
Thomas Gleixner's avatar
Thomas Gleixner committed
49
	unsigned int mpc_oemptr;	/* 0 if not present */
Linus Torvalds's avatar
Linus Torvalds committed
50 51
	unsigned short mpc_oemsize;	/* 0 if not present */
	unsigned short mpc_oemcount;
Thomas Gleixner's avatar
Thomas Gleixner committed
52 53
	unsigned int mpc_lapic;	/* APIC address */
	unsigned int reserved;
Linus Torvalds's avatar
Linus Torvalds committed
54 55 56 57
};

/* Followed by entries */

Thomas Gleixner's avatar
Thomas Gleixner committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71
#define	MP_PROCESSOR		0
#define	MP_BUS			1
#define	MP_IOAPIC		2
#define	MP_INTSRC		3
#define	MP_LINTSRC		4
/* Used by IBM NUMA-Q to describe node locality */
#define	MP_TRANSLATION		192

#define CPU_ENABLED		1	/* Processor is available */
#define CPU_BOOTPROCESSOR	2	/* Processor is the BP */

#define CPU_STEPPING_MASK	0x000F
#define CPU_MODEL_MASK		0x00F0
#define CPU_FAMILY_MASK		0x0F00
Linus Torvalds's avatar
Linus Torvalds committed
72

73
struct mpc_config_processor {
Linus Torvalds's avatar
Linus Torvalds committed
74 75 76 77
	unsigned char mpc_type;
	unsigned char mpc_apicid;	/* Local APIC number */
	unsigned char mpc_apicver;	/* Its versions */
	unsigned char mpc_cpuflag;
Thomas Gleixner's avatar
Thomas Gleixner committed
78 79 80
	unsigned int mpc_cpufeature;
	unsigned int mpc_featureflag;	/* CPUID feature value */
	unsigned int mpc_reserved[2];
Linus Torvalds's avatar
Linus Torvalds committed
81 82
};

83
struct mpc_config_bus {
Linus Torvalds's avatar
Linus Torvalds committed
84 85
	unsigned char mpc_type;
	unsigned char mpc_busid;
86
	unsigned char mpc_bustype[6];
Linus Torvalds's avatar
Linus Torvalds committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
};

/* List of Bus Type string values, Intel MP Spec. */
#define BUSTYPE_EISA	"EISA"
#define BUSTYPE_ISA	"ISA"
#define BUSTYPE_INTERN	"INTERN"	/* Internal BUS */
#define BUSTYPE_MCA	"MCA"
#define BUSTYPE_VL	"VL"		/* Local bus */
#define BUSTYPE_PCI	"PCI"
#define BUSTYPE_PCMCIA	"PCMCIA"
#define BUSTYPE_CBUS	"CBUS"
#define BUSTYPE_CBUSII	"CBUSII"
#define BUSTYPE_FUTURE	"FUTURE"
#define BUSTYPE_MBI	"MBI"
#define BUSTYPE_MBII	"MBII"
#define BUSTYPE_MPI	"MPI"
#define BUSTYPE_MPSA	"MPSA"
#define BUSTYPE_NUBUS	"NUBUS"
#define BUSTYPE_TC	"TC"
#define BUSTYPE_VME	"VME"
#define BUSTYPE_XPRESS	"XPRESS"

Thomas Gleixner's avatar
Thomas Gleixner committed
109 110
#define MPC_APIC_USABLE		0x01

111
struct mpc_config_ioapic {
Linus Torvalds's avatar
Linus Torvalds committed
112 113 114 115
	unsigned char mpc_type;
	unsigned char mpc_apicid;
	unsigned char mpc_apicver;
	unsigned char mpc_flags;
Thomas Gleixner's avatar
Thomas Gleixner committed
116
	unsigned int mpc_apicaddr;
Linus Torvalds's avatar
Linus Torvalds committed
117 118
};

119
struct mpc_config_intsrc {
Linus Torvalds's avatar
Linus Torvalds committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
	unsigned char mpc_type;
	unsigned char mpc_irqtype;
	unsigned short mpc_irqflag;
	unsigned char mpc_srcbus;
	unsigned char mpc_srcbusirq;
	unsigned char mpc_dstapic;
	unsigned char mpc_dstirq;
};

enum mp_irq_source_types {
	mp_INT = 0,
	mp_NMI = 1,
	mp_SMI = 2,
	mp_ExtINT = 3
};

#define MP_IRQDIR_DEFAULT	0
#define MP_IRQDIR_HIGH		1
#define MP_IRQDIR_LOW		3

Thomas Gleixner's avatar
Thomas Gleixner committed
140
#define MP_APIC_ALL	0xFF
Linus Torvalds's avatar
Linus Torvalds committed
141

142
struct mpc_config_lintsrc {
Linus Torvalds's avatar
Linus Torvalds committed
143 144 145 146 147
	unsigned char mpc_type;
	unsigned char mpc_irqtype;
	unsigned short mpc_irqflag;
	unsigned char mpc_srcbusid;
	unsigned char mpc_srcbusirq;
Thomas Gleixner's avatar
Thomas Gleixner committed
148
	unsigned char mpc_destapic;
Linus Torvalds's avatar
Linus Torvalds committed
149 150 151
	unsigned char mpc_destapiclint;
};

Thomas Gleixner's avatar
Thomas Gleixner committed
152 153
#define MPC_OEM_SIGNATURE "_OEM"

154
struct mp_config_oemtable {
Linus Torvalds's avatar
Linus Torvalds committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
	char oem_signature[4];
	unsigned short oem_length;	/* Size of table */
	char  oem_rev;			/* 0x01 */
	char  oem_checksum;
	char  mpc_oem[8];
};

/*
 *	Default configurations
 *
 *	1	2 CPU ISA 82489DX
 *	2	2 CPU EISA 82489DX neither IRQ 0 timer nor IRQ 13 DMA chaining
 *	3	2 CPU EISA 82489DX
 *	4	2 CPU MCA 82489DX
 *	5	2 CPU ISA+PCI
 *	6	2 CPU EISA+PCI
 *	7	2 CPU MCA+PCI
 */

enum mp_bustype {
	MP_BUS_ISA = 1,
	MP_BUS_EISA,
	MP_BUS_PCI,
	MP_BUS_MCA,
};
180
#endif /* _ASM_X86_MPSPEC_DEF_H */