diff options
author | Amit Tendolkar <amit.tendolkar@in.ibm.com> | 2017-06-12 08:06:53 -0500 |
---|---|---|
committer | AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> | 2017-06-30 13:13:17 -0400 |
commit | 904d0a5530c419697b32afb447ea7efa704252a7 (patch) | |
tree | b2d05d785e9acf83417754e8243c27c2acbb65be | |
parent | 11fa67b9093f9f1fcd9c1721682bd61637e11978 (diff) | |
download | talos-sbe-904d0a5530c419697b32afb447ea7efa704252a7.tar.gz talos-sbe-904d0a5530c419697b32afb447ea7efa704252a7.zip |
Dummy commit to enable mirroring new files from gerrit review 41599 into HB
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: I85dad65cf75f4b18e843d5e3ce06ff56230c33e1
RTC: 172582
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41681
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42654
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
-rw-r--r-- | src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.C | 85 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.H | 70 |
2 files changed, 155 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.C b/src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.C new file mode 100644 index 00000000..fa29ff1a --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.C @@ -0,0 +1,85 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.C $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// +/// @file p9_eq_clear_atomic_lock.C +/// +/// *HWP HW Owner : Greg Still <stillgs@us.ibm.com> +/// *HWP HW Backup Owner : Brian Vanderpool <vanderp@us.ibm.com> +/// *HWP FW Owner : Amit Tendolkar <amit.tendolkar@in.ibm.com> +/// *HWP Team : PM +/// *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" +{ + 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 + + 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); + + 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); + + 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); + } + } + + if (l_rc != fapi2::FAPI2_RC_SUCCESS) + { + FAPI_ERR ("Could not clear eq atomic lock for FFDC"); + } + +#endif + FAPI_INF ("<< p9_eq_clear_atomic_lock"); + return fapi2::FAPI2_RC_SUCCESS; // always return success + } +} + diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.H b/src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.H new file mode 100644 index 00000000..1c876581 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.H @@ -0,0 +1,70 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/ffdc/p9_eq_clear_atomic_lock.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// +/// @file p9_eq_clear_atomic_lock.H +/// @brief FFDC procedure to pick up the atomic lock on cache chiplet +// +/// +/// *HWP HW Owner : Greg Still <stillgs@us.ibm.com> +/// *HWP HW Backup Owner : Brian Vanderpool <vanderp@us.ibm.com> +/// *HWP FW Owner : Amit Tendolkar <amit.tendolkar@in.ibm.com> +/// *HWP Team : PM +/// *HWP Level : 2 +/// *HWP Consumed by : SBE, HB + +#ifndef __P9_EQ_CLEAR_ATOMIC_LOCK_H__ +#define __P9_EQ_CLEAR_ATOMIC_LOCK_H__ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <fapi2.H> +#include <error_info_defs.H> + +/// @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& +); + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ +extern "C" +{ + +/// @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 +/// @param [inout] io_rc Return code - unused +/// @return FAPI2_RC_SUCCESS Always succeeds + fapi2::ReturnCode + p9_eq_clear_atomic_lock ( const fapi2::ffdc_t& i_eq_target, + fapi2::ReturnCode& io_rc ); + +} // extern C + +#endif // __P9_EQ_CLEAR_ATOMIC_LOCK_H__ |