From a1ea1852fc3706bb80a821d792c5ef174378c3a6 Mon Sep 17 00:00:00 2001 From: Vasant Hegde Date: Wed, 19 Nov 2014 15:39:00 +0530 Subject: [PATCH 1/4] VPD: Add OPAL version details Recently we have added firmware/version property in DT for PowerKVM platform which contains OPAL version details. Also deprecated old firmware/git-id property. Use this new property to get firmware version details. Also for backward compitability purpose, if new property (version) is not available then check for old property (git-id). Output on old FW: *CL OPAL v3 d427354 Output on new FW: *CL OPAL skiboot-2.1.1-fw810.20-1 Signed-off-by: Vasant Hegde Reviewed-by: Janani Venkataraman --- src/include/devicetreecollector.hpp | 1 + src/internal/sys_interface/devicetreecollector.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/include/devicetreecollector.hpp b/src/include/devicetreecollector.hpp index 7934e00..9da46fa 100755 --- a/src/include/devicetreecollector.hpp +++ b/src/include/devicetreecollector.hpp @@ -51,6 +51,7 @@ namespace lsvpd #define OPAL_SYS_FW_ML_FILE "ml-version" #define OPAL_SYS_FW_MI_FILE "mi-version" #define OPAL_SYS_FW_CL_FILE "git-id" + #define OPAL_SYS_FW_CL_FILE2 "version" /** * DeviceTreeCollector contains the logic for device discovery and VPD diff --git a/src/internal/sys_interface/devicetreecollector.cpp b/src/internal/sys_interface/devicetreecollector.cpp index 678829d..7498a3b 100755 --- a/src/internal/sys_interface/devicetreecollector.cpp +++ b/src/internal/sys_interface/devicetreecollector.cpp @@ -829,11 +829,17 @@ ERROR: if (val.length() > 0) setVPDField( c, string("MI"), val.substr(3), __FILE__, __LINE__ ); - val = getAttrValue( os.str( ), OPAL_SYS_FW_CL_FILE ); + val = getAttrValue( os.str( ), OPAL_SYS_FW_CL_FILE2 ); if (val.length() > 0) { - string firmware = PlatformCollector::getFirmwareName(); - val = firmware + " " + val; + val = "OPAL " + val; setVPDField( c, string("CL"), val, __FILE__, __LINE__ ); + } else { + val = getAttrValue( os.str( ), OPAL_SYS_FW_CL_FILE ); + if (val.length() > 0) { + string firmware = PlatformCollector::getFirmwareName(); + val = firmware + " " + val; + setVPDField( c, string("CL"), val, __FILE__, __LINE__ ); + } } devs.push_back( c ); -- 1.9.1