Skip to content

Commit

Permalink
L3 Level changes in p9_avbus_lib.C
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
prasrang authored and dcrowell77 committed Jul 17, 2017
1 parent 135432f commit 986dd16
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 53 deletions.
69 changes: 35 additions & 34 deletions src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.C
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
//##############################################################################
Expand Down Expand Up @@ -583,6 +583,7 @@ avsValidateResponse(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
}

fapi_try_exit:

return fapi2::current_err;

}
11 changes: 10 additions & 1 deletion src/import/chips/p9/procedures/hwp/lib/p9_avsbus_lib.H
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion src/import/hwpf/fapi2/include/return_code_defs.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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
};

}
Expand Down

0 comments on commit 986dd16

Please sign in to comment.