diff options
Diffstat (limited to 'src/usr/i2c/eepromCache.H')
-rw-r--r-- | src/usr/i2c/eepromCache.H | 157 |
1 files changed, 155 insertions, 2 deletions
diff --git a/src/usr/i2c/eepromCache.H b/src/usr/i2c/eepromCache.H index 5cad475ba..253367b07 100644 --- a/src/usr/i2c/eepromCache.H +++ b/src/usr/i2c/eepromCache.H @@ -97,10 +97,44 @@ errlHndl_t buildEepromRecordHeader(TARGETING::Target * i_target, eeprom_addr_t & io_eepromInfo, eepromRecordHeader & o_eepromRecordHeader); + +#ifndef __HOSTBOOT_RUNTIME + +/** +* +* @brief Check if entry already exists in g_cachedEeproms, if a match is +* found then return true. If there is no match, add it to the list +* and return false; +* +* @param[in] i_eepromRecordHeader Header for record we want to add to map +* +* @param[in] i_recordHeaderVaddr Virtual address to PNOR copy of header information +* +* @return TRUE if entry is already in map FALSE if this is a new entry +* +*/ +bool addEepromToCachedList(const eepromRecordHeader & i_eepromRecordHeader, + const uint64_t i_recordHeaderVaddr); + +/** +* +* @brief Perform a lookup on the global map g_cachedEeproms to get a +* virtual address for a given EEPROM entry in the EECACHE table of contents +* +* @param[in] i_eepromRecordHeader +* +* @pre It is expected that i_eepromRecordHeader has valid information for +* the uniqueID (i2cm_huid, port, engine, devAddr, mux_select) +* +* @return uint64_t virtual address pointing to the cached eeprom data in pnor +* +*/ +uint64_t lookupEepromHeaderAddr(const eepromRecordHeader& i_eepromRecordHeader); + /** * * @brief Perform a lookup on the global map g_cachedEeproms to get a -* virtual address for a given EEPROM +* virtual address for a given EEPROM cache entry * * @param[in] i_eepromRecordHeader * @@ -110,8 +144,127 @@ errlHndl_t buildEepromRecordHeader(TARGETING::Target * i_target, * @return uint64_t virtual address pointing to the cached eeprom data in pnor * */ -uint64_t lookupEepromAddr(const eepromRecordHeader & i_eepromRecordHeader); +uint64_t lookupEepromCacheAddr(const eepromRecordHeader& i_eepromRecordHeader); + +/** +* +* @brief Print the info found in the Table of Contents of the EECACHE +* section of pnor to trace buffer +* +* @return void +* +*/ +void printTableOfContents(void); + + +/** +* +* @brief Update the record entry in the Table of Contents of the EECACHE +* section of pnor to either mark the contents of the cache to be +* valid or invalid +* +* @param[in] i_target Target associated with EEPROM +* +* @param[in] i_eepromRole Role of EEPROM associated with target (VPD_PRIMARY etc) +* +* @param[in] i_isValid Mark eeprom cache valid or invalid ? +* +* @return errlHndl_t - nullptr if successful, otherwise a pointer to the +* error log. +* +*/ +errlHndl_t setIsValidCacheEntry(const TARGETING::Target * i_target, + const EEPROM_ROLE &i_eepromRole, + bool i_isValid); + +/** +* +* @brief Update the record entry in the Table of Contents of the EECACHE +* section of pnor to either mark the contents of the cache to be +* valid or invalid +* +* @param[in] i_eepromRecordHeader eepromRecord oject already filled in (including eepromRole) +* +* @param[in] i_isValid Mark eeprom cache valid or invalid ? +* +* @return errlHndl_t - nullptr if successful, otherwise a pointer to the +* error log. +* +*/ +errlHndl_t setIsValidCacheEntry(const eepromRecordHeader& i_eepromRecordHeader, bool i_isValid); + +/** +* +* @brief Lookup a given i_eepromRecordHeader in the global map of eeprom +* caches and check if the eeprom has changed this IPL or not +* +* @param[in] i_eepromRecordHeader we want to look up +* +* @return bool Return TRUE if eeprom is found in map AND mark_target_changed + was set to true for the eeprom entry. Return FALSE otherwise. +* +*/ +bool hasEeepromChanged(const eepromRecordHeader & i_eepromRecordHeader); + +/** +* +* @brief Lookup a given i_eepromRecordHeader in the global map of eeprom +* caches and mark that it has changed this IPL +* +* @param[in] i_eepromRecordHeader we want to mark as changed +* +* @return void +*/ +void setEeepromChanged(const eepromRecordHeader & i_eepromRecordHeader); +#else +/** +* +* @brief Check if entry already exists in g_cachedEeproms, if a match is +* found then return true. If there is no match, add it to the list +* and return false; +* +* @param[in] i_eepromRecordHeader Header for record we want to add to map +* +* @param[in] i_recordHeaderVaddr Virtual address to PNOR copy of header information +* +* @param[in] i_instance Node ID that this eeprom is on +* +* @return TRUE if entry is already in map FALSE if this is a new entry +* +*/ +bool addEepromToCachedList(const eepromRecordHeader & i_eepromRecordHeader, + const uint64_t i_recordHeaderVaddr, + const uint8_t i_instance); + +/** +* +* @brief Perform a lookup on the global map g_cachedEeproms to get a +* virtual address for a given EEPROM cache entry +* +* @param[in] i_eepromRecordHeader Header for record we want to add to lookup address for +* +* @param[in] i_isntance Node ID that this eeprom is on +* +* @pre It is expected that i_eepromRecordHeader has valid information for +* the uniqueID (i2cm_huid, port, engine, devAddr, mux_select) +* +* @return uint64_t virtual address pointing to the cached eeprom data in pnor +* +*/ +uint64_t lookupEepromCacheAddr(const eepromRecordHeader& i_eepromRecordHeader, + const uint8_t i_instance); + +/** +* +* @brief Walk through g_cachedEeproms map and print information about +* the cached eeproms found +* +* @return void +* +*/ +void printCurrentCachedEepromMap(void); +#endif // __HOSTBOOT_RUNTIME } #endif
\ No newline at end of file |