]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi20.h
Detab
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Acpi20.h
1 /** @file
2 ACPI 2.0 definitions from the ACPI Specification, revision 2.0
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_2_0_H_
15 #define _ACPI_2_0_H_
16
17 #include <IndustryStandard/Acpi10.h>
18
19 //
20 // Ensure proper structure formats
21 //
22 #pragma pack(1)
23
24 ///
25 /// ACPI 2.0 Generic Address Space definition
26 ///
27 typedef struct {
28 UINT8 AddressSpaceId;
29 UINT8 RegisterBitWidth;
30 UINT8 RegisterBitOffset;
31 UINT8 Reserved;
32 UINT64 Address;
33 } EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
34
35 //
36 // Generic Address Space Address IDs
37 //
38 #define EFI_ACPI_2_0_SYSTEM_MEMORY 0
39 #define EFI_ACPI_2_0_SYSTEM_IO 1
40 #define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
41 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
42 #define EFI_ACPI_2_0_SMBUS 4
43 #define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
44
45 //
46 // ACPI 2.0 table structures
47 //
48
49 ///
50 /// Root System Description Pointer Structure
51 ///
52 typedef struct {
53 UINT64 Signature;
54 UINT8 Checksum;
55 UINT8 OemId[6];
56 UINT8 Revision;
57 UINT32 RsdtAddress;
58 UINT32 Length;
59 UINT64 XsdtAddress;
60 UINT8 ExtendedChecksum;
61 UINT8 Reserved[3];
62 } EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
63
64 ///
65 /// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
66 ///
67 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
68
69 ///
70 /// Common table header, this prefaces all ACPI tables, including FACS, but
71 /// excluding the RSD PTR structure
72 ///
73 typedef struct {
74 UINT32 Signature;
75 UINT32 Length;
76 } EFI_ACPI_2_0_COMMON_HEADER;
77
78 //
79 // Root System Description Table
80 // No definition needed as it is a common description table header, the same with
81 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
82 //
83
84 ///
85 /// RSDT Revision (as defined in ACPI 2.0 spec.)
86 ///
87 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
88
89 //
90 // Extended System Description Table
91 // No definition needed as it is a common description table header, the same with
92 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT64 table pointers.
93 //
94
95 ///
96 /// XSDT Revision (as defined in ACPI 2.0 spec.)
97 ///
98 #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
99
100 ///
101 /// Fixed ACPI Description Table Structure (FADT)
102 ///
103 typedef struct {
104 EFI_ACPI_DESCRIPTION_HEADER Header;
105 UINT32 FirmwareCtrl;
106 UINT32 Dsdt;
107 UINT8 Reserved0;
108 UINT8 PreferredPmProfile;
109 UINT16 SciInt;
110 UINT32 SmiCmd;
111 UINT8 AcpiEnable;
112 UINT8 AcpiDisable;
113 UINT8 S4BiosReq;
114 UINT8 PstateCnt;
115 UINT32 Pm1aEvtBlk;
116 UINT32 Pm1bEvtBlk;
117 UINT32 Pm1aCntBlk;
118 UINT32 Pm1bCntBlk;
119 UINT32 Pm2CntBlk;
120 UINT32 PmTmrBlk;
121 UINT32 Gpe0Blk;
122 UINT32 Gpe1Blk;
123 UINT8 Pm1EvtLen;
124 UINT8 Pm1CntLen;
125 UINT8 Pm2CntLen;
126 UINT8 PmTmrLen;
127 UINT8 Gpe0BlkLen;
128 UINT8 Gpe1BlkLen;
129 UINT8 Gpe1Base;
130 UINT8 CstCnt;
131 UINT16 PLvl2Lat;
132 UINT16 PLvl3Lat;
133 UINT16 FlushSize;
134 UINT16 FlushStride;
135 UINT8 DutyOffset;
136 UINT8 DutyWidth;
137 UINT8 DayAlrm;
138 UINT8 MonAlrm;
139 UINT8 Century;
140 UINT16 IaPcBootArch;
141 UINT8 Reserved1;
142 UINT32 Flags;
143 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
144 UINT8 ResetValue;
145 UINT8 Reserved2[3];
146 UINT64 XFirmwareCtrl;
147 UINT64 XDsdt;
148 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
149 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
150 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
151 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
152 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
153 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
154 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
155 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
156 } EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
157
158 ///
159 /// FADT Version (as defined in ACPI 2.0 spec.)
160 ///
161 #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
162
163 ///
164 /// Fixed ACPI Description Table Boot Architecture Flags
165 /// All other bits are reserved and must be set to 0.
166 ///
167 #define EFI_ACPI_2_0_LEGACY_DEVICES (1 << 0)
168 #define EFI_ACPI_2_0_8042 (1 << 1)
169
170 //
171 // Fixed ACPI Description Table Fixed Feature Flags
172 // All other bits are reserved and must be set to 0.
173 //
174 #define EFI_ACPI_2_0_WBINVD (1 << 0)
175 #define EFI_ACPI_2_0_WBINVD_FLUSH (1 << 1)
176 #define EFI_ACPI_2_0_PROC_C1 (1 << 2)
177 #define EFI_ACPI_2_0_P_LVL2_UP (1 << 3)
178 #define EFI_ACPI_2_0_PWR_BUTTON (1 << 4)
179 #define EFI_ACPI_2_0_SLP_BUTTON (1 << 5)
180 #define EFI_ACPI_2_0_FIX_RTC (1 << 6)
181 #define EFI_ACPI_2_0_RTC_S4 (1 << 7)
182 #define EFI_ACPI_2_0_TMR_VAL_EXT (1 << 8)
183 #define EFI_ACPI_2_0_DCK_CAP (1 << 9)
184 #define EFI_ACPI_2_0_RESET_REG_SUP (1 << 10)
185 #define EFI_ACPI_2_0_SEALED_CASE (1 << 11)
186 #define EFI_ACPI_2_0_HEADLESS (1 << 12)
187 #define EFI_ACPI_2_0_CPU_SW_SLP (1 << 13)
188
189 ///
190 /// Firmware ACPI Control Structure
191 ///
192 typedef struct {
193 UINT32 Signature;
194 UINT32 Length;
195 UINT32 HardwareSignature;
196 UINT32 FirmwareWakingVector;
197 UINT32 GlobalLock;
198 UINT32 Flags;
199 UINT64 XFirmwareWakingVector;
200 UINT8 Version;
201 UINT8 Reserved[31];
202 } EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
203
204 ///
205 /// FACS Version (as defined in ACPI 2.0 spec.)
206 ///
207 #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
208
209 ///
210 /// Firmware Control Structure Feature Flags
211 /// All other bits are reserved and must be set to 0.
212 ///
213 #define EFI_ACPI_2_0_S4BIOS_F (1 << 0)
214
215 ///
216 /// Multiple APIC Description Table header definition. The rest of the table
217 /// must be defined in a platform specific manner.
218 ///
219 typedef struct {
220 EFI_ACPI_DESCRIPTION_HEADER Header;
221 UINT32 LocalApicAddress;
222 UINT32 Flags;
223 } EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
224
225 ///
226 /// MADT Revision (as defined in ACPI 2.0 spec.)
227 ///
228 #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
229
230 ///
231 /// Multiple APIC Flags
232 /// All other bits are reserved and must be set to 0.
233 ///
234 #define EFI_ACPI_2_0_PCAT_COMPAT (1 << 0)
235
236 //
237 // Multiple APIC Description Table APIC structure types
238 // All other values between 0x09 an 0xFF are reserved and
239 // will be ignored by OSPM.
240 //
241 #define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
242 #define EFI_ACPI_2_0_IO_APIC 0x01
243 #define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
244 #define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
245 #define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
246 #define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
247 #define EFI_ACPI_2_0_IO_SAPIC 0x06
248 #define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
249 #define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
250
251 //
252 // APIC Structure Definitions
253 //
254
255 ///
256 /// Processor Local APIC Structure Definition
257 ///
258 typedef struct {
259 UINT8 Type;
260 UINT8 Length;
261 UINT8 AcpiProcessorId;
262 UINT8 ApicId;
263 UINT32 Flags;
264 } EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
265
266 ///
267 /// Local APIC Flags. All other bits are reserved and must be 0.
268 ///
269 #define EFI_ACPI_2_0_LOCAL_APIC_ENABLED (1 << 0)
270
271 ///
272 /// IO APIC Structure
273 ///
274 typedef struct {
275 UINT8 Type;
276 UINT8 Length;
277 UINT8 IoApicId;
278 UINT8 Reserved;
279 UINT32 IoApicAddress;
280 UINT32 GlobalSystemInterruptBase;
281 } EFI_ACPI_2_0_IO_APIC_STRUCTURE;
282
283 ///
284 /// Interrupt Source Override Structure
285 ///
286 typedef struct {
287 UINT8 Type;
288 UINT8 Length;
289 UINT8 Bus;
290 UINT8 Source;
291 UINT32 GlobalSystemInterrupt;
292 UINT16 Flags;
293 } EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
294
295 ///
296 /// Non-Maskable Interrupt Source Structure
297 ///
298 typedef struct {
299 UINT8 Type;
300 UINT8 Length;
301 UINT16 Flags;
302 UINT32 GlobalSystemInterrupt;
303 } EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
304
305 ///
306 /// Local APIC NMI Structure
307 ///
308 typedef struct {
309 UINT8 Type;
310 UINT8 Length;
311 UINT8 AcpiProcessorId;
312 UINT16 Flags;
313 UINT8 LocalApicLint;
314 } EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
315
316 ///
317 /// Local APIC Address Override Structure
318 ///
319 typedef struct {
320 UINT8 Type;
321 UINT8 Length;
322 UINT16 Reserved;
323 UINT64 LocalApicAddress;
324 } EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
325
326 ///
327 /// IO SAPIC Structure
328 ///
329 typedef struct {
330 UINT8 Type;
331 UINT8 Length;
332 UINT8 IoApicId;
333 UINT8 Reserved;
334 UINT32 GlobalSystemInterruptBase;
335 UINT64 IoSapicAddress;
336 } EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
337
338 ///
339 /// Local SAPIC Structure
340 ///
341 typedef struct {
342 UINT8 Type;
343 UINT8 Length;
344 UINT8 AcpiProcessorId;
345 UINT8 LocalSapicId;
346 UINT8 LocalSapicEid;
347 UINT8 Reserved[3];
348 UINT32 Flags;
349 } EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
350
351 ///
352 /// Platform Interrupt Sources Structure
353 ///
354 typedef struct {
355 UINT8 Type;
356 UINT8 Length;
357 UINT16 Flags;
358 UINT8 InterruptType;
359 UINT8 ProcessorId;
360 UINT8 ProcessorEid;
361 UINT8 IoSapicVector;
362 UINT32 GlobalSystemInterrupt;
363 UINT32 Reserved;
364 } EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
365
366 ///
367 /// Smart Battery Description Table (SBST)
368 ///
369 typedef struct {
370 EFI_ACPI_DESCRIPTION_HEADER Header;
371 UINT32 WarningEnergyLevel;
372 UINT32 LowEnergyLevel;
373 UINT32 CriticalEnergyLevel;
374 } EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
375
376 ///
377 /// SBST Version (as defined in ACPI 2.0 spec.)
378 ///
379 #define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
380
381 ///
382 /// Embedded Controller Boot Resources Table (ECDT)
383 /// The table is followed by a null terminated ASCII string that contains
384 /// a fully qualified reference to the name space object.
385 ///
386 typedef struct {
387 EFI_ACPI_DESCRIPTION_HEADER Header;
388 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
389 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
390 UINT32 Uid;
391 UINT8 GpeBit;
392 } EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
393
394 ///
395 /// ECDT Version (as defined in ACPI 2.0 spec.)
396 ///
397 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
398
399 //
400 // Known table signatures
401 //
402
403 ///
404 /// "RSD PTR " Root System Description Pointer
405 ///
406 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
407
408 ///
409 /// "SPIC" Multiple SAPIC Description Table
410 ///
411 /// BUGBUG: Don't know where this came from except SR870BN4 uses it.
412 /// #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
413 ///
414 #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
415
416 ///
417 /// "BOOT" MS Simple Boot Spec
418 ///
419 #define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE SIGNATURE_32('B', 'O', 'O', 'T')
420
421 ///
422 /// "DBGP" MS Bebug Port Spec
423 ///
424 #define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE SIGNATURE_32('D', 'B', 'G', 'P')
425
426 ///
427 /// "DSDT" Differentiated System Description Table
428 ///
429 #define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
430
431 ///
432 /// "ECDT" Embedded Controller Boot Resources Table
433 ///
434 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE SIGNATURE_32('E', 'C', 'D', 'T')
435
436 ///
437 /// "ETDT" Event Timer Description Table
438 ///
439 #define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('E', 'T', 'D', 'T')
440
441 ///
442 /// "FACS" Firmware ACPI Control Structure
443 ///
444 #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
445
446 ///
447 /// "FACP" Fixed ACPI Description Table
448 ///
449 #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
450
451 ///
452 /// "APIC" Multiple APIC Description Table
453 ///
454 #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
455
456 ///
457 /// "PSDT" Persistent System Description Table
458 ///
459 #define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
460
461 ///
462 /// "RSDT" Root System Description Table
463 ///
464 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
465
466 ///
467 /// "SBST" Smart Battery Specification Table
468 ///
469 #define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
470
471 ///
472 /// "SLIT" System Locality Information Table
473 ///
474 #define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE SIGNATURE_32('S', 'L', 'I', 'T')
475
476 ///
477 /// "SPCR" Serial Port Concole Redirection Table
478 ///
479 #define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'C', 'R')
480
481 ///
482 /// "SRAT" Static Resource Affinity Table
483 ///
484 #define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE SIGNATURE_32('S', 'R', 'A', 'T')
485
486 ///
487 /// "SSDT" Secondary System Description Table
488 ///
489 #define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
490
491 ///
492 /// "SPMI" Server Platform Management Interface Table
493 ///
494 #define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE SIGNATURE_32('S', 'P', 'M', 'I')
495
496 ///
497 /// "XSDT" Extended System Description Table
498 ///
499 #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('X', 'S', 'D', 'T')
500
501 ///
502 /// "MCFG" Static Resource Affinity Table
503 ///
504 #define EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'F', 'G')
505
506 #pragma pack()
507
508 #endif