diff --git a/src/mainboard/ocp/tiogapass/Kconfig b/src/mainboard/ocp/tiogapass/Kconfig index 8bf7e799b0..a1ff82f79a 100644 --- a/src/mainboard/ocp/tiogapass/Kconfig +++ b/src/mainboard/ocp/tiogapass/Kconfig @@ -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 diff --git a/src/mainboard/ocp/tiogapass/devicetree.cb b/src/mainboard/ocp/tiogapass/devicetree.cb index 37e740a4c0..427694a149 100644 --- a/src/mainboard/ocp/tiogapass/devicetree.cb +++ b/src/mainboard/ocp/tiogapass/devicetree.cb @@ -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 diff --git a/src/mainboard/ocp/tiogapass/ramstage.c b/src/mainboard/ocp/tiogapass/ramstage.c index a07edb80e8..fbc5e92913 100644 --- a/src/mainboard/ocp/tiogapass/ramstage.c +++ b/src/mainboard/ocp/tiogapass/ramstage.c @@ -3,8 +3,10 @@ #include #include #include +#include #include #include +#include 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)