acpi: Add enums for TPM2 start method

Based on the "TCG ACPI Specification" Version 1.3 published 2021.
Add an enum for the ACPI start methods and use it instead of hardcoding
various numbers in plain code.

Change-Id: I8b66527ee7417e231fe52e0a609b8c100de522b0
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89458
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Patrick Rudolph 2025-10-08 12:36:30 +02:00 committed by Felix Held
commit b741e2274e
2 changed files with 17 additions and 6 deletions

View file

@ -287,17 +287,14 @@ static void acpi_create_tpm2(acpi_header_t *header, void *unused)
tpm2->platform_class = 0;
if (CONFIG(AMD_CRB_FTPM) && crb_tpm_is_active()) {
/* Must be set to 2 for AMD fTPM Support */
tpm2->control_area = crb_tpm_base_address() + 0x40;
tpm2->start_method = 2;
tpm2->start_method = ACPI_TPM2_SM_ACPI_START;
} else if (CONFIG(CRB_TPM) && crb_tpm_is_active()) {
/* Must be set to 7 for CRB Support */
tpm2->control_area = crb_tpm_base_address() + 0x40;
tpm2->start_method = 7;
tpm2->start_method = ACPI_TPM2_SM_CRB;
} else {
/* Must be set to 0 for FIFO interface support */
tpm2->control_area = 0;
tpm2->start_method = 6;
tpm2->start_method = ACPI_TPM2_SM_MMIO_TIS;
}
memset(tpm2->msp, 0, sizeof(tpm2->msp));

View file

@ -243,6 +243,20 @@ typedef struct acpi_tcpa {
u64 lasa;
} __packed acpi_tcpa_t;
/* TCG ACPI Specification "Table 8: Start Method values for ACPI table for TPM 2.0" */
enum acpi_tpm2_start_methods {
ACPI_TPM2_SM_NOT_ALLOWED = 0,
ACPI_TPM2_SM_LEGACY,
ACPI_TPM2_SM_ACPI_START,
ACPI_TPM2_SM_MMIO_TIS = 6,
ACPI_TPM2_SM_CRB,
ACPI_TPM2_SM_CRB_AND_ACPI_START,
ACPI_TPM2_SM_CRB_AND_ARM_SECURE_MONITOR = 11,
ACPI_TPM2_SM_FIFO_I2C,
ACPI_TPM2_SM_RESERVED_MMIO0,
ACPI_TPM2_SM_RESERVED_MMIO1,
};
typedef struct acpi_tpm2 {
acpi_header_t header;
u16 platform_class;