3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 ACPI 3.0 definitions from the ACPI Specification Revision 3.0
26 // Statements that include other files
28 #include "AcpiCommon.h"
31 // Ensure proper structure formats
35 // ACPI Specification Revision
37 #define EFI_ACPI_3_0_REVISION 0x03
40 // ACPI 3.0 Generic Address Space definition
44 UINT8 RegisterBitWidth
;
45 UINT8 RegisterBitOffset
;
48 } EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE
;
51 // Generic Address Space Address IDs
53 #define EFI_ACPI_3_0_SYSTEM_MEMORY 0
54 #define EFI_ACPI_3_0_SYSTEM_IO 1
55 #define EFI_ACPI_3_0_PCI_CONFIGURATION_SPACE 2
56 #define EFI_ACPI_3_0_EMBEDDED_CONTROLLER 3
57 #define EFI_ACPI_3_0_SMBUS 4
58 #define EFI_ACPI_3_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
61 // Generic Address Space Access Sizes
63 #define EFI_ACPI_3_0_UNDEFINED 0
64 #define EFI_ACPI_3_0_BYTE 1
65 #define EFI_ACPI_3_0_WORD 2
66 #define EFI_ACPI_3_0_DWORD 3
67 #define EFI_ACPI_3_0_QWORD 4
70 // ACPI 3.0 table structures
73 // Root System Description Pointer Structure
83 UINT8 ExtendedChecksum
;
85 } EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
;
88 // RSD_PTR Revision (as defined in ACPI 3.0 spec.)
90 #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02 // ACPISpec30 (Revision 3.0) says current value is 2
92 // Common table header, this prefaces all ACPI tables, including FACS, but
93 // excluding the RSD PTR structure
98 } EFI_ACPI_3_0_COMMON_HEADER
;
101 // Root System Description Table
102 // No definition needed as it is a common description table header followed by a
103 // variable number of UINT32 table pointers.
106 // RSDT Revision (as defined in ACPI 3.0 spec.)
108 #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
111 // Extended System Description Table
112 // No definition needed as it is a common description table header followed by a
113 // variable number of UINT64 table pointers.
116 // XSDT Revision (as defined in ACPI 3.0 spec.)
118 #define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
121 // Fixed ACPI Description Table Structure (FADT)
124 EFI_ACPI_DESCRIPTION_HEADER Header
;
128 UINT8 PreferredPmProfile
;
163 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE ResetReg
;
166 UINT64 XFirmwareCtrl
;
168 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk
;
169 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk
;
170 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk
;
171 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk
;
172 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk
;
173 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk
;
174 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk
;
175 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk
;
176 } EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE
;
179 // FADT Version (as defined in ACPI 3.0 spec.)
181 #define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x04
184 // Fixed ACPI Description Table Preferred Power Management Profile
186 #define EFI_ACPI_3_0_PM_PROFILE_UNSPECIFIED 0
187 #define EFI_ACPI_3_0_PM_PROFILE_DESKTOP 1
188 #define EFI_ACPI_3_0_PM_PROFILE_MOBILE 2
189 #define EFI_ACPI_3_0_PM_PROFILE_WORKSTATION 3
190 #define EFI_ACPI_3_0_PM_PROFILE_ENTERPRISE_SERVER 4
191 #define EFI_ACPI_3_0_PM_PROFILE_SOHO_SERVER 5
192 #define EFI_ACPI_3_0_PM_PROFILE_APPLIANCE_PC 6
193 #define EFI_ACPI_3_0_PM_PROFILE_PERFORMANCE_SERVER 7
196 // Fixed ACPI Description Table Boot Architecture Flags
197 // All other bits are reserved and must be set to 0.
199 #define EFI_ACPI_3_0_LEGACY_DEVICES (1 << 0)
200 #define EFI_ACPI_3_0_8042 (1 << 1)
201 #define EFI_ACPI_3_0_VGA_NOT_PRESENT (1 << 2)
202 #define EFI_ACPI_3_0_MSI_NOT_SUPPORTED (1 << 3)
203 #define EFI_ACPI_3_0_PCIE_ASPM_CONTROLS (1 << 4)
205 // Fixed ACPI Description Table Fixed Feature Flags
206 // All other bits are reserved and must be set to 0.
208 #define EFI_ACPI_3_0_WBINVD (1 << 0)
209 #define EFI_ACPI_3_0_WBINVD_FLUSH (1 << 1)
210 #define EFI_ACPI_3_0_PROC_C1 (1 << 2)
211 #define EFI_ACPI_3_0_P_LVL2_UP (1 << 3)
212 #define EFI_ACPI_3_0_PWR_BUTTON (1 << 4)
213 #define EFI_ACPI_3_0_SLP_BUTTON (1 << 5)
214 #define EFI_ACPI_3_0_FIX_RTC (1 << 6)
215 #define EFI_ACPI_3_0_RTC_S4 (1 << 7)
216 #define EFI_ACPI_3_0_TMR_VAL_EXT (1 << 8)
217 #define EFI_ACPI_3_0_DCK_CAP (1 << 9)
218 #define EFI_ACPI_3_0_RESET_REG_SUP (1 << 10)
219 #define EFI_ACPI_3_0_SEALED_CASE (1 << 11)
220 #define EFI_ACPI_3_0_HEADLESS (1 << 12)
221 #define EFI_ACPI_3_0_CPU_SW_SLP (1 << 13)
222 #define EFI_ACPI_3_0_PCI_EXP_WAK (1 << 14)
223 #define EFI_ACPI_3_0_USE_PLATFORM_CLOCK (1 << 15)
224 #define EFI_ACPI_3_0_S4_RTC_STS_VALID (1 << 16)
225 #define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE (1 << 17)
226 #define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL (1 << 18)
227 #define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE (1 << 19)
230 // Firmware ACPI Control Structure
235 UINT32 HardwareSignature
;
236 UINT32 FirmwareWakingVector
;
239 UINT64 XFirmwareWakingVector
;
242 } EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE
;
245 // FACS Version (as defined in ACPI 3.0 spec.)
247 #define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
250 // Firmware Control Structure Feature Flags
251 // All other bits are reserved and must be set to 0.
253 #define EFI_ACPI_3_0_S4BIOS_F (1 << 0)
256 // Differentiated System Description Table,
257 // Secondary System Description Table
258 // and Persistent System Description Table,
259 // no definition needed as they are common description table header followed by a
262 #define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
263 #define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION 0x02
266 // Multiple APIC Description Table header definition. The rest of the table
267 // must be defined in a platform specific manner.
270 EFI_ACPI_DESCRIPTION_HEADER Header
;
271 UINT32 LocalApicAddress
;
273 } EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER
;
276 // MADT Revision (as defined in ACPI 3.0 spec.)
278 #define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x02
281 // Multiple APIC Flags
282 // All other bits are reserved and must be set to 0.
284 #define EFI_ACPI_3_0_PCAT_COMPAT (1 << 0)
287 // Multiple APIC Description Table APIC structure types
288 // All other values between 0x09 an 0xFF are reserved and
289 // will be ignored by OSPM.
291 #define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC 0x00
292 #define EFI_ACPI_3_0_IO_APIC 0x01
293 #define EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE 0x02
294 #define EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
295 #define EFI_ACPI_3_0_LOCAL_APIC_NMI 0x04
296 #define EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
297 #define EFI_ACPI_3_0_IO_SAPIC 0x06
298 #define EFI_ACPI_3_0_LOCAL_SAPIC 0x07
299 #define EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES 0x08
302 // APIC Structure Definitions
305 // Processor Local APIC Structure Definition
310 UINT8 AcpiProcessorId
;
313 } EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE
;
316 // Local APIC Flags. All other bits are reserved and must be 0.
318 #define EFI_ACPI_3_0_LOCAL_APIC_ENABLED (1 << 0)
328 UINT32 IoApicAddress
;
329 UINT32 GlobalSystemInterruptBase
;
330 } EFI_ACPI_3_0_IO_APIC_STRUCTURE
;
333 // Interrupt Source Override Structure
340 UINT32 GlobalSystemInterrupt
;
342 } EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE
;
345 // Platform Interrupt Sources Structure Definition
355 UINT32 GlobalSystemInterrupt
;
356 UINT32 PlatformInterruptSourceFlags
;
357 UINT8 CpeiProcessorOverride
;
359 } EFI_ACPI_3_0_PLATFORM_INTERRUPT_APIC_STRUCTURE
;
363 // All other bits are reserved and must be set to 0.
365 #define EFI_ACPI_3_0_POLARITY (3 << 0)
366 #define EFI_ACPI_3_0_TRIGGER_MODE (3 << 2)
369 // Non-Maskable Interrupt Source Structure
375 UINT32 GlobalSystemInterrupt
;
376 } EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE
;
379 // Local APIC NMI Structure
384 UINT8 AcpiProcessorId
;
387 } EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE
;
390 // Local APIC Address Override Structure
396 UINT64 LocalApicAddress
;
397 } EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE
;
400 // IO SAPIC Structure
407 UINT32 GlobalSystemInterruptBase
;
408 UINT64 IoSapicAddress
;
409 } EFI_ACPI_3_0_IO_SAPIC_STRUCTURE
;
412 // Local SAPIC Structure
413 // This struct followed by a null-terminated ASCII string - ACPI Processor UID String
418 UINT8 AcpiProcessorId
;
423 UINT32 ACPIProcessorUIDValue
;
424 } EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE
;
427 // Platform Interrupt Sources Structure
437 UINT32 GlobalSystemInterrupt
;
438 UINT32 PlatformInterruptSourceFlags
;
439 } EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE
;
442 // Platform Interrupt Source Flags.
443 // All other bits are reserved and must be set to 0.
445 #define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE (1 << 0)
448 // Smart Battery Description Table (SBST)
451 EFI_ACPI_DESCRIPTION_HEADER Header
;
452 UINT32 WarningEnergyLevel
;
453 UINT32 LowEnergyLevel
;
454 UINT32 CriticalEnergyLevel
;
455 } EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE
;
458 // SBST Version (as defined in ACPI 3.0 spec.)
460 #define EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
463 // Embedded Controller Boot Resources Table (ECDT)
464 // The table is followed by a null terminated ASCII string that contains
465 // a fully qualified reference to the name space object.
468 EFI_ACPI_DESCRIPTION_HEADER Header
;
469 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcControl
;
470 EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE EcData
;
473 } EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE
;
476 // ECDT Version (as defined in ACPI 3.0 spec.)
478 #define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
481 // System Resource Affinity Table (SRAT. The rest of the table
482 // must be defined in a platform specific manner.
485 EFI_ACPI_DESCRIPTION_HEADER Header
;
486 UINT32 Reserved1
; // Must be set to 1
488 } EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER
;
491 // SRAT Version (as defined in ACPI 3.0 spec.)
493 #define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION 0x02
496 // SRAT structure types.
497 // All other values between 0x02 an 0xFF are reserved and
498 // will be ignored by OSPM.
500 #define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY 0x00
501 #define EFI_ACPI_3_0_MEMORY_AFFINITY 0x01
504 // Processor Local APIC/SAPIC Affinity Structure Definition
509 UINT8 ProximityDomain7To0
;
513 UINT8 ProximityDomain31To8
[3];
515 } EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE
;
518 // Local APIC/SAPIC Flags. All other bits are reserved and must be 0.
520 #define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
523 // Memory Affinity Structure Definition
528 UINT32 ProximityDomain
;
530 UINT32 AddressBaseLow
;
531 UINT32 AddressBaseHigh
;
537 } EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE
;
540 // Memory Flags. All other bits are reserved and must be 0.
542 #define EFI_ACPI_3_0_MEMORY_ENABLED (1 << 0)
543 #define EFI_ACPI_3_0_MEMORY_HOT_PLUGGABLE (1 << 1)
544 #define EFI_ACPI_3_0_MEMORY_NONVOLATILE (1 << 2)
547 // System Locality Distance Information Table (SLIT).
548 // The rest of the table is a matrix.
551 EFI_ACPI_DESCRIPTION_HEADER Header
;
552 UINT64 NumberOfSystemLocalities
;
553 } EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER
;
556 // SLIT Version (as defined in ACPI 3.0 spec.)
558 #define EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION 0x01
561 // Known table signatures
564 // "RSD PTR " Root System Description Pointer
566 #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE 0x2052545020445352
569 // "APIC" Multiple APIC Description Table
571 #define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041
574 // "DSDT" Differentiated System Description Table
576 #define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344
579 // "ECDT" Embedded Controller Boot Resources Table
581 #define EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE 0x54444345
584 // "FACP" Fixed ACPI Description Table
586 #define EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146
589 // "FACS" Firmware ACPI Control Structure
591 #define EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE 0x53434146
594 // "PSDT" Persistent System Description Table
596 #define EFI_ACPI_3_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445350
599 // "RSDT" Root System Description Table
601 #define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445352
604 // "SBST" Smart Battery Specification Table
606 #define EFI_ACPI_3_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE 0x54534253
609 // "SLIT" System Locality Information Table
611 #define EFI_ACPI_3_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE 0x54494C53
614 // "SRAT" System Resource Affinity Table
616 #define EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE 0x54415253
619 // "SSDT" Secondary System Description Table
621 #define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353
624 // "XSDT" Extended System Description Table
626 #define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445358
629 // "BOOT" MS Simple Boot Spec
631 #define EFI_ACPI_3_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE 0x544F4F42
634 // "CPEP" Corrected Platform Error Polling Table
637 #define EFI_ACPI_3_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_SIGNATURE 0x50455043
640 // "DBGP" MS Debug Port Spec
642 #define EFI_ACPI_3_0_DEBUG_PORT_TABLE_SIGNATURE 0x50474244
645 // "ETDT" Event Timer Description Table
647 #define EFI_ACPI_3_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE 0x54445445
650 // "HPET" IA-PC High Precision Event Timer Table
652 #define EFI_ACPI_3_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE 0x54455048
655 // "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
657 #define EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE 0x4746434D
660 // "SPCR" Serial Port Concole Redirection Table
662 #define EFI_ACPI_3_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE 0x52435053
665 // "SPMI" Server Platform Management Interface Table
667 #define EFI_ACPI_3_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE 0x494D5053
670 // "TCPA" Trusted Computing Platform Alliance Capabilities Table
672 #define EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE 0x41504354
675 // "WDRT" Watchdog Resource Table
677 #define EFI_ACPI_3_0_WATCHDOG_RESOURCE_TABLE_SIGNATURE 0x54524457
680 // "WDAT" Watchdog Action Table
682 #define EFI_ACPI_3_0_WATCHDOG_ACTION_TABLE_SIGNATURE 0x54414457
685 // "iBFT" iSCSI Boot Firmware Table
687 #define EFI_ACPI_3_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE 0x54464269