summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Raybuck <matthew.raybuck@ibm.com>2019-04-11 14:31:01 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-04-18 10:39:29 -0500
commit740541cdd9e0c49ffe3cc2b9f6268a26b308d2c8 (patch)
treeeb4240c28abfce3170ab032a08d574ee6955457b
parent1737cfb1a19dc9ce51e4497ad240f1f63949688d (diff)
downloadtalos-hostboot-740541cdd9e0c49ffe3cc2b9f6268a26b308d2c8.tar.gz
talos-hostboot-740541cdd9e0c49ffe3cc2b9f6268a26b308d2c8.zip
Infer presense detection of Explorer chip from VPD EEPROM
During presense detection the explorer chip is being held in reset. In this state it will not respond to any I2C operations and therefore we cannot physically detect the chip during normal presense detection. Instead we infer its presense based on the presense of the associated VPD EEPROM. Change-Id: Id07eb77fc9c3eab09e852b191ad4a32832880c38 RTC:203722 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75891 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@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: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/usr/i2c/i2cTargetPres.C64
1 files changed, 11 insertions, 53 deletions
diff --git a/src/usr/i2c/i2cTargetPres.C b/src/usr/i2c/i2cTargetPres.C
index 054091b1f..5e7fb5d3b 100644
--- a/src/usr/i2c/i2cTargetPres.C
+++ b/src/usr/i2c/i2cTargetPres.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -28,10 +28,12 @@
#include <vpd/vpd_if.H>
#include <i2c/i2cif.H>
#include <i2c/i2creasoncodes.H>
+#include <i2c/eepromif.H>
#include <initservice/initserviceif.H>
#include <errl/errlmanager.H>
#include "i2c_common.H"
+
extern trace_desc_t* g_trac_i2c;
//#define TRACSSCOMP(args...) TRACFCOMP(args)
@@ -219,62 +221,18 @@ errlHndl_t ocmbI2CPresencePerformOp(DeviceFW::OperationType i_opType,
int64_t i_accessType,
va_list i_args)
{
- bool l_ocmbPresent = 0;
- // Error log which will eventually be returned
- errlHndl_t l_returnedError = nullptr;
- // Useful if two errors occur, but we still want to return first one
- // from this function
errlHndl_t l_invalidateErrl = nullptr;
- l_returnedError = genericI2CTargetPresenceDetect(i_target,
- io_buflen,
- l_ocmbPresent);
+ // @TODO RTC 208696: Gemini vs Explorer Presence Detection via SPD
+ // This function will be updated to differentiate between Explorer and
+ // Gemini OCMB chips. For now, presense of an OCMB chip is inferred by
+ // the presense of the eeprom.
+ bool l_ocmbPresent = EEPROM::eepromPresence(i_target);
- if (l_returnedError)
- {
- TRACFCOMP( g_trac_i2c, ERR_MRK"ocmbI2CTargetPresenceDetect() "
- "Error detecting OCMB target 0x%.08X, io_buffer will not be set.",
- " Invalidating SPD cache for target in pnor. ",
- TARGETING::get_huid(i_target));
- }
- else
- {
- // Copy variable describing if target is present or not to i/o buffer param
- memcpy(io_buffer, &l_ocmbPresent, sizeof(l_ocmbPresent));
- io_buflen = sizeof(l_ocmbPresent);
- }
+ memcpy(io_buffer, &l_ocmbPresent, sizeof(l_ocmbPresent));
+ io_buflen = sizeof(l_ocmbPresent);
- // If OCMB was found to not be present, or an error occurred
- // while checking presence, invalidate the pnor cache of this
- // SPD data
- if(!l_ocmbPresent || l_returnedError)
- {
- // Invalidate the SPD in PNOR
- l_invalidateErrl = VPD::invalidatePnorCache(i_target);
-
- if (l_invalidateErrl)
- {
- TRACFCOMP( g_trac_i2c, ERR_MRK"ocmbI2CTargetPresenceDetect() "
- "Error invalidating SPD in PNOR for target 0x%.08X",
- TARGETING::get_huid(i_target));
- // If there was an error found while running genericI2CTargetPresenceDetect
- // then we want return that error and just link the error we found from
- // invalidatePnorCache and commit it right away. If this is the first error
- // we encounter then we will just return the error from invalidatePnorCache
- if(l_returnedError)
- {
- l_invalidateErrl->plid(l_returnedError->plid());
- errlCommit(l_invalidateErrl, I2C_COMP_ID);
- }
- else
- {
- l_returnedError = l_invalidateErrl;
- l_invalidateErrl = nullptr;
- }
- }
- }
-
- return l_returnedError;
+ return l_invalidateErrl;
}
/**
OpenPOWER on IntegriCloud