mainboard/ocp/tiogapass: Enable TPM

Add support for the optional TPM. When GPP_A22 is low a TPM is
installed.

TEST: Found a working TPM 2.0 SLB9670 on ocp/tiogapass.

Change-Id: I970033981a265eb0094bc91fc070487b34972a5a
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85510
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph 2024-12-05 10:01:55 +01:00 committed by Lean Sheng Tan
commit 15109603c6
3 changed files with 17 additions and 0 deletions

View file

@ -14,6 +14,8 @@ config BOARD_SPECIFIC_OPTIONS
select SOC_INTEL_SKYLAKE_SP
select SUPERIO_ASPEED_AST2400
select UART_OVERRIDE_BAUDRATE
select MEMORY_MAPPED_TPM
select MAINBOARD_HAS_TPM2
select MAINBOARD_USES_IFD_GBE_REGION
select MAINBOARD_USES_IFD_10GBE_0_REGION
select VPD

View file

@ -82,6 +82,9 @@ chip soc/intel/xeon_sp/skx
chip drivers/ipmi/ocp # OCP specific IPMI porting
device pnp ca2.1 on end
end
chip drivers/pc80/tpm # TPM
device pnp 0c31.0 alias tpm on end
end
end # Intel Corporation C621 Series Chipset LPC/eSPI Controller
device pci 1f.1 hidden end # p2sb
device pci 1f.2 on end # Intel Corporation C620 Series Chipset Family Power Management Controller

View file

@ -3,8 +3,10 @@
#include <cpu/x86/smm.h>
#include <drivers/ipmi/ipmi_ops.h>
#include <drivers/ocp/dmi/ocp_dmi.h>
#include <gpio.h>
#include <soc/ramstage.h>
#include <soc/smmrelocate.h>
#include <static.h>
extern struct fru_info_str fru_strings;
@ -165,8 +167,18 @@ static void tp_oem_smbios_strings(struct device *dev, struct smbios_type11 *t)
t->count = smbios_add_oem_string(t->eos, TBF);
}
WEAK_DEV_PTR(tpm);
static void mainboard_enable(struct device *dev)
{
struct device *tpm = DEV_PTR(tpm);
gpio_input(GPP_A22);
if (tpm)
tpm->enabled = !gpio_get(GPP_A22);
printk(BIOS_DEBUG, "TPM present: %d\n", !gpio_get(GPP_A22));
dev->ops->get_smbios_strings = tp_oem_smbios_strings;
read_fru_areas(CONFIG_BMC_KCS_BASE, CONFIG_FRU_DEVICE_ID, 0, &fru_strings);
#if CONFIG(GENERATE_SMBIOS_TABLES)