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