Moved PDI from TPM.interface to TrustedComponent.interface
This patch moved PDI from TPM.interface to TrustedComponent.interface
The changes were made as per discussion mentioned below
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/79157
The association is removed as it is not documented
Tested:
dbus introspect output
[2] busctl get-property xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/inventory/system/chassis/Chassis_0/tpm xyz.openbmc_project.Inventory.Item.TrustedComponent TrustedComponentType
[3] s "xyz.openbmc_project.Inventory.Item.TrustedComponent.ComponentAttachType.Discrete"
Change-Id: I28dbda71ed5493e06330e58d8079f1a940e04c85
Signed-off-by: Prithvi Pai <ppai@nvidia.com>
diff --git a/include/tpm.hpp b/include/tpm.hpp
index efa14f0..9673e89 100644
--- a/include/tpm.hpp
+++ b/include/tpm.hpp
@@ -2,9 +2,8 @@
#include "smbios_mdrv2.hpp"
#include <sdbusplus/asio/connection.hpp>
-#include <xyz/openbmc_project/Association/Definitions/server.hpp>
#include <xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp>
-#include <xyz/openbmc_project/Inventory/Item/Tpm/server.hpp>
+#include <xyz/openbmc_project/Inventory/Item/TrustedComponent/server.hpp>
#include <xyz/openbmc_project/Inventory/Item/server.hpp>
#include <xyz/openbmc_project/Software/Version/server.hpp>
@@ -14,20 +13,19 @@
namespace smbios
{
-using tpm = sdbusplus::server::xyz::openbmc_project::inventory::item::Tpm;
+using trustedComponent =
+ sdbusplus::server::xyz::openbmc_project::inventory::item::TrustedComponent;
using asset =
sdbusplus::server::xyz::openbmc_project::inventory::decorator::Asset;
using Item = sdbusplus::server::xyz::openbmc_project::inventory::Item;
using softwareversion =
sdbusplus::server::xyz::openbmc_project::software::Version;
-using association =
- sdbusplus::server::xyz::openbmc_project::association::Definitions;
constexpr uint8_t tpmMajorVerion1 = 0x01;
constexpr uint8_t tpmMajorVerion2 = 0x02;
class Tpm :
- sdbusplus::server::object_t<tpm, asset, Item, association, softwareversion>
+ sdbusplus::server::object_t<trustedComponent, asset, Item, softwareversion>
{
public:
Tpm() = delete;
@@ -39,7 +37,7 @@
Tpm(sdbusplus::bus_t& bus, const std::string& objPath, const uint8_t tpmID,
uint8_t* smbiosTableStorage, const std::string& motherboard) :
- sdbusplus::server::object_t<tpm, asset, Item, association,
+ sdbusplus::server::object_t<trustedComponent, asset, Item,
softwareversion>(bus, objPath.c_str()),
tpmId(tpmID), storage(smbiosTableStorage), motherboardPath(motherboard)
{
diff --git a/src/tpm.cpp b/src/tpm.cpp
index 74279d0..0009e1c 100644
--- a/src/tpm.cpp
+++ b/src/tpm.cpp
@@ -44,12 +44,7 @@
tpmVendor(tpmInfo);
tpmFirmwareVersion(tpmInfo);
tpmDescription(tpmInfo->description, tpmInfo->length, dataIn);
- if (!motherboardPath.empty())
- {
- std::vector<std::tuple<std::string, std::string, std::string>> assocs;
- assocs.emplace_back("chassis", "trusted_components", motherboardPath);
- association::associations(assocs);
- }
+ trustedComponentType(trustedComponent::ComponentAttachType::Discrete);
}
void Tpm::tpmVendor(const struct TPMInfo* tpmInfo)