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/mdrv2.hpp b/include/mdrv2.hpp
index d248073..2459a89 100644
--- a/include/mdrv2.hpp
+++ b/include/mdrv2.hpp
@@ -20,6 +20,7 @@
#include "pcieslot.hpp"
#include "smbios_mdrv2.hpp"
#include "system.hpp"
+#include "tpm.hpp"
#include <sys/stat.h>
#include <sys/types.h>
@@ -188,9 +189,11 @@
std::optional<size_t> getTotalCpuSlot(void);
std::optional<size_t> getTotalDimmSlot(void);
std::optional<size_t> getTotalPcieSlot(void);
+ std::optional<size_t> getTotalTpm(void);
std::vector<std::unique_ptr<Cpu>> cpus;
std::vector<std::unique_ptr<Dimm>> dimms;
std::vector<std::unique_ptr<Pcie>> pcies;
+ std::vector<std::unique_ptr<Tpm>> tpms;
std::unique_ptr<System> system;
std::shared_ptr<sdbusplus::asio::dbus_interface> smbiosInterface;