diff --git a/include/peci_pcie.hpp b/include/peci_pcie.hpp
index 9053392..5dbe63a 100644
--- a/include/peci_pcie.hpp
+++ b/include/peci_pcie.hpp
@@ -27,6 +27,8 @@
     "/xyz/openbmc_project/inventory/pcie";
 static constexpr const char* peciPCIeDeviceInterface =
     "xyz.openbmc_project.Inventory.Item.PCIeDevice";
+static constexpr char const* peciPCIeAssetInterface =
+    "xyz.openbmc_project.Inventory.Decorator.Asset";
 
 static constexpr const int maxPCIBuses = 256;
 static constexpr const int maxPCIDevices = 32;
diff --git a/src/peci_pcie.cpp b/src/peci_pcie.cpp
index 73b0001..32b4e6f 100644
--- a/src/peci_pcie.cpp
+++ b/src/peci_pcie.cpp
@@ -34,10 +34,16 @@
 
 namespace peci_pcie
 {
+
+struct PcieInterfaces
+{
+    std::shared_ptr<sdbusplus::asio::dbus_interface> deviceIface;
+    std::shared_ptr<sdbusplus::asio::dbus_interface> assetIface;
+};
+
 static boost::container::flat_map<
     int, boost::container::flat_map<
-             int, boost::container::flat_map<
-                      int, std::shared_ptr<sdbusplus::asio::dbus_interface>>>>
+             int, boost::container::flat_map<int, PcieInterfaces>>>
     pcieDeviceDBusMap;
 
 static bool abortScan;
@@ -442,9 +448,19 @@
                                const int& dev, const std::string& propertyName,
                                const std::string& propertyValue)
 {
-    std::shared_ptr<sdbusplus::asio::dbus_interface> iface =
+    peci_pcie::PcieInterfaces pcieIfaces =
         peci_pcie::pcieDeviceDBusMap[clientAddr][bus][dev];
 
+    std::shared_ptr<sdbusplus::asio::dbus_interface> iface;
+    if (propertyName == "Manufacturer")
+    {
+        iface = pcieIfaces.assetIface;
+    }
+    else
+    {
+        iface = pcieIfaces.deviceIface;
+    }
+
     if (iface->is_initialized())
     {
         if (!iface->set_property(propertyName, propertyValue))
@@ -604,10 +620,11 @@
                              const int& clientAddr, const int& bus,
                              const int& dev)
 {
-    std::shared_ptr<sdbusplus::asio::dbus_interface> iface =
+    peci_pcie::PcieInterfaces ifaces =
         peci_pcie::pcieDeviceDBusMap[clientAddr][bus][dev];
 
-    objServer.remove_interface(iface);
+    objServer.remove_interface(ifaces.deviceIface);
+    objServer.remove_interface(ifaces.assetIface);
 
     peci_pcie::pcieDeviceDBusMap[clientAddr][bus].erase(dev);
     if (peci_pcie::pcieDeviceDBusMap[clientAddr][bus].empty())
@@ -627,9 +644,12 @@
     std::string pathName = std::string(peci_pcie::peciPCIePath) + "/S" +
                            std::to_string(cpu) + "B" + std::to_string(bus) +
                            "D" + std::to_string(dev);
-    std::shared_ptr<sdbusplus::asio::dbus_interface> iface =
+    peci_pcie::PcieInterfaces ifaces;
+    ifaces.deviceIface =
         objServer.add_interface(pathName, peci_pcie::peciPCIeDeviceInterface);
-    peci_pcie::pcieDeviceDBusMap[clientAddr][bus][dev] = iface;
+    ifaces.assetIface =
+        objServer.add_interface(pathName, peci_pcie::peciPCIeAssetInterface);
+    peci_pcie::pcieDeviceDBusMap[clientAddr][bus][dev] = ifaces;
 
     // Update the properties for the new device
     if (updatePCIeDevice(clientAddr, bus, dev) != resCode::resOk)
@@ -638,7 +658,8 @@
         return resCode::resErr;
     }
 
-    iface->initialize();
+    ifaces.deviceIface->initialize();
+    ifaces.assetIface->initialize();
     return resCode::resOk;
 }
 
@@ -654,7 +675,8 @@
             if (auto devIt = busIt->second.find(dev);
                 devIt != busIt->second.end())
             {
-                if (devIt->second)
+                if (devIt->second.deviceIface != nullptr ||
+                    devIt->second.assetIface != nullptr)
                 {
                     return true;
                 }
