Skip to content

Commit

Permalink
Add unmask_after_exp_omi_setup and FIR checks
Browse files Browse the repository at this point in the history
Adds FIR checks for BOOT_CONFIG_1 fails exp_omi_train
Adds disabled FIR checks for BOOT_CONFIG_0 fails until
FIR register availability is understood for that type of fail

Change-Id: Ice99fbf0f59ddb9cca809b9f70e39fa929a1ef16
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90851
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
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>
Dev-Ready: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/91575
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
stermole authored and dcrowell77 committed Feb 27, 2020
1 parent d348d7c commit 288f7ba
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 122 deletions.
Expand Up @@ -43,7 +43,7 @@
#include <lib/workarounds/exp_omi_workarounds.H>
#include <generic/memory/lib/utils/find.H>
#include <generic/memory/lib/utils/fir/gen_mss_unmask.H>
#include <lib/fir/exp_fir.H>
#include <generic/memory/lib/utils/fir/gen_mss_fir.H>

///
/// @brief Verify we know how to talk to the connected device
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -34,6 +34,7 @@
// *HWP Consumed by: Memory

#include <fapi2.H>
#include <lib/shared/exp_defaults.H>
#include <exp_omi_setup.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/exp_attribute_accessors_manual.H>
Expand All @@ -44,6 +45,8 @@
#include <generic/memory/lib/mss_generic_attribute_getters.H>
#include <generic/memory/lib/mss_generic_system_attribute_getters.H>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#include <generic/memory/lib/utils/fir/gen_mss_unmask.H>
#include <generic/memory/lib/utils/mss_generic_check.H>

extern "C"
{
Expand All @@ -56,6 +59,7 @@ extern "C"
fapi2::ReturnCode exp_omi_setup( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target)
{
mss::display_git_commit_info("exp_omi_setup");
fapi2::ReturnCode l_rc(fapi2::FAPI2_RC_SUCCESS);
uint8_t l_gem_menterp_workaround = 0;

// Declares variables
Expand All @@ -75,7 +79,17 @@ extern "C"
FAPI_TRY(mss::exp::i2c::boot_config(i_target, l_boot_config_data));

// Check FW status for success
FAPI_TRY(mss::exp::i2c::fw_status(i_target, mss::DELAY_1MS, 100));
l_rc = mss::exp::i2c::fw_status(i_target, mss::DELAY_1MS, 100);

// Note: It's still under discussion whether FIRs will be lit if BOOT_CONFIG_0 fails, and if
// the registers will be clocked so we can read them. Disabling FIR checking until this
// gets resolved.
#ifdef FIRS_AVAIL_AFTER_BOOT_CONFIG_0_FAIL
// If BOOT_CONFIG_0 failed or timed out, we need to check some FIRs
FAPI_TRY(mss::check::fir_or_pll_fail<mss::mc_type::EXPLORER>(i_target, l_rc));
#else
FAPI_TRY(l_rc, "%s BOOT_CONFIG_0 either failed or timed out", mss::c_str(i_target));
#endif

FAPI_TRY(mss::exp::workarounds::omi::gem_menterp(i_target, l_gem_menterp_workaround));

Expand Down Expand Up @@ -129,6 +143,9 @@ extern "C"
// Train mode 6 (state 3)
FAPI_TRY(mss::exp::workarounds::omi::pre_training_prbs(i_target));

// Unmask FIRs
FAPI_TRY(mss::unmask::after_mc_omi_setup<mss::mc_type::EXPLORER>(i_target));

fapi_try_exit:
return fapi2::current_err;
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -43,6 +43,7 @@
#include <generic/memory/mss_git_data_helper.H>
#include <generic/memory/lib/mss_generic_attribute_getters.H>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#include <generic/memory/lib/utils/mss_generic_check.H>

extern "C"
{
Expand All @@ -55,6 +56,7 @@ extern "C"
fapi2::ReturnCode exp_omi_train(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target)
{
mss::display_git_commit_info("exp_omi_train");
fapi2::ReturnCode l_rc(fapi2::FAPI2_RC_SUCCESS);

// Perform p9a workaround
// Train mode 1 (PATTERN_A)
Expand Down Expand Up @@ -82,7 +84,10 @@ extern "C"
if (l_ocmb_is_explorer)
{
// Explorer & P9A environment should see a busy status until auto train is kicked off from both sides
FAPI_TRY(mss::exp::i2c::check_fw_status_busy(i_target));
l_rc = mss::exp::i2c::check_fw_status_busy(i_target);

// If BOOT_CONFIG_1 failed or timed out, we need to check some FIRs
FAPI_TRY(mss::check::fir_or_pll_fail<mss::mc_type::EXPLORER>(i_target, l_rc));
}
else
{
Expand Down
122 changes: 122 additions & 0 deletions src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/fir/exp_fir.C
Expand Up @@ -22,3 +22,125 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */

///
/// @file exp_fir.C
/// @brief Memory subsystem FIR support
///
// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#include <fapi2.H>
#include <p9a_mc_scom_addresses.H>
#include <p9a_mc_scom_addresses_fld.H>
#include <p9a_mc_scom_addresses_fixes.H>
#include <p9a_mc_scom_addresses_fld_fixes.H>
#include <generic/memory/lib/utils/find.H>
#include <generic/memory/lib/utils/fir/gen_mss_fir.H>
#include <generic/memory/lib/utils/mss_generic_check.H>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#include <lib/fir/exp_fir_traits.H>

namespace mss
{

namespace check
{

// Declares FIR registers that are re-used between multiple functions
// Vectors of FIR and mask registers to read through
// As check_fir can be called in multiple places, we don't know what the mask may hold
// In order to tell if a FIR is legit or not, we read the FIR and check it against the mask reg
// Note: using a vector here in case we need to expand
static const std::vector<std::pair<uint64_t, uint64_t>> EXPLORER_FIR_REGS =
{
// Explorer LOCAL_FIR
{EXPLR_TP_MB_UNIT_TOP_LOCAL_FIR, EXPLR_TP_MB_UNIT_TOP_LOCAL_FIR_MASK},

// Explorer MC_OMI_FIR_REG
{EXPLR_DLX_MC_OMI_FIR_REG, EXPLR_DLX_MC_OMI_FIR_MASK_REG},
};

static const std::vector<std::pair<uint64_t, uint64_t>> MC_FIR_REGS =
{
// Axone MC_OMI_FIR_REG
{P9A_MC_REG0_OMI_FIR, P9A_MC_REG0_OMI_FIR_MASK},
};

static const std::vector<std::pair<uint64_t, uint64_t>> MCC_FIR_REGS =
{
// Axone DSTLFIR
{P9A_MCC_DSTLFIR, P9A_MCC_DSTLFIRMASK},
};

///
/// @brief Checks whether any FIRs have lit up on a target
/// @param[in] i_target - the target on which to operate
/// @param[in,out] io_rc - the return code for the function
/// @param[out] o_fir_error - true iff a FIR was hit
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
///
template< >
fapi2::ReturnCode bad_fir_bits<mss::mc_type::EXPLORER>( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
fapi2::ReturnCode& io_rc,
bool& o_fir_error )
{
const auto& l_mcc = mss::find_target<fapi2::TARGET_TYPE_MCC>(i_target);
const auto& l_mc = mss::find_target<fapi2::TARGET_TYPE_MC>(l_mcc);

// Start by assuming we do not have a FIR
o_fir_error = false;

// Loop, check the scoms, and check the FIR
// Note: we return out if any FIR is bad
for(const auto& l_fir_reg : EXPLORER_FIR_REGS)
{
FAPI_TRY(fir_with_mask<mss::mc_type::EXPLORER>(i_target, l_fir_reg, o_fir_error));

// Log the error if need be
log_fir_helper(i_target, o_fir_error, io_rc);

// Exit if we have found a FIR
if(o_fir_error)
{
return fapi2::FAPI2_RC_SUCCESS;
}
}

for(const auto& l_fir_reg : MC_FIR_REGS)
{
FAPI_TRY(fir_with_mask<mss::mc_type::EXPLORER>(l_mc, l_fir_reg, o_fir_error));

// Log the error if need be
log_fir_helper(l_mc, o_fir_error, io_rc);

// Exit if we have found a FIR
if(o_fir_error)
{
return fapi2::FAPI2_RC_SUCCESS;
}
}

for(const auto& l_fir_reg : MCC_FIR_REGS)
{
FAPI_TRY(fir_with_mask<mss::mc_type::EXPLORER>(l_mcc, l_fir_reg, o_fir_error));

// Log the error if need be
log_fir_helper(l_mcc, o_fir_error, io_rc);

// Exit if we have found a FIR
if(o_fir_error)
{
return fapi2::FAPI2_RC_SUCCESS;
}
}

fapi_try_exit:
return fapi2::current_err;
}

} // end check ns
} // end mss ns

This file was deleted.

0 comments on commit 288f7ba

Please sign in to comment.