]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: acpi: Include the TPMv1 table only if needed
authorSimon Glass <sjg@chromium.org>
Wed, 4 Nov 2020 16:57:40 +0000 (09:57 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 6 Nov 2020 01:51:32 +0000 (09:51 +0800)
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>
arch/x86/lib/acpi_table.c

index 66cff822dc2bf35be4aec48c4baa361c6731a304..9f0871c9f4931587f3b187b0a2b6e0b913565dd0 100644 (file)
@@ -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");