https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6847cc3ae0877fe1959f3…
commit 6847cc3ae0877fe1959f3af49cc62cd576bf8cdb
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Thu Oct 25 12:07:40 2018 +0200
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Oct 28 15:28:34 2018 +0100
[ACPICA] Update to version 20180531. CORE-15222
---
drivers/bus/acpi/acpica/dispatcher/dsargs.c | 1 +
drivers/bus/acpi/acpica/dispatcher/dsdebug.c | 10 +-
drivers/bus/acpi/acpica/dispatcher/dsopcode.c | 4 +-
drivers/bus/acpi/acpica/dispatcher/dspkginit.c | 161 +-
drivers/bus/acpi/acpica/dispatcher/dswexec.c | 4 +-
drivers/bus/acpi/acpica/dispatcher/dswload.c | 2 +-
drivers/bus/acpi/acpica/dispatcher/dswscope.c | 9 +-
drivers/bus/acpi/acpica/events/evevent.c | 9 +-
drivers/bus/acpi/acpica/events/evgpe.c | 238 +-
drivers/bus/acpi/acpica/events/evgpeblk.c | 20 +-
drivers/bus/acpi/acpica/events/evrgnini.c | 5 +-
drivers/bus/acpi/acpica/events/evxface.c | 9 +
drivers/bus/acpi/acpica/events/evxfgpe.c | 31 +-
drivers/bus/acpi/acpica/executer/exconfig.c | 21 +
drivers/bus/acpi/acpica/executer/exconvrt.c | 1 +
drivers/bus/acpi/acpica/executer/exdebug.c | 7 +-
drivers/bus/acpi/acpica/executer/exnames.c | 7 +-
drivers/bus/acpi/acpica/executer/exresop.c | 1 +
drivers/bus/acpi/acpica/hardware/hwgpe.c | 1 -
drivers/bus/acpi/acpica/hardware/hwsleep.c | 12 +-
drivers/bus/acpi/acpica/hardware/hwxfsleep.c | 2 +-
drivers/bus/acpi/acpica/include/acapps.h | 4 +
drivers/bus/acpi/acpica/include/acdisasm.h | 1 +
drivers/bus/acpi/acpica/include/acevents.h | 21 +
drivers/bus/acpi/acpica/include/acmacros.h | 4 +-
drivers/bus/acpi/acpica/include/acnames.h | 7 +-
drivers/bus/acpi/acpica/include/acnamesp.h | 6 +
drivers/bus/acpi/acpica/include/acopcode.h | 14 +-
drivers/bus/acpi/acpica/include/acoutput.h | 4 +-
drivers/bus/acpi/acpica/include/acpixf.h | 23 +-
drivers/bus/acpi/acpica/include/actbinfo.h | 1 +
drivers/bus/acpi/acpica/include/actbl1.h | 2526 ++++++++++---------
drivers/bus/acpi/acpica/include/actbl2.h | 2634 +++++++++++---------
drivers/bus/acpi/acpica/include/actbl3.h | 1136 ++++-----
drivers/bus/acpi/acpica/include/actypes.h | 27 +-
drivers/bus/acpi/acpica/include/amlcode.h | 21 +-
drivers/bus/acpi/acpica/include/platform/aclinux.h | 2 +
drivers/bus/acpi/acpica/namespace/nsdump.c | 4 +
drivers/bus/acpi/acpica/namespace/nsdumpdv.c | 5 +-
drivers/bus/acpi/acpica/namespace/nseval.c | 35 +-
drivers/bus/acpi/acpica/namespace/nsinit.c | 79 +-
drivers/bus/acpi/acpica/namespace/nsload.c | 24 +-
drivers/bus/acpi/acpica/namespace/nsnames.c | 3 +
drivers/bus/acpi/acpica/namespace/nsparse.c | 34 +-
drivers/bus/acpi/acpica/namespace/nsxfname.c | 22 +-
drivers/bus/acpi/acpica/parser/psargs.c | 10 +-
drivers/bus/acpi/acpica/parser/psloop.c | 68 +-
drivers/bus/acpi/acpica/parser/psobject.c | 35 +-
drivers/bus/acpi/acpica/parser/psparse.c | 2 +-
drivers/bus/acpi/acpica/parser/pstree.c | 1 +
drivers/bus/acpi/acpica/parser/pswalk.c | 29 +-
drivers/bus/acpi/acpica/resources/rsdump.c | 2 +-
drivers/bus/acpi/acpica/tables/tbdata.c | 18 +-
drivers/bus/acpi/acpica/tables/tbinstal.c | 8 +-
drivers/bus/acpi/acpica/tables/tbxfload.c | 13 +-
drivers/bus/acpi/acpica/utilities/utbuffer.c | 4 +-
drivers/bus/acpi/acpica/utilities/utcache.c | 5 +-
drivers/bus/acpi/acpica/utilities/utdelete.c | 16 +-
drivers/bus/acpi/acpica/utilities/uterror.c | 10 +-
drivers/bus/acpi/acpica/utilities/utosi.c | 1 +
drivers/bus/acpi/acpica/utilities/utprint.c | 1 +
drivers/bus/acpi/acpica/utilities/utstring.c | 2 +-
drivers/bus/acpi/acpica/utilities/utxfinit.c | 48 +-
63 files changed, 3925 insertions(+), 3540 deletions(-)
diff --git a/drivers/bus/acpi/acpica/dispatcher/dsargs.c
b/drivers/bus/acpi/acpica/dispatcher/dsargs.c
index fd68e27670..da05c5e431 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsargs.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsargs.c
@@ -373,6 +373,7 @@ AcpiDsGetPackageArguments (
Status = AcpiDsExecuteArguments (Node, Node,
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
+
return_ACPI_STATUS (Status);
}
diff --git a/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
b/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
index b4e6690fa9..f962a61c10 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
@@ -143,6 +143,7 @@ AcpiDsDumpMethodStack (
ACPI_FUNCTION_TRACE (DsDumpMethodStack);
+
/* Ignore control codes, they are not errors */
if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
@@ -212,8 +213,13 @@ AcpiDsDumpMethodStack (
Op->Common.Next = NULL;
#ifdef ACPI_DISASSEMBLER
- AcpiOsPrintf ("Failed at ");
- AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
+ if (WalkState->MethodNode != AcpiGbl_RootNode)
+ {
+ /* More verbose if not module-level code */
+
+ AcpiOsPrintf ("Failed at ");
+ AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
+ }
#endif
Op->Common.Next = Next;
}
diff --git a/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
b/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
index 086a9b332f..309f011e88 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
@@ -644,8 +644,8 @@ AcpiDsEvalDataObjectOperands (
if (!Op->Common.Value.Arg)
{
ACPI_ERROR ((AE_INFO,
- "Dispatch: Missing child while executing TermArg for %X",
- Op->Common.AmlOpcode));
+ "Missing child while evaluating opcode %4.4X, Op %p",
+ Op->Common.AmlOpcode, Op));
return_ACPI_STATUS (AE_OK);
}
diff --git a/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
b/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
index 4a4ac47fce..56ab585eaa 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
@@ -47,6 +47,7 @@
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
+#include "acparser.h"
#define _COMPONENT ACPI_NAMESPACE
@@ -100,6 +101,7 @@ AcpiDsBuildInternalPackageObj (
ACPI_PARSE_OBJECT *Parent;
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
ACPI_STATUS Status = AE_OK;
+ BOOLEAN ModuleLevelCode = FALSE;
UINT16 ReferenceCount;
UINT32 Index;
UINT32 i;
@@ -108,6 +110,13 @@ AcpiDsBuildInternalPackageObj (
ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
+ /* Check if we are executing module level code */
+
+ if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)
+ {
+ ModuleLevelCode = TRUE;
+ }
+
/* Find the parent of a possibly nested package */
Parent = Op->Common.Parent;
@@ -142,25 +151,43 @@ AcpiDsBuildInternalPackageObj (
/*
* Allocate the element array (array of pointers to the individual
- * objects) based on the NumElements parameter. Add an extra pointer slot
- * so that the list is always null terminated.
+ * objects) if necessary. the count is based on the NumElements
+ * parameter. Add an extra pointer slot so that the list is always
+ * null terminated.
*/
- ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
-
if (!ObjDesc->Package.Elements)
{
- AcpiUtDeleteObjectDesc (ObjDesc);
- return_ACPI_STATUS (AE_NO_MEMORY);
+ ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
+ ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
+
+ if (!ObjDesc->Package.Elements)
+ {
+ AcpiUtDeleteObjectDesc (ObjDesc);
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ ObjDesc->Package.Count = ElementCount;
}
- ObjDesc->Package.Count = ElementCount;
+ /* First arg is element count. Second arg begins the initializer list */
+
Arg = Op->Common.Value.Arg;
Arg = Arg->Common.Next;
- if (Arg)
+ /*
+ * If we are executing module-level code, we will defer the
+ * full resolution of the package elements in order to support
+ * forward references from the elements. This provides
+ * compatibility with other ACPI implementations.
+ */
+ if (ModuleLevelCode)
{
- ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+ ObjDesc->Package.AmlStart = WalkState->Aml;
+ ObjDesc->Package.AmlLength = 0;
+
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
+ "%s: Deferring resolution of Package elements\n",
+ ACPI_GET_FUNCTION_NAME));
}
/*
@@ -200,12 +227,17 @@ AcpiDsBuildInternalPackageObj (
ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not
found"));
}
- /*
- * Initialize this package element. This function handles the
- * resolution of named references within the package.
- */
- AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
- NULL, &ObjDesc->Package.Elements[i]);
+ if (!ModuleLevelCode)
+ {
+ /*
+ * Initialize this package element. This function handles the
+ * resolution of named references within the package.
+ * Forward references from module-level code are deferred
+ * until all ACPI tables are loaded.
+ */
+ AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
+ NULL, &ObjDesc->Package.Elements[i]);
+ }
}
if (*ObjDescPtr)
@@ -275,15 +307,21 @@ AcpiDsBuildInternalPackageObj (
* NumElements count.
*
* Note: this is not an error, the package is padded out
- * with NULLs.
+ * with NULLs as per the ACPI specification.
*/
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Package List length (%u) smaller than NumElements "
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
+ "%s: Package List length (%u) smaller than NumElements "
"count (%u), padded with null elements\n",
- i, ElementCount));
+ ACPI_GET_FUNCTION_NAME, i, ElementCount));
+ }
+
+ /* Module-level packages will be resolved later */
+
+ if (!ModuleLevelCode)
+ {
+ ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
}
- ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
return_ACPI_STATUS (Status);
}
@@ -373,11 +411,12 @@ AcpiDsResolvePackageElement (
ACPI_OPERAND_OBJECT **ElementPtr)
{
ACPI_STATUS Status;
+ ACPI_STATUS Status2;
ACPI_GENERIC_STATE ScopeInfo;
ACPI_OPERAND_OBJECT *Element = *ElementPtr;
ACPI_NAMESPACE_NODE *ResolvedNode;
ACPI_NAMESPACE_NODE *OriginalNode;
- char *ExternalPath = NULL;
+ char *ExternalPath = "";
ACPI_OBJECT_TYPE Type;
@@ -388,6 +427,10 @@ AcpiDsResolvePackageElement (
if (Element->Reference.Resolved)
{
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
+ "%s: Package element is already resolved\n",
+ ACPI_GET_FUNCTION_NAME));
+
return_VOID;
}
@@ -395,21 +438,47 @@ AcpiDsResolvePackageElement (
ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
- Status = AcpiNsLookup (&ScopeInfo,
- (char *) Element->Reference.Aml, /* Pointer to AML path */
+ Status = AcpiNsLookup (&ScopeInfo, (char *) Element->Reference.Aml,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
NULL, &ResolvedNode);
if (ACPI_FAILURE (Status))
{
- Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
- (char *) Element->Reference.Aml,
- NULL, &ExternalPath);
+ if ((Status == AE_NOT_FOUND) && AcpiGbl_IgnorePackageResolutionErrors)
+ {
+ /*
+ * Optionally be silent about the NOT_FOUND case for the referenced
+ * name. Although this is potentially a serious problem,
+ * it can generate a lot of noise/errors on platforms whose
+ * firmware carries around a bunch of unused Package objects.
+ * To disable these errors, set this global to TRUE:
+ * AcpiGbl_IgnorePackageResolutionErrors
+ *
+ * If the AML actually tries to use such a package, the unresolved
+ * element(s) will be replaced with NULL elements.
+ */
+
+ /* Referenced name not found, set the element to NULL */
+
+ AcpiUtRemoveReference (*ElementPtr);
+ *ElementPtr = NULL;
+ return_VOID;
+ }
+
+ Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX,
+ (char *) Element->Reference.Aml, NULL, &ExternalPath);
ACPI_EXCEPTION ((AE_INFO, Status,
- "Could not find/resolve named package element: %s",
ExternalPath));
+ "While resolving a named reference package element - %s",
+ ExternalPath));
+ if (ACPI_SUCCESS (Status2))
+ {
+ ACPI_FREE (ExternalPath);
+ }
+
+ /* Could not resolve name, set the element to NULL */
- ACPI_FREE (ExternalPath);
+ AcpiUtRemoveReference (*ElementPtr);
*ElementPtr = NULL;
return_VOID;
}
@@ -423,24 +492,6 @@ AcpiDsResolvePackageElement (
*ElementPtr = NULL;
return_VOID;
}
-#if 0
- else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
- {
- /*
- * A temporary node found here indicates that the reference is
- * to a node that was created within this method. We are not
- * going to allow it (especially if the package is returned
- * from the method) -- the temporary node will be deleted out
- * from under the method. (05/2017).
- */
- ACPI_ERROR ((AE_INFO,
- "Package element refers to a temporary name [%4.4s], "
- "inserting a NULL element",
- ResolvedNode->Name.Ascii));
- *ElementPtr = NULL;
- return_VOID;
- }
-#endif
/*
* Special handling for Alias objects. We need ResolvedNode to point
@@ -479,22 +530,6 @@ AcpiDsResolvePackageElement (
return_VOID;
}
-#if 0
-/* TBD - alias support */
- /*
- * Special handling for Alias objects. We need to setup the type
- * and the Op->Common.Node to point to the Alias target. Note,
- * Alias has at most one level of indirection internally.
- */
- Type = Op->Common.Node->Type;
- if (Type == ACPI_TYPE_LOCAL_ALIAS)
- {
- Type = ObjDesc->Common.Type;
- Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- Op->Common.Node->Object);
- }
-#endif
-
switch (Type)
{
/*
diff --git a/drivers/bus/acpi/acpica/dispatcher/dswexec.c
b/drivers/bus/acpi/acpica/dispatcher/dswexec.c
index 932fa4f1f6..e3aa385a12 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dswexec.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dswexec.c
@@ -615,8 +615,8 @@ AcpiDsExecEndOp (
case AML_TYPE_CREATE_OBJECT:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
- Op, Op->Named.Data));
+ "Executing CreateObject (Buffer/Package) Op=%p Child=%p
ParentOpcode=%4.4X\n",
+ Op, Op->Named.Value.Arg, Op->Common.Parent->Common.AmlOpcode));
switch (Op->Common.Parent->Common.AmlOpcode)
{
diff --git a/drivers/bus/acpi/acpica/dispatcher/dswload.c
b/drivers/bus/acpi/acpica/dispatcher/dswload.c
index c451b80bbb..0b222072e2 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dswload.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dswload.c
@@ -156,7 +156,7 @@ AcpiDsLoad1BeginOp (
UINT32 Flags;
- ACPI_FUNCTION_TRACE (DsLoad1BeginOp);
+ ACPI_FUNCTION_TRACE_PTR (DsLoad1BeginOp, WalkState->Op);
Op = WalkState->Op;
diff --git a/drivers/bus/acpi/acpica/dispatcher/dswscope.c
b/drivers/bus/acpi/acpica/dispatcher/dswscope.c
index 0d9df41b4c..d94242e523 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dswscope.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dswscope.c
@@ -161,8 +161,7 @@ AcpiDsScopeStackPush (
}
else
{
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
- "[\\___] (%s)", "ROOT"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
@@ -220,15 +219,13 @@ AcpiDsScopeStackPop (
NewScopeInfo = WalkState->ScopeInfo;
if (NewScopeInfo)
{
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
- "[%4.4s] (%s)\n",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)\n",
AcpiUtGetNodeName (NewScopeInfo->Scope.Node),
AcpiUtGetTypeName (NewScopeInfo->Common.Value)));
}
else
{
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
- "[\\___] (ROOT)\n"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%s\n", ACPI_NAMESPACE_ROOT));
}
AcpiUtDeleteGenericState (ScopeInfo);
diff --git a/drivers/bus/acpi/acpica/events/evevent.c
b/drivers/bus/acpi/acpica/events/evevent.c
index f802e9b07d..cec39cbb1c 100644
--- a/drivers/bus/acpi/acpica/events/evevent.c
+++ b/drivers/bus/acpi/acpica/events/evevent.c
@@ -236,6 +236,7 @@ AcpiEvFixedEventDetect (
UINT32 FixedStatus;
UINT32 FixedEnable;
UINT32 i;
+ ACPI_STATUS Status;
ACPI_FUNCTION_NAME (EvFixedEventDetect);
@@ -245,8 +246,12 @@ AcpiEvFixedEventDetect (
* Read the fixed feature status and enable registers, as all the cases
* depend on their values. Ignore errors here.
*/
- (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
- (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
+ Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
+ Status |= AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (IntStatus);
+ }
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"Fixed Event Block: Enable %08X Status %08X\n",
diff --git a/drivers/bus/acpi/acpica/events/evgpe.c
b/drivers/bus/acpi/acpica/events/evgpe.c
index 34294c0bc6..15e260ae2a 100644
--- a/drivers/bus/acpi/acpica/events/evgpe.c
+++ b/drivers/bus/acpi/acpica/events/evgpe.c
@@ -118,7 +118,7 @@ AcpiEvUpdateGpeEnableMask (
*
* RETURN: Status
*
- * DESCRIPTION: Clear a GPE of stale events and enable it.
+ * DESCRIPTION: Enable a GPE.
*
******************************************************************************/
@@ -132,14 +132,6 @@ AcpiEvEnableGpe (
ACPI_FUNCTION_TRACE (EvEnableGpe);
- /* Clear the GPE (of stale events) */
-
- Status = AcpiHwClearGpe (GpeEventInfo);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/* Enable the requested GPE */
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
@@ -434,17 +426,12 @@ UINT32
AcpiEvGpeDetect (
ACPI_GPE_XRUPT_INFO *GpeXruptList)
{
- ACPI_STATUS Status;
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_NAMESPACE_NODE *GpeDevice;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
UINT32 GpeNumber;
- ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
- UINT8 EnabledStatusByte;
- UINT64 StatusReg;
- UINT64 EnableReg;
ACPI_CPU_FLAGS Flags;
UINT32 i;
UINT32 j;
@@ -500,105 +487,25 @@ AcpiEvGpeDetect (
continue;
}
- /* Read the Status Register */
-
- Status = AcpiHwRead (&StatusReg,
&GpeRegisterInfo->StatusAddress);
- if (ACPI_FAILURE (Status))
- {
- goto UnlockAndExit;
- }
-
- /* Read the Enable Register */
-
- Status = AcpiHwRead (&EnableReg,
&GpeRegisterInfo->EnableAddress);
- if (ACPI_FAILURE (Status))
- {
- goto UnlockAndExit;
- }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
- "RunEnable=%02X, WakeEnable=%02X\n",
- GpeRegisterInfo->BaseGpeNumber,
- GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
- (UINT32) StatusReg, (UINT32) EnableReg,
- GpeRegisterInfo->EnableForRun,
- GpeRegisterInfo->EnableForWake));
-
- /* Check if there is anything active at all in this register */
-
- EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
- if (!EnabledStatusByte)
- {
- /* No active GPEs in this register, move on */
-
- continue;
- }
-
/* Now look at the individual GPEs in this byte register */
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
{
- /* Examine one GPE bit */
+ /* Detect and dispatch one GPE bit */
GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
ACPI_GPE_REGISTER_WIDTH) + j];
GpeNumber = j + GpeRegisterInfo->BaseGpeNumber;
-
- if (EnabledStatusByte & (1 << j))
- {
- /* Invoke global event handler if present */
-
- AcpiGpeCount++;
- if (AcpiGbl_GlobalEventHandler)
- {
- AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
- GpeDevice, GpeNumber,
- AcpiGbl_GlobalEventHandlerContext);
- }
-
- /* Found an active GPE */
-
- if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
- ACPI_GPE_DISPATCH_RAW_HANDLER)
- {
- /* Dispatch the event to a raw handler */
-
- GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
-
- /*
- * There is no protection around the namespace node
- * and the GPE handler to ensure a safe destruction
- * because:
- * 1. The namespace node is expected to always
- * exist after loading a table.
- * 2. The GPE handler is expected to be flushed by
- * AcpiOsWaitEventsComplete() before the
- * destruction.
- */
- AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
- IntStatus |= GpeHandlerInfo->Address (
- GpeDevice, GpeNumber, GpeHandlerInfo->Context);
- Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
- }
- else
- {
- /*
- * Dispatch the event to a standard handler or
- * method.
- */
- IntStatus |= AcpiEvGpeDispatch (GpeDevice,
- GpeEventInfo, GpeNumber);
- }
- }
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ IntStatus |= AcpiEvDetectGpe (
+ GpeDevice, GpeEventInfo, GpeNumber);
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
}
}
GpeBlock = GpeBlock->Next;
}
-UnlockAndExit:
-
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return (IntStatus);
}
@@ -784,6 +691,137 @@ AcpiEvFinishGpe (
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiEvDetectGpe
+ *
+ * PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1
+ * GpeEventInfo - Info for this GPE
+ * GpeNumber - Number relative to the parent GPE block
+ *
+ * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
+ *
+ * DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
+ * (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
+ * NOTE: GPE is W1C, so it is possible to handle a single GPE from both
+ * task and irq context in parallel as long as the process to
+ * detect and mask the GPE is atomic.
+ * However the atomicity of ACPI_GPE_DISPATCH_RAW_HANDLER is
+ * dependent on the raw handler itself.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiEvDetectGpe (
+ ACPI_NAMESPACE_NODE *GpeDevice,
+ ACPI_GPE_EVENT_INFO *GpeEventInfo,
+ UINT32 GpeNumber)
+{
+ UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
+ UINT8 EnabledStatusByte;
+ UINT64 StatusReg;
+ UINT64 EnableReg;
+ UINT32 RegisterBit;
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
+ ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
+ ACPI_CPU_FLAGS Flags;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (EvGpeDetect);
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+ /* Get the info block for the entire GPE register */
+
+ GpeRegisterInfo = GpeEventInfo->RegisterInfo;
+
+ /* Get the register bitmask for this GPE */
+
+ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
+
+ /* GPE currently enabled (enable bit == 1)? */
+
+ Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ /* GPE currently active (status bit == 1)? */
+
+ Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ /* Check if there is anything active at all in this GPE */
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
+ "Read registers for GPE %02X: Status=%02X, Enable=%02X, "
+ "RunEnable=%02X, WakeEnable=%02X\n",
+ GpeNumber,
+ (UINT32) (StatusReg & RegisterBit),
+ (UINT32) (EnableReg & RegisterBit),
+ GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo->EnableForWake));
+
+ EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
+ if (!(EnabledStatusByte & RegisterBit))
+ {
+ goto ErrorExit;
+ }
+
+ /* Invoke global event handler if present */
+
+ AcpiGpeCount++;
+ if (AcpiGbl_GlobalEventHandler)
+ {
+ AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
+ GpeDevice, GpeNumber,
+ AcpiGbl_GlobalEventHandlerContext);
+ }
+
+ /* Found an active GPE */
+
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_RAW_HANDLER)
+ {
+ /* Dispatch the event to a raw handler */
+
+ GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
+
+ /*
+ * There is no protection around the namespace node
+ * and the GPE handler to ensure a safe destruction
+ * because:
+ * 1. The namespace node is expected to always
+ * exist after loading a table.
+ * 2. The GPE handler is expected to be flushed by
+ * AcpiOsWaitEventsComplete() before the
+ * destruction.
+ */
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ IntStatus |= GpeHandlerInfo->Address (
+ GpeDevice, GpeNumber, GpeHandlerInfo->Context);
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+ }
+ else
+ {
+ /* Dispatch the event to a standard handler or method. */
+
+ IntStatus |= AcpiEvGpeDispatch (GpeDevice,
+ GpeEventInfo, GpeNumber);
+ }
+
+ErrorExit:
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ return (IntStatus);
+}
+
+
/*******************************************************************************
*
* FUNCTION: AcpiEvGpeDispatch
@@ -797,8 +835,6 @@ AcpiEvFinishGpe (
* DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC)
* or method (e.g. _Lxx/_Exx) handler.
*
- * This function executes at interrupt level.
- *
******************************************************************************/
UINT32
diff --git a/drivers/bus/acpi/acpica/events/evgpeblk.c
b/drivers/bus/acpi/acpica/events/evgpeblk.c
index 6c929e7817..cded0598d7 100644
--- a/drivers/bus/acpi/acpica/events/evgpeblk.c
+++ b/drivers/bus/acpi/acpica/events/evgpeblk.c
@@ -477,7 +477,7 @@ ACPI_STATUS
AcpiEvInitializeGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
- void *Ignored)
+ void *Context)
{
ACPI_STATUS Status;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
@@ -485,6 +485,8 @@ AcpiEvInitializeGpeBlock (
UINT32 GpeIndex;
UINT32 i;
UINT32 j;
+ BOOLEAN *IsPollingNeeded = Context;
+ ACPI_ERROR_ONLY (UINT32 GpeNumber);
ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
@@ -514,14 +516,14 @@ AcpiEvInitializeGpeBlock (
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
+ ACPI_ERROR_ONLY(GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex);
+ GpeEventInfo->Flags |= ACPI_GPE_INITIALIZED;
/*
* Ignore GPEs that have no corresponding _Lxx/_Exx method
* and GPEs that are used to wake the system
*/
- if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_NONE) ||
- (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_HANDLER) ||
- (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_RAW_HANDLER) ||
+ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
ACPI_GPE_DISPATCH_METHOD) ||
(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
continue;
@@ -532,10 +534,18 @@ AcpiEvInitializeGpeBlock (
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not enable GPE 0x%02X",
- GpeIndex + GpeBlock->BlockBaseNumber));
+ GpeNumber));
continue;
}
+ GpeEventInfo->Flags |= ACPI_GPE_AUTO_ENABLED;
+
+ if (IsPollingNeeded &&
+ ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
+ {
+ *IsPollingNeeded = TRUE;
+ }
+
GpeEnabledCount++;
}
}
diff --git a/drivers/bus/acpi/acpica/events/evrgnini.c
b/drivers/bus/acpi/acpica/events/evrgnini.c
index 7ed8ae558f..0ab23c1094 100644
--- a/drivers/bus/acpi/acpica/events/evrgnini.c
+++ b/drivers/bus/acpi/acpica/events/evrgnini.c
@@ -628,9 +628,12 @@ AcpiEvInitializeRegion (
* Node's object was replaced by this Method object and we
* saved the handler in the method object.
*
+ * Note: Only used for the legacy MLC support. Will
+ * be removed in the future.
+ *
* See AcpiNsExecModuleCode
*/
- if (!AcpiGbl_ParseTableAsTermList &&
+ if (!AcpiGbl_ExecuteTablesAsMethods &&
ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
HandlerObj = ObjDesc->Method.Dispatch.Handler;
diff --git a/drivers/bus/acpi/acpica/events/evxface.c
b/drivers/bus/acpi/acpica/events/evxface.c
index 159184737d..79dc347c7c 100644
--- a/drivers/bus/acpi/acpica/events/evxface.c
+++ b/drivers/bus/acpi/acpica/events/evxface.c
@@ -1149,6 +1149,15 @@ AcpiRemoveGpeHandler (
Handler->OriginallyEnabled)
{
(void) AcpiEvAddGpeReference (GpeEventInfo);
+ if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
+ {
+ /* Poll edge triggered GPEs to handle existing events */
+
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ (void) AcpiEvDetectGpe (
+ GpeDevice, GpeEventInfo, GpeNumber);
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+ }
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
diff --git a/drivers/bus/acpi/acpica/events/evxfgpe.c
b/drivers/bus/acpi/acpica/events/evxfgpe.c
index 2b6be57e88..0b1b22e7b7 100644
--- a/drivers/bus/acpi/acpica/events/evxfgpe.c
+++ b/drivers/bus/acpi/acpica/events/evxfgpe.c
@@ -80,6 +80,7 @@ AcpiUpdateAllGpes (
void)
{
ACPI_STATUS Status;
+ BOOLEAN IsPollingNeeded = FALSE;
ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes);
@@ -96,7 +97,8 @@ AcpiUpdateAllGpes (
goto UnlockAndExit;
}
- Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL);
+ Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock,
+ &IsPollingNeeded);
if (ACPI_SUCCESS (Status))
{
AcpiGbl_AllGpesInitialized = TRUE;
@@ -104,6 +106,13 @@ AcpiUpdateAllGpes (
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+
+ if (IsPollingNeeded && AcpiGbl_AllGpesInitialized)
+ {
+ /* Poll GPEs to handle already triggered events */
+
+ AcpiEvGpeDetect (AcpiGbl_GpeXruptListHead);
+ }
return_ACPI_STATUS (Status);
}
@@ -151,6 +160,16 @@ AcpiEnableGpe (
ACPI_GPE_DISPATCH_NONE)
{
Status = AcpiEvAddGpeReference (GpeEventInfo);
+ if (ACPI_SUCCESS (Status) &&
+ ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
+ {
+ /* Poll edge-triggered GPEs to handle existing events */
+
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ (void) AcpiEvDetectGpe (
+ GpeDevice, GpeEventInfo, GpeNumber);
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+ }
}
else
{
@@ -501,6 +520,16 @@ AcpiSetupGpeForWake (
GpeEventInfo->Flags =
(ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
}
+ else if (GpeEventInfo->Flags & ACPI_GPE_AUTO_ENABLED)
+ {
+ /*
+ * A reference to this GPE has been added during the GPE block
+ * initialization, so drop it now to prevent the GPE from being
+ * permanently enabled and clear its ACPI_GPE_AUTO_ENABLED flag.
+ */
+ (void) AcpiEvRemoveGpeReference (GpeEventInfo);
+ GpeEventInfo->Flags &= ~~ACPI_GPE_AUTO_ENABLED;
+ }
/*
* If we already have an implicit notify on this GPE, add
diff --git a/drivers/bus/acpi/acpica/executer/exconfig.c
b/drivers/bus/acpi/acpica/executer/exconfig.c
index df6ff629a0..864637463f 100644
--- a/drivers/bus/acpi/acpica/executer/exconfig.c
+++ b/drivers/bus/acpi/acpica/executer/exconfig.c
@@ -233,6 +233,11 @@ AcpiExLoadTableOp (
return_ACPI_STATUS (Status);
}
+ /* Complete the initialization/resolution of package objects */
+
+ Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+
/* Parameter Data (optional) */
if (ParameterNode)
@@ -506,6 +511,11 @@ AcpiExLoadOp (
return_ACPI_STATUS (Status);
}
+ /* Complete the initialization/resolution of package objects */
+
+ Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+
/* Store the DdbHandle into the Target operand */
Status = AcpiExStore (DdbHandle, Target, WalkState);
@@ -558,6 +568,17 @@ AcpiExUnloadTable (
ACPI_WARNING ((AE_INFO,
"Received request to unload an ACPI table"));
+ /*
+ * May 2018: Unload is no longer supported for the following reasons:
+ * 1) A correct implementation on some hosts may not be possible.
+ * 2) Other ACPI implementations do not correctly/fully support it.
+ * 3) It requires host device driver support which does not exist.
+ * (To properly support namespace unload out from underneath.)
+ * 4) This AML operator has never been seen in the field.
+ */
+ ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
+ "AML Unload operator is not supported"));
+
/*
* Validate the handle
* Although the handle is partially validated in AcpiExReconfiguration()
diff --git a/drivers/bus/acpi/acpica/executer/exconvrt.c
b/drivers/bus/acpi/acpica/executer/exconvrt.c
index 2e33ac85da..6c2bc9db19 100644
--- a/drivers/bus/acpi/acpica/executer/exconvrt.c
+++ b/drivers/bus/acpi/acpica/executer/exconvrt.c
@@ -649,6 +649,7 @@ AcpiExConvertToTargetType (
switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs))
{
case ARGI_SIMPLE_TARGET:
+ case ARGI_FIXED_TARGET:
case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */
switch (DestinationType)
diff --git a/drivers/bus/acpi/acpica/executer/exdebug.c
b/drivers/bus/acpi/acpica/executer/exdebug.c
index e31b381dc1..e340fb1b16 100644
--- a/drivers/bus/acpi/acpica/executer/exdebug.c
+++ b/drivers/bus/acpi/acpica/executer/exdebug.c
@@ -96,15 +96,14 @@ AcpiExDoDebugObject (
return_VOID;
}
- /* Null string or newline -- don't emit the line header */
+ /* Newline -- don't emit the line header */
if (SourceDesc &&
(ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) &&
(SourceDesc->Common.Type == ACPI_TYPE_STRING))
{
- if ((SourceDesc->String.Length == 0) ||
- ((SourceDesc->String.Length == 1) &&
- (*SourceDesc->String.Pointer == '\n')))
+ if ((SourceDesc->String.Length == 1) &&
+ (*SourceDesc->String.Pointer == '\n'))
{
AcpiOsPrintf ("\n");
return_VOID;
diff --git a/drivers/bus/acpi/acpica/executer/exnames.c
b/drivers/bus/acpi/acpica/executer/exnames.c
index caab78982c..b4a2a648ae 100644
--- a/drivers/bus/acpi/acpica/executer/exnames.c
+++ b/drivers/bus/acpi/acpica/executer/exnames.c
@@ -201,14 +201,11 @@ AcpiExNameSegment (
return_ACPI_STATUS (AE_CTRL_PENDING);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n"));
-
for (Index = 0;
(Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0));
Index++)
{
CharBuf[Index] = *AmlAddress++;
- ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "%c\n", CharBuf[Index]));
}
@@ -222,9 +219,9 @@ AcpiExNameSegment (
if (NameString)
{
- strcat (NameString, CharBuf);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "Appended to - %s\n", NameString));
+ "Appending NameSeg %s\n", CharBuf));
+ strcat (NameString, CharBuf);
}
else
{
diff --git a/drivers/bus/acpi/acpica/executer/exresop.c
b/drivers/bus/acpi/acpica/executer/exresop.c
index f8e2c21f5e..3453803556 100644
--- a/drivers/bus/acpi/acpica/executer/exresop.c
+++ b/drivers/bus/acpi/acpica/executer/exresop.c
@@ -321,6 +321,7 @@ AcpiExResolveOperands (
case ARGI_OBJECT_REF:
case ARGI_DEVICE_REF:
case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
+ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
case ARGI_STORE_TARGET:
diff --git a/drivers/bus/acpi/acpica/hardware/hwgpe.c
b/drivers/bus/acpi/acpica/hardware/hwgpe.c
index dff688db17..788fc56e5f 100644
--- a/drivers/bus/acpi/acpica/hardware/hwgpe.c
+++ b/drivers/bus/acpi/acpica/hardware/hwgpe.c
@@ -550,7 +550,6 @@ AcpiHwDisableAllGpes (
Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
- Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
return_ACPI_STATUS (Status);
}
diff --git a/drivers/bus/acpi/acpica/hardware/hwsleep.c
b/drivers/bus/acpi/acpica/hardware/hwsleep.c
index 5a89bfcf94..8fce247a5f 100644
--- a/drivers/bus/acpi/acpica/hardware/hwsleep.c
+++ b/drivers/bus/acpi/acpica/hardware/hwsleep.c
@@ -90,16 +90,8 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- /* Clear all fixed and general purpose status bits */
-
- Status = AcpiHwClearAcpiStatus ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/*
- * 1) Disable/Clear all GPEs
+ * 1) Disable all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
@@ -319,7 +311,7 @@ AcpiHwLegacyWake (
* might get fired there
*
* Restore the GPEs:
- * 1) Disable/Clear all GPEs
+ * 1) Disable all GPEs
* 2) Enable all runtime GPEs
*/
Status = AcpiHwDisableAllGpes ();
diff --git a/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
b/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
index 8170f837a9..f6e3ec13d5 100644
--- a/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
+++ b/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
@@ -229,7 +229,7 @@ AcpiEnterSleepStateS4bios (
}
/*
- * 1) Disable/Clear all GPEs
+ * 1) Disable all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
diff --git a/drivers/bus/acpi/acpica/include/acapps.h
b/drivers/bus/acpi/acpica/include/acapps.h
index 654ff55daf..0192ea7750 100644
--- a/drivers/bus/acpi/acpica/include/acapps.h
+++ b/drivers/bus/acpi/acpica/include/acapps.h
@@ -216,6 +216,10 @@ FlSplitInputPathname (
char **OutDirectoryPath,
char **OutFilename);
+char *
+FlGetFileBasename (
+ char *FilePathname);
+
char *
AdGenerateFilename (
char *Prefix,
diff --git a/drivers/bus/acpi/acpica/include/acdisasm.h
b/drivers/bus/acpi/acpica/include/acdisasm.h
index 99448ec3b7..e9b7a4876b 100644
--- a/drivers/bus/acpi/acpica/include/acdisasm.h
+++ b/drivers/bus/acpi/acpica/include/acdisasm.h
@@ -341,6 +341,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort5[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[];
diff --git a/drivers/bus/acpi/acpica/include/acevents.h
b/drivers/bus/acpi/acpica/include/acevents.h
index de7b8c6532..5559544ec7 100644
--- a/drivers/bus/acpi/acpica/include/acevents.h
+++ b/drivers/bus/acpi/acpica/include/acevents.h
@@ -45,6 +45,21 @@
#define __ACEVENTS_H__
+/*
+ * Conditions to trigger post enabling GPE polling:
+ * It is not sufficient to trigger edge-triggered GPE with specific GPE
+ * chips, software need to poll once after enabling.
+ */
+#ifdef ACPI_USE_GPE_POLLING
+#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) \
+ ((__gpe__)->RuntimeCount == 1 && \
+ (__gpe__)->Flags & ACPI_GPE_INITIALIZED && \
+ ((__gpe__)->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED)
+#else
+#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) FALSE
+#endif
+
+
/*
* evevent
*/
@@ -142,6 +157,12 @@ ACPI_STATUS
AcpiEvFinishGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
+UINT32
+AcpiEvDetectGpe (
+ ACPI_NAMESPACE_NODE *GpeDevice,
+ ACPI_GPE_EVENT_INFO *GpeEventInfo,
+ UINT32 GpeNumber);
+
/*
* evgpeblk - Upper-level GPE block support
diff --git a/drivers/bus/acpi/acpica/include/acmacros.h
b/drivers/bus/acpi/acpica/include/acmacros.h
index 1816c3f128..b7aba87b3a 100644
--- a/drivers/bus/acpi/acpica/include/acmacros.h
+++ b/drivers/bus/acpi/acpica/include/acmacros.h
@@ -464,16 +464,18 @@
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
#define ACPI_BIOS_ERROR_PREDEFINED(plist) AcpiUtPredefinedBiosError plist
+#define ACPI_ERROR_ONLY(s) s
#else
/* No error messages */
-#define ACPI_ERROR_NAMESPACE(s, e)
+#define ACPI_ERROR_NAMESPACE(s, p, e)
#define ACPI_ERROR_METHOD(s, n, p, e)
#define ACPI_WARN_PREDEFINED(plist)
#define ACPI_INFO_PREDEFINED(plist)
#define ACPI_BIOS_ERROR_PREDEFINED(plist)
+#define ACPI_ERROR_ONLY(s)
#endif /* ACPI_NO_ERROR_MESSAGES */
diff --git a/drivers/bus/acpi/acpica/include/acnames.h
b/drivers/bus/acpi/acpica/include/acnames.h
index 663c6b13f6..8ca7fc8573 100644
--- a/drivers/bus/acpi/acpica/include/acnames.h
+++ b/drivers/bus/acpi/acpica/include/acnames.h
@@ -83,11 +83,14 @@
/* Definitions of the predefined namespace names */
#define ACPI_UNKNOWN_NAME (UINT32) 0x3F3F3F3F /* Unknown name is
"????" */
-#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is
"\___" */
-
#define ACPI_PREFIX_MIXED (UINT32) 0x69706341 /* "Acpi" */
#define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */
+/* Root name stuff */
+
+#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is
"\___" */
+#define ACPI_ROOT_PATHNAME "\\___"
+#define ACPI_NAMESPACE_ROOT "Namespace Root"
#define ACPI_NS_ROOT_PATH "\\"
#endif /* __ACNAMES_H__ */
diff --git a/drivers/bus/acpi/acpica/include/acnamesp.h
b/drivers/bus/acpi/acpica/include/acnamesp.h
index c93d555f38..51d4d93349 100644
--- a/drivers/bus/acpi/acpica/include/acnamesp.h
+++ b/drivers/bus/acpi/acpica/include/acnamesp.h
@@ -96,6 +96,12 @@ ACPI_STATUS
AcpiNsInitializeDevices (
UINT32 Flags);
+ACPI_STATUS
+AcpiNsInitOnePackage (
+ ACPI_HANDLE ObjHandle,
+ UINT32 Level,
+ void *Context,
+ void **ReturnValue);
/*
* nsload - Namespace loading
diff --git a/drivers/bus/acpi/acpica/include/acopcode.h
b/drivers/bus/acpi/acpica/include/acopcode.h
index 7c544f7586..1bd91359a4 100644
--- a/drivers/bus/acpi/acpica/include/acopcode.h
+++ b/drivers/bus/acpi/acpica/include/acopcode.h
@@ -253,7 +253,7 @@
#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
+#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_IF_OP ARGI_INVALID_OPCODE
#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_TARGETREF)
#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
@@ -317,12 +317,12 @@
#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER,
ARGI_TARGETREF)
#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
#define ARGI_TIMER_OP ARG_NONE
-#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
-#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER,
ARGI_TARGETREF)
+#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
+#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER,
ARGI_FIXED_TARGET)
#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
diff --git a/drivers/bus/acpi/acpica/include/acoutput.h
b/drivers/bus/acpi/acpica/include/acoutput.h
index a29367567e..a03003b953 100644
--- a/drivers/bus/acpi/acpica/include/acoutput.h
+++ b/drivers/bus/acpi/acpica/include/acoutput.h
@@ -115,7 +115,8 @@
#define ACPI_LV_ALLOCATIONS 0x00100000
#define ACPI_LV_FUNCTIONS 0x00200000
#define ACPI_LV_OPTIMIZATIONS 0x00400000
-#define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1
+#define ACPI_LV_PARSE_TREES 0x00800000
+#define ACPI_LV_VERBOSITY2 0x00F00000 | ACPI_LV_VERBOSITY1
#define ACPI_LV_ALL ACPI_LV_VERBOSITY2
/* Trace verbosity level 3 [Threading, I/O, and Interrupts] */
@@ -167,6 +168,7 @@
#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
#define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
+#define ACPI_DB_PARSE_TREES ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES)
#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
diff --git a/drivers/bus/acpi/acpica/include/acpixf.h
b/drivers/bus/acpi/acpica/include/acpixf.h
index 8242adf5a2..ebf5981356 100644
--- a/drivers/bus/acpi/acpica/include/acpixf.h
+++ b/drivers/bus/acpi/acpica/include/acpixf.h
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20180105
+#define ACPI_CA_VERSION 0x20180531
#include "acconfig.h"
#include "actypes.h"
@@ -194,15 +194,18 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
/*
* Optionally support group module level code.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
*/
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE);
/*
- * Optionally support module level code by parsing the entire table as
- * a TermList. Default is FALSE, do not execute entire table until some
- * lock order issues are fixed.
+ * Optionally support module level code by parsing an entire table as
+ * a method as it is loaded. Default is TRUE.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
*/
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_ParseTableAsTermList, FALSE);
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_ExecuteTablesAsMethods, TRUE);
/*
* Optionally use 32-bit FADT addresses if and when there is a conflict
@@ -268,6 +271,16 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
*/
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_MaxLoopIterations, ACPI_MAX_LOOP_TIMEOUT);
+/*
+ * Optionally ignore AE_NOT_FOUND errors from named reference package elements
+ * during DSDT/SSDT table loading. This reduces error "noise" in platforms
+ * whose firmware is carrying around a bunch of unused package objects that
+ * refer to non-existent named objects. However, If the AML actually tries to
+ * use such a package, the unresolved element(s) will be replaced with NULL
+ * elements.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnorePackageResolutionErrors, FALSE);
+
/*
* This mechanism is used to trace a specified AML method. The method is
* traced each time it is executed.
diff --git a/drivers/bus/acpi/acpica/include/actbinfo.h
b/drivers/bus/acpi/acpica/include/actbinfo.h
index 6c0d997bce..8a1fd74742 100644
--- a/drivers/bus/acpi/acpica/include/actbinfo.h
+++ b/drivers/bus/acpi/acpica/include/actbinfo.h
@@ -149,6 +149,7 @@
#define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f)
#define ACPI_IORT3A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f)
#define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f)
+#define ACPI_IORT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_PMCG,f)
#define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f)
#define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
#define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f)
diff --git a/drivers/bus/acpi/acpica/include/actbl1.h
b/drivers/bus/acpi/acpica/include/actbl1.h
index cc83db5153..b76195f8b1 100644
--- a/drivers/bus/acpi/acpica/include/actbl1.h
+++ b/drivers/bus/acpi/acpica/include/actbl1.h
@@ -47,13 +47,11 @@
/*******************************************************************************
*
- * Additional ACPI Tables (1)
+ * Additional ACPI Tables
*
* These tables are not consumed directly by the ACPICA subsystem, but are
* included here to support device drivers and the AML disassembler.
*
- * The tables in this file are fully defined within the ACPI specification.
- *
******************************************************************************/
@@ -62,24 +60,44 @@
* file. Useful because they make it more difficult to inadvertently type in
* the wrong signature.
*/
+#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
+#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
+#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling
table */
+#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
+#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
+#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
+#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
+#define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for
Measurement table */
#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot
Resources Table */
#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table
*/
-#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes
Table */
+#define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table
*/
+#define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table
*/
#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
-#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table
*/
-#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics
Table */
-#define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
-#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology
Table */
-#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification
Table */
-#define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
-#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance
Information Table */
-#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table
*/
-#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table
*/
+#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes
Table */
+#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table
*/
+#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
+
+#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
+/* Reserved table signatures */
+
+#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table
*/
+#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table
*/
+
+/*
+ * These tables have been seen in the field, but no definition has been found
+ */
+#ifdef ACPI_UNDEFINED_TABLES
+#define ACPI_SIG_ATKG "ATKG"
+#define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */
+#define ACPI_SIG_IEIT "IEIT"
+#endif
+
/*
* All tables must be byte-packed to match the ACPI specification, since
* the tables are provided by the system BIOS.
@@ -130,6 +148,146 @@ typedef struct acpi_whea_header
} ACPI_WHEA_HEADER;
+/*******************************************************************************
+ *
+ * ASF - Alert Standard Format table (Signature "ASF!")
+ * Revision 0x10
+ *
+ * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_asf
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_ASF;
+
+
+/* ASF subtable header */
+
+typedef struct acpi_asf_header
+{
+ UINT8 Type;
+ UINT8 Reserved;
+ UINT16 Length;
+
+} ACPI_ASF_HEADER;
+
+
+/* Values for Type field above */
+
+enum AcpiAsfType
+{
+ ACPI_ASF_TYPE_INFO = 0,
+ ACPI_ASF_TYPE_ALERT = 1,
+ ACPI_ASF_TYPE_CONTROL = 2,
+ ACPI_ASF_TYPE_BOOT = 3,
+ ACPI_ASF_TYPE_ADDRESS = 4,
+ ACPI_ASF_TYPE_RESERVED = 5
+};
+
+/*
+ * ASF subtables
+ */
+
+/* 0: ASF Information */
+
+typedef struct acpi_asf_info
+{
+ ACPI_ASF_HEADER Header;
+ UINT8 MinResetValue;
+ UINT8 MinPollInterval;
+ UINT16 SystemId;
+ UINT32 MfgId;
+ UINT8 Flags;
+ UINT8 Reserved2[3];
+
+} ACPI_ASF_INFO;
+
+/* Masks for Flags field above */
+
+#define ACPI_ASF_SMBUS_PROTOCOLS (1)
+
+
+/* 1: ASF Alerts */
+
+typedef struct acpi_asf_alert
+{
+ ACPI_ASF_HEADER Header;
+ UINT8 AssertMask;
+ UINT8 DeassertMask;
+ UINT8 Alerts;
+ UINT8 DataLength;
+
+} ACPI_ASF_ALERT;
+
+typedef struct acpi_asf_alert_data
+{
+ UINT8 Address;
+ UINT8 Command;
+ UINT8 Mask;
+ UINT8 Value;
+ UINT8 SensorType;
+ UINT8 Type;
+ UINT8 Offset;
+ UINT8 SourceType;
+ UINT8 Severity;
+ UINT8 SensorNumber;
+ UINT8 Entity;
+ UINT8 Instance;
+
+} ACPI_ASF_ALERT_DATA;
+
+
+/* 2: ASF Remote Control */
+
+typedef struct acpi_asf_remote
+{
+ ACPI_ASF_HEADER Header;
+ UINT8 Controls;
+ UINT8 DataLength;
+ UINT16 Reserved2;
+
+} ACPI_ASF_REMOTE;
+
+typedef struct acpi_asf_control_data
+{
+ UINT8 Function;
+ UINT8 Address;
+ UINT8 Command;
+ UINT8 Value;
+
+} ACPI_ASF_CONTROL_DATA;
+
+
+/* 3: ASF RMCP Boot Options */
+
+typedef struct acpi_asf_rmcp
+{
+ ACPI_ASF_HEADER Header;
+ UINT8 Capabilities[7];
+ UINT8 CompletionCode;
+ UINT32 EnterpriseId;
+ UINT8 Command;
+ UINT16 Parameter;
+ UINT16 BootOptions;
+ UINT16 OemParameters;
+
+} ACPI_ASF_RMCP;
+
+
+/* 4: ASF Address */
+
+typedef struct acpi_asf_address
+{
+ ACPI_ASF_HEADER Header;
+ UINT8 EpromAddress;
+ UINT8 Devices;
+
+} ACPI_ASF_ADDRESS;
+
+
/*******************************************************************************
*
* BERT - Boot Error Record Table (ACPI 4.0)
@@ -183,6 +341,49 @@ enum AcpiBertErrorSeverity
*/
+/*******************************************************************************
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_bgrt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT16 Version;
+ UINT8 Status;
+ UINT8 ImageType;
+ UINT64 ImageAddress;
+ UINT32 ImageOffsetX;
+ UINT32 ImageOffsetY;
+
+} ACPI_TABLE_BGRT;
+
+/* Flags for Status field above */
+
+#define ACPI_BGRT_DISPLAYED (1)
+#define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1)
+
+
+/*******************************************************************************
+ *
+ * BOOT - Simple Boot Flag Table
+ * Version 1
+ *
+ * Conforms to the "Simple Boot Flag Specification", Version 2.1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_boot
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT8 CmosIndex; /* Index in CMOS RAM for the boot
register */
+ UINT8 Reserved[3];
+
+} ACPI_TABLE_BOOT;
+
+
/*******************************************************************************
*
* CPEP - Corrected Platform Error Polling table (ACPI 4.0)
@@ -212,1725 +413,1522 @@ typedef struct acpi_cpep_polling
/*******************************************************************************
*
- * ECDT - Embedded Controller Boot Resources Table
- * Version 1
+ * CSRT - Core System Resource Table
+ * Version 0
+ *
+ * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
*
******************************************************************************/
-typedef struct acpi_table_ecdt
+typedef struct acpi_table_csrt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register
*/
- ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */
- UINT32 Uid; /* Unique ID - must be same as the EC
_UID method */
- UINT8 Gpe; /* The GPE for the EC */
- UINT8 Id[1]; /* Full namepath of the EC in the ACPI
namespace */
-} ACPI_TABLE_ECDT;
+} ACPI_TABLE_CSRT;
-/*******************************************************************************
- *
- * EINJ - Error Injection Table (ACPI 4.0)
- * Version 1
- *
- ******************************************************************************/
+/* Resource Group subtable */
-typedef struct acpi_table_einj
+typedef struct acpi_csrt_group
{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 HeaderLength;
- UINT8 Flags;
- UINT8 Reserved[3];
- UINT32 Entries;
+ UINT32 Length;
+ UINT32 VendorId;
+ UINT32 SubvendorId;
+ UINT16 DeviceId;
+ UINT16 SubdeviceId;
+ UINT16 Revision;
+ UINT16 Reserved;
+ UINT32 SharedInfoLength;
-} ACPI_TABLE_EINJ;
+ /* Shared data immediately follows (Length = SharedInfoLength) */
+} ACPI_CSRT_GROUP;
-/* EINJ Injection Instruction Entries (actions) */
+/* Shared Info subtable */
-typedef struct acpi_einj_entry
+typedef struct acpi_csrt_shared_info
{
- ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
-
-} ACPI_EINJ_ENTRY;
+ UINT16 MajorVersion;
+ UINT16 MinorVersion;
+ UINT32 MmioBaseLow;
+ UINT32 MmioBaseHigh;
+ UINT32 GsiInterrupt;
+ UINT8 InterruptPolarity;
+ UINT8 InterruptMode;
+ UINT8 NumChannels;
+ UINT8 DmaAddressWidth;
+ UINT16 BaseRequestLine;
+ UINT16 NumHandshakeSignals;
+ UINT32 MaxBlockSize;
-/* Masks for Flags field above */
+ /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength)
*/
-#define ACPI_EINJ_PRESERVE (1)
+} ACPI_CSRT_SHARED_INFO;
-/* Values for Action field above */
+/* Resource Descriptor subtable */
-enum AcpiEinjActions
+typedef struct acpi_csrt_descriptor
{
- ACPI_EINJ_BEGIN_OPERATION = 0,
- ACPI_EINJ_GET_TRIGGER_TABLE = 1,
- ACPI_EINJ_SET_ERROR_TYPE = 2,
- ACPI_EINJ_GET_ERROR_TYPE = 3,
- ACPI_EINJ_END_OPERATION = 4,
- ACPI_EINJ_EXECUTE_OPERATION = 5,
- ACPI_EINJ_CHECK_BUSY_STATUS = 6,
- ACPI_EINJ_GET_COMMAND_STATUS = 7,
- ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
- ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
- ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
- ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
-};
+ UINT32 Length;
+ UINT16 Type;
+ UINT16 Subtype;
+ UINT32 Uid;
-/* Values for Instruction field above */
+ /* Resource-specific information immediately follows */
-enum AcpiEinjInstructions
-{
- ACPI_EINJ_READ_REGISTER = 0,
- ACPI_EINJ_READ_REGISTER_VALUE = 1,
- ACPI_EINJ_WRITE_REGISTER = 2,
- ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
- ACPI_EINJ_NOOP = 4,
- ACPI_EINJ_FLUSH_CACHELINE = 5,
- ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
-};
+} ACPI_CSRT_DESCRIPTOR;
-typedef struct acpi_einj_error_type_with_addr
+
+/* Resource Types */
+
+#define ACPI_CSRT_TYPE_INTERRUPT 0x0001
+#define ACPI_CSRT_TYPE_TIMER 0x0002
+#define ACPI_CSRT_TYPE_DMA 0x0003
+
+/* Resource Subtypes */
+
+#define ACPI_CSRT_XRUPT_LINE 0x0000
+#define ACPI_CSRT_XRUPT_CONTROLLER 0x0001
+#define ACPI_CSRT_TIMER 0x0000
+#define ACPI_CSRT_DMA_CHANNEL 0x0000
+#define ACPI_CSRT_DMA_CONTROLLER 0x0001
+
+
+/*******************************************************************************
+ *
+ * DBG2 - Debug Port Table 2
+ * Version 0 (Both main table and subtables)
+ *
+ * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_dbg2
{
- UINT32 ErrorType;
- UINT32 VendorStructOffset;
- UINT32 Flags;
- UINT32 ApicId;
- UINT64 Address;
- UINT64 Range;
- UINT32 PcieId;
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 InfoOffset;
+ UINT32 InfoCount;
-} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
+} ACPI_TABLE_DBG2;
-typedef struct acpi_einj_vendor
+
+typedef struct acpi_dbg2_header
{
- UINT32 Length;
- UINT32 PcieId;
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT8 RevisionId;
- UINT8 Reserved[3];
+ UINT32 InfoOffset;
+ UINT32 InfoCount;
-} ACPI_EINJ_VENDOR;
+} ACPI_DBG2_HEADER;
-/* EINJ Trigger Error Action Table */
+/* Debug Device Information Subtable */
-typedef struct acpi_einj_trigger
+typedef struct acpi_dbg2_device
{
- UINT32 HeaderSize;
- UINT32 Revision;
- UINT32 TableSize;
- UINT32 EntryCount;
+ UINT8 Revision;
+ UINT16 Length;
+ UINT8 RegisterCount; /* Number of BaseAddress registers */
+ UINT16 NamepathLength;
+ UINT16 NamepathOffset;
+ UINT16 OemDataLength;
+ UINT16 OemDataOffset;
+ UINT16 PortType;
+ UINT16 PortSubtype;
+ UINT16 Reserved;
+ UINT16 BaseAddressOffset;
+ UINT16 AddressSizeOffset;
+ /*
+ * Data that follows:
+ * BaseAddress (required) - Each in 12-byte Generic Address Structure format.
+ * AddressSize (required) - Array of UINT32 sizes corresponding to each
BaseAddress register.
+ * Namepath (required) - Null terminated string. Single dot if not supported.
+ * OemData (optional) - Length is OemDataLength.
+ */
+} ACPI_DBG2_DEVICE;
-} ACPI_EINJ_TRIGGER;
+/* Types for PortType field above */
-/* Command status return values */
+#define ACPI_DBG2_SERIAL_PORT 0x8000
+#define ACPI_DBG2_1394_PORT 0x8001
+#define ACPI_DBG2_USB_PORT 0x8002
+#define ACPI_DBG2_NET_PORT 0x8003
-enum AcpiEinjCommandStatus
-{
- ACPI_EINJ_SUCCESS = 0,
- ACPI_EINJ_FAILURE = 1,
- ACPI_EINJ_INVALID_ACCESS = 2,
- ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
-};
+/* Subtypes for PortSubtype field above */
+#define ACPI_DBG2_16550_COMPATIBLE 0x0000
+#define ACPI_DBG2_16550_SUBSET 0x0001
+#define ACPI_DBG2_ARM_PL011 0x0003
+#define ACPI_DBG2_ARM_SBSA_32BIT 0x000D
+#define ACPI_DBG2_ARM_SBSA_GENERIC 0x000E
+#define ACPI_DBG2_ARM_DCC 0x000F
+#define ACPI_DBG2_BCM2835 0x0010
-/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
+#define ACPI_DBG2_1394_STANDARD 0x0000
-#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
-#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
-#define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
-#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
-#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
-#define ACPI_EINJ_MEMORY_FATAL (1<<5)
-#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
-#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
-#define ACPI_EINJ_PCIX_FATAL (1<<8)
-#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
-#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
-#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
-#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
+#define ACPI_DBG2_USB_XHCI 0x0000
+#define ACPI_DBG2_USB_EHCI 0x0001
/*******************************************************************************
*
- * ERST - Error Record Serialization Table (ACPI 4.0)
+ * DBGP - Debug Port table
* Version 1
*
+ * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
+ *
******************************************************************************/
-typedef struct acpi_table_erst
+typedef struct acpi_table_dbgp
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 HeaderLength;
- UINT32 Reserved;
- UINT32 Entries;
+ UINT8 Type; /* 0=full 16550, 1=subset of 16550 */
+ UINT8 Reserved[3];
+ ACPI_GENERIC_ADDRESS DebugPort;
-} ACPI_TABLE_ERST;
+} ACPI_TABLE_DBGP;
-/* ERST Serialization Entries (actions) */
+/*******************************************************************************
+ *
+ * DMAR - DMA Remapping table
+ * Version 1
+ *
+ * Conforms to "Intel Virtualization Technology for Directed I/O",
+ * Version 2.3, October 2014
+ *
+ ******************************************************************************/
-typedef struct acpi_erst_entry
+typedef struct acpi_table_dmar
{
- ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT8 Width; /* Host Address Width */
+ UINT8 Flags;
+ UINT8 Reserved[10];
-} ACPI_ERST_ENTRY;
+} ACPI_TABLE_DMAR;
/* Masks for Flags field above */
-#define ACPI_ERST_PRESERVE (1)
+#define ACPI_DMAR_INTR_REMAP (1)
+#define ACPI_DMAR_X2APIC_OPT_OUT (1<<1)
+#define ACPI_DMAR_X2APIC_MODE (1<<2)
-/* Values for Action field above */
-enum AcpiErstActions
+/* DMAR subtable header */
+
+typedef struct acpi_dmar_header
{
- ACPI_ERST_BEGIN_WRITE = 0,
- ACPI_ERST_BEGIN_READ = 1,
- ACPI_ERST_BEGIN_CLEAR = 2,
- ACPI_ERST_END = 3,
- ACPI_ERST_SET_RECORD_OFFSET = 4,
- ACPI_ERST_EXECUTE_OPERATION = 5,
- ACPI_ERST_CHECK_BUSY_STATUS = 6,
- ACPI_ERST_GET_COMMAND_STATUS = 7,
- ACPI_ERST_GET_RECORD_ID = 8,
- ACPI_ERST_SET_RECORD_ID = 9,
- ACPI_ERST_GET_RECORD_COUNT = 10,
- ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
- ACPI_ERST_NOT_USED = 12,
- ACPI_ERST_GET_ERROR_RANGE = 13,
- ACPI_ERST_GET_ERROR_LENGTH = 14,
- ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
- ACPI_ERST_EXECUTE_TIMINGS = 16,
- ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
-};
+ UINT16 Type;
+ UINT16 Length;
-/* Values for Instruction field above */
+} ACPI_DMAR_HEADER;
-enum AcpiErstInstructions
-{
- ACPI_ERST_READ_REGISTER = 0,
- ACPI_ERST_READ_REGISTER_VALUE = 1,
- ACPI_ERST_WRITE_REGISTER = 2,
- ACPI_ERST_WRITE_REGISTER_VALUE = 3,
- ACPI_ERST_NOOP = 4,
- ACPI_ERST_LOAD_VAR1 = 5,
- ACPI_ERST_LOAD_VAR2 = 6,
- ACPI_ERST_STORE_VAR1 = 7,
- ACPI_ERST_ADD = 8,
- ACPI_ERST_SUBTRACT = 9,
- ACPI_ERST_ADD_VALUE = 10,
- ACPI_ERST_SUBTRACT_VALUE = 11,
- ACPI_ERST_STALL = 12,
- ACPI_ERST_STALL_WHILE_TRUE = 13,
- ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
- ACPI_ERST_GOTO = 15,
- ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
- ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
- ACPI_ERST_MOVE_DATA = 18,
- ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
-};
-
-/* Command status return values */
+/* Values for subtable type in ACPI_DMAR_HEADER */
-enum AcpiErstCommandStatus
+enum AcpiDmarType
{
- ACPI_ERST_SUCESS = 0,
- ACPI_ERST_NO_SPACE = 1,
- ACPI_ERST_NOT_AVAILABLE = 2,
- ACPI_ERST_FAILURE = 3,
- ACPI_ERST_RECORD_EMPTY = 4,
- ACPI_ERST_NOT_FOUND = 5,
- ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
+ ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
+ ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
+ ACPI_DMAR_TYPE_ROOT_ATS = 2,
+ ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
+ ACPI_DMAR_TYPE_NAMESPACE = 4,
+ ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};
-/* Error Record Serialization Information */
+/* DMAR Device Scope structure */
-typedef struct acpi_erst_info
+typedef struct acpi_dmar_device_scope
{
- UINT16 Signature; /* Should be "ER" */
- UINT8 Data[48];
-
-} ACPI_ERST_INFO;
+ UINT8 EntryType;
+ UINT8 Length;
+ UINT16 Reserved;
+ UINT8 EnumerationId;
+ UINT8 Bus;
+} ACPI_DMAR_DEVICE_SCOPE;
-/*******************************************************************************
- *
- * HEST - Hardware Error Source Table (ACPI 4.0)
- * Version 1
- *
- ******************************************************************************/
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
-typedef struct acpi_table_hest
+enum AcpiDmarScopeType
{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 ErrorSourceCount;
-
-} ACPI_TABLE_HEST;
-
-
-/* HEST subtable header */
+ ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
+ ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
+ ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
+ ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
+ ACPI_DMAR_SCOPE_TYPE_HPET = 4,
+ ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
+ ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
+};
-typedef struct acpi_hest_header
+typedef struct acpi_dmar_pci_path
{
- UINT16 Type;
- UINT16 SourceId;
-
-} ACPI_HEST_HEADER;
+ UINT8 Device;
+ UINT8 Function;
-
-/* Values for Type field above for subtables */
-
-enum AcpiHestTypes
-{
- ACPI_HEST_TYPE_IA32_CHECK = 0,
- ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
- ACPI_HEST_TYPE_IA32_NMI = 2,
- ACPI_HEST_TYPE_NOT_USED3 = 3,
- ACPI_HEST_TYPE_NOT_USED4 = 4,
- ACPI_HEST_TYPE_NOT_USED5 = 5,
- ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
- ACPI_HEST_TYPE_AER_ENDPOINT = 7,
- ACPI_HEST_TYPE_AER_BRIDGE = 8,
- ACPI_HEST_TYPE_GENERIC_ERROR = 9,
- ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
- ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
- ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */
-};
+} ACPI_DMAR_PCI_PATH;
/*
- * HEST substructures contained in subtables
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
*/
-/*
- * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
- * ACPI_HEST_IA_CORRECTED structures.
- */
-typedef struct acpi_hest_ia_error_bank
-{
- UINT8 BankNumber;
- UINT8 ClearStatusOnInit;
- UINT8 StatusFormat;
- UINT8 Reserved;
- UINT32 ControlRegister;
- UINT64 ControlData;
- UINT32 StatusRegister;
- UINT32 AddressRegister;
- UINT32 MiscRegister;
-
-} ACPI_HEST_IA_ERROR_BANK;
-
-
-/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
+/* 0: Hardware Unit Definition */
-typedef struct acpi_hest_aer_common
+typedef struct acpi_dmar_hardware_unit
{
- UINT16 Reserved1;
+ ACPI_DMAR_HEADER Header;
UINT8 Flags;
- UINT8 Enabled;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- UINT32 Bus; /* Bus and Segment numbers */
- UINT16 Device;
- UINT16 Function;
- UINT16 DeviceControl;
- UINT16 Reserved2;
- UINT32 UncorrectableMask;
- UINT32 UncorrectableSeverity;
- UINT32 CorrectableMask;
- UINT32 AdvancedCapabilities;
-
-} ACPI_HEST_AER_COMMON;
-
-/* Masks for HEST Flags fields */
-
-#define ACPI_HEST_FIRMWARE_FIRST (1)
-#define ACPI_HEST_GLOBAL (1<<1)
-#define ACPI_HEST_GHES_ASSIST (1<<2)
-
-/*
- * Macros to access the bus/segment numbers in Bus field above:
- * Bus number is encoded in bits 7:0
- * Segment number is encoded in bits 23:8
- */
-#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
-#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
+ UINT8 Reserved;
+ UINT16 Segment;
+ UINT64 Address; /* Register Base Address */
+} ACPI_DMAR_HARDWARE_UNIT;
-/* Hardware Error Notification */
+/* Masks for Flags field above */
-typedef struct acpi_hest_notify
-{
- UINT8 Type;
- UINT8 Length;
- UINT16 ConfigWriteEnable;
- UINT32 PollInterval;
- UINT32 Vector;
- UINT32 PollingThresholdValue;
- UINT32 PollingThresholdWindow;
- UINT32 ErrorThresholdValue;
- UINT32 ErrorThresholdWindow;
+#define ACPI_DMAR_INCLUDE_ALL (1)
-} ACPI_HEST_NOTIFY;
-/* Values for Notify Type field above */
+/* 1: Reserved Memory Defininition */
-enum AcpiHestNotifyTypes
+typedef struct acpi_dmar_reserved_memory
{
- ACPI_HEST_NOTIFY_POLLED = 0,
- ACPI_HEST_NOTIFY_EXTERNAL = 1,
- ACPI_HEST_NOTIFY_LOCAL = 2,
- ACPI_HEST_NOTIFY_SCI = 3,
- ACPI_HEST_NOTIFY_NMI = 4,
- ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
- ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
- ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
- ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
- ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
- ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
- ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
- ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
-};
+ ACPI_DMAR_HEADER Header;
+ UINT16 Reserved;
+ UINT16 Segment;
+ UINT64 BaseAddress; /* 4K aligned base address */
+ UINT64 EndAddress; /* 4K aligned limit address */
-/* Values for ConfigWriteEnable bitfield above */
+} ACPI_DMAR_RESERVED_MEMORY;
-#define ACPI_HEST_TYPE (1)
-#define ACPI_HEST_POLL_INTERVAL (1<<1)
-#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
-#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
-#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
-#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
+/* Masks for Flags field above */
+#define ACPI_DMAR_ALLOW_ALL (1)
-/*
- * HEST subtables
- */
-/* 0: IA32 Machine Check Exception */
+/* 2: Root Port ATS Capability Reporting Structure */
-typedef struct acpi_hest_ia_machine_check
+typedef struct acpi_dmar_atsr
{
- ACPI_HEST_HEADER Header;
- UINT16 Reserved1;
- UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above
*/
- UINT8 Enabled;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- UINT64 GlobalCapabilityData;
- UINT64 GlobalControlData;
- UINT8 NumHardwareBanks;
- UINT8 Reserved3[7];
-
-} ACPI_HEST_IA_MACHINE_CHECK;
-
+ ACPI_DMAR_HEADER Header;
+ UINT8 Flags;
+ UINT8 Reserved;
+ UINT16 Segment;
-/* 1: IA32 Corrected Machine Check */
+} ACPI_DMAR_ATSR;
-typedef struct acpi_hest_ia_corrected
-{
- ACPI_HEST_HEADER Header;
- UINT16 Reserved1;
- UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above
*/
- UINT8 Enabled;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- ACPI_HEST_NOTIFY Notify;
- UINT8 NumHardwareBanks;
- UINT8 Reserved2[3];
+/* Masks for Flags field above */
-} ACPI_HEST_IA_CORRECTED;
+#define ACPI_DMAR_ALL_PORTS (1)
-/* 2: IA32 Non-Maskable Interrupt */
+/* 3: Remapping Hardware Static Affinity Structure */
-typedef struct acpi_hest_ia_nmi
+typedef struct acpi_dmar_rhsa
{
- ACPI_HEST_HEADER Header;
+ ACPI_DMAR_HEADER Header;
UINT32 Reserved;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- UINT32 MaxRawDataLength;
+ UINT64 BaseAddress;
+ UINT32 ProximityDomain;
-} ACPI_HEST_IA_NMI;
+} ACPI_DMAR_RHSA;
-/* 3,4,5: Not used */
+/* 4: ACPI Namespace Device Declaration Structure */
-/* 6: PCI Express Root Port AER */
-
-typedef struct acpi_hest_aer_root
+typedef struct acpi_dmar_andd
{
- ACPI_HEST_HEADER Header;
- ACPI_HEST_AER_COMMON Aer;
- UINT32 RootErrorCommand;
+ ACPI_DMAR_HEADER Header;
+ UINT8 Reserved[3];
+ UINT8 DeviceNumber;
+ char DeviceName[1];
-} ACPI_HEST_AER_ROOT;
+} ACPI_DMAR_ANDD;
-/* 7: PCI Express AER (AER Endpoint) */
+/*******************************************************************************
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
+ * Table version 1
+ *
+ ******************************************************************************/
-typedef struct acpi_hest_aer
+typedef struct acpi_table_drtm
{
- ACPI_HEST_HEADER Header;
- ACPI_HEST_AER_COMMON Aer;
-
-} ACPI_HEST_AER;
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT64 EntryBaseAddress;
+ UINT64 EntryLength;
+ UINT32 EntryAddress32;
+ UINT64 EntryAddress64;
+ UINT64 ExitAddress;
+ UINT64 LogAreaAddress;
+ UINT32 LogAreaLength;
+ UINT64 ArchDependentAddress;
+ UINT32 Flags;
+} ACPI_TABLE_DRTM;
-/* 8: PCI Express/PCI-X Bridge AER */
-
-typedef struct acpi_hest_aer_bridge
-{
- ACPI_HEST_HEADER Header;
- ACPI_HEST_AER_COMMON Aer;
- UINT32 UncorrectableMask2;
- UINT32 UncorrectableSeverity2;
- UINT32 AdvancedCapabilities2;
+/* Flag Definitions for above */
-} ACPI_HEST_AER_BRIDGE;
+#define ACPI_DRTM_ACCESS_ALLOWED (1)
+#define ACPI_DRTM_ENABLE_GAP_CODE (1<<1)
+#define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2)
+#define ACPI_DRTM_AUTHORITY_ORDER (1<<3)
-/* 9: Generic Hardware Error Source */
+/* 1) Validated Tables List (64-bit addresses) */
-typedef struct acpi_hest_generic
+typedef struct acpi_drtm_vtable_list
{
- ACPI_HEST_HEADER Header;
- UINT16 RelatedSourceId;
- UINT8 Reserved;
- UINT8 Enabled;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- UINT32 MaxRawDataLength;
- ACPI_GENERIC_ADDRESS ErrorStatusAddress;
- ACPI_HEST_NOTIFY Notify;
- UINT32 ErrorBlockLength;
+ UINT32 ValidatedTableCount;
+ UINT64 ValidatedTables[1];
-} ACPI_HEST_GENERIC;
+} ACPI_DRTM_VTABLE_LIST;
+/* 2) Resources List (of Resource Descriptors) */
-/* 10: Generic Hardware Error Source, version 2 */
+/* Resource Descriptor */
-typedef struct acpi_hest_generic_v2
+typedef struct acpi_drtm_resource
{
- ACPI_HEST_HEADER Header;
- UINT16 RelatedSourceId;
- UINT8 Reserved;
- UINT8 Enabled;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- UINT32 MaxRawDataLength;
- ACPI_GENERIC_ADDRESS ErrorStatusAddress;
- ACPI_HEST_NOTIFY Notify;
- UINT32 ErrorBlockLength;
- ACPI_GENERIC_ADDRESS ReadAckRegister;
- UINT64 ReadAckPreserve;
- UINT64 ReadAckWrite;
-
-} ACPI_HEST_GENERIC_V2;
-
-
-/* Generic Error Status block */
-
-typedef struct acpi_hest_generic_status
-{
- UINT32 BlockStatus;
- UINT32 RawDataOffset;
- UINT32 RawDataLength;
- UINT32 DataLength;
- UINT32 ErrorSeverity;
-
-} ACPI_HEST_GENERIC_STATUS;
-
-/* Values for BlockStatus flags above */
-
-#define ACPI_HEST_UNCORRECTABLE (1)
-#define ACPI_HEST_CORRECTABLE (1<<1)
-#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
-#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
-#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
+ UINT8 Size[7];
+ UINT8 Type;
+ UINT64 Address;
+} ACPI_DRTM_RESOURCE;
-/* Generic Error Data entry */
-
-typedef struct acpi_hest_generic_data
+typedef struct acpi_drtm_resource_list
{
- UINT8 SectionType[16];
- UINT32 ErrorSeverity;
- UINT16 Revision;
- UINT8 ValidationBits;
- UINT8 Flags;
- UINT32 ErrorDataLength;
- UINT8 FruId[16];
- UINT8 FruText[20];
+ UINT32 ResourceCount;
+ ACPI_DRTM_RESOURCE Resources[1];
-} ACPI_HEST_GENERIC_DATA;
+} ACPI_DRTM_RESOURCE_LIST;
-/* Extension for revision 0x0300 */
+/* 3) Platform-specific Identifiers List */
-typedef struct acpi_hest_generic_data_v300
+typedef struct acpi_drtm_dps_id
{
- UINT8 SectionType[16];
- UINT32 ErrorSeverity;
- UINT16 Revision;
- UINT8 ValidationBits;
- UINT8 Flags;
- UINT32 ErrorDataLength;
- UINT8 FruId[16];
- UINT8 FruText[20];
- UINT64 TimeStamp;
+ UINT32 DpsIdLength;
+ UINT8 DpsId[16];
-} ACPI_HEST_GENERIC_DATA_V300;
+} ACPI_DRTM_DPS_ID;
-/* Values for ErrorSeverity above */
-#define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
-#define ACPI_HEST_GEN_ERROR_FATAL 1
-#define ACPI_HEST_GEN_ERROR_CORRECTED 2
-#define ACPI_HEST_GEN_ERROR_NONE 3
-
-/* Flags for ValidationBits above */
-
-#define ACPI_HEST_GEN_VALID_FRU_ID (1)
-#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
-#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
-
-
-/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
+/*******************************************************************************
+ *
+ * ECDT - Embedded Controller Boot Resources Table
+ * Version 1
+ *
+ ******************************************************************************/
-typedef struct acpi_hest_ia_deferred_check
+typedef struct acpi_table_ecdt
{
- ACPI_HEST_HEADER Header;
- UINT16 Reserved1;
- UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above
*/
- UINT8 Enabled;
- UINT32 RecordsToPreallocate;
- UINT32 MaxSectionsPerRecord;
- ACPI_HEST_NOTIFY Notify;
- UINT8 NumHardwareBanks;
- UINT8 Reserved2[3];
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register
*/
+ ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */
+ UINT32 Uid; /* Unique ID - must be same as the EC
_UID method */
+ UINT8 Gpe; /* The GPE for the EC */
+ UINT8 Id[1]; /* Full namepath of the EC in the ACPI
namespace */
-} ACPI_HEST_IA_DEFERRED_CHECK;
+} ACPI_TABLE_ECDT;
/*******************************************************************************
*
- * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
+ * EINJ - Error Injection Table (ACPI 4.0)
* Version 1
*
******************************************************************************/
-typedef struct acpi_table_hmat
+typedef struct acpi_table_einj
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 Reserved;
+ UINT32 HeaderLength;
+ UINT8 Flags;
+ UINT8 Reserved[3];
+ UINT32 Entries;
-} ACPI_TABLE_HMAT;
+} ACPI_TABLE_EINJ;
-/* Values for HMAT structure types */
-
-enum AcpiHmatType
-{
- ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
- ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth
information */
- ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
- ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
-};
+/* EINJ Injection Instruction Entries (actions) */
-typedef struct acpi_hmat_structure
+typedef struct acpi_einj_entry
{
- UINT16 Type;
- UINT16 Reserved;
- UINT32 Length;
+ ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
-} ACPI_HMAT_STRUCTURE;
+} ACPI_EINJ_ENTRY;
+/* Masks for Flags field above */
-/*
- * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
- */
+#define ACPI_EINJ_PRESERVE (1)
-/* 0: Memory subystem address range */
+/* Values for Action field above */
-typedef struct acpi_hmat_address_range
+enum AcpiEinjActions
{
- ACPI_HMAT_STRUCTURE Header;
- UINT16 Flags;
- UINT16 Reserved1;
- UINT32 ProcessorPD; /* Processor proximity domain */
- UINT32 MemoryPD; /* Memory proximity domain */
- UINT32 Reserved2;
- UINT64 PhysicalAddressBase; /* Physical address range base */
- UINT64 PhysicalAddressLength; /* Physical address range length */
-
-} ACPI_HMAT_ADDRESS_RANGE;
-
-/* Masks for Flags field above */
-
-#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: ProcessorPD field is valid */
-#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: MemoryPD field is valid */
-#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
-
+ ACPI_EINJ_BEGIN_OPERATION = 0,
+ ACPI_EINJ_GET_TRIGGER_TABLE = 1,
+ ACPI_EINJ_SET_ERROR_TYPE = 2,
+ ACPI_EINJ_GET_ERROR_TYPE = 3,
+ ACPI_EINJ_END_OPERATION = 4,
+ ACPI_EINJ_EXECUTE_OPERATION = 5,
+ ACPI_EINJ_CHECK_BUSY_STATUS = 6,
+ ACPI_EINJ_GET_COMMAND_STATUS = 7,
+ ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
+ ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
+ ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
+ ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
+};
-/* 1: System locality latency and bandwidth information */
+/* Values for Instruction field above */
-typedef struct acpi_hmat_locality
+enum AcpiEinjInstructions
{
- ACPI_HMAT_STRUCTURE Header;
- UINT8 Flags;
- UINT8 DataType;
- UINT16 Reserved1;
- UINT32 NumberOfInitiatorPDs;
- UINT32 NumberOfTargetPDs;
- UINT32 Reserved2;
- UINT64 EntryBaseUnit;
-
-} ACPI_HMAT_LOCALITY;
-
-/* Masks for Flags field above */
-
-#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
+ ACPI_EINJ_READ_REGISTER = 0,
+ ACPI_EINJ_READ_REGISTER_VALUE = 1,
+ ACPI_EINJ_WRITE_REGISTER = 2,
+ ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
+ ACPI_EINJ_NOOP = 4,
+ ACPI_EINJ_FLUSH_CACHELINE = 5,
+ ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
+};
-/* Values for Memory Hierarchy flag */
+typedef struct acpi_einj_error_type_with_addr
+{
+ UINT32 ErrorType;
+ UINT32 VendorStructOffset;
+ UINT32 Flags;
+ UINT32 ApicId;
+ UINT64 Address;
+ UINT64 Range;
+ UINT32 PcieId;
-#define ACPI_HMAT_MEMORY 0
-#define ACPI_HMAT_LAST_LEVEL_CACHE 1
-#define ACPI_HMAT_1ST_LEVEL_CACHE 2
-#define ACPI_HMAT_2ND_LEVEL_CACHE 3
-#define ACPI_HMAT_3RD_LEVEL_CACHE 4
+} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
-/* Values for DataType field above */
+typedef struct acpi_einj_vendor
+{
+ UINT32 Length;
+ UINT32 PcieId;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT8 RevisionId;
+ UINT8 Reserved[3];
-#define ACPI_HMAT_ACCESS_LATENCY 0
-#define ACPI_HMAT_READ_LATENCY 1
-#define ACPI_HMAT_WRITE_LATENCY 2
-#define ACPI_HMAT_ACCESS_BANDWIDTH 3
-#define ACPI_HMAT_READ_BANDWIDTH 4
-#define ACPI_HMAT_WRITE_BANDWIDTH 5
+} ACPI_EINJ_VENDOR;
-/* 2: Memory side cache information */
+/* EINJ Trigger Error Action Table */
-typedef struct acpi_hmat_cache
+typedef struct acpi_einj_trigger
{
- ACPI_HMAT_STRUCTURE Header;
- UINT32 MemoryPD;
- UINT32 Reserved1;
- UINT64 CacheSize;
- UINT32 CacheAttributes;
- UINT16 Reserved2;
- UINT16 NumberOfSMBIOSHandles;
-
-} ACPI_HMAT_CACHE;
+ UINT32 HeaderSize;
+ UINT32 Revision;
+ UINT32 TableSize;
+ UINT32 EntryCount;
-/* Masks for CacheAttributes field above */
+} ACPI_EINJ_TRIGGER;
-#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
-#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
-#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
-#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
-#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
+/* Command status return values */
-/* Values for cache associativity flag */
+enum AcpiEinjCommandStatus
+{
+ ACPI_EINJ_SUCCESS = 0,
+ ACPI_EINJ_FAILURE = 1,
+ ACPI_EINJ_INVALID_ACCESS = 2,
+ ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
+};
-#define ACPI_HMAT_CA_NONE (0)
-#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
-#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
-/* Values for write policy flag */
+/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
-#define ACPI_HMAT_CP_NONE (0)
-#define ACPI_HMAT_CP_WB (1)
-#define ACPI_HMAT_CP_WT (2)
+#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
+#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
+#define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
+#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
+#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
+#define ACPI_EINJ_MEMORY_FATAL (1<<5)
+#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
+#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
+#define ACPI_EINJ_PCIX_FATAL (1<<8)
+#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
+#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
+#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
+#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
/*******************************************************************************
*
- * MADT - Multiple APIC Description Table
- * Version 3
+ * ERST - Error Record Serialization Table (ACPI 4.0)
+ * Version 1
*
******************************************************************************/
-typedef struct acpi_table_madt
+typedef struct acpi_table_erst
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 Address; /* Physical address of local APIC */
- UINT32 Flags;
+ UINT32 HeaderLength;
+ UINT32 Reserved;
+ UINT32 Entries;
+
+} ACPI_TABLE_ERST;
-} ACPI_TABLE_MADT;
-/* Masks for Flags field above */
+/* ERST Serialization Entries (actions) */
-#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
+typedef struct acpi_erst_entry
+{
+ ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
-/* Values for PCATCompat flag */
+} ACPI_ERST_ENTRY;
-#define ACPI_MADT_DUAL_PIC 1
-#define ACPI_MADT_MULTIPLE_APIC 0
+/* Masks for Flags field above */
+#define ACPI_ERST_PRESERVE (1)
-/* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
+/* Values for Action field above */
-enum AcpiMadtType
+enum AcpiErstActions
{
- ACPI_MADT_TYPE_LOCAL_APIC = 0,
- ACPI_MADT_TYPE_IO_APIC = 1,
- ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
- ACPI_MADT_TYPE_NMI_SOURCE = 3,
- ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
- ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
- ACPI_MADT_TYPE_IO_SAPIC = 6,
- ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
- ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
- ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
- ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
- ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
- ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
- ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
- ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
- ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
- ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
+ ACPI_ERST_BEGIN_WRITE = 0,
+ ACPI_ERST_BEGIN_READ = 1,
+ ACPI_ERST_BEGIN_CLEAR = 2,
+ ACPI_ERST_END = 3,
+ ACPI_ERST_SET_RECORD_OFFSET = 4,
+ ACPI_ERST_EXECUTE_OPERATION = 5,
+ ACPI_ERST_CHECK_BUSY_STATUS = 6,
+ ACPI_ERST_GET_COMMAND_STATUS = 7,
+ ACPI_ERST_GET_RECORD_ID = 8,
+ ACPI_ERST_SET_RECORD_ID = 9,
+ ACPI_ERST_GET_RECORD_COUNT = 10,
+ ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
+ ACPI_ERST_NOT_USED = 12,
+ ACPI_ERST_GET_ERROR_RANGE = 13,
+ ACPI_ERST_GET_ERROR_LENGTH = 14,
+ ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
+ ACPI_ERST_EXECUTE_TIMINGS = 16,
+ ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
};
+/* Values for Instruction field above */
-/*
- * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
- */
-
-/* 0: Processor Local APIC */
-
-typedef struct acpi_madt_local_apic
+enum AcpiErstInstructions
{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 ProcessorId; /* ACPI processor id */
- UINT8 Id; /* Processor's local APIC id */
- UINT32 LapicFlags;
-
-} ACPI_MADT_LOCAL_APIC;
-
+ ACPI_ERST_READ_REGISTER = 0,
+ ACPI_ERST_READ_REGISTER_VALUE = 1,
+ ACPI_ERST_WRITE_REGISTER = 2,
+ ACPI_ERST_WRITE_REGISTER_VALUE = 3,
+ ACPI_ERST_NOOP = 4,
+ ACPI_ERST_LOAD_VAR1 = 5,
+ ACPI_ERST_LOAD_VAR2 = 6,
+ ACPI_ERST_STORE_VAR1 = 7,
+ ACPI_ERST_ADD = 8,
+ ACPI_ERST_SUBTRACT = 9,
+ ACPI_ERST_ADD_VALUE = 10,
+ ACPI_ERST_SUBTRACT_VALUE = 11,
+ ACPI_ERST_STALL = 12,
+ ACPI_ERST_STALL_WHILE_TRUE = 13,
+ ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
+ ACPI_ERST_GOTO = 15,
+ ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
+ ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
+ ACPI_ERST_MOVE_DATA = 18,
+ ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
+};
-/* 1: IO APIC */
+/* Command status return values */
-typedef struct acpi_madt_io_apic
+enum AcpiErstCommandStatus
{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 Id; /* I/O APIC ID */
- UINT8 Reserved; /* Reserved - must be zero */
- UINT32 Address; /* APIC physical address */
- UINT32 GlobalIrqBase; /* Global system interrupt where INTI
lines start */
-
-} ACPI_MADT_IO_APIC;
+ ACPI_ERST_SUCESS = 0,
+ ACPI_ERST_NO_SPACE = 1,
+ ACPI_ERST_NOT_AVAILABLE = 2,
+ ACPI_ERST_FAILURE = 3,
+ ACPI_ERST_RECORD_EMPTY = 4,
+ ACPI_ERST_NOT_FOUND = 5,
+ ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
+};
-/* 2: Interrupt Override */
+/* Error Record Serialization Information */
-typedef struct acpi_madt_interrupt_override
+typedef struct acpi_erst_info
{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 Bus; /* 0 - ISA */
- UINT8 SourceIrq; /* Interrupt source (IRQ) */
- UINT32 GlobalIrq; /* Global system interrupt */
- UINT16 IntiFlags;
+ UINT16 Signature; /* Should be "ER" */
+ UINT8 Data[48];
-} ACPI_MADT_INTERRUPT_OVERRIDE;
+} ACPI_ERST_INFO;
-/* 3: NMI Source */
+/*******************************************************************************
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
-typedef struct acpi_madt_nmi_source
+typedef struct acpi_table_fpdt
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 IntiFlags;
- UINT32 GlobalIrq; /* Global system interrupt */
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
-} ACPI_MADT_NMI_SOURCE;
+} ACPI_TABLE_FPDT;
-/* 4: Local APIC NMI */
+/* FPDT subtable header (Performance Record Structure) */
-typedef struct acpi_madt_local_apic_nmi
+typedef struct acpi_fpdt_header
{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 ProcessorId; /* ACPI processor id */
- UINT16 IntiFlags;
- UINT8 Lint; /* LINTn to which NMI is connected */
-
-} ACPI_MADT_LOCAL_APIC_NMI;
+ UINT16 Type;
+ UINT8 Length;
+ UINT8 Revision;
+} ACPI_FPDT_HEADER;
-/* 5: Address Override */
+/* Values for Type field above */
-typedef struct acpi_madt_local_apic_override
+enum AcpiFpdtType
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* Reserved, must be zero */
- UINT64 Address; /* APIC physical address */
+ ACPI_FPDT_TYPE_BOOT = 0,
+ ACPI_FPDT_TYPE_S3PERF = 1
+};
-} ACPI_MADT_LOCAL_APIC_OVERRIDE;
+/*
+ * FPDT subtables
+ */
-/* 6: I/O Sapic */
+/* 0: Firmware Basic Boot Performance Record */
-typedef struct acpi_madt_io_sapic
+typedef struct acpi_fpdt_boot_pointer
{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 Id; /* I/O SAPIC ID */
- UINT8 Reserved; /* Reserved, must be zero */
- UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */
- UINT64 Address; /* SAPIC physical address */
+ ACPI_FPDT_HEADER Header;
+ UINT8 Reserved[4];
+ UINT64 Address;
-} ACPI_MADT_IO_SAPIC;
+} ACPI_FPDT_BOOT_POINTER;
-/* 7: Local Sapic */
+/* 1: S3 Performance Table Pointer Record */
-typedef struct acpi_madt_local_sapic
+typedef struct acpi_fpdt_s3pt_pointer
{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 ProcessorId; /* ACPI processor id */
- UINT8 Id; /* SAPIC ID */
- UINT8 Eid; /* SAPIC EID */
- UINT8 Reserved[3]; /* Reserved, must be zero */
- UINT32 LapicFlags;
- UINT32 Uid; /* Numeric UID - ACPI 3.0 */
- char UidString[1]; /* String UID - ACPI 3.0 */
-
-} ACPI_MADT_LOCAL_SAPIC;
+ ACPI_FPDT_HEADER Header;
+ UINT8 Reserved[4];
+ UINT64 Address;
+} ACPI_FPDT_S3PT_POINTER;
-/* 8: Platform Interrupt Source */
-typedef struct acpi_madt_interrupt_source
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * S3 Pointer Record above.
+ */
+typedef struct acpi_table_s3pt
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 IntiFlags;
- UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */
- UINT8 Id; /* Processor ID */
- UINT8 Eid; /* Processor EID */
- UINT8 IoSapicVector; /* Vector value for PMI interrupts */
- UINT32 GlobalIrq; /* Global system interrupt */
- UINT32 Flags; /* Interrupt Source Flags */
-
-} ACPI_MADT_INTERRUPT_SOURCE;
+ UINT8 Signature[4]; /* "S3PT" */
+ UINT32 Length;
-/* Masks for Flags field above */
+} ACPI_TABLE_S3PT;
-#define ACPI_MADT_CPEI_OVERRIDE (1)
+/*
+ * S3PT Subtables (Not part of the actual FPDT)
+ */
-/* 9: Processor Local X2APIC (ACPI 4.0) */
+/* Values for Type field in S3PT header */
-typedef struct acpi_madt_local_x2apic
+enum AcpiS3ptType
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* Reserved - must be zero */
- UINT32 LocalApicId; /* Processor x2APIC ID */
- UINT32 LapicFlags;
- UINT32 Uid; /* ACPI processor UID */
-
-} ACPI_MADT_LOCAL_X2APIC;
+ ACPI_S3PT_TYPE_RESUME = 0,
+ ACPI_S3PT_TYPE_SUSPEND = 1,
+ ACPI_FPDT_BOOT_PERFORMANCE = 2
+};
+typedef struct acpi_s3pt_resume
+{
+ ACPI_FPDT_HEADER Header;
+ UINT32 ResumeCount;
+ UINT64 FullResume;
+ UINT64 AverageResume;
-/* 10: Local X2APIC NMI (ACPI 4.0) */
+} ACPI_S3PT_RESUME;
-typedef struct acpi_madt_local_x2apic_nmi
+typedef struct acpi_s3pt_suspend
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 IntiFlags;
- UINT32 Uid; /* ACPI processor UID */
- UINT8 Lint; /* LINTn to which NMI is connected */
- UINT8 Reserved[3]; /* Reserved - must be zero */
+ ACPI_FPDT_HEADER Header;
+ UINT64 SuspendStart;
+ UINT64 SuspendEnd;
-} ACPI_MADT_LOCAL_X2APIC_NMI;
+} ACPI_S3PT_SUSPEND;
-/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
-
-typedef struct acpi_madt_generic_interrupt
+/*
+ * FPDT Boot Performance Record (Not part of the actual FPDT)
+ */
+typedef struct acpi_fpdt_boot
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* Reserved - must be zero */
- UINT32 CpuInterfaceNumber;
- UINT32 Uid;
- UINT32 Flags;
- UINT32 ParkingVersion;
- UINT32 PerformanceInterrupt;
- UINT64 ParkedAddress;
- UINT64 BaseAddress;
- UINT64 GicvBaseAddress;
- UINT64 GichBaseAddress;
- UINT32 VgicInterrupt;
- UINT64 GicrBaseAddress;
- UINT64 ArmMpidr;
- UINT8 EfficiencyClass;
- UINT8 Reserved2[3];
-
-} ACPI_MADT_GENERIC_INTERRUPT;
-
-/* Masks for Flags field above */
+ ACPI_FPDT_HEADER Header;
+ UINT8 Reserved[4];
+ UINT64 ResetEnd;
+ UINT64 LoadStart;
+ UINT64 StartupStart;
+ UINT64 ExitServicesEntry;
+ UINT64 ExitServicesExit;
-/* ACPI_MADT_ENABLED (1) Processor is usable if set */
-#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode
*/
-#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt
mode */
+} ACPI_FPDT_BOOT;
-/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
+/*******************************************************************************
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ * Version 2
+ *
+ ******************************************************************************/
-typedef struct acpi_madt_generic_distributor
+typedef struct acpi_table_gtdt
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* Reserved - must be zero */
- UINT32 GicId;
- UINT64 BaseAddress;
- UINT32 GlobalIrqBase;
- UINT8 Version;
- UINT8 Reserved2[3]; /* Reserved - must be zero */
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT64 CounterBlockAddresss;
+ UINT32 Reserved;
+ UINT32 SecureEl1Interrupt;
+ UINT32 SecureEl1Flags;
+ UINT32 NonSecureEl1Interrupt;
+ UINT32 NonSecureEl1Flags;
+ UINT32 VirtualTimerInterrupt;
+ UINT32 VirtualTimerFlags;
+ UINT32 NonSecureEl2Interrupt;
+ UINT32 NonSecureEl2Flags;
+ UINT64 CounterReadBlockAddress;
+ UINT32 PlatformTimerCount;
+ UINT32 PlatformTimerOffset;
-} ACPI_MADT_GENERIC_DISTRIBUTOR;
+} ACPI_TABLE_GTDT;
-/* Values for Version field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
-enum AcpiMadtGicVersion
-{
- ACPI_MADT_GIC_VERSION_NONE = 0,
- ACPI_MADT_GIC_VERSION_V1 = 1,
- ACPI_MADT_GIC_VERSION_V2 = 2,
- ACPI_MADT_GIC_VERSION_V3 = 3,
- ACPI_MADT_GIC_VERSION_V4 = 4,
- ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
-};
+#define ACPI_GTDT_INTERRUPT_MODE (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
+#define ACPI_GTDT_ALWAYS_ON (1<<2)
-/* 13: Generic MSI Frame (ACPI 5.1) */
+/* Common GTDT subtable header */
-typedef struct acpi_madt_generic_msi_frame
+typedef struct acpi_gtdt_header
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* Reserved - must be zero */
- UINT32 MsiFrameId;
- UINT64 BaseAddress;
- UINT32 Flags;
- UINT16 SpiCount;
- UINT16 SpiBase;
+ UINT8 Type;
+ UINT16 Length;
-} ACPI_MADT_GENERIC_MSI_FRAME;
+} ACPI_GTDT_HEADER;
-/* Masks for Flags field above */
+/* Values for GTDT subtable type above */
+
+enum AcpiGtdtType
+{
+ ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
+ ACPI_GTDT_TYPE_WATCHDOG = 1,
+ ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
-#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
-/* 14: Generic Redistributor (ACPI 5.1) */
+/* 0: Generic Timer Block */
-typedef struct acpi_madt_generic_redistributor
+typedef struct acpi_gtdt_timer_block
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* reserved - must be zero */
- UINT64 BaseAddress;
- UINT32 Length;
-
-} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 BlockAddress;
+ UINT32 TimerCount;
+ UINT32 TimerOffset;
+} ACPI_GTDT_TIMER_BLOCK;
-/* 15: Generic Translator (ACPI 6.0) */
+/* Timer Sub-Structure, one per timer */
-typedef struct acpi_madt_generic_translator
+typedef struct acpi_gtdt_timer_entry
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* reserved - must be zero */
- UINT32 TranslationId;
+ UINT8 FrameNumber;
+ UINT8 Reserved[3];
UINT64 BaseAddress;
- UINT32 Reserved2;
+ UINT64 El0BaseAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+ UINT32 VirtualTimerInterrupt;
+ UINT32 VirtualTimerFlags;
+ UINT32 CommonFlags;
-} ACPI_MADT_GENERIC_TRANSLATOR;
+} ACPI_GTDT_TIMER_ENTRY;
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
-/*
- * Common flags fields for MADT subtables
- */
+#define ACPI_GTDT_GT_IRQ_MODE (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
+
+/* Flag Definitions: CommonFlags above */
-/* MADT Local APIC flags */
+#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
+#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
-#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
-/* MADT MPS INTI flags (IntiFlags) */
+/* 1: SBSA Generic Watchdog Structure */
-#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input
signals */
-#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC
input signals */
+typedef struct acpi_gtdt_watchdog
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 RefreshFrameAddress;
+ UINT64 ControlFrameAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
-/* Values for MPS INTI flags */
+} ACPI_GTDT_WATCHDOG;
-#define ACPI_MADT_POLARITY_CONFORMS 0
-#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
-#define ACPI_MADT_POLARITY_RESERVED 2
-#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
+/* Flag Definitions: TimerFlags above */
-#define ACPI_MADT_TRIGGER_CONFORMS (0)
-#define ACPI_MADT_TRIGGER_EDGE (1<<2)
-#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
-#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
/*******************************************************************************
*
- * MSCT - Maximum System Characteristics Table (ACPI 4.0)
+ * HEST - Hardware Error Source Table (ACPI 4.0)
* Version 1
*
******************************************************************************/
-typedef struct acpi_table_msct
+typedef struct acpi_table_hest
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 ProximityOffset; /* Location of proximity info struct(s)
*/
- UINT32 MaxProximityDomains;/* Max number of proximity domains */
- UINT32 MaxClockDomains; /* Max number of clock domains */
- UINT64 MaxAddress; /* Max physical address in system */
+ UINT32 ErrorSourceCount;
-} ACPI_TABLE_MSCT;
+} ACPI_TABLE_HEST;
-/* Subtable - Maximum Proximity Domain Information. Version 1 */
+/* HEST subtable header */
-typedef struct acpi_msct_proximity
+typedef struct acpi_hest_header
{
- UINT8 Revision;
- UINT8 Length;
- UINT32 RangeStart; /* Start of domain range */
- UINT32 RangeEnd; /* End of domain range */
- UINT32 ProcessorCapacity;
- UINT64 MemoryCapacity; /* In bytes */
+ UINT16 Type;
+ UINT16 SourceId;
-} ACPI_MSCT_PROXIMITY;
+} ACPI_HEST_HEADER;
-/*******************************************************************************
- *
- * NFIT - NVDIMM Interface Table (ACPI 6.0+)
- * Version 1
- *
- ******************************************************************************/
+/* Values for Type field above for subtables */
-typedef struct acpi_table_nfit
+enum AcpiHestTypes
{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 Reserved; /* Reserved, must be zero */
+ ACPI_HEST_TYPE_IA32_CHECK = 0,
+ ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
+ ACPI_HEST_TYPE_IA32_NMI = 2,
+ ACPI_HEST_TYPE_NOT_USED3 = 3,
+ ACPI_HEST_TYPE_NOT_USED4 = 4,
+ ACPI_HEST_TYPE_NOT_USED5 = 5,
+ ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
+ ACPI_HEST_TYPE_AER_ENDPOINT = 7,
+ ACPI_HEST_TYPE_AER_BRIDGE = 8,
+ ACPI_HEST_TYPE_GENERIC_ERROR = 9,
+ ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
+ ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
+ ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */
+};
-} ACPI_TABLE_NFIT;
-/* Subtable header for NFIT */
+/*
+ * HEST substructures contained in subtables
+ */
-typedef struct acpi_nfit_header
+/*
+ * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
+ * ACPI_HEST_IA_CORRECTED structures.
+ */
+typedef struct acpi_hest_ia_error_bank
{
- UINT16 Type;
- UINT16 Length;
+ UINT8 BankNumber;
+ UINT8 ClearStatusOnInit;
+ UINT8 StatusFormat;
+ UINT8 Reserved;
+ UINT32 ControlRegister;
+ UINT64 ControlData;
+ UINT32 StatusRegister;
+ UINT32 AddressRegister;
+ UINT32 MiscRegister;
-} ACPI_NFIT_HEADER;
+} ACPI_HEST_IA_ERROR_BANK;
-/* Values for subtable type in ACPI_NFIT_HEADER */
+/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
-enum AcpiNfitType
+typedef struct acpi_hest_aer_common
{
- ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
- ACPI_NFIT_TYPE_MEMORY_MAP = 1,
- ACPI_NFIT_TYPE_INTERLEAVE = 2,
- ACPI_NFIT_TYPE_SMBIOS = 3,
- ACPI_NFIT_TYPE_CONTROL_REGION = 4,
- ACPI_NFIT_TYPE_DATA_REGION = 5,
- ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
- ACPI_NFIT_TYPE_CAPABILITIES = 7,
- ACPI_NFIT_TYPE_RESERVED = 8 /* 8 and greater are reserved */
-};
+ UINT16 Reserved1;
+ UINT8 Flags;
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ UINT32 Bus; /* Bus and Segment numbers */
+ UINT16 Device;
+ UINT16 Function;
+ UINT16 DeviceControl;
+ UINT16 Reserved2;
+ UINT32 UncorrectableMask;
+ UINT32 UncorrectableSeverity;
+ UINT32 CorrectableMask;
+ UINT32 AdvancedCapabilities;
+
+} ACPI_HEST_AER_COMMON;
+
+/* Masks for HEST Flags fields */
+
+#define ACPI_HEST_FIRMWARE_FIRST (1)
+#define ACPI_HEST_GLOBAL (1<<1)
+#define ACPI_HEST_GHES_ASSIST (1<<2)
/*
- * NFIT Subtables
+ * Macros to access the bus/segment numbers in Bus field above:
+ * Bus number is encoded in bits 7:0
+ * Segment number is encoded in bits 23:8
*/
+#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
+
-/* 0: System Physical Address Range Structure */
+/* Hardware Error Notification */
-typedef struct acpi_nfit_system_address
+typedef struct acpi_hest_notify
{
- ACPI_NFIT_HEADER Header;
- UINT16 RangeIndex;
- UINT16 Flags;
- UINT32 Reserved; /* Reserved, must be zero */
- UINT32 ProximityDomain;
- UINT8 RangeGuid[16];
- UINT64 Address;
- UINT64 Length;
- UINT64 MemoryMapping;
+ UINT8 Type;
+ UINT8 Length;
+ UINT16 ConfigWriteEnable;
+ UINT32 PollInterval;
+ UINT32 Vector;
+ UINT32 PollingThresholdValue;
+ UINT32 PollingThresholdWindow;
+ UINT32 ErrorThresholdValue;
+ UINT32 ErrorThresholdWindow;
-} ACPI_NFIT_SYSTEM_ADDRESS;
+} ACPI_HEST_NOTIFY;
-/* Flags */
+/* Values for Notify Type field above */
-#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
-#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
+enum AcpiHestNotifyTypes
+{
+ ACPI_HEST_NOTIFY_POLLED = 0,
+ ACPI_HEST_NOTIFY_EXTERNAL = 1,
+ ACPI_HEST_NOTIFY_LOCAL = 2,
+ ACPI_HEST_NOTIFY_SCI = 3,
+ ACPI_HEST_NOTIFY_NMI = 4,
+ ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
+ ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
+ ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
+ ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
+ ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
+ ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
+ ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
+ ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
+};
-/* Range Type GUIDs appear in the include/acuuid.h file */
+/* Values for ConfigWriteEnable bitfield above */
+#define ACPI_HEST_TYPE (1)
+#define ACPI_HEST_POLL_INTERVAL (1<<1)
+#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
+#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
+#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
+#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
-/* 1: Memory Device to System Address Range Map Structure */
-typedef struct acpi_nfit_memory_map
-{
- ACPI_NFIT_HEADER Header;
- UINT32 DeviceHandle;
- UINT16 PhysicalId;
- UINT16 RegionId;
- UINT16 RangeIndex;
- UINT16 RegionIndex;
- UINT64 RegionSize;
- UINT64 RegionOffset;
- UINT64 Address;
- UINT16 InterleaveIndex;
- UINT16 InterleaveWays;
- UINT16 Flags;
- UINT16 Reserved; /* Reserved, must be zero */
+/*
+ * HEST subtables
+ */
-} ACPI_NFIT_MEMORY_MAP;
+/* 0: IA32 Machine Check Exception */
-/* Flags */
+typedef struct acpi_hest_ia_machine_check
+{
+ ACPI_HEST_HEADER Header;
+ UINT16 Reserved1;
+ UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above
*/
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ UINT64 GlobalCapabilityData;
+ UINT64 GlobalControlData;
+ UINT8 NumHardwareBanks;
+ UINT8 Reserved3[7];
-#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed
*/
-#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory
Device failed */
-#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
-#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed
*/
-#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed
SMART/health events */
-#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled
*/
-#define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
+} ACPI_HEST_IA_MACHINE_CHECK;
-/* 2: Interleave Structure */
+/* 1: IA32 Corrected Machine Check */
-typedef struct acpi_nfit_interleave
+typedef struct acpi_hest_ia_corrected
{
- ACPI_NFIT_HEADER Header;
- UINT16 InterleaveIndex;
- UINT16 Reserved; /* Reserved, must be zero */
- UINT32 LineCount;
- UINT32 LineSize;
- UINT32 LineOffset[1]; /* Variable length */
+ ACPI_HEST_HEADER Header;
+ UINT16 Reserved1;
+ UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above
*/
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ ACPI_HEST_NOTIFY Notify;
+ UINT8 NumHardwareBanks;
+ UINT8 Reserved2[3];
-} ACPI_NFIT_INTERLEAVE;
+} ACPI_HEST_IA_CORRECTED;
-/* 3: SMBIOS Management Information Structure */
+/* 2: IA32 Non-Maskable Interrupt */
-typedef struct acpi_nfit_smbios
+typedef struct acpi_hest_ia_nmi
{
- ACPI_NFIT_HEADER Header;
- UINT32 Reserved; /* Reserved, must be zero */
- UINT8 Data[1]; /* Variable length */
+ ACPI_HEST_HEADER Header;
+ UINT32 Reserved;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ UINT32 MaxRawDataLength;
+
+} ACPI_HEST_IA_NMI;
-} ACPI_NFIT_SMBIOS;
+/* 3,4,5: Not used */
-/* 4: NVDIMM Control Region Structure */
+/* 6: PCI Express Root Port AER */
-typedef struct acpi_nfit_control_region
+typedef struct acpi_hest_aer_root
{
- ACPI_NFIT_HEADER Header;
- UINT16 RegionIndex;
- UINT16 VendorId;
- UINT16 DeviceId;
- UINT16 RevisionId;
- UINT16 SubsystemVendorId;
- UINT16 SubsystemDeviceId;
- UINT16 SubsystemRevisionId;
- UINT8 ValidFields;
- UINT8 ManufacturingLocation;
- UINT16 ManufacturingDate;
- UINT8 Reserved[2]; /* Reserved, must be zero */
- UINT32 SerialNumber;
- UINT16 Code;
- UINT16 Windows;
- UINT64 WindowSize;
- UINT64 CommandOffset;
- UINT64 CommandSize;
- UINT64 StatusOffset;
- UINT64 StatusSize;
- UINT16 Flags;
- UINT8 Reserved1[6]; /* Reserved, must be zero */
+ ACPI_HEST_HEADER Header;
+ ACPI_HEST_AER_COMMON Aer;
+ UINT32 RootErrorCommand;
-} ACPI_NFIT_CONTROL_REGION;
+} ACPI_HEST_AER_ROOT;
-/* Flags */
-#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation
is buffered */
+/* 7: PCI Express AER (AER Endpoint) */
-/* ValidFields bits */
+typedef struct acpi_hest_aer
+{
+ ACPI_HEST_HEADER Header;
+ ACPI_HEST_AER_COMMON Aer;
-#define ACPI_NFIT_CONTROL_MFG_INFO_VALID (1) /* Manufacturing fields are valid */
+} ACPI_HEST_AER;
-/* 5: NVDIMM Block Data Window Region Structure */
+/* 8: PCI Express/PCI-X Bridge AER */
-typedef struct acpi_nfit_data_region
+typedef struct acpi_hest_aer_bridge
{
- ACPI_NFIT_HEADER Header;
- UINT16 RegionIndex;
- UINT16 Windows;
- UINT64 Offset;
- UINT64 Size;
- UINT64 Capacity;
- UINT64 StartAddress;
+ ACPI_HEST_HEADER Header;
+ ACPI_HEST_AER_COMMON Aer;
+ UINT32 UncorrectableMask2;
+ UINT32 UncorrectableSeverity2;
+ UINT32 AdvancedCapabilities2;
-} ACPI_NFIT_DATA_REGION;
+} ACPI_HEST_AER_BRIDGE;
-/* 6: Flush Hint Address Structure */
+/* 9: Generic Hardware Error Source */
-typedef struct acpi_nfit_flush_address
+typedef struct acpi_hest_generic
{
- ACPI_NFIT_HEADER Header;
- UINT32 DeviceHandle;
- UINT16 HintCount;
- UINT8 Reserved[6]; /* Reserved, must be zero */
- UINT64 HintAddress[1]; /* Variable length */
+ ACPI_HEST_HEADER Header;
+ UINT16 RelatedSourceId;
+ UINT8 Reserved;
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ UINT32 MaxRawDataLength;
+ ACPI_GENERIC_ADDRESS ErrorStatusAddress;
+ ACPI_HEST_NOTIFY Notify;
+ UINT32 ErrorBlockLength;
-} ACPI_NFIT_FLUSH_ADDRESS;
+} ACPI_HEST_GENERIC;
-/* 7: Platform Capabilities Structure */
+/* 10: Generic Hardware Error Source, version 2 */
-typedef struct acpi_nfit_capabilities
+typedef struct acpi_hest_generic_v2
{
- ACPI_NFIT_HEADER Header;
- UINT8 HighestCapability;
- UINT8 Reserved[3]; /* Reserved, must be zero */
- UINT32 Capabilities;
- UINT32 Reserved2;
-
-} ACPI_NFIT_CAPABILITIES;
+ ACPI_HEST_HEADER Header;
+ UINT16 RelatedSourceId;
+ UINT8 Reserved;
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ UINT32 MaxRawDataLength;
+ ACPI_GENERIC_ADDRESS ErrorStatusAddress;
+ ACPI_HEST_NOTIFY Notify;
+ UINT32 ErrorBlockLength;
+ ACPI_GENERIC_ADDRESS ReadAckRegister;
+ UINT64 ReadAckPreserve;
+ UINT64 ReadAckWrite;
-/* Capabilities Flags */
+} ACPI_HEST_GENERIC_V2;
-#define ACPI_NFIT_CAPABILITY_CACHE_FLUSH (1) /* 00: Cache Flush to NVDIMM
capable */
-#define ACPI_NFIT_CAPABILITY_MEM_FLUSH (1<<1) /* 01: Memory Flush to
NVDIMM capable */
-#define ACPI_NFIT_CAPABILITY_MEM_MIRRORING (1<<2) /* 02: Memory Mirroring
capable */
+/* Generic Error Status block */
-/*
- * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
- */
-typedef struct nfit_device_handle
+typedef struct acpi_hest_generic_status
{
- UINT32 Handle;
-
-} NFIT_DEVICE_HANDLE;
+ UINT32 BlockStatus;
+ UINT32 RawDataOffset;
+ UINT32 RawDataLength;
+ UINT32 DataLength;
+ UINT32 ErrorSeverity;
-/* Device handle construction and extraction macros */
+} ACPI_HEST_GENERIC_STATUS;
-#define ACPI_NFIT_DIMM_NUMBER_MASK 0x0000000F
-#define ACPI_NFIT_CHANNEL_NUMBER_MASK 0x000000F0
-#define ACPI_NFIT_MEMORY_ID_MASK 0x00000F00
-#define ACPI_NFIT_SOCKET_ID_MASK 0x0000F000
-#define ACPI_NFIT_NODE_ID_MASK 0x0FFF0000
+/* Values for BlockStatus flags above */
-#define ACPI_NFIT_DIMM_NUMBER_OFFSET 0
-#define ACPI_NFIT_CHANNEL_NUMBER_OFFSET 4
-#define ACPI_NFIT_MEMORY_ID_OFFSET 8
-#define ACPI_NFIT_SOCKET_ID_OFFSET 12
-#define ACPI_NFIT_NODE_ID_OFFSET 16
+#define ACPI_HEST_UNCORRECTABLE (1)
+#define ACPI_HEST_CORRECTABLE (1<<1)
+#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
+#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
+#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
-/* Macro to construct a NFIT/NVDIMM device handle */
-#define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
- ((dimm) | \
- ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET) | \
- ((memory) << ACPI_NFIT_MEMORY_ID_OFFSET) | \
- ((socket) << ACPI_NFIT_SOCKET_ID_OFFSET) | \
- ((node) << ACPI_NFIT_NODE_ID_OFFSET))
+/* Generic Error Data entry */
-/* Macros to extract individual fields from a NFIT/NVDIMM device handle */
+typedef struct acpi_hest_generic_data
+{
+ UINT8 SectionType[16];
+ UINT32 ErrorSeverity;
+ UINT16 Revision;
+ UINT8 ValidationBits;
+ UINT8 Flags;
+ UINT32 ErrorDataLength;
+ UINT8 FruId[16];
+ UINT8 FruText[20];
-#define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
- ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
+} ACPI_HEST_GENERIC_DATA;
-#define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
- (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >>
ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
+/* Extension for revision 0x0300 */
-#define ACPI_NFIT_GET_MEMORY_ID(handle) \
- (((handle) & ACPI_NFIT_MEMORY_ID_MASK) >> ACPI_NFIT_MEMORY_ID_OFFSET)
+typedef struct acpi_hest_generic_data_v300
+{
+ UINT8 SectionType[16];
+ UINT32 ErrorSeverity;
+ UINT16 Revision;
+ UINT8 ValidationBits;
+ UINT8 Flags;
+ UINT32 ErrorDataLength;
+ UINT8 FruId[16];
+ UINT8 FruText[20];
+ UINT64 TimeStamp;
-#define ACPI_NFIT_GET_SOCKET_ID(handle) \
- (((handle) & ACPI_NFIT_SOCKET_ID_MASK) >> ACPI_NFIT_SOCKET_ID_OFFSET)
+} ACPI_HEST_GENERIC_DATA_V300;
-#define ACPI_NFIT_GET_NODE_ID(handle) \
- (((handle) & ACPI_NFIT_NODE_ID_MASK) >> ACPI_NFIT_NODE_ID_OFFSET)
+/* Values for ErrorSeverity above */
+#define ACPI_HEST_GEN_ERROR_RECOVERABLE 0
+#define ACPI_HEST_GEN_ERROR_FATAL 1
+#define ACPI_HEST_GEN_ERROR_CORRECTED 2
+#define ACPI_HEST_GEN_ERROR_NONE 3
-/*******************************************************************************
- *
- * PDTT - Platform Debug Trigger Table (ACPI 6.2)
- * Version 0
- *
- ******************************************************************************/
+/* Flags for ValidationBits above */
-typedef struct acpi_table_pdtt
-{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT8 TriggerCount;
- UINT8 Reserved[3];
- UINT32 ArrayOffset;
+#define ACPI_HEST_GEN_VALID_FRU_ID (1)
+#define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1)
+#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
-} ACPI_TABLE_PDTT;
+/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
-/*
- * PDTT Communication Channel Identifier Structure.
- * The number of these structures is defined by TriggerCount above,
- * starting at ArrayOffset.
- */
-typedef struct acpi_pdtt_channel
+typedef struct acpi_hest_ia_deferred_check
{
- UINT8 SubchannelId;
- UINT8 Flags;
-
-} ACPI_PDTT_CHANNEL;
-
-/* Flags for above */
+ ACPI_HEST_HEADER Header;
+ UINT16 Reserved1;
+ UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above
*/
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ ACPI_HEST_NOTIFY Notify;
+ UINT8 NumHardwareBanks;
+ UINT8 Reserved2[3];
-#define ACPI_PDTT_RUNTIME_TRIGGER (1)
-#define ACPI_PDTT_WAIT_COMPLETION (1<<1)
+} ACPI_HEST_IA_DEFERRED_CHECK;
/*******************************************************************************
*
- * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
* Version 1
*
******************************************************************************/
-typedef struct acpi_table_pptt
+typedef struct acpi_table_hmat
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 Reserved;
-} ACPI_TABLE_PPTT;
+} ACPI_TABLE_HMAT;
-/* Values for Type field above */
-enum AcpiPpttType
+/* Values for HMAT structure types */
+
+enum AcpiHmatType
{
- ACPI_PPTT_TYPE_PROCESSOR = 0,
- ACPI_PPTT_TYPE_CACHE = 1,
- ACPI_PPTT_TYPE_ID = 2,
- ACPI_PPTT_TYPE_RESERVED = 3
+ ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
+ ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth
information */
+ ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
+ ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
};
+typedef struct acpi_hmat_structure
+{
+ UINT16 Type;
+ UINT16 Reserved;
+ UINT32 Length;
+
+} ACPI_HMAT_STRUCTURE;
+
+
+/*
+ * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
+ */
-/* 0: Processor Hierarchy Node Structure */
+/* 0: Memory subystem address range */
-typedef struct acpi_pptt_processor
+typedef struct acpi_hmat_address_range
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved;
- UINT32 Flags;
- UINT32 Parent;
- UINT32 AcpiProcessorId;
- UINT32 NumberOfPrivResources;
+ ACPI_HMAT_STRUCTURE Header;
+ UINT16 Flags;
+ UINT16 Reserved1;
+ UINT32 ProcessorPD; /* Processor proximity domain */
+ UINT32 MemoryPD; /* Memory proximity domain */
+ UINT32 Reserved2;
+ UINT64 PhysicalAddressBase; /* Physical address range base */
+ UINT64 PhysicalAddressLength; /* Physical address range length */
-} ACPI_PPTT_PROCESSOR;
+} ACPI_HMAT_ADDRESS_RANGE;
-/* Flags */
+/* Masks for Flags field above */
-#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
-#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
+#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: ProcessorPD field is valid */
+#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: MemoryPD field is valid */
+#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
-/* 1: Cache Type Structure */
+/* 1: System locality latency and bandwidth information */
-typedef struct acpi_pptt_cache
+typedef struct acpi_hmat_locality
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved;
- UINT32 Flags;
- UINT32 NextLevelOfCache;
- UINT32 Size;
- UINT32 NumberOfSets;
- UINT8 Associativity;
- UINT8 Attributes;
- UINT16 LineSize;
+ ACPI_HMAT_STRUCTURE Header;
+ UINT8 Flags;
+ UINT8 DataType;
+ UINT16 Reserved1;
+ UINT32 NumberOfInitiatorPDs;
+ UINT32 NumberOfTargetPDs;
+ UINT32 Reserved2;
+ UINT64 EntryBaseUnit;
-} ACPI_PPTT_CACHE;
+} ACPI_HMAT_LOCALITY;
-/* Flags */
+/* Masks for Flags field above */
-#define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
-#define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
-#define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
-#define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
-#define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
-#define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
-#define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
+#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
-/* Masks for Attributes */
+/* Values for Memory Hierarchy flag */
-#define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
-#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
-#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
+#define ACPI_HMAT_MEMORY 0
+#define ACPI_HMAT_LAST_LEVEL_CACHE 1
+#define ACPI_HMAT_1ST_LEVEL_CACHE 2
+#define ACPI_HMAT_2ND_LEVEL_CACHE 3
+#define ACPI_HMAT_3RD_LEVEL_CACHE 4
-/* Attributes describing cache */
-#define ACPI_PPTT_CACHE_READ_ALLOCATE (0x0) /* Cache line is allocated on read
*/
-#define ACPI_PPTT_CACHE_WRITE_ALLOCATE (0x01) /* Cache line is allocated on write
*/
-#define ACPI_PPTT_CACHE_RW_ALLOCATE (0x02) /* Cache line is allocated on read
and write */
-#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT (0x03) /* Alternate representation of above
*/
+/* Values for DataType field above */
-#define ACPI_PPTT_CACHE_TYPE_DATA (0x0) /* Data cache */
-#define ACPI_PPTT_CACHE_TYPE_INSTR (1<<2) /* Instruction cache */
-#define ACPI_PPTT_CACHE_TYPE_UNIFIED (2<<2) /* Unified I & D cache */
-#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT (3<<2) /* Alternate representation of
above */
+#define ACPI_HMAT_ACCESS_LATENCY 0
+#define ACPI_HMAT_READ_LATENCY 1
+#define ACPI_HMAT_WRITE_LATENCY 2
+#define ACPI_HMAT_ACCESS_BANDWIDTH 3
+#define ACPI_HMAT_READ_BANDWIDTH 4
+#define ACPI_HMAT_WRITE_BANDWIDTH 5
-#define ACPI_PPTT_CACHE_POLICY_WB (0x0) /* Cache is write back */
-#define ACPI_PPTT_CACHE_POLICY_WT (1<<4) /* Cache is write through */
-/* 2: ID Structure */
+/* 2: Memory side cache information */
-typedef struct acpi_pptt_id
+typedef struct acpi_hmat_cache
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved;
- UINT32 VendorId;
- UINT64 Level1Id;
- UINT64 Level2Id;
- UINT16 MajorRev;
- UINT16 MinorRev;
- UINT16 SpinRev;
+ ACPI_HMAT_STRUCTURE Header;
+ UINT32 MemoryPD;
+ UINT32 Reserved1;
+ UINT64 CacheSize;
+ UINT32 CacheAttributes;
+ UINT16 Reserved2;
+ UINT16 NumberOfSMBIOSHandles;
+
+} ACPI_HMAT_CACHE;
-} ACPI_PPTT_ID;
+/* Masks for CacheAttributes field above */
+#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
+#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
+#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
+#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
+#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
-/*******************************************************************************
- *
- * SBST - Smart Battery Specification Table
- * Version 1
- *
- ******************************************************************************/
+/* Values for cache associativity flag */
-typedef struct acpi_table_sbst
-{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 WarningLevel;
- UINT32 LowLevel;
- UINT32 CriticalLevel;
+#define ACPI_HMAT_CA_NONE (0)
+#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
+#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
+
+/* Values for write policy flag */
-} ACPI_TABLE_SBST;
+#define ACPI_HMAT_CP_NONE (0)
+#define ACPI_HMAT_CP_WB (1)
+#define ACPI_HMAT_CP_WT (2)
/*******************************************************************************
*
- * SDEV - Secure Devices Table (ACPI 6.2)
+ * HPET - High Precision Event Timer table
* Version 1
*
+ * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
+ * Version 1.0a, October 2004
+ *
******************************************************************************/
-typedef struct acpi_table_sdev
+typedef struct acpi_table_hpet
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
-
-} ACPI_TABLE_SDEV;
-
-
-typedef struct acpi_sdev_header
-{
- UINT8 Type;
+ UINT32 Id; /* Hardware ID of event timer block */
+ ACPI_GENERIC_ADDRESS Address; /* Address of event timer block */
+ UINT8 Sequence; /* HPET sequence number */
+ UINT16 MinimumTick; /* Main counter min tick, periodic mode
*/
UINT8 Flags;
- UINT16 Length;
-
-} ACPI_SDEV_HEADER;
-
-
-/* Values for subtable type above */
-enum AcpiSdevType
-{
- ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
- ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
- ACPI_SDEV_TYPE_RESERVED = 2 /* 2 and greater are reserved */
-};
-
-/* Values for flags above */
-
-#define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS (1)
-
-/*
- * SDEV subtables
- */
-
-/* 0: Namespace Device Based Secure Device Structure */
+} ACPI_TABLE_HPET;
-typedef struct acpi_sdev_namespace
-{
- ACPI_SDEV_HEADER Header;
- UINT16 DeviceIdOffset;
- UINT16 DeviceIdLength;
- UINT16 VendorDataOffset;
- UINT16 VendorDataLength;
-
-} ACPI_SDEV_NAMESPACE;
-
-/* 1: PCIe Endpoint Device Based Device Structure */
-
-typedef struct acpi_sdev_pcie
-{
- ACPI_SDEV_HEADER Header;
- UINT16 Segment;
- UINT16 StartBus;
- UINT16 PathOffset;
- UINT16 PathLength;
- UINT16 VendorDataOffset;
- UINT16 VendorDataLength;
+/* Masks for Flags field above */
-} ACPI_SDEV_PCIE;
+#define ACPI_HPET_PAGE_PROTECT_MASK (3)
-/* 1a: PCIe Endpoint path entry */
+/* Values for Page Protect flags */
-typedef struct acpi_sdev_pcie_path
+enum AcpiHpetPageProtect
{
- UINT8 Device;
- UINT8 Function;
-
-} ACPI_SDEV_PCIE_PATH;
+ ACPI_HPET_NO_PAGE_PROTECT = 0,
+ ACPI_HPET_PAGE_PROTECT4 = 1,
+ ACPI_HPET_PAGE_PROTECT64 = 2
+};
/*******************************************************************************
*
- * SLIT - System Locality Distance Information Table
+ * IBFT - Boot Firmware Table
* Version 1
*
- ******************************************************************************/
-
-typedef struct acpi_table_slit
-{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT64 LocalityCount;
- UINT8 Entry[1]; /* Real size = localities^2 */
-
-} ACPI_TABLE_SLIT;
-
-
-/*******************************************************************************
+ * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
+ * Specification", Version 1.01, March 1, 2007
*
- * SRAT - System Resource Affinity Table
- * Version 3
+ * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
+ * Therefore, it is not currently supported by the disassembler.
*
******************************************************************************/
-typedef struct acpi_table_srat
+typedef struct acpi_table_ibft
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 TableRevision; /* Must be value '1' */
- UINT64 Reserved; /* Reserved, must be zero */
-
-} ACPI_TABLE_SRAT;
-
-/* Values for subtable type in ACPI_SUBTABLE_HEADER */
-
-enum AcpiSratType
-{
- ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
- ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
- ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
- ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
- ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
- ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
-};
-
-/*
- * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
- */
-
-/* 0: Processor Local APIC/SAPIC Affinity */
-
-typedef struct acpi_srat_cpu_affinity
-{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 ProximityDomainLo;
- UINT8 ApicId;
- UINT32 Flags;
- UINT8 LocalSapicEid;
- UINT8 ProximityDomainHi[3];
- UINT32 ClockDomain;
-
-} ACPI_SRAT_CPU_AFFINITY;
-
-/* Flags */
-
-#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
-
-
-/* 1: Memory Affinity */
-
-typedef struct acpi_srat_mem_affinity
-{
- ACPI_SUBTABLE_HEADER Header;
- UINT32 ProximityDomain;
- UINT16 Reserved; /* Reserved, must be zero */
- UINT64 BaseAddress;
- UINT64 Length;
- UINT32 Reserved1;
- UINT32 Flags;
- UINT64 Reserved2; /* Reserved, must be zero */
+ UINT8 Reserved[12];
-} ACPI_SRAT_MEM_AFFINITY;
+} ACPI_TABLE_IBFT;
-/* Flags */
-#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
-#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot
pluggable */
-#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is
non-volatile */
+/* IBFT common subtable header */
-
-/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
-
-typedef struct acpi_srat_x2apic_cpu_affinity
+typedef struct acpi_ibft_header
{
- ACPI_SUBTABLE_HEADER Header;
- UINT16 Reserved; /* Reserved, must be zero */
- UINT32 ProximityDomain;
- UINT32 ApicId;
- UINT32 Flags;
- UINT32 ClockDomain;
- UINT32 Reserved2;
-
-} ACPI_SRAT_X2APIC_CPU_AFFINITY;
-
-/* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
-
-#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
+ UINT8 Type;
+ UINT8 Version;
+ UINT16 Length;
+ UINT8 Index;
+ UINT8 Flags;
+} ACPI_IBFT_HEADER;
-/* 3: GICC Affinity (ACPI 5.1) */
+/* Values for Type field above */
-typedef struct acpi_srat_gicc_affinity
+enum AcpiIbftType
{
- ACPI_SUBTABLE_HEADER Header;
- UINT32 ProximityDomain;
- UINT32 AcpiProcessorUid;
- UINT32 Flags;
- UINT32 ClockDomain;
-
-} ACPI_SRAT_GICC_AFFINITY;
-
-/* Flags for ACPI_SRAT_GICC_AFFINITY */
-
-#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
-
-
-/* 4: GCC ITS Affinity (ACPI 6.2) */
+ ACPI_IBFT_TYPE_NOT_USED = 0,
+ ACPI_IBFT_TYPE_CONTROL = 1,
+ ACPI_IBFT_TYPE_INITIATOR = 2,
+ ACPI_IBFT_TYPE_NIC = 3,
+ ACPI_IBFT_TYPE_TARGET = 4,
+ ACPI_IBFT_TYPE_EXTENSIONS = 5,
+ ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
+};
-typedef struct acpi_srat_gic_its_affinity
-{
- ACPI_SUBTABLE_HEADER Header;
- UINT32 ProximityDomain;
- UINT16 Reserved;
- UINT32 ItsId;
-} ACPI_SRAT_GIC_ITS_AFFINITY;
+/* IBFT subtables */
+
+typedef struct acpi_ibft_control
+{
+ ACPI_IBFT_HEADER Header;
+ UINT16 Extensions;
+ UINT16 InitiatorOffset;
+ UINT16 Nic0Offset;
+ UINT16 Target0Offset;
+ UINT16 Nic1Offset;
+ UINT16 Target1Offset;
+
+} ACPI_IBFT_CONTROL;
+
+typedef struct acpi_ibft_initiator
+{
+ ACPI_IBFT_HEADER Header;
+ UINT8 SnsServer[16];
+ UINT8 SlpServer[16];
+ UINT8 PrimaryServer[16];
+ UINT8 SecondaryServer[16];
+ UINT16 NameLength;
+ UINT16 NameOffset;
+
+} ACPI_IBFT_INITIATOR;
+
+typedef struct acpi_ibft_nic
+{
+ ACPI_IBFT_HEADER Header;
+ UINT8 IpAddress[16];
+ UINT8 SubnetMaskPrefix;
+ UINT8 Origin;
+ UINT8 Gateway[16];
+ UINT8 PrimaryDns[16];
+ UINT8 SecondaryDns[16];
+ UINT8 Dhcp[16];
+ UINT16 Vlan;
+ UINT8 MacAddress[6];
+ UINT16 PciAddress;
+ UINT16 NameLength;
+ UINT16 NameOffset;
+
+} ACPI_IBFT_NIC;
+
+typedef struct acpi_ibft_target
+{
+ ACPI_IBFT_HEADER Header;
+ UINT8 TargetIpAddress[16];
+ UINT16 TargetIpSocket;
+ UINT8 TargetBootLun[8];
+ UINT8 ChapType;
+ UINT8 NicAssociation;
+ UINT16 TargetNameLength;
+ UINT16 TargetNameOffset;
+ UINT16 ChapNameLength;
+ UINT16 ChapNameOffset;
+ UINT16 ChapSecretLength;
+ UINT16 ChapSecretOffset;
+ UINT16 ReverseChapNameLength;
+ UINT16 ReverseChapNameOffset;
+ UINT16 ReverseChapSecretLength;
+ UINT16 ReverseChapSecretOffset;
+
+} ACPI_IBFT_TARGET;
/* Reset to default packing */
diff --git a/drivers/bus/acpi/acpica/include/actbl2.h
b/drivers/bus/acpi/acpica/include/actbl2.h
index 7592bfa72b..3205ec9310 100644
--- a/drivers/bus/acpi/acpica/include/actbl2.h
+++ b/drivers/bus/acpi/acpica/include/actbl2.h
@@ -52,9 +52,6 @@
* These tables are not consumed directly by the ACPICA subsystem, but are
* included here to support device drivers and the AML disassembler.
*
- * Generally, the tables in this file are defined by third-party specifications,
- * and are not defined directly by the ACPI specification itself.
- *
******************************************************************************/
@@ -63,44 +60,26 @@
* file. Useful because they make it more difficult to inadvertently type in
* the wrong signature.
*/
-#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
-#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
-#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
-#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
-#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
-#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
-#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table
*/
-#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
#define ACPI_SIG_IORT "IORT" /* IO Remapping Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting
Structure */
#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
+#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table
*/
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration
table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host
Interface table */
+#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
+#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics
Table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table
*/
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
+#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table
*/
+#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel
Table */
+#define ACPI_SIG_PDTT "PDTT" /* Platform Debug Trigger Table */
+#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table
*/
+#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology
Table */
+#define ACPI_SIG_RASF "RASF" /* RAS Feature table */
+#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification
Table */
#define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception
Interface Table */
-#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description
Table */
-#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection
table */
-#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management
Interface table */
-#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform
Alliance table */
-#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W
interface table */
-#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
-#define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table
*/
-#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices
Table */
-#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
-#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table
*/
-#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
-#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations
Table */
-#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for
ASL/ASL+ converter */
-
-#ifdef ACPI_UNDEFINED_TABLES
-/*
- * These tables have been seen in the field, but no definition has been found
- */
-#define ACPI_SIG_ATKG "ATKG"
-#define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */
-#define ACPI_SIG_IEIT "IEIT"
-#endif
+#define ACPI_SIG_SDEV "SDEV" /* Secure Devices table */
+
/*
* All tables must be byte-packed to match the ACPI specification, since
@@ -123,1712 +102,1951 @@
/*******************************************************************************
*
- * ASF - Alert Standard Format table (Signature "ASF!")
- * Revision 0x10
+ * IORT - IO Remapping Table
*
- * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
+ * Conforms to "IO Remapping Table System Software on ARM Platforms",
+ * Document number: ARM DEN 0049D, March 2018
*
******************************************************************************/
-typedef struct acpi_table_asf
+typedef struct acpi_table_iort
{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
-
-} ACPI_TABLE_ASF;
+ ACPI_TABLE_HEADER Header;
+ UINT32 NodeCount;
+ UINT32 NodeOffset;
+ UINT32 Reserved;
+} ACPI_TABLE_IORT;
-/* ASF subtable header */
-typedef struct acpi_asf_header
+/*
+ * IORT subtables
+ */
+typedef struct acpi_iort_node
{
UINT8 Type;
- UINT8 Reserved;
UINT16 Length;
+ UINT8 Revision;
+ UINT32 Reserved;
+ UINT32 MappingCount;
+ UINT32 MappingOffset;
+ char NodeData[1];
-} ACPI_ASF_HEADER;
-
+} ACPI_IORT_NODE;
-/* Values for Type field above */
+/* Values for subtable Type above */
-enum AcpiAsfType
+enum AcpiIortNodeType
{
- ACPI_ASF_TYPE_INFO = 0,
- ACPI_ASF_TYPE_ALERT = 1,
- ACPI_ASF_TYPE_CONTROL = 2,
- ACPI_ASF_TYPE_BOOT = 3,
- ACPI_ASF_TYPE_ADDRESS = 4,
- ACPI_ASF_TYPE_RESERVED = 5
+ ACPI_IORT_NODE_ITS_GROUP = 0x00,
+ ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
+ ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
+ ACPI_IORT_NODE_SMMU = 0x03,
+ ACPI_IORT_NODE_SMMU_V3 = 0x04,
+ ACPI_IORT_NODE_PMCG = 0x05
};
-/*
- * ASF subtables
- */
-
-/* 0: ASF Information */
-typedef struct acpi_asf_info
+typedef struct acpi_iort_id_mapping
{
- ACPI_ASF_HEADER Header;
- UINT8 MinResetValue;
- UINT8 MinPollInterval;
- UINT16 SystemId;
- UINT32 MfgId;
- UINT8 Flags;
- UINT8 Reserved2[3];
-
-} ACPI_ASF_INFO;
-
-/* Masks for Flags field above */
-
-#define ACPI_ASF_SMBUS_PROTOCOLS (1)
+ UINT32 InputBase; /* Lowest value in input range */
+ UINT32 IdCount; /* Number of IDs */
+ UINT32 OutputBase; /* Lowest value in output range */
+ UINT32 OutputReference; /* A reference to the output node */
+ UINT32 Flags;
+} ACPI_IORT_ID_MAPPING;
-/* 1: ASF Alerts */
+/* Masks for Flags field above for IORT subtable */
-typedef struct acpi_asf_alert
-{
- ACPI_ASF_HEADER Header;
- UINT8 AssertMask;
- UINT8 DeassertMask;
- UINT8 Alerts;
- UINT8 DataLength;
+#define ACPI_IORT_ID_SINGLE_MAPPING (1)
-} ACPI_ASF_ALERT;
-typedef struct acpi_asf_alert_data
+typedef struct acpi_iort_memory_access
{
- UINT8 Address;
- UINT8 Command;
- UINT8 Mask;
- UINT8 Value;
- UINT8 SensorType;
- UINT8 Type;
- UINT8 Offset;
- UINT8 SourceType;
- UINT8 Severity;
- UINT8 SensorNumber;
- UINT8 Entity;
- UINT8 Instance;
-
-} ACPI_ASF_ALERT_DATA;
+ UINT32 CacheCoherency;
+ UINT8 Hints;
+ UINT16 Reserved;
+ UINT8 MemoryFlags;
+} ACPI_IORT_MEMORY_ACCESS;
-/* 2: ASF Remote Control */
+/* Values for CacheCoherency field above */
-typedef struct acpi_asf_remote
-{
- ACPI_ASF_HEADER Header;
- UINT8 Controls;
- UINT8 DataLength;
- UINT16 Reserved2;
+#define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent
*/
+#define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent
*/
-} ACPI_ASF_REMOTE;
+/* Masks for Hints field above */
-typedef struct acpi_asf_control_data
-{
- UINT8 Function;
- UINT8 Address;
- UINT8 Command;
- UINT8 Value;
+#define ACPI_IORT_HT_TRANSIENT (1)
+#define ACPI_IORT_HT_WRITE (1<<1)
+#define ACPI_IORT_HT_READ (1<<2)
+#define ACPI_IORT_HT_OVERRIDE (1<<3)
-} ACPI_ASF_CONTROL_DATA;
+/* Masks for MemoryFlags field above */
+#define ACPI_IORT_MF_COHERENCY (1)
+#define ACPI_IORT_MF_ATTRIBUTES (1<<1)
-/* 3: ASF RMCP Boot Options */
-typedef struct acpi_asf_rmcp
+/*
+ * IORT node specific subtables
+ */
+typedef struct acpi_iort_its_group
{
- ACPI_ASF_HEADER Header;
- UINT8 Capabilities[7];
- UINT8 CompletionCode;
- UINT32 EnterpriseId;
- UINT8 Command;
- UINT16 Parameter;
- UINT16 BootOptions;
- UINT16 OemParameters;
-
-} ACPI_ASF_RMCP;
+ UINT32 ItsCount;
+ UINT32 Identifiers[1]; /* GIC ITS identifier arrary */
+} ACPI_IORT_ITS_GROUP;
-/* 4: ASF Address */
-typedef struct acpi_asf_address
+typedef struct acpi_iort_named_component
{
- ACPI_ASF_HEADER Header;
- UINT8 EpromAddress;
- UINT8 Devices;
+ UINT32 NodeFlags;
+ UINT64 MemoryProperties; /* Memory access properties */
+ UINT8 MemoryAddressLimit; /* Memory address size limit */
+ char DeviceName[1]; /* Path of namespace object */
-} ACPI_ASF_ADDRESS;
+} ACPI_IORT_NAMED_COMPONENT;
+/* Masks for Flags field above */
-/*******************************************************************************
- *
- * BOOT - Simple Boot Flag Table
- * Version 1
- *
- * Conforms to the "Simple Boot Flag Specification", Version 2.1
- *
- ******************************************************************************/
+#define ACPI_IORT_NC_STALL_SUPPORTED (1)
+#define ACPI_IORT_NC_PASID_BITS (31<<1)
-typedef struct acpi_table_boot
+typedef struct acpi_iort_root_complex
{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT8 CmosIndex; /* Index in CMOS RAM for the boot
register */
- UINT8 Reserved[3];
+ UINT64 MemoryProperties; /* Memory access properties */
+ UINT32 AtsAttribute;
+ UINT32 PciSegmentNumber;
+ UINT8 MemoryAddressLimit; /* Memory address size limit */
+ UINT8 Reserved[3]; /* Reserved, must be zero */
-} ACPI_TABLE_BOOT;
+} ACPI_IORT_ROOT_COMPLEX;
+/* Values for AtsAttribute field above */
-/*******************************************************************************
- *
- * CSRT - Core System Resource Table
- * Version 0
- *
- * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
- *
- ******************************************************************************/
+#define ACPI_IORT_ATS_SUPPORTED 0x00000001 /* The root complex supports ATS */
+#define ACPI_IORT_ATS_UNSUPPORTED 0x00000000 /* The root complex doesn't
support ATS */
-typedef struct acpi_table_csrt
-{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
-} ACPI_TABLE_CSRT;
+typedef struct acpi_iort_smmu
+{
+ UINT64 BaseAddress; /* SMMU base address */
+ UINT64 Span; /* Length of memory range */
+ UINT32 Model;
+ UINT32 Flags;
+ UINT32 GlobalInterruptOffset;
+ UINT32 ContextInterruptCount;
+ UINT32 ContextInterruptOffset;
+ UINT32 PmuInterruptCount;
+ UINT32 PmuInterruptOffset;
+ UINT64 Interrupts[1]; /* Interrupt array */
+} ACPI_IORT_SMMU;
-/* Resource Group subtable */
+/* Values for Model field above */
-typedef struct acpi_csrt_group
-{
- UINT32 Length;
- UINT32 VendorId;
- UINT32 SubvendorId;
- UINT16 DeviceId;
- UINT16 SubdeviceId;
- UINT16 Revision;
- UINT16 Reserved;
- UINT32 SharedInfoLength;
+#define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */
+#define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */
+#define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */
+#define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */
+#define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */
+#define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium ThunderX SMMUv2 */
- /* Shared data immediately follows (Length = SharedInfoLength) */
+/* Masks for Flags field above */
-} ACPI_CSRT_GROUP;
+#define ACPI_IORT_SMMU_DVM_SUPPORTED (1)
+#define ACPI_IORT_SMMU_COHERENT_WALK (1<<1)
-/* Shared Info subtable */
+/* Global interrupt format */
-typedef struct acpi_csrt_shared_info
+typedef struct acpi_iort_smmu_gsi
{
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 MmioBaseLow;
- UINT32 MmioBaseHigh;
- UINT32 GsiInterrupt;
- UINT8 InterruptPolarity;
- UINT8 InterruptMode;
- UINT8 NumChannels;
- UINT8 DmaAddressWidth;
- UINT16 BaseRequestLine;
- UINT16 NumHandshakeSignals;
- UINT32 MaxBlockSize;
-
- /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength)
*/
+ UINT32 NSgIrpt;
+ UINT32 NSgIrptFlags;
+ UINT32 NSgCfgIrpt;
+ UINT32 NSgCfgIrptFlags;
-} ACPI_CSRT_SHARED_INFO;
+} ACPI_IORT_SMMU_GSI;
-/* Resource Descriptor subtable */
-typedef struct acpi_csrt_descriptor
+typedef struct acpi_iort_smmu_v3
{
- UINT32 Length;
- UINT16 Type;
- UINT16 Subtype;
- UINT32 Uid;
+ UINT64 BaseAddress; /* SMMUv3 base address */
+ UINT32 Flags;
+ UINT32 Reserved;
+ UINT64 VatosAddress;
+ UINT32 Model;
+ UINT32 EventGsiv;
+ UINT32 PriGsiv;
+ UINT32 GerrGsiv;
+ UINT32 SyncGsiv;
+ UINT32 Pxm;
+ UINT32 IdMappingIndex;
- /* Resource-specific information immediately follows */
+} ACPI_IORT_SMMU_V3;
-} ACPI_CSRT_DESCRIPTOR;
+/* Values for Model field above */
+#define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */
+#define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* HiSilicon Hi161x SMMUv3 */
+#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */
-/* Resource Types */
+/* Masks for Flags field above */
-#define ACPI_CSRT_TYPE_INTERRUPT 0x0001
-#define ACPI_CSRT_TYPE_TIMER 0x0002
-#define ACPI_CSRT_TYPE_DMA 0x0003
+#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
+#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1)
+#define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3)
-/* Resource Subtypes */
+typedef struct acpi_iort_pmcg
+{
+ UINT64 Page0BaseAddress;
+ UINT32 OverflowGsiv;
+ UINT32 NodeReference;
+ UINT64 Page1BaseAddress;
-#define ACPI_CSRT_XRUPT_LINE 0x0000
-#define ACPI_CSRT_XRUPT_CONTROLLER 0x0001
-#define ACPI_CSRT_TIMER 0x0000
-#define ACPI_CSRT_DMA_CHANNEL 0x0000
-#define ACPI_CSRT_DMA_CONTROLLER 0x0001
+} ACPI_IORT_PMCG;
/*******************************************************************************
*
- * DBG2 - Debug Port Table 2
- * Version 0 (Both main table and subtables)
+ * IVRS - I/O Virtualization Reporting Structure
+ * Version 1
*
- * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015
+ * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
+ * Revision 1.26, February 2009.
*
******************************************************************************/
-typedef struct acpi_table_dbg2
+typedef struct acpi_table_ivrs
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT32 InfoOffset;
- UINT32 InfoCount;
-
-} ACPI_TABLE_DBG2;
+ UINT32 Info; /* Common virtualization info */
+ UINT64 Reserved;
+} ACPI_TABLE_IVRS;
-typedef struct acpi_dbg2_header
-{
- UINT32 InfoOffset;
- UINT32 InfoCount;
+/* Values for Info field above */
-} ACPI_DBG2_HEADER;
+#define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
+#define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
+#define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved
*/
-/* Debug Device Information Subtable */
+/* IVRS subtable header */
-typedef struct acpi_dbg2_device
+typedef struct acpi_ivrs_header
{
- UINT8 Revision;
- UINT16 Length;
- UINT8 RegisterCount; /* Number of BaseAddress registers */
- UINT16 NamepathLength;
- UINT16 NamepathOffset;
- UINT16 OemDataLength;
- UINT16 OemDataOffset;
- UINT16 PortType;
- UINT16 PortSubtype;
- UINT16 Reserved;
- UINT16 BaseAddressOffset;
- UINT16 AddressSizeOffset;
- /*
- * Data that follows:
- * BaseAddress (required) - Each in 12-byte Generic Address Structure format.
- * AddressSize (required) - Array of UINT32 sizes corresponding to each
BaseAddress register.
- * Namepath (required) - Null terminated string. Single dot if not supported.
- * OemData (optional) - Length is OemDataLength.
- */
-} ACPI_DBG2_DEVICE;
-
-/* Types for PortType field above */
-
-#define ACPI_DBG2_SERIAL_PORT 0x8000
-#define ACPI_DBG2_1394_PORT 0x8001
-#define ACPI_DBG2_USB_PORT 0x8002
-#define ACPI_DBG2_NET_PORT 0x8003
+ UINT8 Type; /* Subtable type */
+ UINT8 Flags;
+ UINT16 Length; /* Subtable length */
+ UINT16 DeviceId; /* ID of IOMMU */
-/* Subtypes for PortSubtype field above */
+} ACPI_IVRS_HEADER;
-#define ACPI_DBG2_16550_COMPATIBLE 0x0000
-#define ACPI_DBG2_16550_SUBSET 0x0001
-#define ACPI_DBG2_ARM_PL011 0x0003
-#define ACPI_DBG2_ARM_SBSA_32BIT 0x000D
-#define ACPI_DBG2_ARM_SBSA_GENERIC 0x000E
-#define ACPI_DBG2_ARM_DCC 0x000F
-#define ACPI_DBG2_BCM2835 0x0010
+/* Values for subtable Type above */
-#define ACPI_DBG2_1394_STANDARD 0x0000
+enum AcpiIvrsType
+{
+ ACPI_IVRS_TYPE_HARDWARE = 0x10,
+ ACPI_IVRS_TYPE_MEMORY1 = 0x20,
+ ACPI_IVRS_TYPE_MEMORY2 = 0x21,
+ ACPI_IVRS_TYPE_MEMORY3 = 0x22
+};
-#define ACPI_DBG2_USB_XHCI 0x0000
-#define ACPI_DBG2_USB_EHCI 0x0001
+/* Masks for Flags field above for IVHD subtable */
+#define ACPI_IVHD_TT_ENABLE (1)
+#define ACPI_IVHD_PASS_PW (1<<1)
+#define ACPI_IVHD_RES_PASS_PW (1<<2)
+#define ACPI_IVHD_ISOC (1<<3)
+#define ACPI_IVHD_IOTLB (1<<4)
-/*******************************************************************************
- *
- * DBGP - Debug Port table
- * Version 1
- *
- * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
- *
- ******************************************************************************/
+/* Masks for Flags field above for IVMD subtable */
-typedef struct acpi_table_dbgp
-{
- ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT8 Type; /* 0=full 16550, 1=subset of 16550 */
- UINT8 Reserved[3];
- ACPI_GENERIC_ADDRESS DebugPort;
... 5154 lines suppressed ...