Skip to content

Commit

Permalink
IO Xbus Post Training Mfg Check
Browse files Browse the repository at this point in the history
- Added Mfg Min Eye Width Checking based upon
    attribute flag & min eye width value

Change-Id: I4099e20d1efb22fe51266567d7bc39c9fefbca8b
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29985
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Gary A. Peterson <garyp@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29987
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
steffenchris authored and dcrowell77 committed Mar 6, 2017
1 parent 28770d1 commit 336b646
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 80 deletions.
100 changes: 87 additions & 13 deletions src/import/chips/p9/procedures/hwp/io/p9_io_xbus_post_trainadv.C
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 @@ -52,13 +52,77 @@
// ----------------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------------

#include "p9_io_xbus_post_trainadv.H"
#include <p9_io_scom.H>
#include <p9_io_regs.H>

// ----------------------------------------------------------------------------
// Procedure Function
// ----------------------------------------------------------------------------


fapi2::ReturnCode getDebugInfo(
const fapi2::Target<fapi2::TARGET_TYPE_XBUS> i_tgt,
const uint8_t i_grp )
{
FAPI_IMP("Entering...");


FAPI_IMP("Exiting...");
return fapi2::current_err;
}

fapi2::ReturnCode checkEyeWidth(
const fapi2::Target<fapi2::TARGET_TYPE_XBUS> i_tgt,
const uint8_t i_grp )
{
FAPI_IMP("Entering...");

const uint32_t ONE_MS = 1000000; // 1,000,000ns = 1ms
const uint32_t DELAY_NS = 100 * ONE_MS; // Delay for 100ms
const uint32_t DELAY_CYCLES = 1; // We won't be using this feature in sim.
const uint8_t LN0 = 0;
uint64_t data64 = 0;
uint8_t minMfgEyeWidth = 0;
char tgt_str[fapi2::MAX_ECMD_STRING_LEN];

fapi2::toString(i_tgt, tgt_str, fapi2::MAX_ECMD_STRING_LEN);

// Get the minimum manufacturing eye width
FAPI_TRY( FAPI_ATTR_GET( fapi2::ATTR_IO_X_MFG_MIN_EYE_WIDTH, i_tgt, minMfgEyeWidth ) );

// We need to wait for each lane to get through recal before the historical eye
// width values will be valid. At 2ms per lane * 17 lanes = 34ms. To be safe
// we want this number to get through a few times. We will wait 100ms
FAPI_TRY(fapi2::delay(DELAY_NS, DELAY_CYCLES));


// Read the historical minimum eye width
FAPI_TRY( io::read( EDIP_RX_CTL_CNTL13_EO_PG, i_tgt, i_grp, LN0, data64 ),
"Reading EDI+ RX CTL CNTL13 EO PG Failed" );

FAPI_DBG( "tgt(%s:g%d) Min Eye Width(%d) Lane(%d) Valid(%d) :: MinMfgEyeWidth(%d)",
tgt_str, i_grp,
io::get( EDIP_RX_HIST_MIN_EYE_WIDTH , data64 ),
io::get( EDIP_RX_HIST_MIN_EYE_WIDTH_LANE , data64 ),
io::get( EDIP_RX_HIST_MIN_EYE_WIDTH_VALID, data64 ),
minMfgEyeWidth );

// Check if the historical eye width is less then the manufacturing minimum eye width
FAPI_ASSERT( ( io::get( EDIP_RX_HIST_MIN_EYE_WIDTH, data64 ) >= minMfgEyeWidth ),
fapi2::IO_XBUS_MFG_RX_EYE_WIDTH_FAILURE().set_TARGET( i_tgt ).set_GROUP( i_grp )
.set_EYE_WIDTH( io::get( EDIP_RX_HIST_MIN_EYE_WIDTH, data64 ) )
.set_EYE_WIDTH_LANE( io::get( EDIP_RX_HIST_MIN_EYE_WIDTH_LANE, data64 ) )
.set_EYE_WIDTH_VALID( io::get( EDIP_RX_HIST_MIN_EYE_WIDTH_VALID, data64 ) )
.set_MIN_EYE_WIDTH( minMfgEyeWidth ),
"I/O EDI+ Xbus Manufacturing Eye Width Failure." );


fapi_try_exit:
FAPI_IMP("Exiting...");
return fapi2::current_err;
}

/**
* @brief A simple HWP that runs after io_run_trainig.
* This function is called on every Xbus.
Expand All @@ -69,29 +133,39 @@
* @retval ReturnCode
*/
fapi2::ReturnCode p9_io_xbus_post_trainadv(
const fapi2::Target < fapi2::TARGET_TYPE_XBUS >& i_target,
const uint8_t& i_group,
const fapi2::Target < fapi2::TARGET_TYPE_XBUS >& i_ctarget,
const uint8_t& i_cgroup)
const fapi2::Target < fapi2::TARGET_TYPE_XBUS >& i_tgt,
const uint8_t& i_grp,
const fapi2::Target < fapi2::TARGET_TYPE_XBUS >& i_ctgt,
const uint8_t& i_cgrp)
{
FAPI_IMP("Entering...");
uint8_t l_status = 0x0;
char target_string[fapi2::MAX_ECMD_STRING_LEN];
char tgt_str[fapi2::MAX_ECMD_STRING_LEN];

fapi2::toString(i_tgt, tgt_str, fapi2::MAX_ECMD_STRING_LEN);

fapi2::toString(i_target, target_string, fapi2::MAX_ECMD_STRING_LEN);
FAPI_INF("Checking %s:g%d Post Link Training.", tgt_str, i_grp);

FAPI_INF("Checking %s:g%d Debug Status.", target_string, i_group);
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IO_X_DEBUG, i_target, l_status));
// Get Debug Info
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IO_X_DEBUG, i_tgt, l_status));

if(l_status == fapi2::ENUM_ATTR_IO_X_DEBUG_TRUE)
{
FAPI_INF("Debug True.");
FAPI_TRY( getDebugInfo( i_tgt, i_grp ) );
FAPI_TRY( getDebugInfo( i_ctgt, i_cgrp ) );
}
else

// Run Manufacturing Eye Width Check
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IO_X_MFG_CHK, i_tgt, l_status));

if(l_status == fapi2::ENUM_ATTR_IO_X_MFG_CHK_TRUE)
{
FAPI_INF("Debug False.");
FAPI_TRY( checkEyeWidth( i_tgt, i_grp ) );
FAPI_TRY( checkEyeWidth( i_ctgt, i_cgrp ) );
}



fapi_try_exit:
FAPI_IMP("Exiting...");
return fapi2::current_err;
Expand Down
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 @@ -53,6 +53,30 @@
<platInit/>
</attribute>
<!-- ********************************************************************** -->
<attribute>
<id>ATTR_IO_X_MFG_CHK</id>
<targetType>TARGET_TYPE_XBUS</targetType>
<description>
Indicate if manufacturing tests should be taken pre / post linktraining.
</description>
<valueType>uint8</valueType>
<enum>
FALSE = 0x0,
TRUE = 0x1
</enum>
<platInit/>
</attribute>
<!-- ********************************************************************** -->
<attribute>
<id>ATTR_IO_X_MFG_MIN_EYE_WIDTH</id>
<targetType>TARGET_TYPE_XBUS</targetType>
<description>
Minimum eye width to allow passing through manufacturing.
</description>
<valueType>uint8</valueType>
<platInit/>
</attribute>
<!-- ********************************************************************** -->
<attribute>
<id>ATTR_IO_XBUS_MASTER_MODE</id>
<targetType>TARGET_TYPE_XBUS</targetType>
Expand Down

This file was deleted.

@@ -1,11 +1,11 @@
<!-- IBM_PROLOG_BEGIN_TAG -->
<!-- This is an automatically generated prolog. -->
<!-- -->
<!-- $Source: src/import/chips/p9/procedures/xml/error_info/p9_io_xbus_linktrain_errors.xml $ -->
<!-- $Source: src/import/chips/p9/procedures/xml/error_info/p9_io_xbus_errors.xml $ -->
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2015,2016 -->
<!-- Contributors Listed Below - COPYRIGHT 2015,2017 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand All @@ -23,6 +23,73 @@
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
<hwpErrors>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_P9_XBUS_SCOMINIT_PARTIAL_GOOD_ERR</rc>
<ffdc>TARGET</ffdc>
<description>Partial good attribute state does not allow for action on
chiplet target.
</description>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
</hwpError>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_IO_XBUS_RX_DCCAL_TIMEOUT</rc>
<ffdc>GROUP</ffdc>
<ffdc>TARGET</ffdc>
<description>I/O EDI+ Xbus Rx Dccal(Offset calibration) Timeout</description>
<callout>
<target>TARGET</target>
<priority>MEDIUM</priority>
</callout>
<deconfigure>
<target>TARGET</target>
</deconfigure>
<gard>
<target>TARGET</target>
</gard>
</hwpError>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_IO_XBUS_RX_CLEANUP_PLL_NOT_LOCKED</rc>
<ffdc>GROUP</ffdc>
<ffdc>TARGET</ffdc>
<description>I/O EDI+ Xbus Rx Dccal Cleanup Pll Not Locked</description>
<callout>
<target>TARGET</target>
<priority>MEDIUM</priority>
</callout>
<deconfigure>
<target>TARGET</target>
</deconfigure>
<gard>
<target>TARGET</target>
</gard>
</hwpError>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_IO_XBUS_MFG_RX_EYE_WIDTH_FAILURE</rc>
<ffdc>TARGET</ffdc>
<ffdc>GROUP</ffdc>
<ffdc>EYE_WIDTH</ffdc>
<ffdc>EYE_WIDTH_LANE</ffdc>
<ffdc>EYE_WIDTH_VALID</ffdc>
<ffdc>MIN_EYE_WIDTH</ffdc>
<description>I/O EDI+ Xbus Rx Eye Width Failure</description>
<callout>
<target>TARGET</target>
<priority>MEDIUM</priority>
</callout>
<deconfigure>
<target>TARGET</target>
</deconfigure>
<gard>
<target>TARGET</target>
</gard>
</hwpError>
<!-- *********************************************************************** -->
<hwpError>
<rc>RC_IO_XBUS_NOT_MASTER</rc>
Expand Down Expand Up @@ -118,4 +185,6 @@
</gard>
</hwpError>
<!-- *********************************************************************** -->
</hwpErrors>
</hwpErrors>


9 changes: 9 additions & 0 deletions src/import/hwpf/fapi2/xml/attribute_info/hb_temp_defaults.xml
Expand Up @@ -123,6 +123,15 @@
<id>ATTR_EFF_RANK_GROUP_OVERRIDE</id>
<default>0x0</default>
</attribute>
<attribute>
<id>ATTR_IO_X_MFG_CHK</id>
<default>0x0</default>
</attribute>
<attribute>
<id>ATTR_IO_X_MFG_MIN_EYE_WIDTH</id>
<default>0x0</default>
</attribute>

<!-- =====================================================================
End of temporary definitions
================================================================= -->
Expand Down
36 changes: 36 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types.xml
Expand Up @@ -22986,6 +22986,42 @@ Measured in GB</description>
</hwpfToHbAttrMap>
</attribute>

<attribute>
<id>IO_X_MFG_CHK</id>
<!-- <targetType>TARGET_TYPE_XBUS</targetType> -->
<description>
Indicate if manufacturing tests should be taken pre / post linktraining.
FALSE = 0x0,
TRUE = 0x1
</description>
<simpleType>
<uint8_t></uint8_t>
</simpleType>
<persistency>volatile-zeroed</persistency>
<readable/>
<hwpfToHbAttrMap>
<id>ATTR_IO_X_MFG_CHK</id>
<macro>DIRECT</macro>
</hwpfToHbAttrMap>
</attribute>

<attribute>
<id>IO_X_MFG_MIN_EYE_WIDTH</id>
<!-- <targetType>TARGET_TYPE_XBUS</targetType> -->
<description>
Minimum eye width to allow passing through manufacturing.
</description>
<simpleType>
<uint8_t></uint8_t>
</simpleType>
<persistency>volatile-zeroed</persistency>
<readable/>
<hwpfToHbAttrMap>
<id>ATTR_IO_X_MFG_MIN_EYE_WIDTH</id>
<macro>DIRECT</macro>
</hwpfToHbAttrMap>
</attribute>

<attribute>
<id>IO_XBUS_MASTER_MODE</id>
<description>
Expand Down

0 comments on commit 336b646

Please sign in to comment.