aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass2020-11-04 09:57:40 -0700
committerBin Meng2020-11-06 09:51:32 +0800
commit7f061e0d255d5cdfbd216960134ea66e474ae819 (patch)
tree50d91001c517bc96bb54b61f30f9662b38b94287 /arch
parent1da448bb9fd281e5a0574aab838d9ef1f6b18575 (diff)
x86: acpi: Include the TPMv1 table only if needed
This table is not needed if a v2 TPM is in use. Add a condition to avoid adding it when not needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/acpi_table.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index 66cff822dc2..9f0871c9f49 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -646,14 +646,17 @@ ulong write_acpi_tables(ulong start_addr)
acpi_inc_align(ctx, madt->header.length);
acpi_add_table(ctx, madt);
- debug("ACPI: * TCPA\n");
- tcpa = (struct acpi_tcpa *)ctx->current;
- ret = acpi_create_tcpa(tcpa);
- if (ret) {
- log_warning("Failed to create TCPA table (err=%d)\n", ret);
- } else {
- acpi_inc_align(ctx, tcpa->header.length);
- acpi_add_table(ctx, tcpa);
+ if (IS_ENABLED(CONFIG_TPM_V1)) {
+ debug("ACPI: * TCPA\n");
+ tcpa = (struct acpi_tcpa *)ctx->current;
+ ret = acpi_create_tcpa(tcpa);
+ if (ret) {
+ log_warning("Failed to create TCPA table (err=%d)\n",
+ ret);
+ } else {
+ acpi_inc_align(ctx, tcpa->header.length);
+ acpi_add_table(ctx, tcpa);
+ }
}
debug("ACPI: * CSRT\n");