Skip to content

Commit

Permalink
Always update EECACHE header when we find a new eeprom entry
Browse files Browse the repository at this point in the history
The plan of this caching algorithm is to make a cache entry for
every OCMB/DIMM, Proc, and Node eeprom that we detect in the XML.
We will only copy the contents of the EEPROM if the target is found
to be present, but we still must make header entries in for targets
that are not present.

Change-Id: I46328b84f7095eec9df7abb2f40b0d11ed0c4324
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81192
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Glenn Miles <milesg@ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Aug 1, 2019
1 parent b3043ae commit 7e05c2e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/usr/i2c/eepromCache.C
Expand Up @@ -102,6 +102,9 @@ errlHndl_t cacheEeprom(TARGETING::Target* i_target,
bool l_updateHeader = true;
bool l_updateContents = true;

// Initially assume this is a new eeprom cache entry
bool l_newEntryDetected = true;

do{
// eepromReadAttributes keys off the eepromRole value
// to determine what attribute to lookup to get eeprom info
Expand Down Expand Up @@ -222,6 +225,9 @@ errlHndl_t cacheEeprom(TARGETING::Target* i_target,
if( memcmp(l_recordHeaderToUpdate, &l_eepromRecordHeader, NUM_BYTE_UNIQUE_ID ) == 0 )
{
l_recordHeaderToUpdateIndex = i;
// We have matched with existing eeprom in the PNOR's EECACHE
// section. So we know this is not a new entry.
l_newEntryDetected = false;

if( l_recordHeaderToUpdate->completeRecord.cache_copy_size != l_eepromRecordHeader.completeRecord.cache_copy_size)
{
Expand Down Expand Up @@ -414,16 +420,15 @@ errlHndl_t cacheEeprom(TARGETING::Target* i_target,
else if(!i_present)
{
// If the target is not present, then do not update contents
// or header
l_updateContents = false;
l_updateHeader = false;
// Only update header if this is a new entry
l_updateHeader = l_newEntryDetected;
}
// The check below makes sure that is isnt a new entry, because
// new entries do not have internal_offset set in header.
// The check below makes sure that is isnt a new entry
// If there is a matching header entry in PNOR marked 'invalid'
// but we now see the target as present, this indicates a replacement
// part has been added where a part was removed
else if(l_recordHeaderToUpdate->completeRecord.internal_offset != UNSET_INTERNAL_OFFSET_VALUE)
else if(!l_newEntryDetected)
{
TRACFCOMP(g_trac_eeprom, "cacheEeprom() Detected replacement of a part"
" Master 0x%.08X Engine 0x%.02X"
Expand Down Expand Up @@ -953,4 +958,4 @@ uint64_t lookupEepromHeaderAddr(const eepromRecordHeader& i_eepromRecordHeader)
return l_vaddr;
}

}
}

0 comments on commit 7e05c2e

Please sign in to comment.