diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2018-02-21 09:31:25 +0100 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2018-06-27 16:26:12 -0400 |
commit | 5129448452b605487512bdaabb66b5afb7cd7a70 (patch) | |
tree | 561e704b85c39a7fe60347e687559952384ec3ab | |
parent | 44180ef7b2b455b54f268a36c40ee7ee94246423 (diff) | |
download | talos-hostboot-5129448452b605487512bdaabb66b5afb7cd7a70.tar.gz talos-hostboot-5129448452b605487512bdaabb66b5afb7cd7a70.zip |
p9_sbe_lpc_init: Add final check for errors
Add an external FFDC collection procedure that will dump the LPC
register spaces, make sure it is called if after LPC setup an OPB
error is registered.
Change-Id: I91046a6a3814ba94abd878f860e08f1b1338390b
CQ: SW435433
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57803
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@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/60996
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
6 files changed, 117 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 cb0779da7..c84739fb4 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,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,4 +34,5 @@ #include <p9_pib2pcb_mux_seq.H> #include <p9_collect_ppe_state.H> #include <p9_eq_clear_atomic_lock.H> +#include <p9_collect_lpc_regs.H> #endif diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.C b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.C index 846677b4d..16f2a8438 100644 --- a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.C +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.C @@ -22,3 +22,56 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +#include <stdint.h> +#include <hwp_error_info.H> +#include <fapi2.H> +#include "p9_collect_lpc_regs.H" +#include "p9_perv_scom_addresses.H" +#include "p9_perv_scom_addresses_fld.H" +#include "p9_misc_scom_addresses.H" +#include "p9_misc_scom_addresses_fld.H" + +const bool LPC_UTILS_TIMEOUT_FFDC = false; +#include "../perv/p9_lpc_utils.H" + +static void lpc_dump( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip, + uint32_t i_first_addr, uint32_t i_last_addr, + fapi2::variable_buffer& o_data, fapi2::ffdc_t& o_ffdc) +{ + const uint32_t l_nregs = (i_last_addr - i_first_addr + 4) / 4; + fapi2::buffer<uint32_t> l_data32; + o_data.resize(l_nregs * 32); + o_ffdc.ptr() = o_data.pointer(); + o_ffdc.size() = o_data.getLength<uint8_t>(); + + for (uint32_t i = 0; i < l_nregs; i++) + { + fapi2::ReturnCode l_rc = lpc_read(i_target_chip, i_first_addr + (i * 4), l_data32); + + if (l_rc != fapi2::FAPI2_RC_SUCCESS) + { + l_data32 = 0xDEADC0DE; + } + + o_data.set(l_data32(), i); + } +} + +extern "C" fapi2::ReturnCode p9_collect_lpc_regs(fapi2::ffdc_t& i_target_chip, fapi2::ReturnCode& o_rc) +{ + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_target_chip = + *(reinterpret_cast<const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> *> + (i_target_chip.ptr())); + + fapi2::variable_buffer l_opb_mst_regs, l_opb_arb_regs, l_lpc_hc_regs; + fapi2::ffdc_t OPB_MST_REGS, OPB_ARB_REGS, LPC_HC_REGS; + + lpc_dump(l_target_chip, 0xC0010000, 0xC001005C, l_opb_mst_regs, OPB_MST_REGS); + lpc_dump(l_target_chip, 0xC0011000, 0xC0011004, l_opb_arb_regs, OPB_ARB_REGS); + lpc_dump(l_target_chip, 0xC0012000, 0xC00120FC, l_lpc_hc_regs, LPC_HC_REGS); + + FAPI_ADD_INFO_TO_HWP_ERROR(o_rc, RC_LPC_REGISTERS); + return fapi2::ReturnCode(); +} diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.H b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.H index 8dd6366bf..e9ffe69ae 100644 --- a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.H +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.H @@ -22,3 +22,37 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ +#ifndef _COLLECT_LPC_REGS_H_ +#define _COLLECT_LPC_REGS_H_ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <return_code.H> +#include <error_info_defs.H> + +//------------------------------------------------------------------------------ +// Structure definitions +//------------------------------------------------------------------------------ + +// function pointer typedef definition for HWP call support +typedef fapi2::ReturnCode (*p9_collect_lpc_regs_FP_t)(fapi2::ffdc_t&, fapi2::ReturnCode&); + +//------------------------------------------------------------------------------ +// Constant definitions +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ + +/// +/// @brief Procedure for gathering LPC register data into FFDC, to complement p9_sbe_lpc_init +/// @param[in] i_target_chip - P9 chip to collect LPC registers from +/// @param[out] o_rc - return code to add FFDC data to. +/// +/// @return FAPI2_RC_SUCCESS +extern "C" fapi2::ReturnCode p9_collect_lpc_regs(fapi2::ffdc_t& i_target_chip, fapi2::ReturnCode& o_rc); + +#endif diff --git a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.mk b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.mk index 6f735bd36..39fc7b19a 100644 --- a/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.mk +++ b/src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.mk @@ -22,3 +22,5 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG +PROCEDURE=p9_collect_lpc_regs +$(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/xml/error_info/p9_sbe_lpc_init_errors.xml b/src/import/chips/p9/procedures/xml/error_info/p9_sbe_lpc_init_errors.xml index e14772a31..87f7db6f3 100644 --- a/src/import/chips/p9/procedures/xml/error_info/p9_sbe_lpc_init_errors.xml +++ b/src/import/chips/p9/procedures/xml/error_info/p9_sbe_lpc_init_errors.xml @@ -45,4 +45,29 @@ <target>TARGET_CHIP</target> </deconfigure> </hwpError> + <hwpError> + <sbeError/> + <rc>RC_LPC_OPB_ERROR</rc> + <description>After LPC initialization, the OPB master indicated an error.</description> + <collectFfdc>p9_collect_lpc_regs, FFDC_TARGET_CHIP</collectFfdc> + <callout> + <procedure>CODE</procedure> + <priority>HIGH</priority> + </callout> + <callout> + <target>TARGET_CHIP</target> + <targetType>TARGET_TYPE_PROC_CHIP</targetType> + <priority>MEDIUM</priority> + </callout> + <deconfigure> + <target>TARGET_CHIP</target> + </deconfigure> + </hwpError> + <hwpError> + <rc>RC_LPC_REGISTERS</rc> + <description>LPC register dump</description> + <buffer>OPB_MST_REGS</buffer> + <buffer>OPB_ARB_REGS</buffer> + <buffer>LPC_HC_REGS</buffer> + </hwpError> </hwpErrors> diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk index 283b37b72..cfb411ff5 100755 --- a/src/usr/fapi2/fapi2.mk +++ b/src/usr/fapi2/fapi2.mk @@ -92,6 +92,7 @@ OBJS += fapi2_utils.o OBJS += p9_collect_some_ffdc.o OBJS += p9_pib2pcb_mux_seq.o OBJS += p9_collect_ppe_state.o +OBJS += p9_collect_lpc_regs.o OBJS += p9_ppe_state.o OBJS += p9_ppe_utils.o OBJS += p9_eq_clear_atomic_lock.o |