]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi10.h
dbd61a2e401779216b86a3cfe8ab3465c4eedd3d
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Acpi10.h
1 /** @file
2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
3
4 Copyright (c) 2006 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 **/
13
14 #ifndef _ACPI_1_0_H_
15 #define _ACPI_1_0_H_
16
17 ///
18 /// Common table header, this prefaces all ACPI tables, including FACS, but
19 /// excluding the RSD PTR structure
20 ///
21 typedef struct {
22 UINT32 Signature;
23 UINT32 Length;
24 } EFI_ACPI_COMMON_HEADER;
25
26 #pragma pack(1)
27 ///
28 /// Common ACPI description table header. This structure prefaces most ACPI tables.
29 ///
30 typedef struct {
31 UINT32 Signature;
32 UINT32 Length;
33 UINT8 Revision;
34 UINT8 Checksum;
35 UINT8 OemId[6];
36 UINT64 OemTableId;
37 UINT32 OemRevision;
38 UINT32 CreatorId;
39 UINT32 CreatorRevision;
40 } EFI_ACPI_DESCRIPTION_HEADER;
41 #pragma pack()
42
43 //
44 // Define for Desriptor
45 //
46 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
47 #define ACPI_END_TAG_DESCRIPTOR 0x79
48
49 //
50 // Resource Type
51 //
52 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
53 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
54 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
55
56 ///
57 /// Power Management Timer frequency is fixed at 3.579545MHz
58 ///
59 #define ACPI_TIMER_FREQUENCY 3579545
60
61 //
62 // Ensure proper structure formats
63 //
64 #pragma pack(1)
65
66 ///
67 /// The commond definition of QWORD, DWORD, and WORD
68 /// Address Space Descriptors
69 ///
70 typedef struct {
71 UINT8 Desc;
72 UINT16 Len;
73 UINT8 ResType;
74 UINT8 GenFlag;
75 UINT8 SpecificFlag;
76 UINT64 AddrSpaceGranularity;
77 UINT64 AddrRangeMin;
78 UINT64 AddrRangeMax;
79 UINT64 AddrTranslationOffset;
80 UINT64 AddrLen;
81 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
82
83 #pragma pack()
84
85 typedef struct {
86 UINT8 Desc;
87 UINT8 Checksum;
88 } EFI_ACPI_END_TAG_DESCRIPTOR;
89
90 //
91 // General use definitions
92 //
93 #define EFI_ACPI_RESERVED_BYTE 0x00
94 #define EFI_ACPI_RESERVED_WORD 0x0000
95 #define EFI_ACPI_RESERVED_DWORD 0x00000000
96 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
97
98 //
99 // Resource Type Specific Flags
100 // Ref ACPI specification 6.4.3.5.5
101 //
102 // Bit [0] : Write Status, _RW
103 //
104 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
105 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
106 //
107 // Bit [2:1] : Memory Attributes, _MEM
108 //
109 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
110 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
111 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
112 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
113 //
114 // Bit [4:3] : Memory Attributes, _MTP
115 //
116 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
117 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
118 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
119 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
120 //
121 // Bit [5] : Memory to I/O Translation, _TTP
122 //
123 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
124 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
125
126 //
127 // ACPI 1.0b table structures
128 //
129
130 ///
131 /// Root System Description Pointer Structure
132 ///
133 typedef struct {
134 UINT64 Signature;
135 UINT8 Checksum;
136 UINT8 OemId[6];
137 UINT8 Reserved;
138 UINT32 RsdtAddress;
139 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
140
141 //
142 // Root System Description Table
143 // No definition needed as it is a common description table header, the same with
144 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
145 //
146
147 ///
148 /// RSDT Revision (as defined in ACPI 1.0b spec.)
149 ///
150 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
151
152 ///
153 /// Fixed ACPI Description Table Structure (FADT)
154 ///
155 typedef struct {
156 EFI_ACPI_DESCRIPTION_HEADER Header;
157 UINT32 FirmwareCtrl;
158 UINT32 Dsdt;
159 UINT8 IntModel;
160 UINT8 Reserved1;
161 UINT16 SciInt;
162 UINT32 SmiCmd;
163 UINT8 AcpiEnable;
164 UINT8 AcpiDisable;
165 UINT8 S4BiosReq;
166 UINT8 Reserved2;
167 UINT32 Pm1aEvtBlk;
168 UINT32 Pm1bEvtBlk;
169 UINT32 Pm1aCntBlk;
170 UINT32 Pm1bCntBlk;
171 UINT32 Pm2CntBlk;
172 UINT32 PmTmrBlk;
173 UINT32 Gpe0Blk;
174 UINT32 Gpe1Blk;
175 UINT8 Pm1EvtLen;
176 UINT8 Pm1CntLen;
177 UINT8 Pm2CntLen;
178 UINT8 PmTmLen;
179 UINT8 Gpe0BlkLen;
180 UINT8 Gpe1BlkLen;
181 UINT8 Gpe1Base;
182 UINT8 Reserved3;
183 UINT16 PLvl2Lat;
184 UINT16 PLvl3Lat;
185 UINT16 FlushSize;
186 UINT16 FlushStride;
187 UINT8 DutyOffset;
188 UINT8 DutyWidth;
189 UINT8 DayAlrm;
190 UINT8 MonAlrm;
191 UINT8 Century;
192 UINT8 Reserved4;
193 UINT8 Reserved5;
194 UINT8 Reserved6;
195 UINT32 Flags;
196 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
197
198 ///
199 /// FADT Version (as defined in ACPI 1.0b spec.)
200 ///
201 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
202
203 //
204 // Fixed ACPI Description Table Fixed Feature Flags
205 // All other bits are reserved and must be set to 0.
206 //
207 #define EFI_ACPI_1_0_WBINVD BIT0
208 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
209 #define EFI_ACPI_1_0_PROC_C1 BIT2
210 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
211 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
212 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
213 #define EFI_ACPI_1_0_FIX_RTC BIT6
214 #define EFI_ACPI_1_0_RTC_S4 BIT7
215 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
216 #define EFI_ACPI_1_0_DCK_CAP BIT9
217
218 ///
219 /// Firmware ACPI Control Structure
220 ///
221 typedef struct {
222 UINT32 Signature;
223 UINT32 Length;
224 UINT32 HardwareSignature;
225 UINT32 FirmwareWakingVector;
226 UINT32 GlobalLock;
227 UINT32 Flags;
228 UINT8 Reserved[40];
229 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
230
231 ///
232 /// Firmware Control Structure Feature Flags
233 /// All other bits are reserved and must be set to 0.
234 ///
235 #define EFI_ACPI_1_0_S4BIOS_F BIT0
236
237 ///
238 /// Multiple APIC Description Table header definition. The rest of the table
239 /// must be defined in a platform specific manner.
240 ///
241 typedef struct {
242 EFI_ACPI_DESCRIPTION_HEADER Header;
243 UINT32 LocalApicAddress;
244 UINT32 Flags;
245 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
246
247 ///
248 /// MADT Revision (as defined in ACPI 1.0b spec.)
249 ///
250 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
251
252 ///
253 /// Multiple APIC Flags
254 /// All other bits are reserved and must be set to 0.
255 ///
256 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
257
258 //
259 // Multiple APIC Description Table APIC structure types
260 // All other values between 0x05 an 0xFF are reserved and
261 // will be ignored by OSPM.
262 //
263 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
264 #define EFI_ACPI_1_0_IO_APIC 0x01
265 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
266 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
267 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
268
269 //
270 // APIC Structure Definitions
271 //
272
273 ///
274 /// Processor Local APIC Structure Definition
275 ///
276 typedef struct {
277 UINT8 Type;
278 UINT8 Length;
279 UINT8 AcpiProcessorId;
280 UINT8 ApicId;
281 UINT32 Flags;
282 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
283
284 ///
285 /// Local APIC Flags. All other bits are reserved and must be 0.
286 ///
287 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
288
289 ///
290 /// IO APIC Structure
291 ///
292 typedef struct {
293 UINT8 Type;
294 UINT8 Length;
295 UINT8 IoApicId;
296 UINT8 Reserved;
297 UINT32 IoApicAddress;
298 UINT32 SystemVectorBase;
299 } EFI_ACPI_1_0_IO_APIC_STRUCTURE;
300
301 ///
302 /// Interrupt Source Override Structure
303 ///
304 typedef struct {
305 UINT8 Type;
306 UINT8 Length;
307 UINT8 Bus;
308 UINT8 Source;
309 UINT32 GlobalSystemInterruptVector;
310 UINT16 Flags;
311 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
312
313 ///
314 /// Non-Maskable Interrupt Source Structure
315 ///
316 typedef struct {
317 UINT8 Type;
318 UINT8 Length;
319 UINT16 Flags;
320 UINT32 GlobalSystemInterruptVector;
321 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
322
323 //
324 // Ensure proper structure formats
325 //
326 #pragma pack(1)
327
328 ///
329 /// Local APIC NMI Structure
330 ///
331 typedef struct {
332 UINT8 Type;
333 UINT8 Length;
334 UINT8 AcpiProcessorId;
335 UINT16 Flags;
336 UINT8 LocalApicInti;
337 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
338
339 #pragma pack()
340
341 ///
342 /// Smart Battery Description Table (SBST)
343 ///
344 typedef struct {
345 EFI_ACPI_DESCRIPTION_HEADER Header;
346 UINT32 WarningEnergyLevel;
347 UINT32 LowEnergyLevel;
348 UINT32 CriticalEnergyLevel;
349 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
350
351 //
352 // Known table signatures
353 //
354
355 ///
356 /// "RSD PTR " Root System Description Pointer
357 ///
358 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
359
360 ///
361 /// "APIC" Multiple APIC Description Table
362 ///
363 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
364
365 ///
366 /// "DSDT" Differentiated System Description Table
367 ///
368 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
369
370 ///
371 /// "FACS" Firmware ACPI Control Structure
372 ///
373 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
374
375 ///
376 /// "FACP" Fixed ACPI Description Table
377 ///
378 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
379
380 ///
381 /// "PSDT" Persistent System Description Table
382 ///
383 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
384
385 ///
386 /// "RSDT" Root System Description Table
387 ///
388 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
389
390 ///
391 /// "SBST" Smart Battery Specification Table
392 ///
393 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
394
395 ///
396 /// "SSDT" Secondary System Description Table
397 ///
398 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
399
400 #endif