From a82020839af2314afb08a2045022ffa7de8f98f5 Mon Sep 17 00:00:00 2001 From: Tao Yuhong Date: Tue, 1 Jun 2021 17:29:42 -0400 Subject: [PATCH] DM: TPM2: Fix remove hard code GPA base miss control register info CRB_REGS_CTRL_REQ is offset of control register to TPM mmio base, need use the address to generate TPM2 acpi table Tracked-On: #6126 Signed-off-by: Tao Yuhong --- devicemodel/hw/platform/acpi/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/hw/platform/acpi/acpi.c b/devicemodel/hw/platform/acpi/acpi.c index 5fa42c900..1af259c05 100644 --- a/devicemodel/hw/platform/acpi/acpi.c +++ b/devicemodel/hw/platform/acpi/acpi.c @@ -803,7 +803,7 @@ basl_fwrite_tpm2(FILE *fp, struct vmctx *ctx) EFPRINTF(fp, "[0002]\t\tPlatform Class : 0000\n"); EFPRINTF(fp, "[0002]\t\tReserved : 0000\n"); - EFPRINTF(fp, "[0008]\t\tControl Address : %016lX\n", (long)CRB_REGS_CTRL_REQ); + EFPRINTF(fp, "[0008]\t\tControl Address : %016lX\n", get_tpm_crb_mmio_addr() + (long)CRB_REGS_CTRL_REQ); EFPRINTF(fp, "[0004]\t\tStart Method : 00000007\n"); EFPRINTF(fp, "[0012]\t\tMethod Parameters : 00 00 00 00 00 00 00 00 00 00 00 00\n");