diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2019-03-15 16:33:27 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-04-18 16:34:18 -0500 |
commit | 16cf78fed03ff0426cd7885c935a711541f329a1 (patch) | |
tree | 398e8f2682cbdf5dfb129cd987d2142779eecebb /src/usr/i2c | |
parent | 625a082c5e39460925c868a6ae27233fecc029dd (diff) | |
download | talos-hostboot-16cf78fed03ff0426cd7885c935a711541f329a1.tar.gz talos-hostboot-16cf78fed03ff0426cd7885c935a711541f329a1.zip |
Add new PMIC target for Axone
PMIC is a voltage regulator for the DDIMM.
It supplies power to the OCMB and DIMM targets.
Change-Id: I10c1b03169f53b070f521ec9cd60cdbd15c4a268
RTC:206184
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75136
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Glenn Miles <milesg@ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/i2c')
-rwxr-xr-x | src/usr/i2c/i2c.C | 123 | ||||
-rw-r--r-- | src/usr/i2c/i2cTargetPres.C | 6 |
2 files changed, 79 insertions, 50 deletions
diff --git a/src/usr/i2c/i2c.C b/src/usr/i2c/i2c.C index ff8629010..63b579202 100755 --- a/src/usr/i2c/i2c.C +++ b/src/usr/i2c/i2c.C @@ -1134,7 +1134,8 @@ void i2cSetSwitches( TARGETING::Target * i_target, // i2cGetI2cMuxTarget // ------------------------------------------------------------------ errlHndl_t i2cGetI2cMuxTarget ( const TARGETING::EntityPath & i_i2cMuxPath, - TARGETING::Target * &o_target ) + TARGETING::Target * &o_target, + bool i_noError ) { errlHndl_t l_err(nullptr); @@ -1155,34 +1156,37 @@ errlHndl_t i2cGetI2cMuxTarget ( const TARGETING::EntityPath & i_i2cMuxPath, if ( nullptr == o_target ) { - TRACFCOMP( g_trac_i2c, - ERR_MRK "i2cGetI2cMuxTarget() - I2C MUX Entity Path (%s)" - " could not be converted to a target.", - l_muxPath ); + if (!i_noError) + { + TRACFCOMP( g_trac_i2c, + ERR_MRK "i2cGetI2cMuxTarget() - I2C MUX Entity Path (%s)" + " could not be converted to a target.", + l_muxPath ); - /*@ - * @errortype - * @reasoncode I2C_MUX_TARGET_NOT_FOUND - * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE - * @moduleid I2C_ACCESS_MUX - * @devdesc I2C mux path target is null - * @custdesc Unexpected boot firmware error - */ - l_err = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - I2C_ACCESS_MUX, - I2C_MUX_TARGET_NOT_FOUND, - 0, - 0, - ERRORLOG::ErrlEntry::ADD_SW_CALLOUT ); + /*@ + * @errortype + * @reasoncode I2C_MUX_TARGET_NOT_FOUND + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid I2C_ACCESS_MUX + * @devdesc I2C mux path target is null + * @custdesc Unexpected boot firmware error + */ + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + I2C_ACCESS_MUX, + I2C_MUX_TARGET_NOT_FOUND, + 0, + 0, + ERRORLOG::ErrlEntry::ADD_SW_CALLOUT ); - // Collect the MUX entity path info - ERRORLOG::ErrlUserDetailsString(l_muxPath).addToLog(l_err); + // Collect the MUX entity path info + ERRORLOG::ErrlUserDetailsString(l_muxPath).addToLog(l_err); - l_err->collectTrace( I2C_COMP_NAME, 256); + l_err->collectTrace( I2C_COMP_NAME, 256); - break; + break; + } } // Is the target functional @@ -1192,31 +1196,34 @@ errlHndl_t i2cGetI2cMuxTarget ( const TARGETING::EntityPath & i_i2cMuxPath, !l_hwasState.present || !l_hwasState.functional ) { - TRACFCOMP( g_trac_i2c, - ERR_MRK "i2cGetI2cMuxTarget() - I2C MUX target (0x%X) " - "is non functional.", - TARGETING::get_huid(o_target) ); - /*@ - * @errortype - * @reasoncode I2C_MUX_TARGET_NON_FUNCTIONAL - * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE - * @moduleid I2C_ACCESS_MUX - * @userdata1 I2C MUX Target Huid - * @devdesc I2C mux path target is not functional - * @custdesc Unexpected boot firmware error - */ - l_err = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - I2C_ACCESS_MUX, - I2C_MUX_TARGET_NON_FUNCTIONAL, - TARGETING::get_huid(o_target), - 0, - ERRORLOG::ErrlEntry::ADD_SW_CALLOUT ); - - // Collect the MUX entity path info - ERRORLOG::ErrlUserDetailsString(l_muxPath).addToLog(l_err); - - l_err->collectTrace( I2C_COMP_NAME, 256); + if (!i_noError) + { + TRACFCOMP( g_trac_i2c, + ERR_MRK "i2cGetI2cMuxTarget() - I2C MUX target (0x%X) " + "is non functional.", + TARGETING::get_huid(o_target) ); + /*@ + * @errortype + * @reasoncode I2C_MUX_TARGET_NON_FUNCTIONAL + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid I2C_ACCESS_MUX + * @userdata1 I2C MUX Target Huid + * @devdesc I2C mux path target is not functional + * @custdesc Unexpected boot firmware error + */ + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + I2C_ACCESS_MUX, + I2C_MUX_TARGET_NON_FUNCTIONAL, + TARGETING::get_huid(o_target), + 0, + ERRORLOG::ErrlEntry::ADD_SW_CALLOUT ); + + // Collect the MUX entity path info + ERRORLOG::ErrlUserDetailsString(l_muxPath).addToLog(l_err); + + l_err->collectTrace( I2C_COMP_NAME, 256); + } // Don't return a non functional target o_target = nullptr; @@ -1264,7 +1271,7 @@ errlHndl_t i2cAccessMux( TARGETING::Target* i_masterTarget, TARGETING::TargetHandle_t l_i2cMuxTarget(nullptr); l_err = i2cGetI2cMuxTarget( i_i2cMuxPath, - l_i2cMuxTarget); + l_i2cMuxTarget, false); // If an issue getting the MUX target, then return error if (l_err) @@ -2278,6 +2285,22 @@ bool i2cPresence( TARGETING::Target * i_target, // Set the MUX selector (if there is one) for the MUX before continuing if (I2C_MUX::NOT_APPLICABLE != i_i2cMuxBusSelector) { + // Check that Mux exists first + TARGETING::TargetHandle_t l_i2cMuxTarget(nullptr); + + bool noError = true; // just return nullptr target if mux doesn't exist + err = i2cGetI2cMuxTarget( i_i2cMuxPath, + l_i2cMuxTarget, + noError ); + if (err || (l_i2cMuxTarget == nullptr)) + { + // exit early if mux does not exist + TRACFCOMP(g_trac_i2c, + ERR_MRK"i2cPresence() - XML appears to be wrong since " + "i2cMuxSelector 0x%02X != NOT_APPLICABLE for non-existent " + "I2C MUX target", i_i2cMuxBusSelector); + break; + } err = i2cAccessMux(i_target, i_i2cMuxBusSelector, i_i2cMuxPath ); if ( err ) diff --git a/src/usr/i2c/i2cTargetPres.C b/src/usr/i2c/i2cTargetPres.C index 5e7fb5d3b..c3809f099 100644 --- a/src/usr/i2c/i2cTargetPres.C +++ b/src/usr/i2c/i2cTargetPres.C @@ -295,4 +295,10 @@ DEVICE_REGISTER_ROUTE( DeviceFW::READ, TARGETING::TYPE_I2C_MUX, basicI2CPresencePerformOp ); +// Register the pmic vrm presence detect function with the device framework +DEVICE_REGISTER_ROUTE( DeviceFW::READ, + DeviceFW::PRESENT, + TARGETING::TYPE_PMIC, + basicI2CPresencePerformOp ); + } |