1433d6423SLionel Sambuc /****************************************************************************** 2433d6423SLionel Sambuc * 3433d6423SLionel Sambuc * Name: actbl.h - Basic ACPI Table Definitions 4433d6423SLionel Sambuc * 5433d6423SLionel Sambuc *****************************************************************************/ 6433d6423SLionel Sambuc 7*29492bb7SDavid van Moolenbroek /* 8*29492bb7SDavid van Moolenbroek * Copyright (C) 2000 - 2014, Intel Corp. 9433d6423SLionel Sambuc * All rights reserved. 10433d6423SLionel Sambuc * 11*29492bb7SDavid van Moolenbroek * Redistribution and use in source and binary forms, with or without 12*29492bb7SDavid van Moolenbroek * modification, are permitted provided that the following conditions 13*29492bb7SDavid van Moolenbroek * are met: 14*29492bb7SDavid van Moolenbroek * 1. Redistributions of source code must retain the above copyright 15*29492bb7SDavid van Moolenbroek * notice, this list of conditions, and the following disclaimer, 16*29492bb7SDavid van Moolenbroek * without modification. 17*29492bb7SDavid van Moolenbroek * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18*29492bb7SDavid van Moolenbroek * substantially similar to the "NO WARRANTY" disclaimer below 19*29492bb7SDavid van Moolenbroek * ("Disclaimer") and any redistribution must be conditioned upon 20*29492bb7SDavid van Moolenbroek * including a substantially similar Disclaimer requirement for further 21*29492bb7SDavid van Moolenbroek * binary redistribution. 22*29492bb7SDavid van Moolenbroek * 3. Neither the names of the above-listed copyright holders nor the names 23*29492bb7SDavid van Moolenbroek * of any contributors may be used to endorse or promote products derived 24*29492bb7SDavid van Moolenbroek * from this software without specific prior written permission. 25433d6423SLionel Sambuc * 26*29492bb7SDavid van Moolenbroek * Alternatively, this software may be distributed under the terms of the 27*29492bb7SDavid van Moolenbroek * GNU General Public License ("GPL") version 2 as published by the Free 28*29492bb7SDavid van Moolenbroek * Software Foundation. 29433d6423SLionel Sambuc * 30*29492bb7SDavid van Moolenbroek * NO WARRANTY 31*29492bb7SDavid van Moolenbroek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32*29492bb7SDavid van Moolenbroek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33*29492bb7SDavid van Moolenbroek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34*29492bb7SDavid van Moolenbroek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35*29492bb7SDavid van Moolenbroek * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36*29492bb7SDavid van Moolenbroek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37*29492bb7SDavid van Moolenbroek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38*29492bb7SDavid van Moolenbroek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39*29492bb7SDavid van Moolenbroek * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40*29492bb7SDavid van Moolenbroek * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41*29492bb7SDavid van Moolenbroek * POSSIBILITY OF SUCH DAMAGES. 42*29492bb7SDavid van Moolenbroek */ 43433d6423SLionel Sambuc 44433d6423SLionel Sambuc #ifndef __ACTBL_H__ 45433d6423SLionel Sambuc #define __ACTBL_H__ 46433d6423SLionel Sambuc 47433d6423SLionel Sambuc 48433d6423SLionel Sambuc /******************************************************************************* 49433d6423SLionel Sambuc * 50433d6423SLionel Sambuc * Fundamental ACPI tables 51433d6423SLionel Sambuc * 52433d6423SLionel Sambuc * This file contains definitions for the ACPI tables that are directly consumed 53433d6423SLionel Sambuc * by ACPICA. All other tables are consumed by the OS-dependent ACPI-related 54433d6423SLionel Sambuc * device drivers and other OS support code. 55433d6423SLionel Sambuc * 56433d6423SLionel Sambuc * The RSDP and FACS do not use the common ACPI table header. All other ACPI 57433d6423SLionel Sambuc * tables use the header. 58433d6423SLionel Sambuc * 59433d6423SLionel Sambuc ******************************************************************************/ 60433d6423SLionel Sambuc 61433d6423SLionel Sambuc 62433d6423SLionel Sambuc /* 63433d6423SLionel Sambuc * Values for description table header signatures for tables defined in this 64433d6423SLionel Sambuc * file. Useful because they make it more difficult to inadvertently type in 65433d6423SLionel Sambuc * the wrong signature. 66433d6423SLionel Sambuc */ 67433d6423SLionel Sambuc #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ 68433d6423SLionel Sambuc #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ 69433d6423SLionel Sambuc #define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */ 70433d6423SLionel Sambuc #define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */ 71433d6423SLionel Sambuc #define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */ 72433d6423SLionel Sambuc #define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */ 73433d6423SLionel Sambuc #define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */ 74433d6423SLionel Sambuc #define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */ 75433d6423SLionel Sambuc #define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */ 76433d6423SLionel Sambuc 77433d6423SLionel Sambuc 78433d6423SLionel Sambuc /* 79433d6423SLionel Sambuc * All tables and structures must be byte-packed to match the ACPI 80433d6423SLionel Sambuc * specification, since the tables are provided by the system BIOS 81433d6423SLionel Sambuc */ 82433d6423SLionel Sambuc #pragma pack(1) 83433d6423SLionel Sambuc 84433d6423SLionel Sambuc /* 85*29492bb7SDavid van Moolenbroek * Note: C bitfields are not used for this reason: 86*29492bb7SDavid van Moolenbroek * 87*29492bb7SDavid van Moolenbroek * "Bitfields are great and easy to read, but unfortunately the C language 88*29492bb7SDavid van Moolenbroek * does not specify the layout of bitfields in memory, which means they are 89*29492bb7SDavid van Moolenbroek * essentially useless for dealing with packed data in on-disk formats or 90*29492bb7SDavid van Moolenbroek * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, 91*29492bb7SDavid van Moolenbroek * this decision was a design error in C. Ritchie could have picked an order 92*29492bb7SDavid van Moolenbroek * and stuck with it." Norman Ramsey. 93*29492bb7SDavid van Moolenbroek * See http://stackoverflow.com/a/1053662/41661 94433d6423SLionel Sambuc */ 95433d6423SLionel Sambuc 96433d6423SLionel Sambuc 97433d6423SLionel Sambuc /******************************************************************************* 98433d6423SLionel Sambuc * 99433d6423SLionel Sambuc * Master ACPI Table Header. This common header is used by all ACPI tables 100433d6423SLionel Sambuc * except the RSDP and FACS. 101433d6423SLionel Sambuc * 102433d6423SLionel Sambuc ******************************************************************************/ 103433d6423SLionel Sambuc 104433d6423SLionel Sambuc typedef struct acpi_table_header 105433d6423SLionel Sambuc { 106433d6423SLionel Sambuc char Signature[ACPI_NAME_SIZE]; /* ASCII table signature */ 107433d6423SLionel Sambuc UINT32 Length; /* Length of table in bytes, including this header */ 108*29492bb7SDavid van Moolenbroek UINT8 Revision; /* ACPI Specification minor version number */ 109433d6423SLionel Sambuc UINT8 Checksum; /* To make sum of entire table == 0 */ 110433d6423SLionel Sambuc char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */ 111433d6423SLionel Sambuc char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */ 112433d6423SLionel Sambuc UINT32 OemRevision; /* OEM revision number */ 113433d6423SLionel Sambuc char AslCompilerId[ACPI_NAME_SIZE]; /* ASCII ASL compiler vendor ID */ 114433d6423SLionel Sambuc UINT32 AslCompilerRevision; /* ASL compiler version */ 115433d6423SLionel Sambuc 116433d6423SLionel Sambuc } ACPI_TABLE_HEADER; 117433d6423SLionel Sambuc 118433d6423SLionel Sambuc 119433d6423SLionel Sambuc /******************************************************************************* 120433d6423SLionel Sambuc * 121433d6423SLionel Sambuc * GAS - Generic Address Structure (ACPI 2.0+) 122433d6423SLionel Sambuc * 123433d6423SLionel Sambuc * Note: Since this structure is used in the ACPI tables, it is byte aligned. 124*29492bb7SDavid van Moolenbroek * If misaligned access is not supported by the hardware, accesses to the 125433d6423SLionel Sambuc * 64-bit Address field must be performed with care. 126433d6423SLionel Sambuc * 127433d6423SLionel Sambuc ******************************************************************************/ 128433d6423SLionel Sambuc 129433d6423SLionel Sambuc typedef struct acpi_generic_address 130433d6423SLionel Sambuc { 131433d6423SLionel Sambuc UINT8 SpaceId; /* Address space where struct or register exists */ 132433d6423SLionel Sambuc UINT8 BitWidth; /* Size in bits of given register */ 133433d6423SLionel Sambuc UINT8 BitOffset; /* Bit offset within the register */ 134433d6423SLionel Sambuc UINT8 AccessWidth; /* Minimum Access size (ACPI 3.0) */ 135433d6423SLionel Sambuc UINT64 Address; /* 64-bit address of struct or register */ 136433d6423SLionel Sambuc 137433d6423SLionel Sambuc } ACPI_GENERIC_ADDRESS; 138433d6423SLionel Sambuc 139433d6423SLionel Sambuc 140433d6423SLionel Sambuc /******************************************************************************* 141433d6423SLionel Sambuc * 142433d6423SLionel Sambuc * RSDP - Root System Description Pointer (Signature is "RSD PTR ") 143433d6423SLionel Sambuc * Version 2 144433d6423SLionel Sambuc * 145433d6423SLionel Sambuc ******************************************************************************/ 146433d6423SLionel Sambuc 147433d6423SLionel Sambuc typedef struct acpi_table_rsdp 148433d6423SLionel Sambuc { 149433d6423SLionel Sambuc char Signature[8]; /* ACPI signature, contains "RSD PTR " */ 150433d6423SLionel Sambuc UINT8 Checksum; /* ACPI 1.0 checksum */ 151433d6423SLionel Sambuc char OemId[ACPI_OEM_ID_SIZE]; /* OEM identification */ 152433d6423SLionel Sambuc UINT8 Revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ 153433d6423SLionel Sambuc UINT32 RsdtPhysicalAddress; /* 32-bit physical address of the RSDT */ 154433d6423SLionel Sambuc UINT32 Length; /* Table length in bytes, including header (ACPI 2.0+) */ 155433d6423SLionel Sambuc UINT64 XsdtPhysicalAddress; /* 64-bit physical address of the XSDT (ACPI 2.0+) */ 156433d6423SLionel Sambuc UINT8 ExtendedChecksum; /* Checksum of entire table (ACPI 2.0+) */ 157433d6423SLionel Sambuc UINT8 Reserved[3]; /* Reserved, must be zero */ 158433d6423SLionel Sambuc 159433d6423SLionel Sambuc } ACPI_TABLE_RSDP; 160433d6423SLionel Sambuc 161433d6423SLionel Sambuc /* Standalone struct for the ACPI 1.0 RSDP */ 162433d6423SLionel Sambuc 163433d6423SLionel Sambuc typedef struct acpi_rsdp_common 164433d6423SLionel Sambuc { 165433d6423SLionel Sambuc char Signature[8]; 166433d6423SLionel Sambuc UINT8 Checksum; 167433d6423SLionel Sambuc char OemId[ACPI_OEM_ID_SIZE]; 168433d6423SLionel Sambuc UINT8 Revision; 169433d6423SLionel Sambuc UINT32 RsdtPhysicalAddress; 170433d6423SLionel Sambuc 171433d6423SLionel Sambuc } ACPI_RSDP_COMMON; 172433d6423SLionel Sambuc 173433d6423SLionel Sambuc /* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */ 174433d6423SLionel Sambuc 175433d6423SLionel Sambuc typedef struct acpi_rsdp_extension 176433d6423SLionel Sambuc { 177433d6423SLionel Sambuc UINT32 Length; 178433d6423SLionel Sambuc UINT64 XsdtPhysicalAddress; 179433d6423SLionel Sambuc UINT8 ExtendedChecksum; 180433d6423SLionel Sambuc UINT8 Reserved[3]; 181433d6423SLionel Sambuc 182433d6423SLionel Sambuc } ACPI_RSDP_EXTENSION; 183433d6423SLionel Sambuc 184433d6423SLionel Sambuc 185433d6423SLionel Sambuc /******************************************************************************* 186433d6423SLionel Sambuc * 187433d6423SLionel Sambuc * RSDT/XSDT - Root System Description Tables 188433d6423SLionel Sambuc * Version 1 (both) 189433d6423SLionel Sambuc * 190433d6423SLionel Sambuc ******************************************************************************/ 191433d6423SLionel Sambuc 192433d6423SLionel Sambuc typedef struct acpi_table_rsdt 193433d6423SLionel Sambuc { 194433d6423SLionel Sambuc ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 195433d6423SLionel Sambuc UINT32 TableOffsetEntry[1]; /* Array of pointers to ACPI tables */ 196433d6423SLionel Sambuc 197433d6423SLionel Sambuc } ACPI_TABLE_RSDT; 198433d6423SLionel Sambuc 199433d6423SLionel Sambuc typedef struct acpi_table_xsdt 200433d6423SLionel Sambuc { 201433d6423SLionel Sambuc ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 202433d6423SLionel Sambuc UINT64 TableOffsetEntry[1]; /* Array of pointers to ACPI tables */ 203433d6423SLionel Sambuc 204433d6423SLionel Sambuc } ACPI_TABLE_XSDT; 205433d6423SLionel Sambuc 206*29492bb7SDavid van Moolenbroek #define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32)) 207*29492bb7SDavid van Moolenbroek #define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64)) 208*29492bb7SDavid van Moolenbroek 209433d6423SLionel Sambuc 210433d6423SLionel Sambuc /******************************************************************************* 211433d6423SLionel Sambuc * 212433d6423SLionel Sambuc * FACS - Firmware ACPI Control Structure (FACS) 213433d6423SLionel Sambuc * 214433d6423SLionel Sambuc ******************************************************************************/ 215433d6423SLionel Sambuc 216433d6423SLionel Sambuc typedef struct acpi_table_facs 217433d6423SLionel Sambuc { 218433d6423SLionel Sambuc char Signature[4]; /* ASCII table signature */ 219433d6423SLionel Sambuc UINT32 Length; /* Length of structure, in bytes */ 220433d6423SLionel Sambuc UINT32 HardwareSignature; /* Hardware configuration signature */ 221433d6423SLionel Sambuc UINT32 FirmwareWakingVector; /* 32-bit physical address of the Firmware Waking Vector */ 222433d6423SLionel Sambuc UINT32 GlobalLock; /* Global Lock for shared hardware resources */ 223433d6423SLionel Sambuc UINT32 Flags; 224433d6423SLionel Sambuc UINT64 XFirmwareWakingVector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ 225433d6423SLionel Sambuc UINT8 Version; /* Version of this table (ACPI 2.0+) */ 226433d6423SLionel Sambuc UINT8 Reserved[3]; /* Reserved, must be zero */ 227433d6423SLionel Sambuc UINT32 OspmFlags; /* Flags to be set by OSPM (ACPI 4.0) */ 228433d6423SLionel Sambuc UINT8 Reserved1[24]; /* Reserved, must be zero */ 229433d6423SLionel Sambuc 230433d6423SLionel Sambuc } ACPI_TABLE_FACS; 231433d6423SLionel Sambuc 232433d6423SLionel Sambuc /* Masks for GlobalLock flag field above */ 233433d6423SLionel Sambuc 234433d6423SLionel Sambuc #define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */ 235433d6423SLionel Sambuc #define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */ 236433d6423SLionel Sambuc 237433d6423SLionel Sambuc /* Masks for Flags field above */ 238433d6423SLionel Sambuc 239433d6423SLionel Sambuc #define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */ 240433d6423SLionel Sambuc #define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */ 241433d6423SLionel Sambuc 242433d6423SLionel Sambuc /* Masks for OspmFlags field above */ 243433d6423SLionel Sambuc 244433d6423SLionel Sambuc #define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */ 245433d6423SLionel Sambuc 246433d6423SLionel Sambuc 247433d6423SLionel Sambuc /******************************************************************************* 248433d6423SLionel Sambuc * 249433d6423SLionel Sambuc * FADT - Fixed ACPI Description Table (Signature "FACP") 250433d6423SLionel Sambuc * Version 4 251433d6423SLionel Sambuc * 252433d6423SLionel Sambuc ******************************************************************************/ 253433d6423SLionel Sambuc 254433d6423SLionel Sambuc /* Fields common to all versions of the FADT */ 255433d6423SLionel Sambuc 256433d6423SLionel Sambuc typedef struct acpi_table_fadt 257433d6423SLionel Sambuc { 258433d6423SLionel Sambuc ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 259433d6423SLionel Sambuc UINT32 Facs; /* 32-bit physical address of FACS */ 260433d6423SLionel Sambuc UINT32 Dsdt; /* 32-bit physical address of DSDT */ 261433d6423SLionel Sambuc UINT8 Model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */ 262433d6423SLionel Sambuc UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */ 263433d6423SLionel Sambuc UINT16 SciInterrupt; /* System vector of SCI interrupt */ 264433d6423SLionel Sambuc UINT32 SmiCommand; /* 32-bit Port address of SMI command port */ 265*29492bb7SDavid van Moolenbroek UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */ 266*29492bb7SDavid van Moolenbroek UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */ 267*29492bb7SDavid van Moolenbroek UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */ 268433d6423SLionel Sambuc UINT8 PstateControl; /* Processor performance state control*/ 269*29492bb7SDavid van Moolenbroek UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ 270*29492bb7SDavid van Moolenbroek UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */ 271*29492bb7SDavid van Moolenbroek UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */ 272*29492bb7SDavid van Moolenbroek UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */ 273*29492bb7SDavid van Moolenbroek UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */ 274*29492bb7SDavid van Moolenbroek UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ 275*29492bb7SDavid van Moolenbroek UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */ 276*29492bb7SDavid van Moolenbroek UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */ 277433d6423SLionel Sambuc UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */ 278433d6423SLionel Sambuc UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */ 279433d6423SLionel Sambuc UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */ 280433d6423SLionel Sambuc UINT8 PmTimerLength; /* Byte Length of ports at PmTimerBlock */ 281433d6423SLionel Sambuc UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */ 282433d6423SLionel Sambuc UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */ 283433d6423SLionel Sambuc UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */ 284*29492bb7SDavid van Moolenbroek UINT8 CstControl; /* Support for the _CST object and C-States change notification */ 285433d6423SLionel Sambuc UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */ 286433d6423SLionel Sambuc UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */ 287*29492bb7SDavid van Moolenbroek UINT16 FlushSize; /* Processor memory cache line width, in bytes */ 288433d6423SLionel Sambuc UINT16 FlushStride; /* Number of flush strides that need to be read */ 289*29492bb7SDavid van Moolenbroek UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */ 290433d6423SLionel Sambuc UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */ 291433d6423SLionel Sambuc UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */ 292433d6423SLionel Sambuc UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */ 293433d6423SLionel Sambuc UINT8 Century; /* Index to century in RTC CMOS RAM */ 294433d6423SLionel Sambuc UINT16 BootFlags; /* IA-PC Boot Architecture Flags (see below for individual flags) */ 295433d6423SLionel Sambuc UINT8 Reserved; /* Reserved, must be zero */ 296433d6423SLionel Sambuc UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */ 297433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */ 298433d6423SLionel Sambuc UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */ 299*29492bb7SDavid van Moolenbroek UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ 300*29492bb7SDavid van Moolenbroek UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */ 301433d6423SLionel Sambuc UINT64 XFacs; /* 64-bit physical address of FACS */ 302433d6423SLionel Sambuc UINT64 XDsdt; /* 64-bit physical address of DSDT */ 303433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ 304433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */ 305433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */ 306433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */ 307433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */ 308433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 309433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ 310433d6423SLionel Sambuc ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ 311*29492bb7SDavid van Moolenbroek ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */ 312*29492bb7SDavid van Moolenbroek ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */ 313433d6423SLionel Sambuc 314433d6423SLionel Sambuc } ACPI_TABLE_FADT; 315433d6423SLionel Sambuc 316433d6423SLionel Sambuc 317*29492bb7SDavid van Moolenbroek /* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ 318433d6423SLionel Sambuc 319433d6423SLionel Sambuc #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ 320433d6423SLionel Sambuc #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ 321433d6423SLionel Sambuc #define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ 322433d6423SLionel Sambuc #define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ 323433d6423SLionel Sambuc #define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ 324*29492bb7SDavid van Moolenbroek #define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */ 325*29492bb7SDavid van Moolenbroek 326*29492bb7SDavid van Moolenbroek /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ 327*29492bb7SDavid van Moolenbroek 328*29492bb7SDavid van Moolenbroek #define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ 329*29492bb7SDavid van Moolenbroek #define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */ 330433d6423SLionel Sambuc 331433d6423SLionel Sambuc /* Masks for FADT flags */ 332433d6423SLionel Sambuc 333*29492bb7SDavid van Moolenbroek #define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ 334*29492bb7SDavid van Moolenbroek #define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] WBINVD flushes but does not invalidate caches */ 335433d6423SLionel Sambuc #define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: [V1] All processors support C1 state */ 336433d6423SLionel Sambuc #define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: [V1] C2 state works on MP system */ 337433d6423SLionel Sambuc #define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */ 338433d6423SLionel Sambuc #define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */ 339*29492bb7SDavid van Moolenbroek #define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status is not in fixed register space */ 340433d6423SLionel Sambuc #define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: [V1] RTC alarm can wake system from S4 */ 341433d6423SLionel Sambuc #define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: [V1] ACPI timer width is 32-bit (0=24-bit) */ 342433d6423SLionel Sambuc #define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: [V1] Docking supported */ 343433d6423SLionel Sambuc #define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: [V2] System reset via the FADT RESET_REG supported */ 344433d6423SLionel Sambuc #define ACPI_FADT_SEALED_CASE (1<<11) /* 11: [V3] No internal expansion capabilities and case is sealed */ 345433d6423SLionel Sambuc #define ACPI_FADT_HEADLESS (1<<12) /* 12: [V3] No local video capabilities or local input devices */ 346433d6423SLionel Sambuc #define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: [V3] Must execute native instruction after writing SLP_TYPx register */ 347433d6423SLionel Sambuc #define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: [V4] System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ 348433d6423SLionel Sambuc #define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: [V4] OSPM should use platform-provided timer (ACPI 3.0) */ 349433d6423SLionel Sambuc #define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: [V4] Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ 350433d6423SLionel Sambuc #define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ 351433d6423SLionel Sambuc #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ 352433d6423SLionel Sambuc #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */ 353*29492bb7SDavid van Moolenbroek #define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */ 354*29492bb7SDavid van Moolenbroek #define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */ 355433d6423SLionel Sambuc 356433d6423SLionel Sambuc 357*29492bb7SDavid van Moolenbroek /* Values for PreferredProfile (Preferred Power Management Profiles) */ 358433d6423SLionel Sambuc 359*29492bb7SDavid van Moolenbroek enum AcpiPreferredPmProfiles 360433d6423SLionel Sambuc { 361433d6423SLionel Sambuc PM_UNSPECIFIED = 0, 362433d6423SLionel Sambuc PM_DESKTOP = 1, 363433d6423SLionel Sambuc PM_MOBILE = 2, 364433d6423SLionel Sambuc PM_WORKSTATION = 3, 365433d6423SLionel Sambuc PM_ENTERPRISE_SERVER = 4, 366433d6423SLionel Sambuc PM_SOHO_SERVER = 5, 367*29492bb7SDavid van Moolenbroek PM_APPLIANCE_PC = 6, 368*29492bb7SDavid van Moolenbroek PM_PERFORMANCE_SERVER = 7, 369*29492bb7SDavid van Moolenbroek PM_TABLET = 8 370433d6423SLionel Sambuc }; 371433d6423SLionel Sambuc 372*29492bb7SDavid van Moolenbroek /* Values for SleepStatus and SleepControl registers (V5 FADT) */ 373*29492bb7SDavid van Moolenbroek 374*29492bb7SDavid van Moolenbroek #define ACPI_X_WAKE_STATUS 0x80 375*29492bb7SDavid van Moolenbroek #define ACPI_X_SLEEP_TYPE_MASK 0x1C 376*29492bb7SDavid van Moolenbroek #define ACPI_X_SLEEP_TYPE_POSITION 0x02 377*29492bb7SDavid van Moolenbroek #define ACPI_X_SLEEP_ENABLE 0x20 378*29492bb7SDavid van Moolenbroek 379433d6423SLionel Sambuc 380433d6423SLionel Sambuc /* Reset to default packing */ 381433d6423SLionel Sambuc 382433d6423SLionel Sambuc #pragma pack() 383433d6423SLionel Sambuc 384433d6423SLionel Sambuc 385433d6423SLionel Sambuc /* 386433d6423SLionel Sambuc * Internal table-related structures 387433d6423SLionel Sambuc */ 388433d6423SLionel Sambuc typedef union acpi_name_union 389433d6423SLionel Sambuc { 390433d6423SLionel Sambuc UINT32 Integer; 391433d6423SLionel Sambuc char Ascii[4]; 392433d6423SLionel Sambuc 393433d6423SLionel Sambuc } ACPI_NAME_UNION; 394433d6423SLionel Sambuc 395433d6423SLionel Sambuc 396433d6423SLionel Sambuc /* Internal ACPI Table Descriptor. One per ACPI table. */ 397433d6423SLionel Sambuc 398433d6423SLionel Sambuc typedef struct acpi_table_desc 399433d6423SLionel Sambuc { 400433d6423SLionel Sambuc ACPI_PHYSICAL_ADDRESS Address; 401433d6423SLionel Sambuc ACPI_TABLE_HEADER *Pointer; 402*29492bb7SDavid van Moolenbroek UINT32 Length; /* Length fixed at 32 bits (fixed in table header) */ 403433d6423SLionel Sambuc ACPI_NAME_UNION Signature; 404433d6423SLionel Sambuc ACPI_OWNER_ID OwnerId; 405433d6423SLionel Sambuc UINT8 Flags; 406433d6423SLionel Sambuc 407433d6423SLionel Sambuc } ACPI_TABLE_DESC; 408433d6423SLionel Sambuc 409433d6423SLionel Sambuc /* Masks for Flags field above */ 410433d6423SLionel Sambuc 411*29492bb7SDavid van Moolenbroek #define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */ 412*29492bb7SDavid van Moolenbroek #define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */ 413*29492bb7SDavid van Moolenbroek #define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */ 414*29492bb7SDavid van Moolenbroek #define ACPI_TABLE_ORIGIN_MASK (3) 415433d6423SLionel Sambuc #define ACPI_TABLE_IS_LOADED (8) 416433d6423SLionel Sambuc 417433d6423SLionel Sambuc 418433d6423SLionel Sambuc /* 419433d6423SLionel Sambuc * Get the remaining ACPI tables 420433d6423SLionel Sambuc */ 421433d6423SLionel Sambuc #include "actbl1.h" 422433d6423SLionel Sambuc #include "actbl2.h" 423*29492bb7SDavid van Moolenbroek #include "actbl3.h" 424433d6423SLionel Sambuc 425433d6423SLionel Sambuc /* Macros used to generate offsets to specific table fields */ 426433d6423SLionel Sambuc 427*29492bb7SDavid van Moolenbroek #define ACPI_FADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FADT, f) 428*29492bb7SDavid van Moolenbroek 429*29492bb7SDavid van Moolenbroek /* 430*29492bb7SDavid van Moolenbroek * Sizes of the various flavors of FADT. We need to look closely 431*29492bb7SDavid van Moolenbroek * at the FADT length because the version number essentially tells 432*29492bb7SDavid van Moolenbroek * us nothing because of many BIOS bugs where the version does not 433*29492bb7SDavid van Moolenbroek * match the expected length. In other words, the length of the 434*29492bb7SDavid van Moolenbroek * FADT is the bottom line as to what the version really is. 435*29492bb7SDavid van Moolenbroek * 436*29492bb7SDavid van Moolenbroek * For reference, the values below are as follows: 437*29492bb7SDavid van Moolenbroek * FADT V1 size: 0x074 438*29492bb7SDavid van Moolenbroek * FADT V2 size: 0x084 439*29492bb7SDavid van Moolenbroek * FADT V3 size: 0x0F4 440*29492bb7SDavid van Moolenbroek * FADT V4 size: 0x0F4 441*29492bb7SDavid van Moolenbroek * FADT V5 size: 0x10C 442*29492bb7SDavid van Moolenbroek */ 443*29492bb7SDavid van Moolenbroek #define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) 444*29492bb7SDavid van Moolenbroek #define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1) 445*29492bb7SDavid van Moolenbroek #define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) 446*29492bb7SDavid van Moolenbroek #define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) 447433d6423SLionel Sambuc 448433d6423SLionel Sambuc #endif /* __ACTBL_H__ */ 449