Do VPD collection manually for ISDIMM
The VPD collection was initially done from the device tree, This has
caused some issues, and so the entries for the ISDIMM were removed from
the device tree. Now we have the VPD app to manually trigger the ISDIMM
by binding the driver for it, so that the collection will happen via
the udev rule specified.
Once UDEV signal is received for the ISDIMM the service to collect the
VPD is triggered.
Change-Id: I5846d419989f23637f5094b485d771b3418183c0
Signed-off-by: Jinu Joy Thomas <jinu.joy.thomas@in.ibm.com>
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index cff1a4f..866eb53 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -1292,14 +1292,25 @@
i = regex_replace(i, pattern, "");
}
- if (i2cReg.size() == 2)
+ // For ISDIMM which uses ee1004 driver
+ // the below is done
+ size_t stringFound = dimmVpd.find("ee1004");
+ if (stringFound != string::npos)
+ {
+ // echo ee1004 0x50 >
+ // /sys/bus/i2c/devices/i2c-110/new_device
+ string cmnd = "echo ee1004 0x" + i2cReg[1] +
+ " > /sys/bus/i2c/devices/i2c-" +
+ i2cReg[0] + "/new_device";
+ executeCmd(cmnd);
+ }
+ else if (i2cReg.size() == 2)
{
// echo 24c32 0x50 >
// /sys/bus/i2c/devices/i2c-16/new_device
string cmnd = "echo 24c32 0x" + i2cReg[1] +
" > /sys/bus/i2c/devices/i2c-" +
i2cReg[0] + "/new_device";
-
executeCmd(cmnd);
}
}
@@ -1356,7 +1367,7 @@
{
if (item.find("holdidlepath") != item.end())
{
- std::string holdidle = item["holdidlepath"];
+ const std::string& holdidle = item["holdidlepath"];
std::cout << "Setting holdidle state for " << holdidle
<< "to 0 " << std::endl;
string cmd = "echo 0 > " + holdidle;