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