Handle CPU Module and FRU in write VPD
Test-
1. Using vpd-tool
./vpd-tool --readKeyword --object /system/chassis/motherboard --record VINI --keyword SN
{
"/system/chassis/motherboard": {
"SN": "YL2E2D010000"
}
}
./vpd-tool --writeKeyword --object /system/chassis/motherboard --record VINI --keyword SN --value 0x303030
./vpd-tool --readKeyword --object /system/chassis/motherboard --record VINI --keyword SN {
"/system/chassis/motherboard": {
"SN": "000E2D010000"
}
}
COM interface-
Change-Id: I39ee0448483be581da254f5633b0817637292dff
-------------
.SN property ay 12 48 48 48 69 50 68 48 49 48 48 48 48 emits-change writable
Common Interface-
----------------
xyz.openbmc_project.Inventory.Decorator.Asset interface - - -
.SerialNumber property s "000E2D010000" emits-change writable
sys path updated-
--------
00000110 35 53 4e 0c 30 30 30 45 32 44 30 31 30 30 30 30 |5SN.000E2D010000|
2. Tested on simics with spi driver supported image for 1 DCM
verified CPUs and other FRUs to work as expected.
1- busctl call WriteKeyword ossay "/system/chassis/motherboard/cpu0" "VINI" "DR" 1 65
Updating CI, so updated cpu0, cpu1 and spi2 vpd.
2- busctl call WriteKeyword ossay "/system/chassis/motherboard/cpu1" "VINI" "DR" 1 66
Updating CI, so updated cpu0, cpu1 and spi2 vpd.
3- busctl call WriteKeyword ossay "/system/chassis/motherboard/cpu0" "VINI" "CC" 1 67
Not a CI, so only cpu0 and spi2 vpd updated.
4- busctl call WriteKeyword ossay "/system/chassis/motherboard/cpu1" "VINI" "CC" 1 67
Not a CI, so only cpu1 and spi6 vpd updated.
cpu1 updated 1 Byte data of DR (7)-
busctl call WriteKeyword ossay "/system/chassis/motherboard/cpu1" "VINI" "DR" 1 55
Read file info at spi2.0/spi2.00/nvmem offset 0x30000-
000001a0 04 56 49 4e 49 44 52 10 37 20 57 41 59 20 20 50 |.VINIDR.7 WAY P| <--DR updated 1 Byte
Change-Id: I5e99c1ac4e09b2d0e05be18a10d1d50eba22fea2
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
diff --git a/vpd-manager/manager.cpp b/vpd-manager/manager.cpp
index 3d8462c..717a83a 100644
--- a/vpd-manager/manager.cpp
+++ b/vpd-manager/manager.cpp
@@ -80,11 +80,16 @@
.get_ref<const nlohmann::json::string_t&>(),
std::make_pair(itemFRUS.key(), isMotherboard));
- fruLocationCode.emplace(
- itemEEPROM["extraInterfaces"][LOCATION_CODE_INF]["LocationCode"]
- .get_ref<const nlohmann::json::string_t&>(),
- itemEEPROM["inventoryPath"]
- .get_ref<const nlohmann::json::string_t&>());
+ if (itemEEPROM["extraInterfaces"].find(LOCATION_CODE_INF) !=
+ itemEEPROM["extraInterfaces"].end())
+ {
+ fruLocationCode.emplace(
+ itemEEPROM["extraInterfaces"][LOCATION_CODE_INF]
+ ["LocationCode"]
+ .get_ref<const nlohmann::json::string_t&>(),
+ itemEEPROM["inventoryPath"]
+ .get_ref<const nlohmann::json::string_t&>());
+ }
}
}
}
@@ -103,7 +108,7 @@
inventory::Path vpdFilePath = frus.find(path)->second.first;
// instantiate editor class to update the data
- EditorImpl edit(vpdFilePath, jsonFile, recordName, keyword);
+ EditorImpl edit(vpdFilePath, jsonFile, recordName, keyword, path);
edit.updateKeyword(value);
// if it is a motehrboard FRU need to check for location expansion