summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
authorJohn Zhao <john.zhao@intel.com>2021-05-19 15:04:53 -0700
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-05-26 15:43:21 +0000
commit3748170476327b45e1a5ea8ef4fef124c8a80de8 (patch)
treee148f33f874776869ba007a55e0ebad978fa9195 /src/soc/intel/common/block
parent81547a7d051a3d571d831725aa66b8060610ce33 (diff)
soc/intel/common: Implement TBT firmware authentication validity check
After Thunderbolt firmware is downloaded to IMR, its authentication validity needs to be checked. This change implements the valid_tbt_auth function. Thunderbolt DSD and its corresponding IMR_VAID will be present to kernel only if its authentication is successful. BUG=b:188695995 TEST=Validated TGL TBT firmware authentication and its IMR_VALID into SSDT which is properly present to kernel. Signed-off-by: John Zhao <john.zhao@intel.com> Change-Id: I3c9dda341ae6f19a2a8c85f92edda3dfa08c917a Reviewed-on: https://review.coreboot.org/c/coreboot/+/54693 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/usb4/usb4.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/usb4/usb4.c b/src/soc/intel/common/block/usb4/usb4.c
index f3c81dc523..923ec5588e 100644
--- a/src/soc/intel/common/block/usb4/usb4.c
+++ b/src/soc/intel/common/block/usb4/usb4.c
@@ -6,7 +6,10 @@
#include <device/pci.h>
#include <device/pci_def.h>
#include <device/pci_ids.h>
+#include <intelblocks/systemagent.h>
#include <soc/pci_devs.h>
+#include <soc/pcr_ids.h>
+#include <soc/tcss.h>
#define INTEL_TBT_IMR_VALID_UUID "C44D002F-69F9-4E7D-A904-A7BAABDF43F7"
#define INTEL_TBT_WAKE_SUPPORTED_UUID "6C501103-C189-4296-BA72-9BF5A26EBE5D"
@@ -24,10 +27,18 @@ static const char *tbt_dma_acpi_name(const struct device *dev)
}
}
+static int valid_tbt_auth(void)
+{
+ return REGBAR32(PID_IOM, IOM_CSME_IMR_TBT_STATUS) & TBT_VALID_AUTHENTICATION;
+}
+
static void tbt_dma_fill_ssdt(const struct device *dev)
{
struct acpi_dp *dsd, *pkg;
+ if (!valid_tbt_auth())
+ return;
+
acpigen_write_scope(acpi_device_path(dev));
dsd = acpi_dp_new_table("_DSD");