summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usr/vpd/ipvpd.C159
-rw-r--r--src/usr/vpd/ipvpd.H107
-rw-r--r--src/usr/vpd/ocmb_spd.H53
-rw-r--r--src/usr/vpd/spd.C60
-rwxr-xr-xsrc/usr/vpd/spd.H2
-rwxr-xr-xsrc/usr/vpd/vpd.C129
6 files changed, 397 insertions, 113 deletions
diff --git a/src/usr/vpd/ipvpd.C b/src/usr/vpd/ipvpd.C
index 2195ab3c3..0469c0250 100644
--- a/src/usr/vpd/ipvpd.C
+++ b/src/usr/vpd/ipvpd.C
@@ -319,6 +319,109 @@ errlHndl_t IpVpdFacade::write ( TARGETING::Target * i_target,
}
// ------------------------------------------------------------------
+// IpVpdFacade::cmpEecacheToEeprom
+// ------------------------------------------------------------------
+errlHndl_t IpVpdFacade::cmpEecacheToEeprom(TARGETING::Target * i_target,
+ VPD::vpdRecord i_record,
+ VPD::vpdKeyword i_keyword,
+ bool & o_match)
+{
+ errlHndl_t l_err = nullptr;
+
+ TRACSSCOMP(g_trac_vpd, ENTER_MRK"cmpEecacheToEeprom() ");
+
+ o_match = false;
+
+ input_args_t l_cacheArgs;
+ l_cacheArgs.record = i_record;
+ l_cacheArgs.keyword = i_keyword;
+ l_cacheArgs.location = VPD::SEEPROM;
+ l_cacheArgs.eepromSource = EEPROM::CACHE;
+
+ input_args_t l_hardwareArgs;
+ l_hardwareArgs.record = i_record;
+ l_hardwareArgs.keyword = i_keyword;
+ l_hardwareArgs.location = VPD::SEEPROM;
+ l_hardwareArgs.eepromSource = EEPROM::HARDWARE;
+
+ do
+ {
+ // Get the CACHE size
+ size_t l_sizeCache = 0;
+
+ l_err = read(i_target,
+ nullptr,
+ l_sizeCache,
+ l_cacheArgs);
+
+ if( l_err || (l_sizeCache == 0) )
+ {
+ break;
+ }
+
+ // Get the CACHE data
+ uint8_t l_dataCache[l_sizeCache];
+ l_err = read( i_target,
+ l_dataCache,
+ l_sizeCache,
+ l_cacheArgs );
+
+ if( l_err )
+ {
+ break;
+ }
+
+ // Get the HARDWARE size
+ size_t l_sizeHardware = 0;
+ l_err = read( i_target,
+ nullptr,
+ l_sizeHardware,
+ l_hardwareArgs );
+
+ if( l_err || (l_sizeHardware == 0) )
+ {
+ break;
+ }
+
+ // Get the HARDWARE data
+ uint8_t l_dataHardware[l_sizeHardware];
+ l_err = read( i_target,
+ l_dataHardware,
+ l_sizeHardware,
+ l_hardwareArgs );
+
+ if( l_err )
+ {
+ break;
+ }
+
+ // Compare the CACHE/HARDWARE keyword size/data
+ if( l_sizeCache != l_sizeHardware )
+ {
+ // Leave o_match == false since there isn't a match.
+ break;
+ }
+
+ if( memcmp( l_dataCache,
+ l_dataHardware,
+ l_sizeCache ) != 0 )
+ {
+ TRACFCOMP( g_trac_vpd, "cmpEecacheToEeprom found mismatch for HUID %.8X 0x%X:0x%X", TARGETING::get_huid(i_target), i_record, i_keyword );
+ TRACFBIN( g_trac_vpd, "HARDWARE", l_dataHardware, l_sizeHardware );
+ TRACFBIN( g_trac_vpd, "CACHE", l_dataCache, l_sizeCache );
+ break;
+ }
+
+ o_match = true;
+
+ } while(0);
+
+ TRACSSCOMP( g_trac_vpd, EXIT_MRK"cmpEecacheToEeprom()" );
+
+ return l_err;
+}
+
+// ------------------------------------------------------------------
// IpVpdFacade::cmpPnorToSeeprom
// ------------------------------------------------------------------
errlHndl_t IpVpdFacade::cmpPnorToSeeprom ( TARGETING::Target * i_target,
@@ -1618,6 +1721,36 @@ errlHndl_t IpVpdFacade::retrieveRecord( const char * i_recordName,
return err;
}
+
+// ------------------------------------------------------------------
+// IpVpdFacade::fetchData
+// ------------------------------------------------------------------
+errlHndl_t IpVpdFacade::fetchData ( uint64_t i_byteAddr,
+ size_t i_numBytes,
+ void * o_data,
+ TARGETING::Target * i_target,
+ VPD::vpdCmdTarget i_location,
+ const char* i_record )
+{
+ errlHndl_t err = nullptr;
+
+ // Create an input_args struct which will default EEPROM_SOURCE
+ // to EEPROM::AUTOSELECT.
+ input_args_t inputArgs;
+
+ // Set the VPD location to the given location (PNOR/SEEPROM).
+ inputArgs.location = i_location;
+
+ err = fetchData(i_byteAddr,
+ i_numBytes,
+ o_data,
+ i_target,
+ inputArgs,
+ i_record);
+
+ return err;
+}
+
// ------------------------------------------------------------------
// IpVpdFacade::fetchData
// ------------------------------------------------------------------
@@ -1625,7 +1758,7 @@ errlHndl_t IpVpdFacade::fetchData ( uint64_t i_byteAddr,
size_t i_numBytes,
void * o_data,
TARGETING::Target * i_target,
- VPD::vpdCmdTarget i_location,
+ input_args_t i_args,
const char* i_record )
{
errlHndl_t err = NULL;
@@ -1636,12 +1769,12 @@ errlHndl_t IpVpdFacade::fetchData ( uint64_t i_byteAddr,
configError = VPD::resolveVpdSource( i_target,
iv_configInfo.vpdReadPNOR,
iv_configInfo.vpdReadHW,
- i_location,
+ i_args.location,
vpdSource );
// Look for a record override in our image unless explicitly told not to
bool l_foundOverride = false;
- if( (i_location & VPD::OVERRIDE_MASK) != VPD::USEVPD )
+ if( (i_args.location & VPD::OVERRIDE_MASK) != VPD::USEVPD )
{
uint8_t* l_overridePtr = nullptr;
VPD::RecordTargetPair_t l_recTarg =
@@ -1694,7 +1827,11 @@ errlHndl_t IpVpdFacade::fetchData ( uint64_t i_byteAddr,
}
else if ( (vpdSource == VPD::SEEPROM) && !l_foundOverride )
{
- err = fetchDataFromEeprom( i_byteAddr, i_numBytes, o_data, i_target );
+ err = fetchDataFromEeprom(i_byteAddr,
+ i_numBytes,
+ o_data,
+ i_target,
+ i_args.eepromSource);
}
else
{
@@ -1723,7 +1860,7 @@ errlHndl_t IpVpdFacade::fetchData ( uint64_t i_byteAddr,
VPD::VPD_READ_SOURCE_UNRESOLVED,
TWO_UINT32_TO_UINT64(
TARGETING::get_huid(i_target),
- i_location ),
+ i_args.location ),
TWO_UINT32_TO_UINT64(
iv_configInfo.vpdReadPNOR,
iv_configInfo.vpdReadHW ),
@@ -1777,10 +1914,11 @@ errlHndl_t IpVpdFacade::fetchDataFromPnor ( uint64_t i_byteAddr,
// ------------------------------------------------------------------
// IpVpdFacade::fetchDataFromEeprom
// ------------------------------------------------------------------
-errlHndl_t IpVpdFacade::fetchDataFromEeprom ( uint64_t i_byteAddr,
- size_t i_numBytes,
- void * o_data,
- TARGETING::Target * i_target )
+errlHndl_t IpVpdFacade::fetchDataFromEeprom(uint64_t i_byteAddr,
+ size_t i_numBytes,
+ void * o_data,
+ TARGETING::Target * i_target,
+ EEPROM::EEPROM_SOURCE i_eepromSource)
{
errlHndl_t err = NULL;
TRACSSCOMP( g_trac_vpd,
@@ -1797,7 +1935,8 @@ errlHndl_t IpVpdFacade::fetchDataFromEeprom ( uint64_t i_byteAddr,
i_numBytes,
DEVICE_EEPROM_ADDRESS(
EEPROM::VPD_PRIMARY,
- i_byteAddr, EEPROM::AUTOSELECT ) );
+ i_byteAddr,
+ i_eepromSource ) );
if( err )
{
break;
diff --git a/src/usr/vpd/ipvpd.H b/src/usr/vpd/ipvpd.H
index 597c6e256..bea06bde4 100644
--- a/src/usr/vpd/ipvpd.H
+++ b/src/usr/vpd/ipvpd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2018 */
+/* Contributors Listed Below - COPYRIGHT 2013,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -33,7 +33,7 @@
#include <devicefw/driverif.H>
#include <config.h>
#include "vpd.H"
-
+#include <i2c/eeprom_const.H>
/** @file ipvpd.H
* @brief Provides base support for i/p-Series style IBM VPD
@@ -79,11 +79,35 @@ class IpVpdFacade
/**
* @brief Structure for all VPD dd input parameter arguments
*/
- typedef struct
+ typedef struct device_driver_input_args
{
- VPD::vpdRecord record;
- VPD::vpdKeyword keyword;
- VPD::vpdCmdTarget location;
+ VPD::vpdRecord record;
+ VPD::vpdKeyword keyword;
+ VPD::vpdCmdTarget location;
+ EEPROM::EEPROM_SOURCE eepromSource;
+
+ // Default constructor
+ device_driver_input_args() : record(0xFFFFFFFF),
+ keyword(0xFFFFFFFF),
+ location(VPD::AUTOSELECT),
+ eepromSource(EEPROM::AUTOSELECT)
+ {};
+
+ // This constructor allows for existing code using brace-enclosed
+ // initializer lists of the first three arguments to continue to
+ // function normally. Since the default behavior for EEPROM_SOURCE is
+ // AUTOSELECT, setting it automatically here is done to maintain that
+ // default assumption.
+ device_driver_input_args(VPD::vpdRecord i_record,
+ VPD::vpdKeyword i_keyword,
+ VPD::vpdCmdTarget i_location)
+ : record(i_record),
+ keyword(i_keyword),
+ location(i_location),
+ eepromSource(EEPROM::AUTOSELECT)
+ {};
+
+
} input_args_t;
/**
@@ -237,6 +261,28 @@ class IpVpdFacade
VPD::vpdRecord record,
VPD::vpdKeyword keyword );
+
+ /**
+ * @brief This function compares the specified record/keyword
+ * in CACHE/HARDWARE and returns the result. A mismatch
+ * will not return an error.
+ *
+ * @param[in] i_target Target device
+ *
+ * @param[in] i_record Record to compare
+ *
+ * @param[in] i_keyword Keyword to compare
+ *
+ * @param[out] o_match Result of compare
+ *
+ * @return errlHndl_t NULL if successful, otherwise a pointer to the
+ * error log.
+ */
+ errlHndl_t cmpEecacheToEeprom(TARGETING::Target * i_target,
+ VPD::vpdRecord i_record,
+ VPD::vpdKeyword i_keyword,
+ bool & o_match);
+
/**
* @brief This function compares the specified record/keyword
* in PNOR/SEEPROM and returns the result. A mismatch
@@ -594,6 +640,8 @@ class IpVpdFacade
uint64_t& o_byteAddr,
input_args_t i_args );
+
+
/**
* @brief This function calls the PNOR or EEPROM version of
* the fetchData function based on the configInfo
@@ -613,12 +661,38 @@ class IpVpdFacade
* @return errHndl_t - NULL if successful, otherwise a pointer to the
* error log.
*/
- errlHndl_t fetchData ( uint64_t i_byteAddr,
- size_t i_numBytes,
- void * o_data,
- TARGETING::Target * i_target,
- VPD::vpdCmdTarget i_location,
- const char* i_record );
+ errlHndl_t fetchData(uint64_t i_byteAddr,
+ size_t i_numBytes,
+ void * o_data,
+ TARGETING::Target * i_target,
+ VPD::vpdCmdTarget i_location,
+ const char* i_record);
+
+ /**
+ * @brief This function calls the PNOR or EEPROM version of
+ * the fetchData function based on the configInfo
+ *
+ * @param[in] i_byteAddr The offset to be read.
+ *
+ * @param[in] i_numBytes The number of bytes to read.
+ *
+ * @param[out] o_data The data buffer where the data will be placed.
+ *
+ * @param[in] i_target Target device.
+ *
+ * @param[in] i_args The input arguments
+ *
+ * @param[in] i_record String representation of the record.
+ *
+ * @return errHndl_t NULL if successful, otherwise a pointer to the
+ * error log.
+ */
+ errlHndl_t fetchData(uint64_t i_byteAddr,
+ size_t i_numBytes,
+ void * o_data,
+ TARGETING::Target * i_target,
+ input_args_t i_args,
+ const char* i_record);
/**
* @brief This function actually reads the data from PNOR
@@ -653,10 +727,11 @@ class IpVpdFacade
* @return errHndl_t - NULL if successful, otherwise a pointer to the
* error log.
*/
- errlHndl_t fetchDataFromEeprom ( uint64_t i_byteAddr,
- size_t i_numBytes,
- void * o_data,
- TARGETING::Target * i_target );
+ errlHndl_t fetchDataFromEeprom(uint64_t i_byteAddr,
+ size_t i_numBytes,
+ void * o_data,
+ TARGETING::Target * i_target,
+ EEPROM::EEPROM_SOURCE i_eepromSource = EEPROM::AUTOSELECT);
/**
* @brief This function compares 2 ipvpd record values. Used for binary
diff --git a/src/usr/vpd/ocmb_spd.H b/src/usr/vpd/ocmb_spd.H
index 2e02d776e..91123dfd4 100644
--- a/src/usr/vpd/ocmb_spd.H
+++ b/src/usr/vpd/ocmb_spd.H
@@ -30,23 +30,18 @@
namespace SPD
{
-/**
-* @brief Read keyword from SPD
-*
-* Currently used to detect I2C_MUTEX and OCMB_CHIP targets
-*
-* @param[in] i_target OCMB target to read data from
-* @param[in/out] io_buffer databuffer SPD will be written to
-* @param[in/out] io_buflen length of the given data buffer
-* @param[in] i_keyword keyword from spdenums.H to read
-* @param[in] i_memType The memory type of this target.
-* @param[in] i_location The EEPROM source (CACHE/HARDWARE).
-*
-* @pre io_buffer and i_target must be non-null
-* @pre currenlty only supported value for i_keyword is ENTIRE_SPD
-*
-* @return errlHndl_t
-*/
+/*
+ * @brief Read keyword from SPD
+ *
+ * @param[in] i_target OCMB target to read data from
+ * @param[in/out] io_buffer databuffer SPD will be written to
+ * @param[in/out] io_buflen length of the given data buffer
+ * @param[in] i_keyword keyword from spdenums.H to read
+ * @param[in] i_memType The memory type of this target.
+ * @param[in] i_location The EEPROM source (CACHE/HARDWARE).
+ *
+ * @return errlHndl_t nullptr on success. Otherwise, error log.
+ */
errlHndl_t ocmbGetSPD(TARGETING::TargetHandle_t i_target,
void* io_buffer,
size_t& io_buflen,
@@ -54,13 +49,31 @@ errlHndl_t ocmbGetSPD(TARGETING::TargetHandle_t i_target,
const uint8_t i_memType,
EEPROM::EEPROM_SOURCE i_location);
-// @TODO RTC 203788 doxygen
+/*
+ * @brief Determine if the given DIMM type is a known DIMM type or not
+ *
+ * @param[in] i_dimmType - The DIMM to verify if valid
+ *
+ * @return boolean - return true if given parameter is a known DIMM type,
+ * false otherwise
+ */
bool isValidOcmbDimmType(const uint8_t i_dimmType);
-// @TODO RTC 203788 doxygen
+/*
+ * @brief This function will read the DIMM memory type for OCMBs.
+ *
+ * @param[out] o_memType - The memory type value to return.
+ *
+ * @param[in] i_target - The target to read data from.
+ *
+ * @param[in] i_eepromSource - The EEPROM source (CACHE/HARDWARE).
+ *
+ * @return errlHndl_t - NULL if successful, otherwise a pointer
+ * to the error log.
+ */
errlHndl_t getMemType(uint8_t& o_memType,
TARGETING::TargetHandle_t i_target,
- EEPROM::EEPROM_SOURCE i_location);
+ EEPROM::EEPROM_SOURCE i_eepromSource);
/**
* @param This function is a wrapper for reading the correct keyword.
diff --git a/src/usr/vpd/spd.C b/src/usr/vpd/spd.C
index 828f1c83b..09db1c497 100644
--- a/src/usr/vpd/spd.C
+++ b/src/usr/vpd/spd.C
@@ -118,13 +118,23 @@ const bool g_usePNOR = true;
*
* @param[in] i_dimmType - The DIMM to verify if valid
*
-* @return boolean - return true if given paramter is a known DIMM type,
+* @return boolean - return true if given parameter is a known DIMM type,
* false otherwise
*/
bool isValidDimmType ( uint8_t i_dimmType );
-//@TODO RTC 203788 doxygen
-bool isValidDimmType(uint8_t i_memType,
+/**
+ * @brief Determines if the given DIMM type is a known DIMM type or not by
+ * calling the correct isValidDimmType function for OCMB_SPD or SPD.
+ *
+ * @param[in] i_dimmType - The DIMM to verify if valid
+ *
+ * @param[in] i_eepromType - The eeprom content type of the DIMM
+ *
+ * @return boolean - return true if given paramter is a known DIMM type,
+ * false otherwise
+ */
+bool isValidDimmType(uint8_t i_dimmType,
TARGETING::EEPROM_CONTENT_TYPE i_eepromType);
@@ -145,15 +155,17 @@ bool isValidDimmType(uint8_t i_memType,
bool compareEntries ( const KeywordData e1,
const KeywordData e2 );
-// @TODO RTC 203788 update comment block
/**
* @brief This function will read the DIMM memory type.
*
- * @param[out] o_memType - The memory type value to return.
+ * @param[out] o_memType - The memory type value to return.
*
- * @param[in] i_target - The target to read data from.
+ * @param[in] i_target - The target to read data from.
*
- * @param[in] i_location - The SPD source (PNOR/SEEPROM).
+ * @param[in] i_location - The SPD source (PNOR/SEEPROM).
+ *
+ * @param[in] i_eepromSource - The EEPROM source (CACHE/HARDWARE).
+ * Default to AUTOSELECT.
*
* @return errlHndl_t - NULL if successful, otherwise a pointer
* to the error log.
@@ -163,23 +175,25 @@ errlHndl_t getMemType(uint8_t & o_memType,
VPD::vpdCmdTarget i_location,
EEPROM::EEPROM_SOURCE i_eepromSource = EEPROM::AUTOSELECT);
-// @TODO RTC 203788 update comment block
/**
- * @brief This function will read the DIMM memory type.
+ * @brief This function will read the DIMM memory type by calling the correct
+ * function given the eeprom content type.
*
- * @param[out] o_memType - The memory type value to return.
+ * @param[out] o_memType - The memory type value to return.
*
- * @param[in] i_target - The target to read data from.
+ * @param[in] i_target - The target to read data from.
*
- * @param[in] i_location - The SPD source (PNOR/SEEPROM).
+ * @param[in] i_eepromType - The Eeprom content type of the target.
+ *
+ * @param[in] i_eepromSource - The EEPROM source (CACHE/HARDWARE).
*
* @return errlHndl_t - NULL if successful, otherwise a pointer
* to the error log.
*/
-errlHndl_t getMemType(uint8_t & o_memType,
- TARGETING::Target * i_target,
+errlHndl_t getMemType(uint8_t & o_memType,
+ TARGETING::Target * i_target,
TARGETING::EEPROM_CONTENT_TYPE i_eepromType,
- EEPROM::EEPROM_SOURCE i_eepromSource);
+ EEPROM::EEPROM_SOURCE i_eepromSource);
/**
* @brief This function will read the DIMM module type.
@@ -2278,7 +2292,21 @@ void setPartAndSerialNumberAttributes( TARGETING::Target * i_target )
TRACSSCOMP(g_trac_spd, EXIT_MRK"spd.C::setPartAndSerialNumberAttributes()");
}
-// @TODO RTC 203788 Doxygen
+/*
+ * @brief Read keyword from SPD by determining which function to call based on
+ * eeprom content type.
+ *
+ * @param[in] i_target target to read data from
+ * @param[in] i_eepromType Eeprom content type of the target.
+ * @param[in] i_keyword keyword from spdenums.H to read
+ * @param[in] i_memType The memory type of this target.
+ * @param[in/out] io_buffer data buffer SPD will be written to
+ * @param[in/out] io_buflen length of the given data buffer
+ * @param[in] i_eepromSource The EEPROM source (CACHE/HARDWARE).
+ *
+ *
+ * @return errlHndl_t nullptr on success. Otherwise, error log.
+ */
errlHndl_t readFromEepromSource(TARGETING::Target* i_target,
TARGETING::EEPROM_CONTENT_TYPE i_eepromType,
const VPD::vpdKeyword i_keyword,
diff --git a/src/usr/vpd/spd.H b/src/usr/vpd/spd.H
index 6fb3658d7..f0e1a157b 100755
--- a/src/usr/vpd/spd.H
+++ b/src/usr/vpd/spd.H
@@ -508,7 +508,7 @@ errlHndl_t cmpPnorToSeeprom( TARGETING::Target * i_target,
bool &o_match );
/**
- * @brief This function compares value of the keyword in PNOR/SEEPROM
+ * @brief This function compares value of the keyword in CACHE/HARDWARE
* and returns the result
*
* @param[in] i_target - Target device
diff --git a/src/usr/vpd/vpd.C b/src/usr/vpd/vpd.C
index 24728c2b8..a9883eb37 100755
--- a/src/usr/vpd/vpd.C
+++ b/src/usr/vpd/vpd.C
@@ -673,6 +673,67 @@ errlHndl_t getPnAndSnRecordAndKeywords( TARGETING::Target * i_target,
return l_err;
}
+/**
+ * @brief This function compares the specified record/keyword in
+ * CACHE/HARDWARE by calling the correct function based on the
+ * target's eeprom content type and returns the result. A mismatch
+ * will not return an error.
+ *
+ * @param[in] i_target Target device
+ *
+ * @param[in] i_eepromType Eeprom content type for the target.
+ *
+ * @param[in] i_keyword Keyword to compare
+ *
+ * @param[in] i_record Record to compare
+ *
+ * @param[out] o_match Result of compare
+ *
+ * @return errlHndl_t NULL if successful, otherwise a pointer to the
+ * error log.
+ */
+errlHndl_t cmpEecacheToEeprom(TARGETING::Target * i_target,
+ TARGETING::EEPROM_CONTENT_TYPE i_eepromType,
+ vpdKeyword i_keyword,
+ vpdRecord i_record,
+ bool& o_match)
+{
+ errlHndl_t l_err = nullptr;
+
+ if ( (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_IBM_MVPD)
+ || (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_IBM_FRUVPD))
+ {
+ auto l_type = i_target->getAttr<TARGETING::ATTR_TYPE>();
+ IpVpdFacade* l_ipvpd = &(Singleton<MvpdFacade>::instance());
+
+ // If we have a NODE, use pvpd api
+ if(l_type == TARGETING::TYPE_NODE)
+ {
+ l_ipvpd = &(Singleton<PvpdFacade>::instance());
+ }
+
+ l_err = l_ipvpd->cmpEecacheToEeprom(i_target,
+ i_record,
+ i_keyword,
+ o_match);
+ }
+ else if ( (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_ISDIMM)
+ || (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_DDIMM))
+ {
+ l_err = SPD::cmpEecacheToEeprom(i_target,
+ i_eepromType,
+ i_keyword,
+ o_match);
+ }
+ else
+ {
+ assert(false, "Error, invalid EEPROM type passed to cmpEecacheToEeprom");
+ }
+
+ return l_err;
+}
+
+
// ------------------------------------------------------------------
// ensureEepromCacheIsInSync
// ------------------------------------------------------------------
@@ -688,23 +749,12 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
vpdKeyword l_keywordPN = 0;
vpdKeyword l_keywordSN = 0;
- TARGETING::TYPE l_type = i_target->getAttr<TARGETING::ATTR_TYPE>();
-
- //@TODO RTC 203788 Uncomment when used for IBM_MVPD and IBM_FRUVPD content
- // types.
-// IpVpdFacade* l_ipvpd = &(Singleton<MvpdFacade>::instance());
-//
-// // If we have a NODE, use pvpd api
-// if(l_type == TARGETING::TYPE_NODE)
-// {
-// l_ipvpd = &(Singleton<PvpdFacade>::instance());
-// }
-//
do
{
// Get the correct Part and serial numbers
l_err = getPnAndSnRecordAndKeywords(i_target,
- l_type,
+ i_target->
+ getAttr<TARGETING::ATTR_TYPE>(),
l_record,
l_keywordPN,
l_keywordSN);
@@ -718,27 +768,15 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
// Compare the Part Numbers in CACHE/HARDWARE
bool l_matchPN = false;
- if ( (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_IBM_MVPD)
- || (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_IBM_FRUVPD))
- {
- // @TODO: RTC 203788 Implement cmpEecacheToEeprom
- // l_err = l_ipvpd->cmpEecacheToEeprom(i_target,
- // l_record,
- // l_keywordPN,
- // l_matchPN);
- }
- else if ( (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_ISDIMM)
- || (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_DDIMM))
- {
- l_err = SPD::cmpEecacheToEeprom(i_target,
- i_eepromType,
- l_keywordPN,
- l_matchPN);
- }
+ l_err = cmpEecacheToEeprom(i_target,
+ i_eepromType,
+ l_keywordPN,
+ l_record,
+ l_matchPN);
if (l_err)
{
- TRACDCOMP(g_trac_vpd,ERR_MRK
+ TRACFCOMP(g_trac_vpd,ERR_MRK
"VPD::ensureEepromCacheIsInSync: "
"Error checking for CACHE/HARDWARE PN match");
break;
@@ -746,27 +784,17 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
// Compare the Serial Numbers in CACHE/HARDWARE
bool l_matchSN = false;
- if ( (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_IBM_MVPD)
- || (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_IBM_FRUVPD))
- {
- //@TODO RTC 203788: Implement for this case
- // l_err = l_ipvpd->cmpEecacheToEeprom(i_target,
- // l_record,
- // l_keywordSN,
- // l_matchSN);
- }
- else if ( (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_ISDIMM)
- || (i_eepromType == TARGETING::EEPROM_CONTENT_TYPE_DDIMM))
- {
- l_err = SPD::cmpEecacheToEeprom(i_target,
- i_eepromType,
- l_keywordSN,
- l_matchSN);
- }
+ l_err = cmpEecacheToEeprom(i_target,
+ i_eepromType,
+ l_keywordSN,
+ l_record,
+ l_matchSN);
if (l_err)
{
- TRACDCOMP(g_trac_vpd,ERR_MRK"VPD::ensureEepromCacheIsInSync: Error checking for CACHE/HARDWARE SN match");
+ TRACFCOMP(g_trac_vpd, ERR_MRK
+ "VPD::ensureEepromCacheIsInSync: Error checking for "
+ "CACHE/HARDWARE SN match");
break;
}
@@ -786,7 +814,8 @@ errlHndl_t ensureEepromCacheIsInSync(TARGETING::Target * i_target,
if (o_isInSync)
{
TRACFCOMP(g_trac_vpd,
- "VPD::ensureEepromCacheIsInSync: CACHE_PN/SN == HARDWARE_PN/SN for target %.8X",
+ "VPD::ensureEepromCacheIsInSync: "
+ "CACHE_PN/SN == HARDWARE_PN/SN for target %.8X",
TARGETING::get_huid(i_target));
}
else
OpenPOWER on IntegriCloud