drivers/crb/tpm: Add new method to retrieve base address

In order to support runtime evaluation of the TPM base address
introduce and use a new method for CRB TPMs.

Change-Id: I29c81d82947eb2603472a515f9ada598e4f8e6ea
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88249
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
This commit is contained in:
Patrick Rudolph 2025-06-30 13:55:15 +02:00 committed by Matt DeVillier
commit 984c64295b
3 changed files with 13 additions and 1 deletions

View file

@ -281,7 +281,7 @@ static void acpi_create_tpm2(acpi_header_t *header, void *unused)
tpm2->platform_class = 0;
if (CONFIG(CRB_TPM)) {
/* Must be set to 7 for CRB Support */
tpm2->control_area = CONFIG_CRB_TPM_BASE_ADDRESS + 0x40;
tpm2->control_area = crb_tpm_base_address() + 0x40;
tpm2->start_method = 7;
} else {
/* Must be set to 0 for FIFO interface support */

View file

@ -346,3 +346,13 @@ bool crb_tpm_is_active(void)
return true;
}
/*
* crb_tpm_base_address
*
* Returns the CRB TPM base address.
*/
uintptr_t crb_tpm_base_address(void)
{
return CONFIG_CRB_TPM_BASE_ADDRESS;
}

View file

@ -68,3 +68,5 @@ size_t crb_tpm_process_command(const void *tpm2_command, size_t command_size,
bool crb_tpm_is_active(void);
tis_sendrecv_fn crb_tis_probe(enum tpm_family *family);
uintptr_t crb_tpm_base_address(void);