# @ValidList 0x80000003 | 0x010D0000\r
gEfiSecurityPkgTokenSpaceGuid.PcdStatusCodeSubClassTpmDevice|0x010D0000|UINT32|0x00000007\r
\r
+ ## Null-terminated string of the Version of Physical Presence interface supported by platform.\r
+ # @Prompt Version of Physical Presence interface supported by platform.\r
+ gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|"1.3"|VOID*|0x00000008\r
+\r
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
## Indicates the presence or absence of the platform operator during firmware booting.\r
# If platform operator is not physical presence during boot. TPM will be locked and the TPM commands \r
return (VOID *) (UINTN) MemoryAddress;\r
}\r
\r
+/**\r
+ Patch version string of Physical Presence interface supported by platform. The initial string tag in TPM \r
+ACPI table is "$PV".\r
+\r
+ @param[in, out] Table The TPM item in ACPI table.\r
+ @param[in] PPVer Version string of Physical Presence interface supported by platform.\r
+\r
+ @return The allocated address for the found region.\r
+\r
+**/\r
+EFI_STATUS\r
+UpdatePPVersion (\r
+ EFI_ACPI_DESCRIPTION_HEADER *Table,\r
+ CHAR8 *PPVer\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ UINT8 *DataPtr;\r
+\r
+ //\r
+ // Patch some pointers for the ASL code before loading the SSDT.\r
+ //\r
+ for (DataPtr = (UINT8 *)(Table + 1);\r
+ DataPtr <= (UINT8 *) ((UINT8 *) Table + Table->Length - PHYSICAL_PRESENCE_VERSION_SIZE);\r
+ DataPtr += 1) {\r
+ if (AsciiStrCmp(DataPtr, PHYSICAL_PRESENCE_VERSION_TAG) == 0) {\r
+ Status = AsciiStrCpyS(DataPtr, PHYSICAL_PRESENCE_VERSION_SIZE, PPVer);\r
+ DEBUG((EFI_D_INFO, "TPM2 Physical Presence Interface Version update status 0x%x\n", Status));\r
+ return Status;\r
+ }\r
+ }\r
+\r
+ return EFI_NOT_FOUND;\r
+}\r
+\r
/**\r
Initialize and publish TPM items in ACPI table.\r
\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ //\r
+ // Update Table version before measuring it to PCR\r
+ //\r
+ Status = UpdatePPVersion(Table, (CHAR8 *)PcdGetPtr(PcdTcgPhysicalPresenceInterfaceVer));\r
+ ASSERT_EFI_ERROR (Status);\r
\r
//\r
// Measure to PCR[0] with event EV_POST_CODE ACPI DATA\r
ASSERT (mTcgNvs != NULL);\r
\r
//\r
- // Publish the TPM ACPI table\r
+ // Publish the TPM ACPI table. Table is re-checksumed.\r
//\r
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **) &AcpiTable);\r
ASSERT_EFI_ERROR (Status);\r
#define MOR_REQUEST_SUCCESS 0\r
#define MOR_REQUEST_GENERAL_FAILURE 1\r
\r
+//\r
+// Physical Presence Interface Version supported by Platform\r
+//\r
+#define PHYSICAL_PRESENCE_VERSION_TAG "$PV"\r
+#define PHYSICAL_PRESENCE_VERSION_SIZE 4\r
+\r
#endif // __TCG_SMM_H__\r
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId ## SOMETIMES_CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision ## SOMETIMES_CONSUMES\r
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress ## CONSUMES\r
+ gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer ## CONSUMES\r
\r
[Depex]\r
gEfiAcpiTableProtocolGuid AND\r
The TPM2 definition block in ACPI table for TCG2 physical presence \r
and MemoryClear.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
(c)Copyright 2016 HP Development Company, L.P.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
//\r
// a) Get Physical Presence Interface Version\r
//\r
- Return ("1.3")\r
+ Return ("$PV")\r
}\r
Case (2)\r
{\r