diff --git a/include/firmware_inventory.hpp b/include/firmware_inventory.hpp
new file mode 100644
index 0000000..ee27050
--- /dev/null
+++ b/include/firmware_inventory.hpp
@@ -0,0 +1,99 @@
+#pragma once
+#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/server.hpp>
+#include <xyz/openbmc_project/Software/ExtendedVersion/server.hpp>
+#include <xyz/openbmc_project/Software/Version/server.hpp>
+
+#include <vector>
+
+namespace phosphor
+{
+
+namespace smbios
+{
+namespace utils
+{
+std::vector<std::string> getExistingVersionPaths(sdbusplus::bus_t& bus);
+}
+
+using association =
+    sdbusplus::server::xyz::openbmc_project::association::Definitions;
+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 softwareExtendedVersion =
+    sdbusplus::server::xyz::openbmc_project::software::ExtendedVersion;
+
+class FirmwareInventory :
+    sdbusplus::server::object_t<asset, item, association, softwareVersion,
+                                softwareExtendedVersion>
+{
+  public:
+    FirmwareInventory() = delete;
+    ~FirmwareInventory() = default;
+    FirmwareInventory(const FirmwareInventory&) = delete;
+    FirmwareInventory& operator=(const FirmwareInventory&) = delete;
+    FirmwareInventory(FirmwareInventory&&) = default;
+    FirmwareInventory& operator=(FirmwareInventory&&) = default;
+
+    FirmwareInventory(sdbusplus::bus_t& bus, const std::string& objPath,
+                      const uint8_t index, uint8_t* smbiosTableStorage) :
+        sdbusplus::server::object_t<asset, item, association, softwareVersion,
+                                    softwareExtendedVersion>(bus,
+                                                             objPath.c_str()),
+        firmwareInventoryIndex(index), storage(smbiosTableStorage)
+    {
+        firmwareInfoUpdate(smbiosTableStorage);
+    }
+
+    void firmwareInfoUpdate(uint8_t* smbiosTableStorage);
+
+    static std::string checkAndCreateFirmwarePath(
+        uint8_t* dataIn, int index,
+        std::vector<std::string>& existingVersionPaths);
+
+  private:
+    int firmwareInventoryIndex;
+
+    uint8_t* storage;
+
+    struct FirmwareInfo
+    {
+        uint8_t type;
+        uint8_t length;
+        uint16_t handle;
+        uint8_t componentName;
+        uint8_t version;
+        uint8_t versionFormat;
+        uint8_t id;
+        uint8_t idFormat;
+        uint8_t releaseDate;
+        uint8_t manufacturer;
+        uint8_t lowestSupportedVersion;
+        uint64_t imageSize;
+        uint16_t characteristics;
+        uint8_t state;
+        uint8_t numOfAssociatedComponents;
+        uint16_t associatedComponentHandles[1];
+    } __attribute__((packed));
+
+    void firmwareId(const uint8_t positionNum, const uint8_t structLen,
+                    uint8_t* dataIn);
+    void firmwareVersion(const uint8_t positionNum, const uint8_t structLen,
+                         uint8_t* dataIn);
+    void firmwareReleaseDate(const uint8_t positionNum, const uint8_t structLen,
+                             uint8_t* dataIn);
+    void firmwareManufacturer(const uint8_t positionNum,
+                              const uint8_t structLen, uint8_t* dataIn);
+    void firmwareComponentName(const uint8_t positionNum,
+                               const uint8_t structLen, uint8_t* dataIn);
+    static bool getFirmwareInventoryData(uint8_t*& dataIn, int inventoryIndex);
+};
+} // namespace smbios
+} // namespace phosphor
diff --git a/include/mdrv2.hpp b/include/mdrv2.hpp
index 2459a89..c60633c 100644
--- a/include/mdrv2.hpp
+++ b/include/mdrv2.hpp
@@ -17,6 +17,7 @@
 #pragma once
 #include "cpu.hpp"
 #include "dimm.hpp"
+#include "firmware_inventory.hpp"
 #include "pcieslot.hpp"
 #include "smbios_mdrv2.hpp"
 #include "system.hpp"
@@ -62,6 +63,8 @@
     "xyz.openbmc_project.Inventory.Item.System";
 static constexpr const char* boardInterface =
     "xyz.openbmc_project.Inventory.Item.Board";
+static constexpr const char* versionInterface =
+    "xyz.openbmc_project.Software.Version";
 constexpr const int limitEntryLen = 0xff;
 
 // Avoid putting multiple interfaces with same name on same object
@@ -190,10 +193,12 @@
     std::optional<size_t> getTotalDimmSlot(void);
     std::optional<size_t> getTotalPcieSlot(void);
     std::optional<size_t> getTotalTpm(void);
+    std::optional<size_t> getTotalFirmwareInventory(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::vector<std::unique_ptr<FirmwareInventory>> firmwareCollection;
     std::unique_ptr<System> system;
     std::shared_ptr<sdbusplus::asio::dbus_interface> smbiosInterface;
 
diff --git a/include/smbios_mdrv2.hpp b/include/smbios_mdrv2.hpp
index 2be6dad..c2f1b4b 100644
--- a/include/smbios_mdrv2.hpp
+++ b/include/smbios_mdrv2.hpp
@@ -157,6 +157,13 @@
     uint64_t structTableAddr;
 } __attribute__((packed));
 
+struct StructureHeader
+{
+    uint8_t type;
+    uint8_t length;
+    uint16_t handle;
+} __attribute__((packed));
+
 static constexpr const char* cpuSuffix = "/chassis/motherboard/cpu";
 
 static constexpr const char* dimmSuffix = "/chassis/motherboard/dimm";
@@ -167,6 +174,8 @@
 
 static constexpr const char* tpmSuffix = "/chassis/motherboard/tpm";
 
+static constexpr const char* firmwarePath = "/xyz/openbmc_project/software";
+
 constexpr std::array<SMBIOSVersion, 8> supportedSMBIOSVersions{
     SMBIOSVersion{3, 0}, SMBIOSVersion{3, 2}, SMBIOSVersion{3, 3},
     SMBIOSVersion{3, 4}, SMBIOSVersion{3, 5}, SMBIOSVersion{3, 6},
@@ -192,7 +201,10 @@
     systemEventLogType = 15,
     physicalMemoryArrayType = 16,
     memoryDeviceType = 17,
+    systemPowerSupply = 39,
+    onboardDevicesExtended = 41,
     tpmDeviceType = 43,
+    firmwareInventoryInformationType = 45,
 } SmbiosType;
 
 static constexpr uint8_t separateLen = 2;
@@ -256,6 +268,51 @@
     return nullptr;
 }
 
+static inline uint8_t* smbiosSkipEntryPoint(uint8_t* smbiosDataIn)
+{
+    const std::string anchorString30 = "_SM3_";
+    if (smbiosDataIn == nullptr)
+    {
+        return nullptr;
+    }
+
+    // Jump to starting address of the SMBIOS Structure Table from Entry Point
+    auto anchor = reinterpret_cast<const char*>(smbiosDataIn);
+    if (std::string_view(anchor, anchorString30.length())
+            .compare(anchorString30) == 0)
+    {
+        auto epStructure =
+            reinterpret_cast<const EntryPointStructure30*>(smbiosDataIn);
+        if (epStructure->structTableAddr < mdrSMBIOSSize)
+        {
+            smbiosDataIn += epStructure->structTableAddr;
+        }
+    }
+
+    return smbiosDataIn;
+}
+
+static inline uint8_t* smbiosHandlePtr(uint8_t* smbiosDataIn, uint16_t handle)
+{
+    auto ptr = smbiosSkipEntryPoint(smbiosDataIn);
+    struct StructureHeader* header;
+    while (ptr != nullptr)
+    {
+        header = reinterpret_cast<struct StructureHeader*>(ptr);
+        if (header->length < sizeof(StructureHeader))
+        {
+            return nullptr;
+        }
+
+        if (header->handle == handle)
+        {
+            return ptr;
+        }
+        ptr = smbiosNextPtr(ptr);
+    }
+    return nullptr;
+}
+
 static inline std::string positionToString(uint8_t positionNum,
                                            uint8_t structLen, uint8_t* dataIn)
 {
diff --git a/meson.options b/meson.options
index f93f1ea..2e302a4 100644
--- a/meson.options
+++ b/meson.options
@@ -55,3 +55,17 @@
     value: 'disabled',
     description: 'Expose TPM D-Bus Interface',
 )
+
+option(
+    'firmware-inventory-dbus',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Expose Firmware Inventory D-Bus Interface',
+)
+
+option(
+    'expose-firmware-component-name',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Use Firmware Component value as dbus object path',
+)
diff --git a/src/firmware_inventory.cpp b/src/firmware_inventory.cpp
new file mode 100644
index 0000000..30053d5
--- /dev/null
+++ b/src/firmware_inventory.cpp
@@ -0,0 +1,218 @@
+#include "firmware_inventory.hpp"
+
+#include "mdrv2.hpp"
+
+#include <boost/algorithm/string.hpp>
+
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <regex>
+#include <sstream>
+
+namespace phosphor
+{
+namespace smbios
+{
+namespace utils
+{
+std::vector<std::string> getExistingVersionPaths(sdbusplus::bus_t& bus)
+{
+    std::vector<std::string> existingVersionPaths;
+
+    auto getVersionPaths = bus.new_method_call(
+        phosphor::smbios::mapperBusName, phosphor::smbios::mapperPath,
+        phosphor::smbios::mapperInterface, "GetSubTreePaths");
+    getVersionPaths.append(firmwarePath);
+    getVersionPaths.append(0);
+    getVersionPaths.append(
+        std::array<std::string, 1>({phosphor::smbios::versionInterface}));
+
+    try
+    {
+        auto reply = bus.call(getVersionPaths);
+        reply.read(existingVersionPaths);
+    }
+    catch (const sdbusplus::exception_t& e)
+    {
+        lg2::error("Failed to query version objects. ERROR={E}", "E", e.what());
+        existingVersionPaths.clear();
+    }
+
+    return existingVersionPaths;
+}
+} // namespace utils
+
+bool FirmwareInventory::getFirmwareInventoryData(uint8_t*& dataIn,
+                                                 int inventoryIndex)
+{
+    dataIn = getSMBIOSTypePtr(dataIn, firmwareInventoryInformationType);
+    if (dataIn == nullptr)
+    {
+        return false;
+    }
+    for (uint8_t index = 0; index < inventoryIndex; index++)
+    {
+        dataIn = smbiosNextPtr(dataIn);
+        if (dataIn == nullptr)
+        {
+            return false;
+        }
+        dataIn = getSMBIOSTypePtr(dataIn, firmwareInventoryInformationType);
+        if (dataIn == nullptr)
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
+void FirmwareInventory::firmwareInfoUpdate(uint8_t* smbiosTableStorage)
+{
+    uint8_t* dataIn = smbiosTableStorage;
+    if (!getFirmwareInventoryData(dataIn, firmwareInventoryIndex))
+    {
+        lg2::info("Failed to get data for firmware inventory index {I}", "I",
+                  firmwareInventoryIndex);
+        return;
+    }
+
+    auto firmwareInfo = reinterpret_cast<struct FirmwareInfo*>(dataIn);
+
+    firmwareComponentName(firmwareInfo->componentName, firmwareInfo->length,
+                          dataIn);
+    firmwareVersion(firmwareInfo->version, firmwareInfo->length, dataIn);
+    firmwareId(firmwareInfo->id, firmwareInfo->length, dataIn);
+    firmwareReleaseDate(firmwareInfo->releaseDate, firmwareInfo->length,
+                        dataIn);
+    firmwareManufacturer(firmwareInfo->manufacturer, firmwareInfo->length,
+                         dataIn);
+    present(true);
+    purpose(softwareVersion::VersionPurpose::Other);
+
+    std::vector<std::tuple<std::string, std::string, std::string>> assocs;
+    assocs.emplace_back("software_version", "functional",
+                        "/xyz/openbmc_project/software");
+    association::associations(assocs);
+}
+
+std::string FirmwareInventory::checkAndCreateFirmwarePath(
+    uint8_t* dataIn, int inventoryIndex,
+    std::vector<std::string>& existingVersionPaths)
+{
+    if (!getFirmwareInventoryData(dataIn, inventoryIndex))
+    {
+        lg2::info("Failed to get data for firmware inventory index {I}", "I",
+                  inventoryIndex);
+        return "";
+    }
+    auto firmwareInfo = reinterpret_cast<struct FirmwareInfo*>(dataIn);
+    std::string firmwareId =
+        positionToString(firmwareInfo->id, firmwareInfo->length, dataIn);
+    auto firmwareName = positionToString(firmwareInfo->componentName,
+                                         firmwareInfo->length, dataIn);
+    std::string firmwareObjPath = "";
+#ifdef EXPOSE_FW_COMPONENT_NAME
+    firmwareObjPath = firmwareName;
+#else
+    firmwareObjPath = firmwareId;
+#endif
+    if (firmwareInfo->numOfAssociatedComponents > 0)
+    {
+        for (int i = 0; i < firmwareInfo->numOfAssociatedComponents; i++)
+        {
+            auto component = smbiosHandlePtr(
+                dataIn, firmwareInfo->associatedComponentHandles[i]);
+            if (component == nullptr)
+            {
+                continue;
+            }
+
+            auto header = reinterpret_cast<struct StructureHeader*>(component);
+            switch (header->type)
+            {
+                case processorsType:
+                case systemSlots:
+                case onboardDevicesExtended:
+                {
+                    auto designation = positionToString(
+                        component[4], header->length, component);
+                    if (!designation.empty())
+                    {
+                        firmwareObjPath.append("_").append(designation);
+                    }
+                    break;
+                }
+                case systemPowerSupply:
+                {
+                    auto location = positionToString(component[5],
+                                                     header->length, component);
+                    if (!location.empty())
+                    {
+                        firmwareObjPath.append("_").append(location);
+                    }
+                    break;
+                }
+                default:
+                    break;
+            }
+        }
+    }
+    if (firmwareObjPath.empty())
+    {
+        firmwareObjPath = "firmware" + std::to_string(inventoryIndex);
+    }
+    boost::algorithm::trim_right(firmwareObjPath);
+    firmwareObjPath =
+        std::regex_replace(firmwareObjPath, std::regex("[^a-zA-Z0-9_/]+"), "_");
+
+    auto eqObjName = [firmwareObjPath](std::string s) {
+        std::filesystem::path p(s);
+        return p.filename().compare(firmwareObjPath) == 0;
+    };
+    if (std::find_if(existingVersionPaths.begin(), existingVersionPaths.end(),
+                     std::move(eqObjName)) != existingVersionPaths.end())
+    {
+        return "";
+    }
+    std::string path = firmwarePath;
+    path.append("/").append(firmwareObjPath);
+    return path;
+}
+
+void FirmwareInventory::firmwareComponentName(
+    const uint8_t positionNum, const uint8_t structLen, uint8_t* dataIn)
+{
+    std::string result = positionToString(positionNum, structLen, dataIn);
+    prettyName(result);
+}
+
+void FirmwareInventory::firmwareVersion(
+    const uint8_t positionNum, const uint8_t structLen, uint8_t* dataIn)
+{
+    std::string result = positionToString(positionNum, structLen, dataIn);
+    version(result);
+}
+
+void FirmwareInventory::firmwareId(const uint8_t positionNum,
+                                   const uint8_t structLen, uint8_t* dataIn)
+{
+    std::string result = positionToString(positionNum, structLen, dataIn);
+    extendedVersion(result);
+}
+
+void FirmwareInventory::firmwareReleaseDate(
+    const uint8_t positionNum, const uint8_t structLen, uint8_t* dataIn)
+{
+    std::string result = positionToString(positionNum, structLen, dataIn);
+    buildDate(result);
+}
+
+void FirmwareInventory::firmwareManufacturer(
+    const uint8_t positionNum, const uint8_t structLen, uint8_t* dataIn)
+{
+    std::string result = positionToString(positionNum, structLen, dataIn);
+    manufacturer(result);
+}
+} // namespace smbios
+} // namespace phosphor
diff --git a/src/mdrv2.cpp b/src/mdrv2.cpp
index f33fbc1..8395c94 100644
--- a/src/mdrv2.cpp
+++ b/src/mdrv2.cpp
@@ -651,6 +651,39 @@
     }
 #endif
 
+#ifdef FIRMWARE_INVENTORY_DBUS
+
+    auto existingVersionPaths = utils::getExistingVersionPaths(*bus);
+    num = getTotalFirmwareInventory();
+    if (!num)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "get firmware inventory failed");
+        existingVersionPaths.clear();
+        return;
+    }
+
+    // In case the new size is smaller than old, trim the vector
+    if (*num < firmwareCollection.size())
+    {
+        firmwareCollection.resize(*num);
+    }
+    for (unsigned int index = 0; index < *num; index++)
+    {
+        auto path = FirmwareInventory::checkAndCreateFirmwarePath(
+            smbiosDir.dir[smbiosDirIndex].dataStorage, index,
+            existingVersionPaths);
+        if (path.empty())
+        {
+            continue;
+        }
+        firmwareCollection.emplace_back(
+            std::make_unique<phosphor::smbios::FirmwareInventory>(
+                *bus, path, index, smbiosDir.dir[smbiosDirIndex].dataStorage));
+    }
+
+#endif
+
     system.reset();
     system = std::make_unique<System>(bus, smbiosInventoryPath + systemSuffix,
                                       smbiosDir.dir[smbiosDirIndex].dataStorage,
@@ -800,6 +833,40 @@
     return num;
 }
 
+std::optional<size_t> MDRV2::getTotalFirmwareInventory()
+{
+    uint8_t* dataIn = smbiosDir.dir[smbiosDirIndex].dataStorage;
+    size_t num = 0;
+
+    if (dataIn == nullptr)
+    {
+        phosphor::logging::log<phosphor::logging::level::ERR>(
+            "Fail to get firmware inventory - no storage data");
+        return std::nullopt;
+    }
+
+    while (1)
+    {
+        dataIn = getSMBIOSTypePtr(dataIn, firmwareInventoryInformationType);
+        if (dataIn == nullptr)
+        {
+            break;
+        }
+        num++;
+        dataIn = smbiosNextPtr(dataIn);
+        if (dataIn == nullptr)
+        {
+            break;
+        }
+        if (num >= limitEntryLen)
+        {
+            break;
+        }
+    }
+
+    return num;
+}
+
 bool MDRV2::checkSMBIOSVersion(uint8_t* dataIn)
 {
     const std::string anchorString21 = "_SM_";
diff --git a/src/meson.build b/src/meson.build
index 3a2bc17..d94397e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -19,6 +19,14 @@
     cpp_args_smbios += ['-DTPM_DBUS']
 endif
 
+if get_option('firmware-inventory-dbus').allowed()
+    cpp_args_smbios += ['-DFIRMWARE_INVENTORY_DBUS']
+endif
+
+if get_option('expose-firmware-component-name').allowed()
+    cpp_args_smbios += ['-DEXPOSE_FW_COMPONENT_NAME']
+endif
+
 executable(
     'smbiosmdrv2app',
     'mdrv2.cpp',
@@ -28,6 +36,7 @@
     'system.cpp',
     'pcieslot.cpp',
     'tpm.cpp',
+    'firmware_inventory.cpp',
     cpp_args: cpp_args_smbios,
     dependencies: [
         boost_dep,
