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