Enhance system VPD map
This commit enhances system VPD map to incorporate useful
information about each critical keywords like the default
keyword value, if the keyword is restorable or not, if the
keyword is resettable at manufacturing or not, if a PEL
required or not when failed to restore the keywords.
Tested the following,
1. system VPD restore on cache via parser
2. system VPD restore on hardware via vpd-manager
3. system VPD restore via vpd-tool
4. system VPD reset via vpd-tool
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I29ae6016f6d84342a8ad91ba72617a45121cf8a6
diff --git a/ibm_vpd_utils.hpp b/ibm_vpd_utils.hpp
index 2b75c7d..508f9d3 100644
--- a/ibm_vpd_utils.hpp
+++ b/ibm_vpd_utils.hpp
@@ -13,14 +13,29 @@
namespace vpd
{
-// Map to hold record, kwd pair which can be re-stored at standby.
-// The list of keywords for VSYS record is as per the S0 system. Should
-// be updated for another type of systems
-static const std::unordered_map<std::string, std::vector<std::string>>
- svpdKwdMap{{"VSYS", {"BR", "TM", "SE", "SU", "RB", "WN", "RG", "FV"}},
- {"VCEN", {"FC", "SE"}},
- {"LXR0", {"LX"}},
- {"UTIL", {"D0"}}};
+// Map which holds system vpd keywords which can be restored at standby and via
+// vpd-tool and also can be used to reset keywords to its defaults at
+// manufacturing. The list of keywords for VSYS record is as per the S0 system.
+// Should be updated for another type of systems For those keywords whose
+// default value is system specific, the default value field is left empty.
+// Record : {Keyword, Default value, Is PEL required on restore failure, Is MFG
+// reset required}
+static const inventory::SystemKeywordsMap svpdKwdMap{
+ {"VSYS",
+ {inventory::SystemKeywordInfo("BR", Binary(2, 0x20), true, true),
+ inventory::SystemKeywordInfo("TM", Binary(8, 0x20), true, true),
+ inventory::SystemKeywordInfo("SE", Binary(7, 0x20), true, true),
+ inventory::SystemKeywordInfo("SU", Binary(6, 0x20), true, true),
+ inventory::SystemKeywordInfo("RB", Binary(4, 0x20), true, true),
+ inventory::SystemKeywordInfo("WN", Binary(12, 0x20), true, true),
+ inventory::SystemKeywordInfo("RG", Binary(4, 0x20), true, true),
+ inventory::SystemKeywordInfo("FV", Binary(32, 0x20), false, true)}},
+ {"VCEN",
+ {inventory::SystemKeywordInfo("FC", Binary(), true, false),
+ inventory::SystemKeywordInfo("SE", Binary(7, 0x20), true, true)}},
+ {"LXR0", {inventory::SystemKeywordInfo("LX", Binary(), true, false)}},
+ {"UTIL",
+ {inventory::SystemKeywordInfo("D0", Binary(1, 0x00), true, true)}}};
/** @brief Return the hex representation of the incoming byte
*