diff options
author | Christian Geddes <crgeddes@us.ibm.com> | 2019-10-16 10:10:34 -0500 |
---|---|---|
committer | William G Hoffa <wghoffa@us.ibm.com> | 2019-11-01 15:41:41 -0500 |
commit | 632582f105da7a546708c4f9705761948d7688fa (patch) | |
tree | f76238e3071d6d7b39459b17eb83796aca6c95a1 /src/usr/hwas/common/hwas.C | |
parent | 3f41702fbfd6a5c4f4de9eabedf1d8acb801ae20 (diff) | |
download | talos-hostboot-632582f105da7a546708c4f9705761948d7688fa.tar.gz talos-hostboot-632582f105da7a546708c4f9705761948d7688fa.zip |
Allow dynmic i2c device addresses and set up PMIC targets to do this
Depending on which vendor made a given OCMB the i2c device address
of the PMIC targets on the OCMB will be different. To account for this
we have added a new DYNAMIC_DEVICE_ADDRESS attribute. This attribute
is filled out on the PMIC target by looking at the SPD on parent
OCMB chip. This means that we must do presence detection on the OCMB
prior to the the PMIC targets. While doing i2c operations if a given
target has the DYNAMIC_DEVICE_ADDRESS we will use that over the devAddr
in the any complex i2c attribute for that target.
Change-Id: I22a185a65c064a1514751dd5828547c57af98df1
RTC: 209714
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/85394
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: William G Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/hwas/common/hwas.C')
-rw-r--r-- | src/usr/hwas/common/hwas.C | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index 8498b12b7..9464e59c9 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -569,6 +569,59 @@ errlHndl_t discoverMuxTargetsAndEnable(const Target &i_sysTarget) return l_err; } +/** + * @brief Do presence detect on only PMIC targets and enable HWAS state + * + * @param[in] i_sysTarget the top level target (CLASS_SYS) + * @return errlHndl_t return nullptr if no error, + * else return a handle to an error entry + * + */ +errlHndl_t discoverPmicTargetsAndEnable(const Target &i_sysTarget) +{ + HWAS_INF(ENTER_MRK"discoverPmicTargetsAndEnable"); + + errlHndl_t l_err{nullptr}; + + do + { + // Only get PMIC targets + const PredicateCTM l_pmicPred(CLASS_ASIC, TYPE_PMIC); + TARGETING::PredicatePostfixExpr l_asicPredExpr; + l_asicPredExpr.push(&l_pmicPred); + TargetHandleList l_pPmicCheckPres; + targetService().getAssociated( l_pPmicCheckPres, (&i_sysTarget), + TargetService::CHILD, TargetService::ALL, &l_asicPredExpr); + + // Do the presence detect on only PMIC targets + // NOTE: this function will remove any non-functional targets + // from pPmicCheckPres + l_err = platPresenceDetect(l_pPmicCheckPres); + + // If an issue with platPresenceDetect, then exit, returning + // error back to caller + if (nullptr != l_err) + { + break; + } + + // Enable the HWAS State for the PMICs + const bool l_present(true); + const bool l_functional(true); + const uint32_t l_errlEid(0); + for (TargetHandle_t pTarget : l_pPmicCheckPres) + { + // set HWAS state to show PMIC is present and functional + enableHwasState(pTarget, l_present, l_functional, l_errlEid); + } + } while (0); + + HWAS_INF(EXIT_MRK"discoverPmicTargetsAndEnable exit with %s", + (nullptr == l_err ? "no error" : "error")); + + return l_err; +} + errlHndl_t discoverTargets() { HWAS_DBG("discoverTargets entry"); @@ -643,11 +696,13 @@ errlHndl_t discoverTargets() PredicateCTM predPmic(CLASS_ASIC, TYPE_PMIC); // We can ignore chips of TYPE_I2C_MUX because they // were already detected above in discoverMuxTargetsAndEnable + // Also we can ignore chips of type PMIC because they will be processed + // below. PredicateCTM predMux(CLASS_CHIP, TYPE_I2C_MUX); PredicatePostfixExpr checkExpr; checkExpr.push(&predChip).push(&predDimm).Or().push(&predEnc).Or(). - push(&predMcs).Or().push(&predPmic).Or(). - push(&predMux).Not().And(); + push(&predMcs).Or().push(&predMux).Not().And(). + push(&predPmic).Not().And(); TargetHandleList pCheckPres; targetService().getAssociated( pCheckPres, pSys, @@ -865,6 +920,16 @@ errlHndl_t discoverTargets() } // for pTarget_it + // After processing all other targets look at the pmics, + // we must wait because we need the SPD cached from the OCMBs + // which occurs when OCMBs go through presence detection above + errl = discoverPmicTargetsAndEnable(*pSys); + + if (errl != NULL) + { + break; // break out of the do/while so that we can return + } + // Check for non-present Procs and if found, trigger // DeconfigGard::_invokeDeconfigureAssocProc() to run by setting // setXAOBusEndpointDeconfigured to true |