diff options
author | Prasad Bg Ranganath <prasadbgr@in.ibm.com> | 2017-07-03 04:06:20 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-07-17 14:50:51 -0400 |
commit | 986dd162063beef24cf9c28391ae19ead61a0116 (patch) | |
tree | ad172100e2e7f1f07aa876ec9d69746cecf8dc72 | |
parent | 135432fd65c9dae658be432a2749355d4c3c9de1 (diff) | |
download | talos-hostboot-986dd162063beef24cf9c28391ae19ead61a0116.tar.gz talos-hostboot-986dd162063beef24cf9c28391ae19ead61a0116.zip |
L3 Level changes in p9_avbus_lib.C
Change-Id: Ifc24ad797b27dce520e4bd921958e74aff2b1192
RTC:165492
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42702
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: BRIAN D. VICTOR <brian.d.victor1@ibm.com>
Reviewed-by: Brian T. Vanderpool <vanderp@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42705
Reviewed-by: Hostboot Team <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>
4 files changed, 72 insertions, 53 deletions
diff --git a/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.C b/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.C index 13d1f3af6..de914061f 100644 --- a/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.C +++ b/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.C @@ -237,6 +237,7 @@ avsPollVoltageTransDone(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& const uint8_t i_avsBusNum, const uint8_t i_o2sBridgeNum) { + fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS; fapi2::buffer<uint64_t> l_data64; uint8_t l_count = 0; @@ -260,11 +261,10 @@ avsPollVoltageTransDone(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& // Check for timeout condition if (l_count >= p9avslib::MAX_POLL_COUNT_AVS) { - - // @todo L3: Added Timeout FAPI2_SET_RC error point // This will set current_err to a non success value that can be // checked by the caller. - + l_rc = fapi2::FAPI2_RC_PLAT_AVSBUS_POLL_TIMEOUT; + fapi2::current_err = l_rc; } fapi_try_exit: @@ -283,7 +283,8 @@ avsDriveCommand(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, const uint32_t i_CmdType, const uint32_t i_CmdGroup, const uint32_t i_CmdDataType, - const uint32_t i_CmdData) + const uint32_t i_CmdData, + enum avsBusOpType i_opType) { fapi2::buffer<uint64_t> l_data64; @@ -343,6 +344,24 @@ avsDriveCommand(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, // Note: caller will check for the specific timeout return code. fapi_try_exit: + + if (fapi2::current_err == fapi2::FAPI2_RC_PLAT_AVSBUS_POLL_TIMEOUT) + { + FAPI_ASSERT(false, + fapi2::PROCPM_AVSBUS_VOLTAGE_TIMEOUT() + .set_CHIP_TARGET(i_target) + .set_AVSBUS_NUM(i_avsBusNum) + .set_AVSBUS_BRIDGE_NUM(i_o2sBridgeNum) + .set_AVSBUS_CMD_TYPE(i_CmdType) + .set_AVSBUS_CMD_GROUP(i_CmdGroup) + .set_AVSBUS_CMD_DATATYPE(i_CmdDataType) + .set_AVSBUS_RAILSELECT(i_RailSelect) + .set_AVSBUS_CMD_DATA(i_CmdData) + .set_CRC(l_crc) + .set_AVSBUS_OP_TYPE(i_opType), + "AVS bus driver command funciton fail"); + } + return fapi2::current_err; } @@ -384,16 +403,6 @@ avsVoltageRead(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, FAPI_INF("Voltage value read is %d mV", o_Voltage); - // @todo L3 insert SET_HWP_RC macro with FFDC - // FFDC: - // i_avsBusNum - // i_o2sBridgeNum, - // i_RailSelect, - // l_CmdType, - // l_CmdGroup - // l_CmdDataType - // O2S Registers (need to create in XML - fapi_try_exit: return fapi2::current_err; } @@ -424,16 +433,6 @@ avsVoltageWrite(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, l_CmdDataType, i_Voltage)); // @todo command data flow - // @todo L3 insert SET_HWP_RC macro with FFDC - // FFDC: - // i_avsBusNum - // i_o2sBridgeNum, - // i_RailSelect, - // l_CmdType, - // l_CmdGroup - // l_CmdDataType - // O2S Registers (need to create in XML) - fapi_try_exit: return fapi2::current_err; } @@ -469,17 +468,18 @@ avsIdleFrame(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, // Wait on o2s_ongoing = 0 FAPI_TRY(avsPollVoltageTransDone(i_target, i_avsBusNum, i_o2sBridgeNum)); - // @todo L3 insert SET_HWP_RC macro with FFDC - // FFDC: - // i_avsBusNum - // i_o2sBridgeNum, - // i_RailSelect, - // l_CmdType, - // l_CmdGroup - // l_CmdDataType - // O2S Registers (need to create in XML - fapi_try_exit: + + if (fapi2::current_err == fapi2::FAPI2_RC_PLAT_AVSBUS_POLL_TIMEOUT) + { + FAPI_ASSERT(false, + fapi2::PROCPM_AVSBUS_IDLEFRAME_TIMEOUT() + .set_CHIP_TARGET(i_target) + .set_AVSBUS_NUM(i_avsBusNum) + .set_AVSBUS_BRIDGE_NUM(i_o2sBridgeNum), + "AVS Idle frame funciton fail"); + } + return fapi2::current_err; } //############################################################################## @@ -583,6 +583,7 @@ avsValidateResponse(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, } fapi_try_exit: + return fapi2::current_err; } diff --git a/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.H b/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.H index e430c7854..0e05eefb0 100644 --- a/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.H +++ b/src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.H @@ -159,9 +159,17 @@ const uint32_t OCB_OIMR1_MASK_VALUES[2][2] = 0xFFFFFEFF //bit 24 }; +enum avsBusOpType +{ + NO_OP, + VLTG_READ_TYPE, + VLTG_WTITE_TYPE, +}; + //const uint64_t OCB_O2SST_MASK = 0x8000000000000000; } //end of p9avslib namespace +using namespace p9avslib; ///@brief Generates a 3 bit CRC value for 29 bit data ///@param[i] i_data @@ -216,7 +224,8 @@ avsDriveCommand(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, const uint32_t i_CmdType, const uint32_t i_CmdGroup, const uint32_t i_CmdDataType, - const uint32_t i_CmdData); + const uint32_t i_CmdData, + enum avsBusOpType i_opType = avsBusOpType::NO_OP); diff --git a/src/import/chips/p9/procedures/xml/error_info/p9_avsbus_lib_errors.xml b/src/import/chips/p9/procedures/xml/error_info/p9_avsbus_lib_errors.xml index 07c484c87..6bedd41dd 100644 --- a/src/import/chips/p9/procedures/xml/error_info/p9_avsbus_lib_errors.xml +++ b/src/import/chips/p9/procedures/xml/error_info/p9_avsbus_lib_errors.xml @@ -32,27 +32,33 @@ <!-- Error definitions for p9_avsbus_lib procedure --> <hwpErrors> <!-- ******************************************************************** --> - <hwpError> - <rc>RC_PROCPM_AVSBUS_READVOLTAGE_TIMEOUT</rc> + <hwpError> + <rc>RC_PROCPM_AVSBUS_VOLTAGE_TIMEOUT</rc> <description> - A timeout occured reading voltage from an AVSBus interface - </description> - </hwpError> - <!-- ******************************************************************** --> - <hwpError> - <rc>RC_PROCPM_AVSBUS_WRITEVOLTAGE_TIMEOUT</rc> - <description> - A timeout occured writing a voltage to an AVSBus interface - </description> - </hwpError> - <!-- ******************************************************************** --> - <hwpError> + A timeout occured reading/writing voltage from an AVSBus + interface + </description> + <ffdc>CHIP_TARGET</ffdc> + <ffdc>AVSBUS_NUM</ffdc> + <ffdc>AVSBUS_BRIDGE_NUM</ffdc> + <ffdc>AVSBUS_CMD_TYPE</ffdc> + <ffdc>AVSBUS_CMD_GROUP</ffdc> + <ffdc>AVSBUS_CMD_DATATYPE</ffdc> + <ffdc>AVSBUS_RAILSELECT</ffdc> + <ffdc>AVSBUS_CMD_DATA</ffdc> + <ffdc>CRC</ffdc> + <ffdc>AVSBUS_OP_TYPE</ffdc> + </hwpError> + <!-- ********************************************************************--> + <hwpError> <rc>RC_PROCPM_AVSBUS_IDLEFRAME_TIMEOUT</rc> <description> A timeout occured writing an idle from to an AVSBus interface - </description> - </hwpError> - + </description> + <ffdc>CHIP_TARGET</ffdc> + <ffdc>AVSBUS_NUM</ffdc> + <ffdc>AVSBUS_BRIDGE_NUM</ffdc> + </hwpError> <!-- ******************************************************************** --> <hwpError> <rc>RC_PM_AVSBUS_ZERO_RESP_ERROR</rc> diff --git a/src/import/hwpf/fapi2/include/return_code_defs.H b/src/import/hwpf/fapi2/include/return_code_defs.H index 7f587aff0..205cd6454 100644 --- a/src/import/hwpf/fapi2/include/return_code_defs.H +++ b/src/import/hwpf/fapi2/include/return_code_defs.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -114,6 +114,9 @@ enum ReturnCodes : uint32_t FAPI2_RC_PLAT_RS4_HEADER_DATA_INVALID = FAPI2_RC_PLAT_MASK | 0x06, //Operation on putring fail because of ringId not found in RS4 image + // + FAPI2_RC_PLAT_AVSBUS_POLL_TIMEOUT = FAPI2_RC_PLAT_MASK | 0x06, + //Operation on putring fail because of ringId not found in RS4 image }; } |