Populate MemoryTotalWidth property
The "MemoryTotalWidth" property did not display correct information
from the smbios file. Add function to transfer "totalWidth" type and
return data in sdbusplus format.
Tested:
Before
```
root@qbmc:root@qbmc:~# busctl introspect xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 xyz.openbmc_project.Inventory.Item.Dimm
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.AllowedSpeedsMT property aq 0 emits-change writable
.CASLatencies property q 0 emits-change writable
.ECC property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.FormFactor property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.MaxMemorySpeedInMhz property q 4800 emits-change writable
.MemoryAttributes property y 2 emits-change writable
.MemoryConfiguredSpeedInMhz property q 4800 emits-change writable
.MemoryDataWidth property q 64 emits-change writable
.MemoryDeviceLocator property s "DIMM0" emits-change writable
.MemoryMedia property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.MemorySizeInKB property t 33554432 emits-change writable
.MemoryTotalWidth property q 0 emits-change writable
.MemoryType property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.MemoryTypeDetail property s "SynchronousUnbuffered" emits-change writable
.RevisionCode property q 0 emits-change writable
```
After patching, MemoryTotalWidth property get correct value.
```
root@qbmc:~# busctl introspect xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0 xyz.openbmc_project.Inventory.Item.Dimm
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.AllowedSpeedsMT property aq 0 emits-change writable
.CASLatencies property q 0 emits-change writable
.ECC property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.FormFactor property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.MaxMemorySpeedInMhz property q 4800 emits-change writable
.MemoryAttributes property y 2 emits-change writable
.MemoryConfiguredSpeedInMhz property q 4800 emits-change writable
.MemoryDataWidth property q 64 emits-change writable
.MemoryDeviceLocator property s "DIMM0" emits-change writable
.MemoryMedia property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.MemorySizeInKB property t 33554432 emits-change writable
.MemoryTotalWidth property q 72 emits-change writable
.MemoryType property s "xyz.openbmc_project.Inventory.Item.D... emits-change writable
.MemoryTypeDetail property s "SynchronousUnbuffered" emits-change writable
.RevisionCode property q 0 emits-change writable
```
Change-Id: I355ef057d7d28e4507d7c91eb45ab2453ed1923e
Signed-off-by: Joseph Fu <joseph.fu@quantatw.com>
diff --git a/include/dimm.hpp b/include/dimm.hpp
index 26ba3d8..6be5644 100644
--- a/include/dimm.hpp
+++ b/include/dimm.hpp
@@ -104,6 +104,7 @@
const std::string& motherboard);
uint16_t memoryDataWidth(uint16_t value) override;
+ uint16_t memoryTotalWidth(uint16_t value) override;
size_t memorySizeInKB(size_t value) override;
std::string memoryDeviceLocator(std::string value) override;
DeviceType memoryType(DeviceType value) override;
diff --git a/src/dimm.cpp b/src/dimm.cpp
index 2138886..14a4984 100644
--- a/src/dimm.cpp
+++ b/src/dimm.cpp
@@ -72,6 +72,7 @@
auto memoryInfo = reinterpret_cast<struct MemoryInfo*>(dataIn);
memoryDataWidth(memoryInfo->dataWidth);
+ memoryTotalWidth(memoryInfo->totalWidth);
if (memoryInfo->size == maxOldDimmSize)
{
@@ -159,6 +160,12 @@
memoryDataWidth(value);
}
+uint16_t Dimm::memoryTotalWidth(uint16_t value)
+{
+ return sdbusplus::xyz::openbmc_project::Inventory::Item::server::Dimm::
+ memoryTotalWidth(value);
+}
+
static constexpr uint16_t baseNewVersionDimmSize = 0x8000;
static constexpr uint16_t dimmSizeUnit = 1024;
void Dimm::dimmSize(const uint16_t size)