smbios-mdr: Add TPM Device Information
Type 43 of SMBIOS records defines the data structure to expose
TPM Device information. Add patch which displays the TPM Device
information on dbus.
Introduced `TPM_DBUS` meson option which will be disabled by default
When enabled, the TPM information is populated on DBUS.
Tested:
TPM information is available under dbus tree of smbios-mdr
```
:~# busctl tree xyz.openbmc_project.Smbios.MDR_V2
`- /xyz
`- /xyz/openbmc_project
|- /xyz/openbmc_project/Smbios
| `- /xyz/openbmc_project/Smbios/MDR_V2
|- /xyz/openbmc_project/inventory
| `- /xyz/openbmc_project/inventory/system
| `- /xyz/openbmc_project/inventory/system/chassis
| |- /xyz/openbmc_project/inventory/system/chassis/motherboard/bios
| `- /xyz/openbmc_project/inventory/system/chassis/motherboard/tpm
```
Change-Id: Icd42f4f043bf5a970f4829e5d318568360fe4b59
Signed-off-by: Prithvi Pai <ppai@nvidia.com>
diff --git a/include/smbios_mdrv2.hpp b/include/smbios_mdrv2.hpp
index 59680bf..2be6dad 100644
--- a/include/smbios_mdrv2.hpp
+++ b/include/smbios_mdrv2.hpp
@@ -165,6 +165,8 @@
static constexpr const char* systemSuffix = "/chassis/motherboard/bios";
+static constexpr const char* tpmSuffix = "/chassis/motherboard/tpm";
+
constexpr std::array<SMBIOSVersion, 8> supportedSMBIOSVersions{
SMBIOSVersion{3, 0}, SMBIOSVersion{3, 2}, SMBIOSVersion{3, 3},
SMBIOSVersion{3, 4}, SMBIOSVersion{3, 5}, SMBIOSVersion{3, 6},
@@ -190,6 +192,7 @@
systemEventLogType = 15,
physicalMemoryArrayType = 16,
memoryDeviceType = 17,
+ tpmDeviceType = 43,
} SmbiosType;
static constexpr uint8_t separateLen = 2;