diff options
author | Amit Tendolkar <amit.tendolkar@in.ibm.com> | 2017-05-05 07:23:01 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-06-11 16:50:46 -0400 |
commit | 6da5b41be5353e1b5fb1f3e6cda73c1ad1650041 (patch) | |
tree | f266ee8f50c7a9c9d7e1a6b5ee1f291517ac401c /src/import/chips/p9/procedures/hwp/ffdc | |
parent | c22f7447d7f0b0b3bee7e9e45fb813a1937a7a15 (diff) | |
download | talos-hostboot-6da5b41be5353e1b5fb1f3e6cda73c1ad1650041.tar.gz talos-hostboot-6da5b41be5353e1b5fb1f3e6cda73c1ad1650041.zip |
Base infra for PM FFDC extraction of PPE state
Allows a HWP to callback into the p9_ppe_state
via FAPI return code using the collectFfdc error
xml tag, such that the PPE state registers get
added as FFDC to the return code
Change-Id: If1c7804fb8d04ba2b8d5939f111f6d7cbb7e4443
RTC: 163327
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40139
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Brian T. Vanderpool <vanderp@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40142
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/ffdc')
4 files changed, 235 insertions, 1 deletions
diff --git a/src/import/chips/p9/procedures/hwp/ffdc/ffdc_includes.H b/src/import/chips/p9/procedures/hwp/ffdc/ffdc_includes.H index d86ddf37c..d5b4480f9 100644 --- a/src/import/chips/p9/procedures/hwp/ffdc/ffdc_includes.H +++ b/src/import/chips/p9/procedures/hwp/ffdc/ffdc_includes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -32,4 +32,5 @@ #include <p9_collect_some_ffdc.H> #include <p9_pib2pcb_mux_seq.H> +#include <p9_collect_ppe_state.H> #endif diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.C b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.C new file mode 100644 index 000000000..194e00d34 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.C @@ -0,0 +1,132 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.C $ */ +/* */ +/* OpenPOWER HostBoot 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_collect_ppe_state.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 : 3 +/// *HWP Consumed by : HB + + +#include <fapi2.H> +#include <hwp_error_info.H> +#include <p9_const_common.H> + +#include <p9_collect_ppe_state.H> +#include <p9_ppe_state.H> + +extern "C" +{ + fapi2::ReturnCode + p9_collect_ppe_state ( const fapi2::ffdc_t& i_target, + const fapi2::ffdc_t& i_v_ppe_addresses, + fapi2::ReturnCode& o_rc ) + { + FAPI_INF (">> p9_collect_ppe_state"); + fapi2::ReturnCode l_rc; + + fapi2::ffdc_t PPE_REG_NR; + fapi2::ffdc_t PPE_REG_VAL; + + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_proc_chip = + *(reinterpret_cast<const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> *> + (i_target.ptr())); + + std::vector<uint64_t> l_ppe_addresses = + *(reinterpret_cast<const std::vector<uint64_t>*> + (i_v_ppe_addresses.ptr())); + + + PPE_DUMP_MODE l_mode = SNAPSHOT; // halt & restart PPE engine, if needed + + std::vector<PPERegValue_t> l_v_sprs; + std::vector<PPERegValue_t> l_v_xirs; + std::vector<PPERegValue_t> l_v_gprs; + + for (auto& it1 : l_ppe_addresses ) + { + fapi2::ReturnCode l_rc_tmp = fapi2::current_err; + + FAPI_INF ("p9_collect_ppe_state: PPE Base Addr 0x%.16llX, 0x%.8X", + it1, l_mode); + FAPI_EXEC_HWP (l_rc, p9_ppe_state, l_proc_chip, it1, l_mode, + l_v_sprs, l_v_xirs, l_v_gprs); + + // Ignore l_rc and continue adding whatever was collected + + // @TODO via RTC: 175232 + // Restore current_err to what was passed in + fapi2::current_err = l_rc_tmp; + + FAPI_INF ("Adding PPE Addr: 0x%.16llX, SPRs: %d XIRs: %d GPRs: %d", + it1, l_v_sprs.size(), l_v_xirs.size(), l_v_gprs.size()); + + for (auto& it : l_v_sprs) + { + PPE_REG_NR.ptr() = static_cast<void*>(&it.number); + PPE_REG_NR.size() = sizeof (it.number); + + PPE_REG_VAL.ptr() = static_cast<void*>(&it.value); + PPE_REG_VAL.size() = sizeof (it.value); + + FAPI_ADD_INFO_TO_HWP_ERROR (o_rc, RC_PPE_STATE_DATA_SPR); + } + + l_v_sprs.clear(); + + for (auto& it : l_v_xirs) + { + PPE_REG_NR.ptr() = static_cast<void*>(&it.number); + PPE_REG_NR.size() = sizeof (it.number); + + PPE_REG_VAL.ptr() = static_cast<void*>(&it.value); + PPE_REG_VAL.size() = sizeof (it.value); + + FAPI_ADD_INFO_TO_HWP_ERROR (o_rc, RC_PPE_STATE_DATA_XIR); + } + + l_v_xirs.clear(); + + for (auto& it : l_v_gprs) + { + PPE_REG_NR.ptr() = static_cast<void*>(&it.number); + PPE_REG_NR.size() = sizeof (it.number); + + PPE_REG_VAL.ptr() = static_cast<void*>(&it.value); + PPE_REG_VAL.size() = sizeof (it.value); + + FAPI_ADD_INFO_TO_HWP_ERROR (o_rc, RC_PPE_STATE_DATA_GPR); + } + + l_v_gprs.clear (); + } + + FAPI_INF ("<< p9_collect_ppe_state"); + return fapi2::FAPI2_RC_SUCCESS; // always return success + } +} diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.H b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.H new file mode 100644 index 000000000..109d3929f --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.H @@ -0,0 +1,74 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.H $ */ +/* */ +/* OpenPOWER HostBoot 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_collect_ppe_state.H +/// @brief FFDC procedure to dump a PPE engine's state to the return code +// object passed by the user. +/// +/// *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 : 3 +/// *HWP Consumed by : HB + +#ifndef __P9_COLLECT_PPE_STATE_H__ +#define __P9_COLLECT_PPE_STATE_H__ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <return_code.H> +#include <error_info_defs.H> + +/// @typedef p9_collect_ppe_state_FP_t +/// function pointer typedef definition for HWP call support +typedef fapi2::ReturnCode (*p9_collect_ppe_state_FP_t) ( + const fapi2::ffdc_t&, + const fapi2::ffdc_t&, + fapi2::ReturnCode& +); + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ +extern "C" +{ + +/// @brief HWP to collect PPE internal register (SPRs, XIRs and GPRs) state as +/// FFDC associated to the input ReturnCode object +/// @param [in] i_target TARGET_TYPE_PROC_CHIP +/// @param [in] i_v_ppe_addresses Vector of addresses of PPEs, whose states +/// are to be collected. See p9_ppe_defs.H +/// @param[out] io_rc Return code to add FFDC data to +/// @return FAPI2_RC_SUCCESS Always succeeds + fapi2::ReturnCode + p9_collect_ppe_state ( const fapi2::ffdc_t& i_target, + const fapi2::ffdc_t& i_v_ppe_addresses, + fapi2::ReturnCode& io_rc ); + +} // extern C + +#endif // __P9_COLLECT_PPE_STATE_H___ diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.mk b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.mk new file mode 100644 index 000000000..86c0b6245 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.mk @@ -0,0 +1,27 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/ffdc/p9_collect_ppe_state.mk $ +# +# OpenPOWER HostBoot 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 +PROCEDURE=p9_collect_ppe_state +$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/lib) +$(call BUILD_PROCEDURE) |