From 66f9ea2003de6c4ddd9e359296243c5cc27f2279 Mon Sep 17 00:00:00 2001 From: Thi Tran Date: Wed, 26 Feb 2014 11:30:50 -0600 Subject: INITPROC: Hostboot SW211645 SBE config update fix Change-Id: Idb93f9efd9332cdf0cb62c7bfdf8c6289011c86a CQ:SW211645 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9180 Tested-by: Jenkins Server Reviewed-by: Donald E. Dahle Reviewed-by: A. Patrick Williams III --- src/usr/hwpf/hwp/slave_sbe/makefile | 5 +- .../proc_check_slave_sbe_seeprom_complete.C | 33 ++++- .../proc_extract_sbe_rc.C | 48 ++++--- .../proc_extract_sbe_rc_errors.xml | 156 +++++++++++++-------- .../proc_reset_i2cm_bus_fence.C | 105 ++++++++++++++ .../proc_reset_i2cm_bus_fence.H | 75 ++++++++++ 6 files changed, 339 insertions(+), 83 deletions(-) create mode 100644 src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.C create mode 100644 src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.H (limited to 'src/usr/hwpf/hwp/slave_sbe') diff --git a/src/usr/hwpf/hwp/slave_sbe/makefile b/src/usr/hwpf/hwp/slave_sbe/makefile index c18022cac..4e6b29f53 100644 --- a/src/usr/hwpf/hwp/slave_sbe/makefile +++ b/src/usr/hwpf/hwp/slave_sbe/makefile @@ -5,7 +5,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2012,2013 +# COPYRIGHT International Business Machines Corp. 2012,2014 # # p1 # @@ -52,7 +52,8 @@ OBJS = slave_sbe.o \ proc_read_seeprom.o \ proc_getecid.o \ proc_cen_ref_clk_enable.o \ - proc_spless_sbe_startWA.o + proc_spless_sbe_startWA.o \ + proc_reset_i2cm_bus_fence.o ## NOTE: add a new directory onto the vpaths when you add a new HWP VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C index 5f5515264..9eddd5582 100644 --- a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C +++ b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_check_slave_sbe_seeprom_complete.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* COPYRIGHT International Business Machines Corp. 2012,2014 */ /* */ /* p1 */ /* */ @@ -21,7 +21,7 @@ /* */ /* IBM_PROLOG_END_TAG */ // -*- mode: C++; c-file-style: "linux"; -*- -// $Id: proc_check_slave_sbe_seeprom_complete.C,v 1.11 2013/11/05 22:08:23 jeshua Exp $ +// $Id: proc_check_slave_sbe_seeprom_complete.C,v 1.13 2014/02/19 02:31:45 jmcgill Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_check_slave_sbe_seeprom_complete.C,v $ //------------------------------------------------------------------------------ // *| @@ -32,7 +32,7 @@ // *! TITLE : proc_check_slave_sbe_seeprom_complete.C // *! DESCRIPTION : Check if a slave has completed the seeprom code // *! -// *! OWNER NAME : Jeshua Smith Email: jeshua@us.ibm.com +// *! OWNER NAME : Joe McGill Email: jmcgill@us.ibm.com // *! // *! Overview: // *! Check if the SBE is still running @@ -49,6 +49,7 @@ #include #include #include +#include //------------------------------------------------------------------------------ // Constant definitions @@ -227,6 +228,9 @@ extern "C" uint32_t rc_ecmd = 0; fapi::ReturnCode rc; + // track if procedure has cleared I2C master bus fence + bool i2cm_bus_fence_cleared = false; + // mark function entry FAPI_INF("Entry"); @@ -238,7 +242,7 @@ extern "C" i_target, still_running ); if( rc ) - { + { break; } @@ -271,6 +275,7 @@ extern "C" "SBE still running after waiting (%lldns, %lld cycles)", NS_TO_FINISH, SIM_CYCLES_TO_FINISH ); + const fapi::Target & CHIP_IN_ERROR = i_target; FAPI_SET_HWP_ERROR(rc, RC_PROC_CHECK_SLAVE_SBE_SEEPROM_COMPLETE_STILL_RUNNING); @@ -279,11 +284,20 @@ extern "C" } //end if(still_running) //SBE is stopped. Let's see where - uint8_t halt_code = 0; uint16_t istep_num = 0; uint8_t substep_num = 0; + // before analysis proceeds, make sure that I2C master bus fence is cleared + FAPI_EXEC_HWP(rc, proc_reset_i2cm_bus_fence, i_target); + if (!rc.ok()) + { + FAPI_ERR("Error from proc_reset_i2cm_bus_fence"); + break; + } + // mark that fence has been cleared + i2cm_bus_fence_cleared = true; + //Get current location from SBE VITAL rc = proc_check_slave_sbe_seeprom_complete_get_location( i_target, @@ -367,6 +381,15 @@ extern "C" } } while (0); + // if an error occurred prior to the I2C master bus fence + // being cleared, attempt to clear it prior to exit + if (!rc.ok() && !i2cm_bus_fence_cleared) + { + // discard rc, return that of original fail + fapi::ReturnCode rc_unused; + FAPI_EXEC_HWP(rc_unused, proc_reset_i2cm_bus_fence, i_target); + } + // mark function exit FAPI_INF("Exit"); return rc; diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc.C b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc.C index bbf2b87ca..89dfd8d8f 100644 --- a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc.C +++ b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* COPYRIGHT International Business Machines Corp. 2012,2014 */ /* */ /* p1 */ /* */ @@ -21,7 +21,7 @@ /* */ /* IBM_PROLOG_END_TAG */ // -*- mode: C++; c-file-style: "linux"; -*- -// $Id: proc_extract_sbe_rc.C,v 1.9 2013/11/05 22:16:08 jeshua Exp $ +// $Id: proc_extract_sbe_rc.C,v 1.12 2014/02/19 02:31:45 jmcgill Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_extract_sbe_rc.C,v $ //------------------------------------------------------------------------------ // *| @@ -32,7 +32,7 @@ // *! TITLE : proc_extract_sbe_rc.C // *! DESCRIPTION : Create a return code for an SBE error // *! -// *! OWNER NAME : Jeshua Smith Email: jeshua@us.ibm.com +// *! OWNER NAME : Johannes Koesters Email: koesters@de.ibm.com // *! // *! Overview: // *! - Check that it was a halt at magic instruction @@ -51,6 +51,7 @@ // Includes //------------------------------------------------------------------------------ #include +#include #include @@ -108,19 +109,16 @@ extern "C" const fapi::Target & CHIP_IN_ERROR = i_target; const uint32_t & ADDRESS = i_address; FAPI_SET_HWP_ERROR(rc, RC_PROC_EXTRACT_SBE_RC_IMAGE_POINTER_NULL); + break; } - else - { - uint8_t * p_errorCode = (uint8_t *)i_pSEEPROM + (i_address & ALIGN_FOUR_BYTE); + uint8_t * p_errorCode = (uint8_t *)i_pSEEPROM + (i_address & ALIGN_FOUR_BYTE); - //Copy the data out of the image pointer - o_data = - (p_errorCode[0] << 3*8) | - (p_errorCode[1] << 2*8) | - (p_errorCode[2] << 1*8) | - (p_errorCode[3]); - rc = fapi::FAPI_RC_SUCCESS; - } + //Copy the data out of the image pointer + o_data = + (p_errorCode[0] << 3*8) | + (p_errorCode[1] << 2*8) | + (p_errorCode[2] << 1*8) | + (p_errorCode[3]); } while(0); return rc; } @@ -203,7 +201,9 @@ extern "C" { rc = proc_extract_sbe_rc_get_pc(i_target,i_engine,address_64); if (rc) + { break; + } uint32_t error_code = 0; //Add 4 because address_64 is pointing at the halt instruction @@ -263,7 +263,8 @@ extern "C" //Look up that error code ////////////////////////////////////////// FAPI_ERR("SBE got error code 0x%06X", error_code); - const fapi::Target & CHIP_IN_ERROR = i_target; + const fapi::Target CHIP_IN_ERROR = i_target; + const fapi::Target CHIP = i_target; FAPI_SET_SBE_ERROR(rc, error_code); } while(0); @@ -309,12 +310,25 @@ extern "C" if ((i_engine != SBE) && (i_engine != SLW)) { - FAPI_ERR("Unknow engine type %i", i_engine); + FAPI_ERR("Unknown engine type %i", i_engine); const por_engine_t ENGINE = i_engine; + const fapi::Target & CHIP_IN_ERROR = i_target; FAPI_SET_HWP_ERROR(rc, RC_PROC_EXTRACT_SBE_RC_UNKNOWN_ENGINE); break; } + // if analyzing SBE engine failure, make sure I2C master bus fence is + // released before proceeding + if (i_engine == SBE) + { + FAPI_EXEC_HWP(rc, proc_reset_i2cm_bus_fence, i_target); + if (!rc.ok()) + { + FAPI_ERR("Error from proc_reset_i2cm_bus_fence"); + break; + } + } + //JDS TODO - split out the generic error into more granular errors? bool generic_hw_error = false; ////////////////////////////////////////// @@ -479,7 +493,9 @@ extern "C" uint64_t pc = 0; rc = proc_extract_sbe_rc_get_pc(i_target, i_engine, pc); if (rc) + { break; + } if ((pc & ADDR_TYPE_MASK) == OTPROM_ADDR_TYPE) { diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc_errors.xml b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc_errors.xml index 1a2ad48a8..a754f87ad 100644 --- a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc_errors.xml +++ b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_extract_sbe_rc_errors.xml @@ -5,7 +5,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -37,6 +37,12 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + + + CHIP_IN_ERROR + @@ -51,6 +57,9 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + @@ -65,6 +74,16 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CODE + LOW + + + CHIP_IN_ERROR + + + CHIP_IN_ERROR + @@ -79,6 +98,12 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + + + CHIP_IN_ERROR + @@ -93,50 +118,12 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR - - - - RC_PROC_EXTRACT_SBE_RC_SCOM_ERROR - - Procedure: proc_extract_sbe_rc - Got a scom error when trying to extract the SBE error - - ADDRESS - ERROR - CHIP_IN_ERROR - - - - RC_PROC_EXTRACT_SBE_RC_MODEL_ERROR_GETTING_SCOM - - Procedure: proc_extract_sbe_rc - Got a model error when trying to extract the SBE error - - ADDRESS - ERROR - CHIP_IN_ERROR - - - - RC_PROC_EXTRACT_SBE_RC_MODEL_ERRROR_SETTING_SEEPROM_ADDR - - Procedure: proc_extract_sbe_rc - Got a model error when trying to set the SEEPROM address to extract - - ADDRESS - ERROR - CHIP_IN_ERROR - - - - RC_PROC_EXTRACT_SBE_RC_MODEL_ERRROR_READING_SEEPROM - - Procedure: proc_extract_sbe_rc - Got a model error when trying to read the SEEPROM address containing the RC - - ADDRESS - ERROR - CHIP_IN_ERROR + + CHIP_IN_ERROR + + + CHIP_IN_ERROR + @@ -146,6 +133,17 @@ Tried to extract error from unknown engine type ENGINE + + CHIP_IN_ERROR + HIGH + + + CODE + LOW + + + CHIP_IN_ERROR + @@ -160,6 +158,12 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + + + CHIP_IN_ERROR + @@ -173,6 +177,9 @@ REG_FFDC_PROC_SLW_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + @@ -187,6 +194,17 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + HIGH + + + CODE + LOW + + + CHIP_IN_ERROR + @@ -200,6 +218,14 @@ REG_FFDC_PROC_SLW_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + HIGH + + + CODE + LOW + @@ -214,6 +240,17 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + HIGH + + + CODE + LOW + + + CHIP_IN_ERROR + @@ -227,6 +264,9 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + @@ -240,6 +280,9 @@ REG_FFDC_PROC_SLW_REGISTERS CHIP_IN_ERROR + + CHIP_IN_ERROR + @@ -253,6 +296,13 @@ REG_FFDC_PROC_SBE_REGISTERS CHIP_IN_ERROR + + CODE + LOW + + + CHIP_IN_ERROR + @@ -268,16 +318,9 @@ REG_FFDC_PROC_FIRST_OTPROM_INSTRUCTIONS CHIP_IN_ERROR - - CHIP_IN_ERROR - HIGH - CHIP_IN_ERROR - - CHIP_IN_ERROR - @@ -291,13 +334,6 @@ REG_FFDC_PROC_SLW_REGISTERS CHIP_IN_ERROR - - CHIP_IN_ERROR - HIGH - - - CHIP_IN_ERROR - CHIP_IN_ERROR diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.C b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.C new file mode 100644 index 000000000..5f97ee47a --- /dev/null +++ b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.C @@ -0,0 +1,105 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2014 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $Id: proc_reset_i2cm_bus_fence.C,v 1.1 2014/02/18 19:53:44 jmcgill Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_reset_i2cm_bus_fence.C,v $ +//------------------------------------------------------------------------------ +// *! (C) Copyright International Business Machines Corp. 2012 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//------------------------------------------------------------------------------ +// *! TITLE : proc_reset_i2cm_bus_fence.C +// *! DESCRIPTION : Clear i2cm bus fence to restore FSP access (FAPI) +// *! +// *! OWNER NAME : Joe McGill Email: jmcgill@us.ibm.com +// *! +// *! ADDITIONAL COMMENTS : +// *! +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include +#include + + +//------------------------------------------------------------------------------ +// Constant definitions +//------------------------------------------------------------------------------ +const uint32_t CFAM_FSI_GP4_I2CM_BUS_FENCE_BIT = 20; + + +//------------------------------------------------------------------------------ +// Function definitions +//------------------------------------------------------------------------------ + +extern "C" { + +// HWP entry point, comments in header +fapi::ReturnCode proc_reset_i2cm_bus_fence(const fapi::Target & i_target) +{ + fapi::ReturnCode rc; + uint32_t rc_ecmd = 0; + + ecmdDataBufferBase cfam_data(32); + + // mark HWP entry + FAPI_INF("proc_reset_i2cm_bus_fence: Start"); + + do + { + // read FSI GP4 + rc = fapiGetCfamRegister(i_target, CFAM_FSI_GP4_0x00002813, cfam_data); + if (!rc.ok()) + { + FAPI_ERR("proc_reset_i2cm_bus_fence: Error from fapiGetCfamRegister (CFAM_FSI_GP4_0x00002813)"); + break; + } + + // clear fence bit + rc_ecmd |= cfam_data.clearBit(CFAM_FSI_GP4_I2CM_BUS_FENCE_BIT); + if (rc_ecmd) + { + FAPI_ERR("proc_reset_i2cm_bus_fence: Error 0x%x forming FSI GP4 register write data buffer", + rc_ecmd); + rc.setEcmdError(rc_ecmd); + break; + } + + // write back modified data + rc = fapiPutCfamRegister(i_target, CFAM_FSI_GP4_0x00002813, cfam_data); + if (!rc.ok()) + { + FAPI_ERR("proc_reset_i2cm_bus_fence: Error from fapiGetCfamRegister (CFAM_FSI_GP4_0x00002813)"); + break; + } + + } while(0); + + // mark HWP exit + FAPI_INF("proc_reset_i2cm_bus_fence: End"); + return rc; +} + + +} // extern "C" diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.H b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.H new file mode 100644 index 000000000..3467ae08a --- /dev/null +++ b/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.H @@ -0,0 +1,75 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete/proc_reset_i2cm_bus_fence.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2014 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $Id: proc_reset_i2cm_bus_fence.H,v 1.1 2014/02/18 19:53:45 jmcgill Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_reset_i2cm_bus_fence.H,v $ +///------------------------------------------------------------------------------ +// *! (C) Copyright International Business Machines Corp. 2012 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//------------------------------------------------------------------------------ +// *! TITLE : proc_reset_i2cm_bus_fence.C +// *! DESCRIPTION : Clear i2cm bus fence to restore FSP access (FAPI) +// *! +// *! OWNER NAME : Joe McGill Email: jmcgill@us.ibm.com +// *! +// *! ADDITIONAL COMMENTS : +// *! +//------------------------------------------------------------------------------ + +#ifndef PROC_RESET_I2CM_BUS_FENCE_H_ +#define PROC_RESET_I2CM_BUS_FENCE_H_ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include + + +//------------------------------------------------------------------------------ +// Structure definitions +//------------------------------------------------------------------------------ + +// function pointer typedef definition for HWP call support +typedef fapi::ReturnCode +(*proc_reset_i2cm_bus_fence_FP_t)(const fapi::Target & i_target); + +extern "C" { + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ + +/** + * @brief HWP which clears i2cm bus fence to restore FSP access in the case of + * an SBE engine failure + * + * @param[in] i_target Reference to processor chip target + * + * @return ReturnCode + */ +fapi::ReturnCode proc_reset_i2cm_bus_fence(const fapi::Target & i_target); + + +} // extern "C" + +#endif // PROC_RESET_I2CM_BUS_FENCE_H_ -- cgit v1.2.1