diff options
author | Cheng C Yang <cheng.c.yang@intel.com> | 2019-11-28 18:37:31 +0300 |
---|---|---|
committer | Yang, Cheng C <cheng.c.yang@intel.com> | 2019-12-05 08:16:57 +0300 |
commit | e1dbcef575309efeb04d275565a6e9649f3b89dd (patch) | |
tree | 3a14f48185ddeeeaae45be6265a19b2c43fbf32b /services/smbios-mdrv2/src/dimm.cpp | |
parent | 8dfc93ce3b2672aca85af76235552dc7075c0349 (diff) | |
download | provingground-e1dbcef575309efeb04d275565a6e9649f3b89dd.tar.xz |
Change mdrv2 to match upstream dimm properties
According to the commit change e59bc11535c21ca8134bc390403dc085d015837e
in phosphor-dbus-interface, update mdrv2 to match the new dimm
properties.
Tested:
Redfish can show correct DIMM information.
Change-Id: I0727a195a988cbeae7d5706ae080c739617302ee
Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
Diffstat (limited to 'services/smbios-mdrv2/src/dimm.cpp')
-rw-r--r-- | services/smbios-mdrv2/src/dimm.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/services/smbios-mdrv2/src/dimm.cpp b/services/smbios-mdrv2/src/dimm.cpp index fdd7ca7..db4170a 100644 --- a/services/smbios-mdrv2/src/dimm.cpp +++ b/services/smbios-mdrv2/src/dimm.cpp @@ -23,6 +23,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) { @@ -64,12 +67,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; } @@ -120,11 +123,10 @@ std::string Dimm::memoryDeviceLocator(std::string value) void Dimm::dimmType(const uint8_t type) { - std::map<uint8_t, const char *>::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 { @@ -132,7 +134,7 @@ void Dimm::dimmType(const 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); @@ -158,10 +160,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(const uint8_t positionNum, const uint8_t structLen, @@ -212,10 +214,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 |