diff options
-rw-r--r-- | services/smbios/include/manager.hpp | 6 | ||||
-rw-r--r-- | services/smbios/include/smbios.hpp | 15 | ||||
-rw-r--r-- | services/smbios/src/smbios-main.cpp | 11 |
3 files changed, 23 insertions, 9 deletions
diff --git a/services/smbios/include/manager.hpp b/services/smbios/include/manager.hpp index 9acaf97..2fb5a2f 100644 --- a/services/smbios/include/manager.hpp +++ b/services/smbios/include/manager.hpp @@ -49,7 +49,7 @@ class MDR_V1 : sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V1 sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V1(bus, path), bus(bus) { - for (uint8_t index = 0; index < 4; index++) + for (uint8_t index = 0; index < maxMdrIndex - 1; index++) { timers[index] = std::make_unique<phosphor::watchdog::Timer>( event, index, [&](uint8_t index) { @@ -57,7 +57,7 @@ class MDR_V1 : sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V1 }); } - std::copy(®ion[0], ®ion[3], regionS); + std::copy(region, region + maxRegion, regionS); if (access(smbiosPath, F_OK) == -1) { int flag = mkdir(smbiosPath, S_IRWXU); @@ -112,7 +112,7 @@ class MDR_V1 : sdbusplus::xyz::openbmc_project::Smbios::server::MDR_V1 uint16_t regionUsed(uint16_t value) override; - static constexpr uint8_t maxRegion = 5; + static constexpr uint8_t maxRegion = maxMdrIndex - 1; struct ManagedDataRegion regionS[maxRegion]; diff --git a/services/smbios/include/smbios.hpp b/services/smbios/include/smbios.hpp index 8a1550f..390ac9a 100644 --- a/services/smbios/include/smbios.hpp +++ b/services/smbios/include/smbios.hpp @@ -21,6 +21,8 @@ static constexpr uint16_t mdrSmbiosSize = 32 * 1024; // 32K static constexpr uint16_t mdrAcpiTableSize = 32 * 1024; // 32K static constexpr uint16_t mdrMemMappingSize = 8 * 1024; // 8K static constexpr uint16_t mdrScsiBootSize = 8 * 1024; // 8K +static constexpr uint16_t mdrNvmeSize = 1 * 1024; // 1K + static constexpr uint16_t smbiosTableStorageSize = 0xffff; static constexpr uint8_t mdrVersion = 0x11; // MDR version 1.1 @@ -31,17 +33,21 @@ static constexpr const char *mdrType2File = "/etc/smbios/smbios2"; static constexpr const char *mdrAcpiFile = "/etc/smbios/acpi"; static constexpr const char *mdrMemMapFile = "/etc/smbios/memmapping"; static constexpr const char *mdrScsiBootFile = "/etc/smbios/scsiboot"; +static constexpr const char *mdrNvmeFile = "/etc/smbios/nvme"; -typedef enum { +typedef enum +{ mdrNone = 0, mdrSmbios = 1, mdrAcpi = 2, mdrMemMap = 3, mdrScsiBoot = 4, - maxMdrIndex = 5 + mdrNvme = 5, + maxMdrIndex = 6 } MDRRegionIndex; -typedef enum { +typedef enum +{ regionLockUnlocked = 0, regionLockStrict, regionLockPreemptable @@ -82,7 +88,8 @@ static constexpr const char *cpuPath = static constexpr const char *systemPath = "/xyz/openbmc_project/inventory/system/chassis/motherboard/bios"; -typedef enum { +typedef enum +{ biosType = 0, systemType = 1, baseboardType = 2, diff --git a/services/smbios/src/smbios-main.cpp b/services/smbios/src/smbios-main.cpp index 2a9b86b..532163c 100644 --- a/services/smbios/src/smbios-main.cpp +++ b/services/smbios/src/smbios-main.cpp @@ -24,8 +24,9 @@ uint8_t mdrSmBiosData[mdrSmbiosSize]; uint8_t mdrAcpiTable[mdrAcpiTableSize]; uint8_t mdrMemoryMapping[mdrMemMappingSize]; uint8_t mdrSCSIBoot[mdrScsiBootSize]; +uint8_t mdrNvmeData[mdrNvmeSize]; -struct ManagedDataRegion regionS[4] = { +struct ManagedDataRegion regionS[] = { // SMBIOS table - matching the regionID order {mdrType1File, mdrSmBiosData, @@ -54,8 +55,14 @@ struct ManagedDataRegion regionS[4] = { 0, {mdrVersion, mdrScsiBoot, false, 0, regionLockUnlocked, mdrScsiBootSize, 0, 0}, - 0} + 0}, + // NVMe table - matching the regionID order + {mdrNvmeFile, + mdrNvmeData, + 0, + {mdrVersion, mdrNvme, false, 0, regionLockUnlocked, mdrNvmeSize, 0, 0}, + 0}, }; int main(void) |