diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2021-02-02 19:16:08 +0100 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2021-05-20 16:22:05 +0000 |
commit | 8c6ee91fcd610db197167310a660cc451c764f55 (patch) | |
tree | 0f6655cf21378b954c47c39431693fcb1bcd2f30 | |
parent | fc6cc717cebabe09f24f4102c2983859f7f0ece7 (diff) | |
download | coreboot-8c6ee91fcd610db197167310a660cc451c764f55.tar.xz |
mb/ocp/deltalake: Implement skipping TXT lockdown via VPD
This allows to skip TXT Lockdown via "skip_intel_txt_lockdown" VPD parameter.
Change-Id: Ic5daf96bdda9c36054c410b07b08bcd3482d777c
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50237
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rocky Phagura
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | src/mainboard/ocp/deltalake/ramstage.c | 23 | ||||
-rw-r--r-- | src/mainboard/ocp/deltalake/vpd.h | 4 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c index 16dde06638..8d9de82751 100644 --- a/src/mainboard/ocp/deltalake/ramstage.c +++ b/src/mainboard/ocp/deltalake/ramstage.c @@ -4,6 +4,8 @@ #include <console/console.h> #include <drivers/ipmi/ipmi_ops.h> #include <drivers/ocp/dmi/ocp_dmi.h> +#include <drivers/vpd/vpd.h> +#include <security/intel/txt/txt.h> #include <soc/ramstage.h> #include <soc/soc_util.h> #include <stdio.h> @@ -17,6 +19,7 @@ #include <cpxsp_dl_gpio.h> #include "ipmi.h" +#include "vpd.h" #define SLOT_ID_LEN 2 @@ -348,3 +351,23 @@ struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, .final = mainboard_final, }; + +bool skip_intel_txt_lockdown(void) +{ + static bool fetched_vpd = 0; + static uint8_t skip_txt = SKIP_INTEL_TXT_LOCKDOWN_DEFAULT; + + if (fetched_vpd) + return (bool)skip_txt; + + if (!vpd_get_bool(SKIP_INTEL_TXT_LOCKDOWN, VPD_RW_THEN_RO, &skip_txt)) + printk(BIOS_INFO, "%s: not able to get VPD %s, default set to %d\n", + __func__, SKIP_INTEL_TXT_LOCKDOWN, SKIP_INTEL_TXT_LOCKDOWN_DEFAULT); + else + printk(BIOS_DEBUG, "%s: VPD %s, got %d\n", __func__, SKIP_INTEL_TXT_LOCKDOWN, + skip_txt); + + fetched_vpd = 1; + + return (bool)skip_txt; +} diff --git a/src/mainboard/ocp/deltalake/vpd.h b/src/mainboard/ocp/deltalake/vpd.h index 0b5a3e1d78..e50f5701be 100644 --- a/src/mainboard/ocp/deltalake/vpd.h +++ b/src/mainboard/ocp/deltalake/vpd.h @@ -46,4 +46,8 @@ #define FSP_DIMM_FREQ "fsp_dimm_freq" #define FSP_DIMM_FREQ_DEFAULT 0 +/* Skip TXT lockdown */ +#define SKIP_INTEL_TXT_LOCKDOWN "skip_intel_txt_lockdown" +#define SKIP_INTEL_TXT_LOCKDOWN_DEFAULT 0 + #endif |