Skip to content

Commit

Permalink
Callback for dropping Quad Atomic Lock
Browse files Browse the repository at this point in the history
HWP that can be called, either as a callback from an error XML file via the
collectFfdc tag or, called directly, to check and clear an atomic lock on the
cache chiplet to allow collection of CME FFDC register content (SCOM/RAM)

Change-Id: I221bf4b8d36a40c38acd930dfb0827e365b69eca
RTC: 172582
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41599
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian T. Vanderpool <vanderp@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41603
Reviewed-by: Hostboot Team <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>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
am10dolkar authored and dcrowell77 committed Jun 19, 2017
1 parent 2e7ac07 commit 9971669
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/import/chips/p9/procedures/hwp/ffdc/ffdc_includes.H
Expand Up @@ -33,4 +33,5 @@
#include <p9_collect_some_ffdc.H>
#include <p9_pib2pcb_mux_seq.H>
#include <p9_collect_ppe_state.H>
#include <p9_eq_clear_atomic_lock.H>
#endif
39 changes: 26 additions & 13 deletions src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.C
Expand Up @@ -32,54 +32,67 @@
/// *HWP Level : 2
/// *HWP Consumed by : SBE, HB

#include <hwp_error_info.H>
#include <p9_quad_scom_addresses.H>
#include <p9_quad_scom_addresses_fld.H>
#include <p9_eq_clear_atomic_lock.H>

extern "C"
{
#ifndef __PPE__
fapi2::ReturnCode
p9_eq_clear_atomic_lock ( const fapi2::ffdc_t& i_eq_target,
fapi2::ReturnCode& io_rc )
{
FAPI_INF (">> p9_eq_clear_atomic_lock");
#if 0
fapi2::ReturnCode l_rc;
fapi2::buffer<uint64_t> l_value;

// Note: Not using FAPI_TRY in FFDC callback context, as it can
// potentially reset the fapi2::current_err
// Note: No FFDC to be added to io_rc in this particular callback
// Note: No FFDC to be appended to io_rc in this callback
// leaving it here for the callback synxtax

fapi2::Target<fapi2::TARGET_TYPE_EQ> l_eq =
*(reinterpret_cast<const fapi2::Target<fapi2::TARGET_TYPE_EQ> *>
(i_eq_target.ptr()));

l_rc = fapi2::getScom (l_eq, EQ_ATOMIC_LOCK_REG, l_value);
// Note: Not using FAPI_TRY in FFDC callback context, as it can
// potentially reset the fapi2::current_err
l_rc = p9_clear_atomic_lock (l_eq);
return l_rc;
}
#endif

fapi2::ReturnCode
p9_clear_atomic_lock (const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_eq )
{
FAPI_INF (">> p9_clear_atomic_lock");
fapi2::ReturnCode l_rc;
fapi2::buffer<uint64_t> l_value;

// Note: Not using FAPI_TRY in FFDC callback context, as it can
// potentially reset the fapi2::current_err

l_rc = fapi2::getScom (i_eq, EQ_ATOMIC_LOCK_REG, l_value);

if ( (l_rc == fapi2::FAPI2_RC_SUCCESS) &&
(l_value.getBit<EQ_ATOMIC_LOCK_REG_ENABLE>() == 1))
{
// Pick the atomic lock if it was already taken
l_rc = fapi2::putScom (l_eq, EQ_ATOMIC_LOCK_REG, l_value);
l_rc = fapi2::putScom (i_eq, EQ_ATOMIC_LOCK_REG, l_value);

if (l_rc == fapi2::FAPI2_RC_SUCCESS)
{
l_value.flush<0>();
// Clear the atomic lock
l_rc = fapi2::putScom (l_eq, EQ_ATOMIC_LOCK_REG, l_value);
l_rc = fapi2::putScom (i_eq, EQ_ATOMIC_LOCK_REG, l_value);
}
}

if (l_rc != fapi2::FAPI2_RC_SUCCESS)
{
FAPI_ERR ("Could not clear eq atomic lock for FFDC");
FAPI_ERR ("Could not clear atomic lock");
}

#endif
FAPI_INF ("<< p9_eq_clear_atomic_lock");
return fapi2::FAPI2_RC_SUCCESS; // always return success
FAPI_INF ("<< p9_clear_atomic_lock");
return l_rc;
}
}

Expand Up @@ -43,19 +43,26 @@
#include <fapi2.H>
#include <error_info_defs.H>

#ifndef __PPE__
/// @typedef p9_eq_clear_atomic_lock_FP_t
/// function pointer typedef definition for HWP call support
typedef fapi2::ReturnCode (*p9_eq_clear_atomic_lock_FP_t) (
const fapi2::ffdc_t&,
fapi2::ReturnCode&
);
#endif

/// typedef p9_clear_atomic_lock_FP_t
/// function pointer typdef definition for HWP call support
typedef fapi2::ReturnCode (*p9_clear_atomic_lock_FP_t) (
const fapi2::Target<fapi2::TARGET_TYPE_EQ>& );

//------------------------------------------------------------------------------
// Function prototypes
//------------------------------------------------------------------------------
extern "C"
{

#ifndef __PPE__
/// @brief HWP to pick up the atomic lock on a cache chiplet to allow the
/// collection of CME FFDC register content (SCOM or RAM)
/// @param [in] i_eq_target TARGET_TYPE_EQ
Expand All @@ -64,7 +71,16 @@ extern "C"
fapi2::ReturnCode
p9_eq_clear_atomic_lock ( const fapi2::ffdc_t& i_eq_target,
fapi2::ReturnCode& io_rc );
#endif

/// @brief HWP to pick up the atomic lock on a cache chiplet to allow the
/// collection of CME FFDC register content (SCOM or RAM)
/// @param [in] i_eq EQ target on which the atomic lock should be released
/// @return FAPI2_RC_SUCCESS on success, else error code
/// @note Unlike the collectFfdc triggered callback, this is a direct HWP call
/// to support the SBE platform limitations
fapi2::ReturnCode
p9_clear_atomic_lock ( const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_eq );
} // extern C

#endif // __P9_EQ_CLEAR_ATOMIC_LOCK_H__

0 comments on commit 9971669

Please sign in to comment.