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/src/meson.build b/src/meson.build
index 1c983bd..3a2bc17 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -15,6 +15,10 @@
cpp_args_smbios += ['-DSLOT_DRIVE_PRESENCE']
endif
+if get_option('tpm-dbus').allowed()
+ cpp_args_smbios += ['-DTPM_DBUS']
+endif
+
executable(
'smbiosmdrv2app',
'mdrv2.cpp',
@@ -23,6 +27,7 @@
'dimm.cpp',
'system.cpp',
'pcieslot.cpp',
+ 'tpm.cpp',
cpp_args: cpp_args_smbios,
dependencies: [
boost_dep,