From 5129448452b605487512bdaabb66b5afb7cd7a70 Mon Sep 17 00:00:00 2001 From: Joachim Fenkes Date: Wed, 21 Feb 2018 09:31:25 +0100 Subject: 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 Tested-by: HWSV CI Tested-by: PPE CI Tested-by: Hostboot CI Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60996 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes --- .../chips/p9/procedures/hwp/ffdc/ffdc_includes.H | 3 +- .../p9/procedures/hwp/ffdc/p9_collect_lpc_regs.C | 53 ++++++++++++++++++++++ .../p9/procedures/hwp/ffdc/p9_collect_lpc_regs.H | 34 ++++++++++++++ .../p9/procedures/hwp/ffdc/p9_collect_lpc_regs.mk | 2 + .../xml/error_info/p9_sbe_lpc_init_errors.xml | 25 ++++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) (limited to 'src/import/chips/p9') 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 #include #include +#include #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 +#include +#include +#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& 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 l_data32; + o_data.resize(l_nregs * 32); + o_ffdc.ptr() = o_data.pointer(); + o_ffdc.size() = o_data.getLength(); + + 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 l_target_chip = + *(reinterpret_cast *> + (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 +#include + +//------------------------------------------------------------------------------ +// 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_CHIP + + + RC_LPC_OPB_ERROR + After LPC initialization, the OPB master indicated an error. + p9_collect_lpc_regs, FFDC_TARGET_CHIP + + CODE + HIGH + + + TARGET_CHIP + TARGET_TYPE_PROC_CHIP + MEDIUM + + + TARGET_CHIP + + + + RC_LPC_REGISTERS + LPC register dump + OPB_MST_REGS + OPB_ARB_REGS + LPC_HC_REGS + -- cgit v1.2.1