From e779523193bc61c475c3207f650bd840a808cb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=BBygowski?= Date: Wed, 4 May 2022 14:10:45 +0200 Subject: smbios: Add API to generate SMBIOS type 43 TPM Device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on DMTF SMBIOS Specification 3.1.0. Signed-off-by: Michał Żygowski Change-Id: Ia2db29f8bc4cfbc6648bb2cabad074d9ea583ca9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64048 Tested-by: build bot (Jenkins) Reviewed-by: Christian Walter --- src/include/smbios.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/include') diff --git a/src/include/smbios.h b/src/include/smbios.h index 605840d5a1..9c438437e8 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -35,6 +35,11 @@ int smbios_write_type41(unsigned long *current, int *handle, const char *name, u8 instance, u16 segment, u8 bus, u8 device, u8 function, u8 device_type); +int smbios_write_type43(unsigned long *current, int *handle, const u32 vendor_id, + const u8 major_spec_ver, const u8 minor_spec_ver, + const u32 fw_ver1, const u32 fw_ver2, const char *description, + const u64 characteristics, const u32 oem_defined); + struct device; int get_smbios_data(struct device *dev, int *handle, unsigned long *current); @@ -253,6 +258,7 @@ typedef enum { SMBIOS_SYSTEM_BOOT_INFORMATION = 32, SMBIOS_IPMI_DEVICE_INFORMATION = 38, SMBIOS_ONBOARD_DEVICES_EXTENDED_INFORMATION = 41, + SMBIOS_TPM_DEVICE = 43, SMBIOS_END_OF_TABLE = 127, } smbios_struct_type_t; @@ -976,6 +982,25 @@ struct smbios_type41 { u8 eos[2]; } __packed; + +#define SMBIOS_TPM_DEVICE_CHARACTERISTICS_NOT_SUPPORTED (1ULL << 2) +#define SMBIOS_TPM_DEVICE_FAMILY_CONFIGURABLE_VIA_FW_UPD (1ULL << 3) +#define SMBIOS_TPM_DEVICE_FAMILY_CONFIGURABLE_VIA_PLATFORM_SW_SUPPORT (1ULL << 4) +#define SMBIOS_TPM_DEVICE_FAMILY_CONFIGURABLE_VIA_OEM_PROPRIETARY (1ULL << 5) + +struct smbios_type43 { + struct smbios_header header; + u32 vendor_id; + u8 major_spec_ver; + u8 minor_spec_ver; + u32 fw_ver1; + u32 fw_ver2; + u8 description; + u64 characteristics; + u32 oem_defined; + u8 eos[2]; +} __packed; + struct smbios_type127 { struct smbios_header header; u8 eos[2]; -- cgit v1.2.3