diff options
author | Thi Tran <thi@us.ibm.com> | 2013-07-18 15:41:17 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-07-24 11:12:10 -0500 |
commit | 6f154577a86b2a47b86c4b63a20563966bf80a52 (patch) | |
tree | 343a0364243d01299efdef93ed6b28eeacc5d6ea /src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle | |
parent | 555099190e4e81769871b551b82437291cc79319 (diff) | |
download | talos-hostboot-6f154577a86b2a47b86c4b63a20563966bf80a52.tar.gz talos-hostboot-6f154577a86b2a47b86c4b63a20563966bf80a52.zip |
INITPROC: Hostboot - proc_prep_master_winkle 1.12
SW208962
Change-Id: I5144fa3304a58ba5e7cfdea1ea6c34ca8eda34db
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5459
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle')
-rw-r--r-- | src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.C | 77 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.H | 10 |
2 files changed, 67 insertions, 20 deletions
diff --git a/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.C b/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.C index 453c13493..cfa7f462f 100644 --- a/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.C +++ b/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -21,7 +21,7 @@ /* */ /* IBM_PROLOG_END_TAG */ // -*- mode: C++; c-file-style: "linux"; -*- -// $Id: proc_prep_master_winkle.C,v 1.11 2012/10/24 22:22:23 jmcgill Exp $ +// $Id: proc_prep_master_winkle.C,v 1.12 2013/07/01 18:41:34 stillgs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_prep_master_winkle.C,v $ //------------------------------------------------------------------------------ // *| @@ -75,22 +75,32 @@ extern "C" // Start SBE deadman timer // *Enter winkle* // -// parameters: i_target => master chip target +// parameters: i_ex_target => Reference to master chiplet target // i_useRealSBE => True if proc_sbe_trigger_winkle is supposed to be // running on the real SBE (default is true), else // false if proc_sbe_trigger_winkle is running on // the FSP (via poreve). // returns: FAPI_RC_SUCCESS if operation was successful, else error //------------------------------------------------------------------------------ - fapi::ReturnCode proc_prep_master_winkle(const fapi::Target & i_target, - const bool & i_useRealSBE = true) + fapi::ReturnCode proc_prep_master_winkle(const fapi::Target & i_ex_target, + const bool & i_useRealSBE) { // data buffer to hold register values ecmdDataBufferBase data(64); + ecmdDataBufferBase pmgp1(64); // return codes - uint32_t rc_ecmd = 0; - fapi::ReturnCode rc; + uint32_t rc_ecmd = 0; + fapi::ReturnCode rc; + + // istep/substep umbers + uint32_t istep_num = 0; + uint8_t substep_num = 0; + + // addressing variables + uint64_t address; + uint8_t l_ex_number = 0; + fapi::Target l_parentTarget; // mark function entry FAPI_INF("Entry, useRealSBE is %s\n", i_useRealSBE? "true":"false"); @@ -98,11 +108,19 @@ extern "C" do { + // Get the parent chip to target the PCBS registers + rc = fapiGetParentChip(i_ex_target, l_parentTarget); + if (rc) + { + FAPI_ERR("fapiGetParentChip access"); + break; + } + // Wait for SBE ready // ie. SBE running, and istep num and substep num correct if( i_useRealSBE ) { - rc = fapiGetScom(i_target, PORE_SBE_CONTROL_0x000E0001, data); + rc = fapiGetScom(l_parentTarget, PORE_SBE_CONTROL_0x000E0001, data); if(!rc.ok()) { FAPI_ERR("Scom error reading SBE STATUS\n"); @@ -111,22 +129,20 @@ extern "C" if( data.isBitSet( 0 ) ) { FAPI_ERR("SBE isn't running when it should be\n"); - const fapi::Target & CHIP_IN_ERROR = i_target; + const fapi::Target & CHIP_IN_ERROR = l_parentTarget; ecmdDataBufferBase & SBE_STATUS = data; FAPI_SET_HWP_ERROR(rc, RC_PROC_PREP_MASTER_WINKLE_SBE_NOT_RUNNING); break; } } - rc = fapiGetScom(i_target, MBOX_SBEVITAL_0x0005001C, data); + rc = fapiGetScom(l_parentTarget, MBOX_SBEVITAL_0x0005001C, data); if(!rc.ok()) { FAPI_ERR("Scom error reading SBE VITAL\n"); break; } - uint32_t istep_num = 0; - uint8_t substep_num = 0; rc_ecmd |= data.extractToRight(&istep_num, ISTEP_NUM_BIT_POSITION, ISTEP_NUM_BIT_LENGTH); @@ -145,7 +161,7 @@ extern "C" FAPI_ERR("Expected istep num %llX but found %X\n", PROC_SBE_TRIGGER_WINKLE_ISTEP_NUM, istep_num ); - const fapi::Target & CHIP_IN_ERROR = i_target; + const fapi::Target & CHIP_IN_ERROR = l_parentTarget; ecmdDataBufferBase & SBE_VITAL = data; FAPI_SET_HWP_ERROR(rc, RC_PROC_PREP_MASTER_WINKLE_BAD_ISTEP_NUM); break; @@ -155,13 +171,44 @@ extern "C" FAPI_ERR("Expected substep num %X but found %X\n", SUBSTEP_SBE_READY, substep_num ); - const fapi::Target & CHIP_IN_ERROR = i_target; + const fapi::Target & CHIP_IN_ERROR = l_parentTarget; ecmdDataBufferBase & SBE_VITAL = data; FAPI_SET_HWP_ERROR(rc, RC_PROC_PREP_MASTER_WINKLE_BAD_SUBSTEP_NUM); break; } FAPI_INF("SBE is ready for master to enter winkle\n"); + // Get the core number + rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &i_ex_target, l_ex_number); + if (rc) + { + FAPI_ERR("fapiGetAttribute of ATTR_CHIP_UNIT_POS with rc = 0x%x", (uint32_t)rc); + break; + } + + FAPI_INF("Processing core %d on %s", l_ex_number, l_parentTarget.toEcmdString()); + + // Disable movement to Fast Winkle if errors are present + rc_ecmd |= pmgp1.flushTo0(); + rc_ecmd |= pmgp1.setBit(20); + if(rc_ecmd) + { + FAPI_ERR("Error (0x%x) setting up ecmdDataBufferBase", rc_ecmd); + + rc.setEcmdError(rc_ecmd); + break; + } + + address = EX_PMGP1_OR_0x100F0105 + (l_ex_number*0x01000000); + rc = fapiPutScom(l_parentTarget, address, pmgp1); + if(!rc.ok()) + { + FAPI_ERR("Scom error updating PMGP1\n"); + break; + } + FAPI_INF("Disabled the ability to have Deep Winkle turned to Fast Winkle if errors are present\n"); + + //Start the deadman timer substep_num = SUBSTEP_DEADMAN_START; rc_ecmd |= data.insertFromRight(&substep_num, @@ -173,7 +220,7 @@ extern "C" rc.setEcmdError(rc_ecmd); break; } - rc = fapiPutScom(i_target, MBOX_SBEVITAL_0x0005001C, data); + rc = fapiPutScom(l_parentTarget, MBOX_SBEVITAL_0x0005001C, data); if(!rc.ok()) { FAPI_ERR("Scom error updating SBE VITAL\n"); diff --git a/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.H b/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.H index 39aeabf14..ae37dcf63 100644 --- a/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.H +++ b/src/usr/hwpf/hwp/core_activate/proc_prep_master_winkle/proc_prep_master_winkle.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: proc_prep_master_winkle.H,v 1.6 2012/10/24 22:22:43 jmcgill Exp $ +// $Id: proc_prep_master_winkle.H,v 1.7 2013/07/01 18:41:37 stillgs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_prep_master_winkle.H,v $ //------------------------------------------------------------------------------ // *| @@ -50,7 +50,7 @@ // function pointer typedef definition for HWP call support typedef fapi::ReturnCode (*proc_prep_master_winkle_FP_t)(const fapi::Target &, - const bool ); + const bool &); //------------------------------------------------------------------------------ // Constant definitions @@ -67,7 +67,7 @@ extern "C" /** * @brief Start the auto-POR engine and the SBE * - * @param[in] i_target Reference to master chip target + * @param[in] i_ex_target Reference to master chiplet target * @param[in] i_useRealSBE True if proc_sbe_trigger_winkle is supposed to be * running on the real SBE (default is true), else * false if proc_sbe_trigger_winkle is running on @@ -75,7 +75,7 @@ extern "C" * * @return ReturnCode */ - fapi::ReturnCode proc_prep_master_winkle(const fapi::Target & i_target, + fapi::ReturnCode proc_prep_master_winkle(const fapi::Target & i_ex_target, const bool & i_useRealSBE); } // extern "C" |