Dimm memory size support
This commit will calculate the memory size for Dimm and
populate the value with property MemorySizeinKB on dbus.
Test- Tested on simics 2s2u
Set the property with dummy value-
root@rain71bmc:/tmp# busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0| grep -e MemorySizeInKB -e Present -e PrettyName -e Model -e PartNumber -e SerialNumber
.Model property s "327A" emits-change writable
.PartNumber property s "78P6574" emits-change writable
.SerialNumber property s "YH301T01P00G" emits-change writable
.SparePartNumber property s "" emits-change writable
.SubModel property s "" emits-change writable
.Present property b true emits-change writable
.PrettyName property s "Memory DIMM" emits-change writable
.MemorySizeInKB property u 33554432 emits-change writable
root@rain71bmc:/tmp#
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
Change-Id: I70e5bc3f538379f9891ae0ede6cdf09a585520a4
diff --git a/vpd-parser/memory_vpd_parser.hpp b/vpd-parser/memory_vpd_parser.hpp
index 27efafe..cbd44bb 100644
--- a/vpd-parser/memory_vpd_parser.hpp
+++ b/vpd-parser/memory_vpd_parser.hpp
@@ -58,6 +58,14 @@
*/
kwdVpdMap readKeywords(Binary::const_iterator iterator);
+ /**
+ * @brief This function calculates dimm size from DIMM VPD
+ *
+ * @param[in] iterator - iterator to buffer containing VPD
+ * @return calculated data or 0 in case of any error.
+ */
+ auto getDimmSize(Binary::const_iterator iterator);
+
// vdp file to be parsed
const Binary& memVpd;
};