summaryrefslogtreecommitdiff
path: root/Include/ACPI.H
blob: d24b089fa2c058416ef51ef39892762aa7827a75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#ifndef  _ACPI_H   //To Avoid this header get compiled twice
#define  _ACPI_H


#include	<Efi.h>
#include    <Token.h>

//---------------------------------------------------------------------------
#pragma	pack(1)

#define APIC_SIG 0x43495041  //"APIC"Multiple APIC Description Table

#define SPIC_SIG 0x43495053  //"SPIC"Multiple SAPIC Description Table

#define BOOT_SIG 0x544F4F42  //"BOOT"MS Simple Boot Spec

#define DBGP_SIG 0x50474244  //"DBGP" MS Bebug Port Spec

#define DSDT_SIG 0x54445344  //"DSDT" Differentiated System Description Table

#define ECDT_SIG 0x54444345	//"ECDT" Embedded Controller Boot Resources Table

#define ETDT_SIG 0x54445445	//"ETDT" Event Timer Description Table

#define FACP_SIG 0x50434146  //"FACP" Fixed ACPI Description Table (FADT)

#define FACS_SIG 0x53434146  //"FACS" //Firmware ACPI Control Structure

#define PSDT_SIG 0x54445350  //"PSDT"Persistent System Description Table

#define RSDT_SIG 0x54445352  //"RSDT"Root System Description Table

#define SBST_SIG 0x54534253  //"SBST"Smart Battery Specification Table

#define SLIT_SIG 0x54494C53  //"SLIT"System Locality Information Table

#define SPCR_SIG 0x52435053  //"SPCR"Serial Port Concole Redirection Table

#define SRAT_SIG 0x54415253  //"SBST"Static Resource Affinity Table

#define SSDT_SIG 0x54445353  //"SSDT"Secondary System Description Table

#define SPMI_SIG 0x494D5053  //"SPMI"Server Platform Management Interface Table

#define XSDT_SIG 0x54445358  //"XSDT" eXtended System Description Table

#define RSDP_SIG 0x2052545020445352 //"RSD PTR "

//======================================================
//  ACPI Description Headers Signatures
//======================================================
#define MCFG_SIG 0x4746434D  //PCI Express Congiguration Table

#define	HPET_SIG 0x54455048

//for testing purposes only
#define IPPT_SIG 0x54505049 // "IPPT" --  IA64 Platform Properties Table

//======================================================
//  RSDT Pointer structure for IA32
//======================================================
typedef struct _RSDT_PTR_20{
    UINT64		    Signature;	//should contain trailing space
    UINT8			Checksum;   //Only First 20 bytes for future compatability 
    UINT8			OEMID[6];
    UINT8			Revision;	//Now Revision ID was reserved in ACPI 1.1 
							//should be 0  for ACPI 1.0 or 2 for ACPI 2.0
    UINT32		    RsdtAddr;	//32 bit RSDT Address for future compatability
	// Here follows additional part that couldn't be met in ACPI 1.1 
	UINT32			Length;		//Length of the table in bytes including header;
	UINT64			XsdtAddr;	
	UINT8			XtdChecksum;//Checksum of entire table
	UINT8			Reserved[3];
} RSDT_PTR_20,*PRSDT_PTR_20;

//======================================================
//  ACPI Tables header structure  for IA32
//======================================================
typedef struct _ACPI_HDR {
    UINT32      Signature;
    UINT32      Length;
    UINT8       Revision;
    UINT8       Checksum;
    UINT8       OemId[6]; 
    UINT8       OemTblId[8];
    UINT32      OemRev;
    UINT32      CreatorId;
    UINT32      CreatorRev;
} ACPI_HDR,*PACPI_HDR;

//======================================================
//  Bits Description in FACP.FLAGS field. IA32&IA64
//======================================================
#define         FF_WBINVD				0x00000001
#define         FF_WBINVD_FLUSH 0x00000002     
#define         FF_PROC_C1      0x00000004
#define         FF_LVL2_UP      0x00000008
#define         FF_PWR_BUTTON   0x00000010
#define         FF_SLP_BUTTON   0x00000020
#define         FF_FIX_RTC      0x00000040
#define         FF_RTC_S4       0x00000080
#define         FF_TMR_VAL_EXT  0x00000100
#define         FF_DCK_CAP      0x00000200

//======================================================
//  RSDT Root System Description Table for IA32
//======================================================
#ifndef ACPI_RSDT_TABLE_NUM
#define ACPI_RSDT_TABLE_NUM	0x10
#endif

typedef	struct _RSDT32 {
	ACPI_HDR	Header;
	UINT32		Ptrs[ACPI_RSDT_TABLE_NUM];
} RSDT32, *PRSDT32, RSDT_20, *PRSDT_20;

//======================================================
//  APIC Multiple APIC Description Table Header IA32
//======================================================
typedef	struct _APIC32H {
	ACPI_HDR	Header;				//0..35
	UINT32		LAPIC_Address;		//36
	UINT32		Flags;				//40
} APIC32H,*PAPIC32H,APIC_20H,*PAPIC_20H;

//======================================================
//  Bits Description in APIC32H.Flags field. IA32
//======================================================
#define	PCAT_COMPAT		0x00000001

//======================================================
//  Bits Description in APICXX.Type field. IA32&64
//======================================================
#define	CpuLapic		0
#define	IoApic			1
//For IA32 following is reserved
#define	IntSrcOvrd		2
#define	IntSrcPlat		3
//For IA64 >4 reserved


//======================================================
//  LAPIC Structure per each CPU  IA32
//======================================================
typedef	struct _LAPIC32 {
	UINT8		Type;				//0
	UINT8		Length;				//1
	UINT8		CpuId;
	UINT8		LapicId;
	UINT32	Flags;
} LAPIC32,*PLAPIC32, LAPIC_20,*PLAPIC_20;

//======================================================
//  IOAPIC Structure per each CPU  IA32
//======================================================
typedef	struct _IOAPIC32 {
	UINT8		Type;				//0
	UINT8		Length;				//1
	UINT8		IoapicId;			//2
	UINT8		Reserved;			//3
	UINT32	IoapicAddress;		//4
	UINT32	SysVectBase;		//8
} IOAPIC32,*PIOAPIC32, IOAPIC_20,*PIOAPIC_20;

//======================================================
//  ISO Interrupt Source Override Structure IA32
//======================================================
//  Should be present per each ISA Interrupt which
//  is not identity-mapped into SAPIC Interrupt space
//======================================================
typedef	struct _ISO32 {
	UINT8		Type;				//0
	UINT8		Length;				//1
	UINT8		Bus;				//2
	UINT8		Source;				//3
	UINT32	GlobalSysVect;		//4
	UINT16	Flags;				//8

} ISO32,*PISO32, ISO_20,*PISO_20;

//======================================================
//  SBDT Smart Battery Description Table IA32
//======================================================
typedef struct _SBDT32 {
	ACPI_HDR	Header;
	UINT32		WarningLvl;
	UINT32		LowLvl;
	UINT32		CriticalLvl;
} SBDT32,*PSBDT32, SBDT_20,*PSBDT_20;

//======================================================
//  Here Follows Definitions that are not Chipset specific
//======================================================

#define CREATOR_ID_MS 0x5446534D  //"TFSM""MSFT"(Microsoft)

#define	CREATOR_REV_MS 0x00010013

#define CREATOR_ID_AMI 0x20494D41  //" IMA""AMI "(AMI)

#define	CREATOR_REV	0x00000000

//==========================================================
// Define  APIC IO Interrupt Assignment INT_FLAGS
//==========================================================
#define IF_PO_HIG	0x1

#define IF_PO_LOW	0x3

#define IF_EL_EDG	0x4

#define IF_EL_LVL	0xC

#pragma	pack()

#endif 

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2005, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             6145-F Northbelt Pkwy, Norcross, GA 30071            **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************