Skip to content

Commit

Permalink
p9_sbe_lpc_init: Add final check for errors
Browse files Browse the repository at this point in the history
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/62237
Tested-by: Jenkins Server <pfd-jenkins+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://rchgit01.rchland.ibm.com/gerrit1/62249
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
fenkes-ibm authored and dcrowell77 committed Jul 24, 2018
1 parent aaaf653 commit c9d74db
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/import/chips/p9/procedures/hwp/ffdc/ffdc_includes.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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
53 changes: 53 additions & 0 deletions src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
34 changes: 34 additions & 0 deletions src/import/chips/p9/procedures/hwp/ffdc/p9_collect_lpc_regs.H
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9_collect_lpc_regs
$(call BUILD_PROCEDURE)
Original file line number Diff line number Diff line change
Expand Up @@ -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>
1 change: 1 addition & 0 deletions src/usr/fapi2/fapi2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c9d74db

Please sign in to comment.