diff options
author | Cheng C Yang <cheng.c.yang@intel.com> | 2019-11-28 18:44:01 +0300 |
---|---|---|
committer | Yang, Cheng C <cheng.c.yang@intel.com> | 2019-12-05 03:49:12 +0300 |
commit | 8dfc93ce3b2672aca85af76235552dc7075c0349 (patch) | |
tree | 089797d059390363f6caa3ed0c403a577fa10cd1 /services/smbios/src/dimm.cpp | |
parent | 4213b26002f644927efdae94e0f8627c80df59a4 (diff) | |
download | provingground-8dfc93ce3b2672aca85af76235552dc7075c0349.tar.xz |
Change mdrv1 to match upstream dimm properties
According to the commit change e59bc11535c21ca8134bc390403dc085d015837
in phosphor-dbus-interface, update mdrv1 to match the new dimm
properties.
Tested:
Redfish can show correct DIMM information.
Change-Id: I93f68755d2b8d1f8b3cfbb0ffa037da41915b407
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
Diffstat (limited to 'services/smbios/src/dimm.cpp')
-rw-r--r-- | services/smbios/src/dimm.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/services/smbios/src/dimm.cpp b/services/smbios/src/dimm.cpp index a3c3603..346c701 100644 --- a/services/smbios/src/dimm.cpp +++ b/services/smbios/src/dimm.cpp @@ -22,6 +22,9 @@ namespace phosphor namespace smbios { +using DeviceType = + sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm::DeviceType; + static constexpr uint16_t maxOldDimmSize = 0x7fff; void Dimm::memoryInfoUpdate(void) { @@ -63,12 +66,12 @@ void Dimm::memoryInfoUpdate(void) dimmDeviceLocator(memoryInfo->deviceLocator, memoryInfo->length, dataIn); dimmType(memoryInfo->memoryType); dimmTypeDetail(memoryInfo->typeDetail); - memorySpeed(memoryInfo->speed); + maxMemorySpeedInMhz(memoryInfo->speed); dimmManufacturer(memoryInfo->manufacturer, memoryInfo->length, dataIn); dimmSerialNum(memoryInfo->serialNum, memoryInfo->length, dataIn); dimmPartNum(memoryInfo->partNum, memoryInfo->length, dataIn); memoryAttributes(memoryInfo->attributes); - memoryConfClockSpeed(memoryInfo->confClockSpeed); + memoryConfiguredSpeedInMhz(memoryInfo->confClockSpeed); return; } @@ -121,11 +124,10 @@ std::string Dimm::memoryDeviceLocator(std::string value) void Dimm::dimmType(uint8_t type) { - std::map<uint8_t, std::string>::const_iterator it = - dimmTypeTable.find(type); + std::map<uint8_t, DeviceType>::const_iterator it = dimmTypeTable.find(type); if (it == dimmTypeTable.end()) { - memoryType("Unknown Memory Type"); + memoryType(DeviceType::Unknown); } else { @@ -133,7 +135,7 @@ void Dimm::dimmType(uint8_t type) } } -std::string Dimm::memoryType(std::string value) +DeviceType Dimm::memoryType(DeviceType value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: memoryType(value); @@ -159,10 +161,10 @@ std::string Dimm::memoryTypeDetail(std::string value) memoryTypeDetail(value); } -uint16_t Dimm::memorySpeed(uint16_t value) +uint16_t Dimm::maxMemorySpeedInMhz(uint16_t value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: - memorySpeed(value); + maxMemorySpeedInMhz(value); } void Dimm::dimmManufacturer(uint8_t positionNum, uint8_t structLen, @@ -218,10 +220,10 @@ uint8_t Dimm::memoryAttributes(uint8_t value) memoryAttributes(value); } -uint16_t Dimm::memoryConfClockSpeed(uint16_t value) +uint16_t Dimm::memoryConfiguredSpeedInMhz(uint16_t value) { return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm:: - memoryConfClockSpeed(value); + memoryConfiguredSpeedInMhz(value); } } // namespace smbios |