UefiPayloadPkg: Parse coreboot's TPM PPI handoff buffer

Read the coreboot table containing the TPM PPI handoff buffer and
place it in gEfiTcgPhysicalPresenceInfoHob.

coreboot uses the same PPI interface as QEMU does and installs the
corresponding ACPI code to provide a full PPI interface to the OS.
The OS must reboot in order to execute the requests.

The corresponding coreboot patch can be found here:
https://review.coreboot.org/c/coreboot/+/45568

In a follow up commit the OvmfPkg PhysicalPresence library will be used
to confirm TPM PPI request. This is necessary as coreboot doesn't have
input drivers or a graphical UI that could be used.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
This commit is contained in:
Patrick Rudolph
2020-10-05 16:29:25 +02:00
committed by Tim Crawford
parent d296a36cc4
commit 7d5abcd016
9 changed files with 156 additions and 0 deletions

View File

@@ -258,5 +258,30 @@ struct cb_smmstorev2 {
(void *)(((UINT8 *) (_rec)) + sizeof(*(_rec)) \
+ (sizeof((_rec)->map[0]) * (_idx)))
#define CB_TAG_TPM_PPI_HANDOFF 0x003a
enum lb_tmp_ppi_tpm_version {
LB_TPM_VERSION_UNSPEC = 0,
LB_TPM_VERSION_TPM_VERSION_1_2,
LB_TPM_VERSION_TPM_VERSION_2,
};
/*
* Handoff buffer for TPM Physical Presence Interface.
* * ppi_address Pointer to PPI buffer shared with ACPI
* The layout of the buffer matches the QEMU virtual memory device
* that is generated by QEMU.
* See files 'hw/i386/acpi-build.c' and 'include/hw/acpi/tpm.h'
* for details.
* * tpm_version TPM version: 1 for TPM1.2, 2 for TPM2.0
* * ppi_version BCD encoded version of TPM PPI interface
*/
struct cb_tpm_physical_presence {
UINT32 tag;
UINT32 size;
UINT32 ppi_address; /* Address of ACPI PPI communication buffer */
UINT8 tpm_version; /* 1: TPM1.2, 2: TPM2.0 */
UINT8 ppi_version; /* BCD encoded */
} __packed;
#endif // _COREBOOT_PEI_H_INCLUDED_