1a9f12690SJung-uk Kim /****************************************************************************** 2a9f12690SJung-uk Kim * 3a9f12690SJung-uk Kim * Name: actbl.h - Basic ACPI Table Definitions 4a9f12690SJung-uk Kim * 5a9f12690SJung-uk Kim *****************************************************************************/ 6a9f12690SJung-uk Kim 7d244b227SJung-uk Kim /* 81c0e1b6dSJung-uk Kim * Copyright (C) 2000 - 2015, Intel Corp. 9a9f12690SJung-uk Kim * All rights reserved. 10a9f12690SJung-uk Kim * 11d244b227SJung-uk Kim * Redistribution and use in source and binary forms, with or without 12d244b227SJung-uk Kim * modification, are permitted provided that the following conditions 13d244b227SJung-uk Kim * are met: 14d244b227SJung-uk Kim * 1. Redistributions of source code must retain the above copyright 15d244b227SJung-uk Kim * notice, this list of conditions, and the following disclaimer, 16d244b227SJung-uk Kim * without modification. 17d244b227SJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18d244b227SJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below 19d244b227SJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon 20d244b227SJung-uk Kim * including a substantially similar Disclaimer requirement for further 21d244b227SJung-uk Kim * binary redistribution. 22d244b227SJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names 23d244b227SJung-uk Kim * of any contributors may be used to endorse or promote products derived 24d244b227SJung-uk Kim * from this software without specific prior written permission. 25a9f12690SJung-uk Kim * 26d244b227SJung-uk Kim * Alternatively, this software may be distributed under the terms of the 27d244b227SJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free 28d244b227SJung-uk Kim * Software Foundation. 29a9f12690SJung-uk Kim * 30d244b227SJung-uk Kim * NO WARRANTY 31d244b227SJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32d244b227SJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33d244b227SJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34d244b227SJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35d244b227SJung-uk Kim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36d244b227SJung-uk Kim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37d244b227SJung-uk Kim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38d244b227SJung-uk Kim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39d244b227SJung-uk Kim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40d244b227SJung-uk Kim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41d244b227SJung-uk Kim * POSSIBILITY OF SUCH DAMAGES. 42d244b227SJung-uk Kim */ 43a9f12690SJung-uk Kim 44a9f12690SJung-uk Kim #ifndef __ACTBL_H__ 45a9f12690SJung-uk Kim #define __ACTBL_H__ 46a9f12690SJung-uk Kim 47d6dd1baeSJung-uk Kim 48d6dd1baeSJung-uk Kim /******************************************************************************* 49d6dd1baeSJung-uk Kim * 50d6dd1baeSJung-uk Kim * Fundamental ACPI tables 51d6dd1baeSJung-uk Kim * 52d6dd1baeSJung-uk Kim * This file contains definitions for the ACPI tables that are directly consumed 53d6dd1baeSJung-uk Kim * by ACPICA. All other tables are consumed by the OS-dependent ACPI-related 54d6dd1baeSJung-uk Kim * device drivers and other OS support code. 55d6dd1baeSJung-uk Kim * 56d6dd1baeSJung-uk Kim * The RSDP and FACS do not use the common ACPI table header. All other ACPI 57d6dd1baeSJung-uk Kim * tables use the header. 58d6dd1baeSJung-uk Kim * 59d6dd1baeSJung-uk Kim ******************************************************************************/ 60d6dd1baeSJung-uk Kim 61d6dd1baeSJung-uk Kim 62a9f12690SJung-uk Kim /* 63d6dd1baeSJung-uk Kim * Values for description table header signatures for tables defined in this 64d6dd1baeSJung-uk Kim * file. Useful because they make it more difficult to inadvertently type in 65d6dd1baeSJung-uk Kim * the wrong signature. 66a9f12690SJung-uk Kim */ 67a9f12690SJung-uk Kim #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ 68a9f12690SJung-uk Kim #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ 69a9f12690SJung-uk Kim #define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */ 70*5ef50723SJung-uk Kim #define ACPI_SIG_OSDT "OSDT" /* Override System Description Table */ 71a9f12690SJung-uk Kim #define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */ 72a9f12690SJung-uk Kim #define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */ 73a9f12690SJung-uk Kim #define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */ 74a9f12690SJung-uk Kim #define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */ 75a9f12690SJung-uk Kim #define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */ 76a9f12690SJung-uk Kim #define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */ 77a9f12690SJung-uk Kim 78a9f12690SJung-uk Kim 79a9f12690SJung-uk Kim /* 80a9f12690SJung-uk Kim * All tables and structures must be byte-packed to match the ACPI 81a9f12690SJung-uk Kim * specification, since the tables are provided by the system BIOS 82a9f12690SJung-uk Kim */ 83a9f12690SJung-uk Kim #pragma pack(1) 84a9f12690SJung-uk Kim 85a9f12690SJung-uk Kim /* 861df130f1SJung-uk Kim * Note: C bitfields are not used for this reason: 871df130f1SJung-uk Kim * 881df130f1SJung-uk Kim * "Bitfields are great and easy to read, but unfortunately the C language 891df130f1SJung-uk Kim * does not specify the layout of bitfields in memory, which means they are 901df130f1SJung-uk Kim * essentially useless for dealing with packed data in on-disk formats or 911df130f1SJung-uk Kim * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, 921df130f1SJung-uk Kim * this decision was a design error in C. Ritchie could have picked an order 931df130f1SJung-uk Kim * and stuck with it." Norman Ramsey. 941df130f1SJung-uk Kim * See http://stackoverflow.com/a/1053662/41661 95a9f12690SJung-uk Kim */ 96a9f12690SJung-uk Kim 97d6dd1baeSJung-uk Kim 98a9f12690SJung-uk Kim /******************************************************************************* 99a9f12690SJung-uk Kim * 100d6dd1baeSJung-uk Kim * Master ACPI Table Header. This common header is used by all ACPI tables 101d6dd1baeSJung-uk Kim * except the RSDP and FACS. 102a9f12690SJung-uk Kim * 103a9f12690SJung-uk Kim ******************************************************************************/ 104a9f12690SJung-uk Kim 105a9f12690SJung-uk Kim typedef struct acpi_table_header 106a9f12690SJung-uk Kim { 107a9f12690SJung-uk Kim char Signature[ACPI_NAME_SIZE]; /* ASCII table signature */ 108a9f12690SJung-uk Kim UINT32 Length; /* Length of table in bytes, including this header */ 1091df130f1SJung-uk Kim UINT8 Revision; /* ACPI Specification minor version number */ 110a9f12690SJung-uk Kim UINT8 Checksum; /* To make sum of entire table == 0 */ 111a9f12690SJung-uk Kim char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */ 112a9f12690SJung-uk Kim char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */ 113a9f12690SJung-uk Kim UINT32 OemRevision; /* OEM revision number */ 114a9f12690SJung-uk Kim char AslCompilerId[ACPI_NAME_SIZE]; /* ASCII ASL compiler vendor ID */ 115a9f12690SJung-uk Kim UINT32 AslCompilerRevision; /* ASL compiler version */ 116a9f12690SJung-uk Kim 117a9f12690SJung-uk Kim } ACPI_TABLE_HEADER; 118a9f12690SJung-uk Kim 119a9f12690SJung-uk Kim 120d6dd1baeSJung-uk Kim /******************************************************************************* 121d6dd1baeSJung-uk Kim * 122a9f12690SJung-uk Kim * GAS - Generic Address Structure (ACPI 2.0+) 123a9f12690SJung-uk Kim * 124a9f12690SJung-uk Kim * Note: Since this structure is used in the ACPI tables, it is byte aligned. 1251df130f1SJung-uk Kim * If misaligned access is not supported by the hardware, accesses to the 126d6dd1baeSJung-uk Kim * 64-bit Address field must be performed with care. 127d6dd1baeSJung-uk Kim * 128d6dd1baeSJung-uk Kim ******************************************************************************/ 129d6dd1baeSJung-uk Kim 130a9f12690SJung-uk Kim typedef struct acpi_generic_address 131a9f12690SJung-uk Kim { 132a9f12690SJung-uk Kim UINT8 SpaceId; /* Address space where struct or register exists */ 133a9f12690SJung-uk Kim UINT8 BitWidth; /* Size in bits of given register */ 134a9f12690SJung-uk Kim UINT8 BitOffset; /* Bit offset within the register */ 135a9f12690SJung-uk Kim UINT8 AccessWidth; /* Minimum Access size (ACPI 3.0) */ 136a9f12690SJung-uk Kim UINT64 Address; /* 64-bit address of struct or register */ 137a9f12690SJung-uk Kim 138a9f12690SJung-uk Kim } ACPI_GENERIC_ADDRESS; 139a9f12690SJung-uk Kim 140a9f12690SJung-uk Kim 141a9f12690SJung-uk Kim /******************************************************************************* 142a9f12690SJung-uk Kim * 143a9f12690SJung-uk Kim * RSDP - Root System Description Pointer (Signature is "RSD PTR ") 144d6dd1baeSJung-uk Kim * Version 2 145a9f12690SJung-uk Kim * 146a9f12690SJung-uk Kim ******************************************************************************/ 147a9f12690SJung-uk Kim 148a9f12690SJung-uk Kim typedef struct acpi_table_rsdp 149a9f12690SJung-uk Kim { 150a9f12690SJung-uk Kim char Signature[8]; /* ACPI signature, contains "RSD PTR " */ 151a9f12690SJung-uk Kim UINT8 Checksum; /* ACPI 1.0 checksum */ 152a9f12690SJung-uk Kim char OemId[ACPI_OEM_ID_SIZE]; /* OEM identification */ 153a9f12690SJung-uk Kim UINT8 Revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ 154a9f12690SJung-uk Kim UINT32 RsdtPhysicalAddress; /* 32-bit physical address of the RSDT */ 155a9f12690SJung-uk Kim UINT32 Length; /* Table length in bytes, including header (ACPI 2.0+) */ 156a9f12690SJung-uk Kim UINT64 XsdtPhysicalAddress; /* 64-bit physical address of the XSDT (ACPI 2.0+) */ 157a9f12690SJung-uk Kim UINT8 ExtendedChecksum; /* Checksum of entire table (ACPI 2.0+) */ 158a9f12690SJung-uk Kim UINT8 Reserved[3]; /* Reserved, must be zero */ 159a9f12690SJung-uk Kim 160a9f12690SJung-uk Kim } ACPI_TABLE_RSDP; 161a9f12690SJung-uk Kim 162a88e22b7SJung-uk Kim /* Standalone struct for the ACPI 1.0 RSDP */ 163a88e22b7SJung-uk Kim 164a88e22b7SJung-uk Kim typedef struct acpi_rsdp_common 165a88e22b7SJung-uk Kim { 166a88e22b7SJung-uk Kim char Signature[8]; 167a88e22b7SJung-uk Kim UINT8 Checksum; 168a88e22b7SJung-uk Kim char OemId[ACPI_OEM_ID_SIZE]; 169a88e22b7SJung-uk Kim UINT8 Revision; 170a88e22b7SJung-uk Kim UINT32 RsdtPhysicalAddress; 171a88e22b7SJung-uk Kim 172a88e22b7SJung-uk Kim } ACPI_RSDP_COMMON; 173a88e22b7SJung-uk Kim 174a88e22b7SJung-uk Kim /* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */ 175a88e22b7SJung-uk Kim 176a88e22b7SJung-uk Kim typedef struct acpi_rsdp_extension 177a88e22b7SJung-uk Kim { 178a88e22b7SJung-uk Kim UINT32 Length; 179a88e22b7SJung-uk Kim UINT64 XsdtPhysicalAddress; 180a88e22b7SJung-uk Kim UINT8 ExtendedChecksum; 181a88e22b7SJung-uk Kim UINT8 Reserved[3]; 182a88e22b7SJung-uk Kim 183a88e22b7SJung-uk Kim } ACPI_RSDP_EXTENSION; 184a9f12690SJung-uk Kim 185a9f12690SJung-uk Kim 186a9f12690SJung-uk Kim /******************************************************************************* 187a9f12690SJung-uk Kim * 188a9f12690SJung-uk Kim * RSDT/XSDT - Root System Description Tables 189d6dd1baeSJung-uk Kim * Version 1 (both) 190a9f12690SJung-uk Kim * 191a9f12690SJung-uk Kim ******************************************************************************/ 192a9f12690SJung-uk Kim 193a9f12690SJung-uk Kim typedef struct acpi_table_rsdt 194a9f12690SJung-uk Kim { 195a9f12690SJung-uk Kim ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 196a9f12690SJung-uk Kim UINT32 TableOffsetEntry[1]; /* Array of pointers to ACPI tables */ 197a9f12690SJung-uk Kim 198a9f12690SJung-uk Kim } ACPI_TABLE_RSDT; 199a9f12690SJung-uk Kim 200a9f12690SJung-uk Kim typedef struct acpi_table_xsdt 201a9f12690SJung-uk Kim { 202a9f12690SJung-uk Kim ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 203a9f12690SJung-uk Kim UINT64 TableOffsetEntry[1]; /* Array of pointers to ACPI tables */ 204a9f12690SJung-uk Kim 205a9f12690SJung-uk Kim } ACPI_TABLE_XSDT; 206a9f12690SJung-uk Kim 207313a0c13SJung-uk Kim #define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32)) 208313a0c13SJung-uk Kim #define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64)) 209313a0c13SJung-uk Kim 210a9f12690SJung-uk Kim 211a9f12690SJung-uk Kim /******************************************************************************* 212a9f12690SJung-uk Kim * 213a9f12690SJung-uk Kim * FACS - Firmware ACPI Control Structure (FACS) 214a9f12690SJung-uk Kim * 215a9f12690SJung-uk Kim ******************************************************************************/ 216a9f12690SJung-uk Kim 217a9f12690SJung-uk Kim typedef struct acpi_table_facs 218a9f12690SJung-uk Kim { 219a9f12690SJung-uk Kim char Signature[4]; /* ASCII table signature */ 220a9f12690SJung-uk Kim UINT32 Length; /* Length of structure, in bytes */ 221a9f12690SJung-uk Kim UINT32 HardwareSignature; /* Hardware configuration signature */ 222a9f12690SJung-uk Kim UINT32 FirmwareWakingVector; /* 32-bit physical address of the Firmware Waking Vector */ 223a9f12690SJung-uk Kim UINT32 GlobalLock; /* Global Lock for shared hardware resources */ 224a9f12690SJung-uk Kim UINT32 Flags; 225a9f12690SJung-uk Kim UINT64 XFirmwareWakingVector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ 226a9f12690SJung-uk Kim UINT8 Version; /* Version of this table (ACPI 2.0+) */ 227d6dd1baeSJung-uk Kim UINT8 Reserved[3]; /* Reserved, must be zero */ 228d6dd1baeSJung-uk Kim UINT32 OspmFlags; /* Flags to be set by OSPM (ACPI 4.0) */ 229d6dd1baeSJung-uk Kim UINT8 Reserved1[24]; /* Reserved, must be zero */ 230a9f12690SJung-uk Kim 231a9f12690SJung-uk Kim } ACPI_TABLE_FACS; 232a9f12690SJung-uk Kim 233d6dd1baeSJung-uk Kim /* Masks for GlobalLock flag field above */ 234d6dd1baeSJung-uk Kim 235d6dd1baeSJung-uk Kim #define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */ 236d6dd1baeSJung-uk Kim #define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */ 237d6dd1baeSJung-uk Kim 238d6dd1baeSJung-uk Kim /* Masks for Flags field above */ 239a9f12690SJung-uk Kim 240a9f12690SJung-uk Kim #define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */ 241d6dd1baeSJung-uk Kim #define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */ 242a9f12690SJung-uk Kim 243d6dd1baeSJung-uk Kim /* Masks for OspmFlags field above */ 244a9f12690SJung-uk Kim 245d6dd1baeSJung-uk Kim #define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */ 246a9f12690SJung-uk Kim 247a9f12690SJung-uk Kim 248a9f12690SJung-uk Kim /******************************************************************************* 249a9f12690SJung-uk Kim * 250a9f12690SJung-uk Kim * FADT - Fixed ACPI Description Table (Signature "FACP") 251d6dd1baeSJung-uk Kim * Version 4 252a9f12690SJung-uk Kim * 253a9f12690SJung-uk Kim ******************************************************************************/ 254a9f12690SJung-uk Kim 255a9f12690SJung-uk Kim /* Fields common to all versions of the FADT */ 256a9f12690SJung-uk Kim 257a9f12690SJung-uk Kim typedef struct acpi_table_fadt 258a9f12690SJung-uk Kim { 259a9f12690SJung-uk Kim ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 260a9f12690SJung-uk Kim UINT32 Facs; /* 32-bit physical address of FACS */ 261a9f12690SJung-uk Kim UINT32 Dsdt; /* 32-bit physical address of DSDT */ 262a9f12690SJung-uk Kim UINT8 Model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ 263a9f12690SJung-uk Kim UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */ 264a9f12690SJung-uk Kim UINT16 SciInterrupt; /* System vector of SCI interrupt */ 265a9f12690SJung-uk Kim UINT32 SmiCommand; /* 32-bit Port address of SMI command port */ 2661df130f1SJung-uk Kim UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */ 2671df130f1SJung-uk Kim UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */ 2681df130f1SJung-uk Kim UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */ 269a9f12690SJung-uk Kim UINT8 PstateControl; /* Processor performance state control*/ 2701df130f1SJung-uk Kim UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ 2711df130f1SJung-uk Kim UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */ 2721df130f1SJung-uk Kim UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */ 2731df130f1SJung-uk Kim UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */ 2741df130f1SJung-uk Kim UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */ 2751df130f1SJung-uk Kim UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ 2761df130f1SJung-uk Kim UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */ 2771df130f1SJung-uk Kim UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */ 278a9f12690SJung-uk Kim UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */ 279a9f12690SJung-uk Kim UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */ 280a9f12690SJung-uk Kim UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */ 281a9f12690SJung-uk Kim UINT8 PmTimerLength; /* Byte Length of ports at PmTimerBlock */ 282a9f12690SJung-uk Kim UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */ 283a9f12690SJung-uk Kim UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */ 284a9f12690SJung-uk Kim UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */ 2851df130f1SJung-uk Kim UINT8 CstControl; /* Support for the _CST object and C-States change notification */ 286a9f12690SJung-uk Kim UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */ 287a9f12690SJung-uk Kim UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */ 2881df130f1SJung-uk Kim UINT16 FlushSize; /* Processor memory cache line width, in bytes */ 289a9f12690SJung-uk Kim UINT16 FlushStride; /* Number of flush strides that need to be read */ 2901df130f1SJung-uk Kim UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */ 291a9f12690SJung-uk Kim UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */ 292a9f12690SJung-uk Kim UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */ 293a9f12690SJung-uk Kim UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */ 294a9f12690SJung-uk Kim UINT8 Century; /* Index to century in RTC CMOS RAM */ 295a9f12690SJung-uk Kim UINT16 BootFlags; /* IA-PC Boot Architecture Flags (see below for individual flags) */ 296a9f12690SJung-uk Kim UINT8 Reserved; /* Reserved, must be zero */ 297a9f12690SJung-uk Kim UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */ 298a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */ 299a9f12690SJung-uk Kim UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */ 300313a0c13SJung-uk Kim UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ 301313a0c13SJung-uk Kim UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */ 302a9f12690SJung-uk Kim UINT64 XFacs; /* 64-bit physical address of FACS */ 303a9f12690SJung-uk Kim UINT64 XDsdt; /* 64-bit physical address of DSDT */ 304a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ 305a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ 306a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ 307a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ 308a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ 309a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 310a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ 311a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ 3121df130f1SJung-uk Kim ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */ 3131df130f1SJung-uk Kim ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */ 314a371a5fdSJung-uk Kim UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */ 315a9f12690SJung-uk Kim 316a9f12690SJung-uk Kim } ACPI_TABLE_FADT; 317a9f12690SJung-uk Kim 318a9f12690SJung-uk Kim 319313a0c13SJung-uk Kim /* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ 320a9f12690SJung-uk Kim 321a9f12690SJung-uk Kim #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ 322a9f12690SJung-uk Kim #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ 323a9f12690SJung-uk Kim #define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ 324a9f12690SJung-uk Kim #define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ 325a9f12690SJung-uk Kim #define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ 3263f0275a0SJung-uk Kim #define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */ 327a9f12690SJung-uk Kim 328313a0c13SJung-uk Kim /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ 329313a0c13SJung-uk Kim 330313a0c13SJung-uk Kim #define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ 331313a0c13SJung-uk Kim #define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */ 332313a0c13SJung-uk Kim 333d6dd1baeSJung-uk Kim /* Masks for FADT flags */ 334a9f12690SJung-uk Kim 3351df130f1SJung-uk Kim #define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ 3361df130f1SJung-uk Kim #define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] WBINVD flushes but does not invalidate caches */ 337a9f12690SJung-uk Kim #define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: [V1] All processors support C1 state */ 338a9f12690SJung-uk Kim #define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: [V1] C2 state works on MP system */ 339a9f12690SJung-uk Kim #define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */ 340a9f12690SJung-uk Kim #define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */ 3411df130f1SJung-uk Kim #define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status is not in fixed register space */ 342a9f12690SJung-uk Kim #define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: [V1] RTC alarm can wake system from S4 */ 343a9f12690SJung-uk Kim #define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: [V1] ACPI timer width is 32-bit (0=24-bit) */ 344a9f12690SJung-uk Kim #define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: [V1] Docking supported */ 345a9f12690SJung-uk Kim #define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: [V2] System reset via the FADT RESET_REG supported */ 346a9f12690SJung-uk Kim #define ACPI_FADT_SEALED_CASE (1<<11) /* 11: [V3] No internal expansion capabilities and case is sealed */ 347a9f12690SJung-uk Kim #define ACPI_FADT_HEADLESS (1<<12) /* 12: [V3] No local video capabilities or local input devices */ 348a9f12690SJung-uk Kim #define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: [V3] Must execute native instruction after writing SLP_TYPx register */ 349a9f12690SJung-uk Kim #define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: [V4] System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ 350a9f12690SJung-uk Kim #define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: [V4] OSPM should use platform-provided timer (ACPI 3.0) */ 351a9f12690SJung-uk Kim #define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: [V4] Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ 352a9f12690SJung-uk Kim #define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ 353a9f12690SJung-uk Kim #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ 354a9f12690SJung-uk Kim #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */ 3553f0275a0SJung-uk Kim #define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */ 356ec3fc72fSJung-uk Kim #define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */ 357a9f12690SJung-uk Kim 358a9f12690SJung-uk Kim 3591df130f1SJung-uk Kim /* Values for PreferredProfile (Preferred Power Management Profiles) */ 360a9f12690SJung-uk Kim 3611df130f1SJung-uk Kim enum AcpiPreferredPmProfiles 362a9f12690SJung-uk Kim { 363a9f12690SJung-uk Kim PM_UNSPECIFIED = 0, 364a9f12690SJung-uk Kim PM_DESKTOP = 1, 365a9f12690SJung-uk Kim PM_MOBILE = 2, 366a9f12690SJung-uk Kim PM_WORKSTATION = 3, 367a9f12690SJung-uk Kim PM_ENTERPRISE_SERVER = 4, 368a9f12690SJung-uk Kim PM_SOHO_SERVER = 5, 3693f0275a0SJung-uk Kim PM_APPLIANCE_PC = 6, 3703f0275a0SJung-uk Kim PM_PERFORMANCE_SERVER = 7, 371ec3fc72fSJung-uk Kim PM_TABLET = 8 372a9f12690SJung-uk Kim }; 373a9f12690SJung-uk Kim 374a371a5fdSJung-uk Kim /* Values for SleepStatus and SleepControl registers (V5+ FADT) */ 375a159c266SJung-uk Kim 376a159c266SJung-uk Kim #define ACPI_X_WAKE_STATUS 0x80 377a159c266SJung-uk Kim #define ACPI_X_SLEEP_TYPE_MASK 0x1C 378a159c266SJung-uk Kim #define ACPI_X_SLEEP_TYPE_POSITION 0x02 379a159c266SJung-uk Kim #define ACPI_X_SLEEP_ENABLE 0x20 380a159c266SJung-uk Kim 381a9f12690SJung-uk Kim 382a9f12690SJung-uk Kim /* Reset to default packing */ 383a9f12690SJung-uk Kim 384a9f12690SJung-uk Kim #pragma pack() 385a9f12690SJung-uk Kim 386a9f12690SJung-uk Kim 387d6dd1baeSJung-uk Kim /* 388d6dd1baeSJung-uk Kim * Internal table-related structures 389d6dd1baeSJung-uk Kim */ 390a9f12690SJung-uk Kim typedef union acpi_name_union 391a9f12690SJung-uk Kim { 392a9f12690SJung-uk Kim UINT32 Integer; 393a9f12690SJung-uk Kim char Ascii[4]; 394a9f12690SJung-uk Kim 395a9f12690SJung-uk Kim } ACPI_NAME_UNION; 396a9f12690SJung-uk Kim 397d6dd1baeSJung-uk Kim 398d6dd1baeSJung-uk Kim /* Internal ACPI Table Descriptor. One per ACPI table. */ 399d6dd1baeSJung-uk Kim 400a9f12690SJung-uk Kim typedef struct acpi_table_desc 401a9f12690SJung-uk Kim { 402a9f12690SJung-uk Kim ACPI_PHYSICAL_ADDRESS Address; 403a9f12690SJung-uk Kim ACPI_TABLE_HEADER *Pointer; 4041df130f1SJung-uk Kim UINT32 Length; /* Length fixed at 32 bits (fixed in table header) */ 405a9f12690SJung-uk Kim ACPI_NAME_UNION Signature; 406a9f12690SJung-uk Kim ACPI_OWNER_ID OwnerId; 407a9f12690SJung-uk Kim UINT8 Flags; 408a9f12690SJung-uk Kim 409a9f12690SJung-uk Kim } ACPI_TABLE_DESC; 410a9f12690SJung-uk Kim 411d6dd1baeSJung-uk Kim /* Masks for Flags field above */ 412a9f12690SJung-uk Kim 413313a0c13SJung-uk Kim #define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */ 414313a0c13SJung-uk Kim #define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */ 415313a0c13SJung-uk Kim #define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */ 416313a0c13SJung-uk Kim #define ACPI_TABLE_ORIGIN_MASK (3) 417a9f12690SJung-uk Kim #define ACPI_TABLE_IS_LOADED (8) 418a9f12690SJung-uk Kim 419a9f12690SJung-uk Kim 420a9f12690SJung-uk Kim /* 421a9f12690SJung-uk Kim * Get the remaining ACPI tables 422a9f12690SJung-uk Kim */ 423ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/actbl1.h> 424ca8a21efSJung-uk Kim #include <contrib/dev/acpica/include/actbl2.h> 4253f0275a0SJung-uk Kim #include <contrib/dev/acpica/include/actbl3.h> 426a9f12690SJung-uk Kim 427a9f12690SJung-uk Kim /* Macros used to generate offsets to specific table fields */ 428a9f12690SJung-uk Kim 429ec3fc72fSJung-uk Kim #define ACPI_FADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FADT, f) 430a9f12690SJung-uk Kim 4310b94ba42SJung-uk Kim /* 4320b94ba42SJung-uk Kim * Sizes of the various flavors of FADT. We need to look closely 4330b94ba42SJung-uk Kim * at the FADT length because the version number essentially tells 4340b94ba42SJung-uk Kim * us nothing because of many BIOS bugs where the version does not 4350b94ba42SJung-uk Kim * match the expected length. In other words, the length of the 4360b94ba42SJung-uk Kim * FADT is the bottom line as to what the version really is. 4370b94ba42SJung-uk Kim * 4380b94ba42SJung-uk Kim * For reference, the values below are as follows: 4393f0275a0SJung-uk Kim * FADT V1 size: 0x074 4403f0275a0SJung-uk Kim * FADT V2 size: 0x084 4413f0275a0SJung-uk Kim * FADT V3 size: 0x0F4 4423f0275a0SJung-uk Kim * FADT V4 size: 0x0F4 443ec3fc72fSJung-uk Kim * FADT V5 size: 0x10C 444a371a5fdSJung-uk Kim * FADT V6 size: 0x114 4450b94ba42SJung-uk Kim */ 4460b94ba42SJung-uk Kim #define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) 447313a0c13SJung-uk Kim #define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1) 448ec3fc72fSJung-uk Kim #define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) 449a371a5fdSJung-uk Kim #define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId)) 450a371a5fdSJung-uk Kim #define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) 4510b94ba42SJung-uk Kim 452a9f12690SJung-uk Kim #endif /* __ACTBL_H__ */ 453