Add full MADT and ECDT support

date	2003.10.01.19.52.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 20:07:33 +00:00
parent 4dc1d631a6
commit 394271db18
3 changed files with 223 additions and 95 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl.h - Table data structures defined in ACPI specification
* $Revision: 1.59 $
* $Revision: 1.60 $
*
*****************************************************************************/
@ -138,16 +138,6 @@
#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
/* values of Mapic.Model */
#define DUAL_PIC 0
#define MULTIPLE_APIC 1
/* values of Type in APIC_HEADER */
#define APIC_PROC 0
#define APIC_IO 1
/*
* Common table types. The base code can remain
@ -162,8 +152,10 @@
#pragma pack(1)
/*
* Architecture-independent tables
* The architecture dependent tables are in separate files
* ACPI Version-independent tables
*
* NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.)
* are in separate files.
*/
typedef struct rsdp_descriptor /* Root System Descriptor Pointer */
{
@ -180,21 +172,6 @@ typedef struct rsdp_descriptor /* Root System Descriptor Pointer */
} RSDP_DESCRIPTOR;
typedef struct acpi_table_header /* ACPI common table header */
{
char Signature [4]; /* ACPI signature (4 ASCII characters) */
UINT32 Length; /* Length of table, in bytes, including header */
UINT8 Revision; /* ACPI Specification minor version # */
UINT8 Checksum; /* To make sum of entire table == 0 */
char OemId [6]; /* OEM identification */
char OemTableId [8]; /* OEM table identification */
UINT32 OemRevision; /* OEM revision number */
char AslCompilerId [4]; /* ASL compiler vendor ID */
UINT32 AslCompilerRevision; /* ASL compiler revision number */
} ACPI_TABLE_HEADER;
typedef struct acpi_common_facs /* Common FACS for internal use */
{
UINT32 *GlobalLock;
@ -204,73 +181,208 @@ typedef struct acpi_common_facs /* Common FACS for internal use */
} ACPI_COMMON_FACS;
typedef struct apic_table
#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
char Signature [4]; /* ACPI signature (4 ASCII characters) */\
UINT32 Length; /* Length of table, in bytes, including header */\
UINT8 Revision; /* ACPI Specification minor version # */\
UINT8 Checksum; /* To make sum of entire table == 0 */\
char OemId [6]; /* OEM identification */\
char OemTableId [8]; /* OEM table identification */\
UINT32 OemRevision; /* OEM revision number */\
char AslCompilerId [4]; /* ASL compiler vendor ID */\
UINT32 AslCompilerRevision; /* ASL compiler revision number */
typedef struct acpi_table_header /* ACPI common table header */
{
ACPI_TABLE_HEADER Header; /* ACPI table header */
UINT32 LocalApicAddress; /* Physical address for accessing local APICs */
UINT32_BIT PCATCompat : 1; /* a one indicates system also has dual 8259s */
ACPI_TABLE_HEADER_DEF
} ACPI_TABLE_HEADER;
/*
* MADT values and structures
*/
/* Values for MADT PCATCompat */
#define DUAL_PIC 0
#define MULTIPLE_APIC 1
/* Master MADT */
typedef struct multiple_apic_table
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
UINT32 LocalApicAddress; /* Physical address of local APIC */
UINT32_BIT PCATCompat : 1; /* A one indicates system also has dual 8259s */
UINT32_BIT Reserved1 : 31;
} APIC_TABLE;
} MULTIPLE_APIC_TABLE;
typedef struct apic_header
/* Values for Type in APIC_HEADER_DEF */
#define APIC_PROCESSOR 0
#define APIC_IO 1
#define APIC_XRUPT_OVERRIDE 2
#define APIC_NMI 3
#define APIC_LOCAL_NMI 4
#define APIC_ADDRESS_OVERRIDE 5
#define APIC_IO_SAPIC 6
#define APIC_LOCAL_SAPIC 7
#define APIC_XRUPT_SOURCE 8
#define APIC_RESERVED 9 /* 9 and greater are reserved */
/*
* MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
*/
#define APIC_HEADER_DEF /* Common APIC sub-structure header */\
UINT8 Type; \
UINT8 Length;
/* Values for MPS INTI flags */
#define POLARITY_CONFORMS 0
#define POLARITY_ACTIVE_HIGH 1
#define POLARITY_RESERVED 2
#define POLARITY_ACTIVE_LOW 3
#define TRIGGER_CONFORMS 0
#define TRIGGER_EDGE 1
#define TRIGGER_RESERVED 2
#define TRIGGER_LEVEL 3
/* Common flag definitions */
#define MPS_INTI_FLAGS \
UINT16_BIT Polarity : 2; /* Polarity of APIC I/O input signals */\
UINT16_BIT TriggerMode : 2; /* Trigger mode of APIC input signals */\
UINT16_BIT Reserved1 : 12; /* Reserved, must be zero */
#define LOCAL_APIC_FLAGS \
UINT32_BIT ProcessorEnabled: 1; /* Processor is usable if set */\
UINT32_BIT Reserved2 : 31; /* Reserved, must be zero */
/* Sub-structures for MADT */
typedef struct madt_processor_apic
{
UINT8 Type; /* APIC type. Either APIC_PROC or APIC_IO */
UINT8 Length; /* Length of APIC structure */
} APIC_HEADER;
typedef struct processor_apic
{
APIC_HEADER Header;
UINT8 ProcessorApicId; /* ACPI processor id */
APIC_HEADER_DEF
UINT8 ProcessorId; /* ACPI processor id */
UINT8 LocalApicId; /* Processor's local APIC id */
UINT32_BIT ProcessorEnabled: 1; /* Processor is usable if set */
UINT32_BIT Reserved1 : 31;
LOCAL_APIC_FLAGS
} PROCESSOR_APIC;
} MADT_PROCESSOR_APIC;
typedef struct io_apic
typedef struct madt_io_apic
{
APIC_HEADER Header;
APIC_HEADER_DEF
UINT8 IoApicId; /* I/O APIC ID */
UINT8 Reserved; /* Reserved - must be zero */
UINT32 IoApicAddress; /* APIC's physical address */
UINT32 Vector; /* Interrupt vector index where INTI
UINT32 Address; /* APIC physical address */
UINT32 Interrupt; /* Global system interrupt where INTI
* lines start */
} IO_APIC;
} MADT_IO_APIC;
/*
* IA64 TBD: Add SAPIC Tables
*/
/*
* IA64 TBD: Modify Smart Battery Description to comply with ACPI IA64
* extensions.
*/
typedef struct smart_battery_description_table
typedef struct madt_interrupt_override
{
ACPI_TABLE_HEADER Header;
APIC_HEADER_DEF
UINT8 Bus; /* 0 - ISA */
UINT8 Source; /* Interrupt source (IRQ) */
UINT32 Interrupt; /* Global system interrupt */
MPS_INTI_FLAGS
} MADT_INTERRUPT_OVERRIDE;
typedef struct madt_nmi_source
{
APIC_HEADER_DEF
MPS_INTI_FLAGS
UINT32 Interrupt; /* Global system interrupt */
} MADT_NMI_SOURCE;
typedef struct madt_local_apic_nmi
{
APIC_HEADER_DEF
UINT8 ProcessorId; /* ACPI processor id */
MPS_INTI_FLAGS
UINT8 Lint; /* LINTn to which NMI is connected */
} MADT_LOCAL_APIC_NMI;
typedef struct madt_address_override
{
APIC_HEADER_DEF
UINT16 Reserved; /* Reserved - must be zero */
UINT32 Address; /* APIC physical address */
} MADT_ADDRESS_OVERRIDE;
typedef struct madt_io_sapic
{
APIC_HEADER_DEF
UINT8 IoSapicId; /* I/O SAPIC ID */
UINT8 Reserved; /* Reserved - must be zero */
UINT32 InterruptBase; /* Glocal interrupt for SAPIC start */
UINT64 Address; /* SAPIC physical address */
} MADT_IO_SAPIC;
typedef struct madt_local_sapic
{
APIC_HEADER_DEF
UINT8 ProcessorId; /* ACPI processor id */
UINT8 LocalSapicId; /* SAPIC ID */
UINT8 LocalSapicEid; /* SAPIC EID */
UINT8 Reserved [3]; /* Reserved - must be zero */
LOCAL_APIC_FLAGS
} MADT_LOCAL_SAPIC;
typedef struct madt_interrupt_source
{
APIC_HEADER_DEF
MPS_INTI_FLAGS
UINT8 InterruptType; /* 1=PMI, 2=INIT, 3=corrected */
UINT8 ProcessorId; /* Processor ID */
UINT8 ProcessorEid; /* Processor EID */
UINT8 IoSapicVector; /* Vector value for PMI interrupts */
UINT32 Interrupt; /* Global system interrupt */
UINT32 Reserved; /* Reserved - must be zero */
} MADT_INTERRUPT_SOURCE;
/*
* Smart Battery
*/
typedef struct smart_battery_table
{
ACPI_TABLE_HEADER_DEF
UINT32 WarningLevel;
UINT32 LowLevel;
UINT32 CriticalLevel;
} SMART_BATTERY_DESCRIPTION_TABLE;
} SMART_BATTERY_TABLE;
typedef struct hpet_description_table
/*
* High performance timer
*/
typedef struct hpet_table
{
ACPI_TABLE_HEADER Header;
ACPI_TABLE_HEADER_DEF
UINT32 HardwareId;
UINT32 BaseAddress[3];
UINT32 BaseAddress [3];
UINT8 HpetNumber;
UINT16 ClockTick;
UINT8 Attributes;
} HPET_DESCRIPTION_TABLE;
} HPET_TABLE;
#pragma pack()
@ -309,9 +421,10 @@ typedef struct acpi_table_support
/*
* Get the architecture-specific tables
* Get the ACPI version-specific tables
*/
#include "actbl1.h" /* Acpi 1.0 table definitions */
#include "actbl2.h" /* Acpi 2.0 table definitions */
#endif /* __ACTBL_H__ */

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl1.h - ACPI 1.0 tables
* $Revision: 1.20 $
* $Revision: 1.27 $
*
*****************************************************************************/
@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
* All rights reserved.
*
* 2. License
@ -122,20 +122,20 @@
/*
* ACPI 1.0 Root System Description Table (RSDT)
*/
typedef struct
typedef struct rsdt_descriptor_rev1
{
ACPI_TABLE_HEADER Header; /* ACPI Table header */
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
UINT32 TableOffsetEntry [1]; /* Array of pointers to other */
/* ACPI tables */
} RSDT_DESCRIPTOR_REV1;
/*
/*
* ACPI 1.0 Firmware ACPI Control Structure (FACS)
*/
typedef struct
typedef struct facs_descriptor_rev1
{
NATIVE_CHAR Signature[4]; /* ACPI Signature */
char Signature[4]; /* ACPI Signature */
UINT32 Length; /* Length of structure, in bytes */
UINT32 HardwareSignature; /* Hardware configuration signature */
UINT32 FirmwareWakingVector; /* ACPI OS waking vector */
@ -147,12 +147,12 @@ typedef struct
} FACS_DESCRIPTOR_REV1;
/*
/*
* ACPI 1.0 Fixed ACPI Description Table (FADT)
*/
typedef struct
typedef struct fadt_descriptor_rev1
{
ACPI_TABLE_HEADER Header; /* ACPI Table header */
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
UINT32 FirmwareCtrl; /* Physical address of FACS */
UINT32 Dsdt; /* Physical address of DSDT */
UINT8 Model; /* System Interrupt Model */
@ -202,7 +202,7 @@ typedef struct
UINT32_BIT TmrValExt : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */
UINT32_BIT Reserved5 : 23; /* Reserved - must be zero */
} FADT_DESCRIPTOR_REV1;
} FADT_DESCRIPTOR_REV1;
#pragma pack()

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
* $Revision: 1.27 $
* $Revision: 1.33 $
*
*****************************************************************************/
@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
* All rights reserved.
*
* 2. License
@ -142,9 +142,9 @@
/*
* ACPI 2.0 Root System Description Table (RSDT)
*/
typedef struct
typedef struct rsdt_descriptor_rev2
{
ACPI_TABLE_HEADER Header; /* ACPI table header */
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
UINT32 TableOffsetEntry [1]; /* Array of pointers to */
/* ACPI table headers */
} RSDT_DESCRIPTOR_REV2;
@ -153,9 +153,9 @@ typedef struct
/*
* ACPI 2.0 Extended System Description Table (XSDT)
*/
typedef struct
typedef struct xsdt_descriptor_rev2
{
ACPI_TABLE_HEADER Header; /* ACPI table header */
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
UINT64 TableOffsetEntry [1]; /* Array of pointers to */
/* ACPI table headers */
} XSDT_DESCRIPTOR_REV2;
@ -164,9 +164,9 @@ typedef struct
/*
* ACPI 2.0 Firmware ACPI Control Structure (FACS)
*/
typedef struct
typedef struct facs_descriptor_rev2
{
NATIVE_CHAR Signature[4]; /* ACPI signature */
char Signature[4]; /* ACPI signature */
UINT32 Length; /* Length of structure, in bytes */
UINT32 HardwareSignature; /* Hardware configuration signature */
UINT32 FirmwareWakingVector; /* 32bit physical address of the Firmware Waking Vector. */
@ -183,7 +183,7 @@ typedef struct
/*
* ACPI 2.0 Generic Address Structure (GAS)
*/
typedef struct
typedef struct acpi_generic_address
{
UINT8 AddressSpaceId; /* Address space where struct or register exists. */
UINT8 RegisterBitWidth; /* Size in bits of given register */
@ -197,9 +197,9 @@ typedef struct
/*
* ACPI 2.0 Fixed ACPI Description Table (FADT)
*/
typedef struct
typedef struct fadt_descriptor_rev2
{
ACPI_TABLE_HEADER Header; /* ACPI table header */
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
UINT32 V1_FirmwareCtrl; /* 32-bit physical address of FACS */
UINT32 V1_Dsdt; /* 32-bit physical address of DSDT */
UINT8 Reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/
@ -230,8 +230,8 @@ typedef struct
UINT16 Plvl3Lat; /* Worst case HW latency to enter/exit C3 state */
UINT16 FlushSize; /* Number of flush strides that need to be read */
UINT16 FlushStride; /* Processor's memory cache line width, in bytes */
UINT8 DutyOffset; /* Processors duty cycle index in processor's P_CNT reg*/
UINT8 DutyWidth; /* Processors duty cycle value bit width in P_CNT register.*/
UINT8 DutyOffset; /* Processor's duty cycle index in processor's P_CNT reg*/
UINT8 DutyWidth; /* Processor's duty cycle value bit width in P_CNT register.*/
UINT8 DayAlrm; /* Index to day-of-month alarm in RTC CMOS RAM */
UINT8 MonAlrm; /* Index to month-of-year alarm in RTC CMOS RAM */
UINT8 Century; /* Index to century in RTC CMOS RAM */
@ -268,7 +268,22 @@ typedef struct
ACPI_GENERIC_ADDRESS XGpe0Blk; /* Extended General Purpose AcpiEvent 0 Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe1Blk; /* Extended General Purpose AcpiEvent 1 Reg Blk address */
} FADT_DESCRIPTOR_REV2;
} FADT_DESCRIPTOR_REV2;
/* Embedded Controller */
typedef struct ec_boot_resources
{
ACPI_TABLE_HEADER_DEF
ACPI_GENERIC_ADDRESS EcControl; /* Address of EC command/status register */
ACPI_GENERIC_ADDRESS EcData; /* Address of EC data register */
UINT32 Uid; /* Unique ID - must be same as the EC _UID method */
UINT8 GpeBit; /* The GPE for the EC */
UINT8 EcId[1]; /* Full namepath of the EC in the ACPI namespace */
} EC_BOOT_RESOURCES;
#pragma pack()