From e8ffd86e1a1a7d5c2ab5b1fe0e899c91f609393f Mon Sep 17 00:00:00 2001 From: Erik Schmauss Date: Thu, 25 Oct 2018 10:29:04 -0700 Subject: iASL: add support for TPM2 rev 3 compilation Signed-off-by: Erik Schmauss --- source/compiler/dttable2.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 3f9703776..0b196a2fe 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -1876,6 +1876,62 @@ DtCompileTcpa ( } +/****************************************************************************** + * + * FUNCTION: DtCompileTpm2Rev3 + * + * PARAMETERS: PFieldList - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile TPM2 revision 3 + * + *****************************************************************************/ +static ACPI_STATUS +DtCompileTpm2Rev3 ( + void **List) +{ + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_SUBTABLE *Subtable; + ACPI_TABLE_TPM23 *Tpm23Header; + DT_SUBTABLE *ParentTable; + ACPI_STATUS Status = AE_OK; + + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23, + &Subtable); + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + Tpm23Header = ACPI_CAST_PTR (ACPI_TABLE_TPM23, ParentTable->Buffer); + + /* Subtable type depends on the StartMethod */ + + switch (Tpm23Header->StartMethod) + { + case ACPI_TPM23_ACPI_START_METHOD: + + /* Subtable specific to to ARM_SMC */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm23a, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + break; + + default: + break; + } + + return (Status); +} + + /****************************************************************************** * * FUNCTION: DtCompileTpm2 @@ -1897,8 +1953,18 @@ DtCompileTpm2 ( ACPI_TABLE_TPM2 *Tpm2Header; DT_SUBTABLE *ParentTable; ACPI_STATUS Status = AE_OK; + ACPI_TABLE_HEADER *Header; + ParentTable = DtPeekSubtable (); + + Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); + + if (Header->Revision == 3) + { + return (DtCompileTpm2Rev3 (List)); + } + /* Compile the main table */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm2, -- cgit v1.2.1