diff options
author | Thi Tran <thi@us.ibm.com> | 2014-02-09 06:39:03 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-02-10 12:03:08 -0600 |
commit | ba276714d25f2dc88cd97cc5cafe1aa86b8019e3 (patch) | |
tree | 1e715c43a825c2ed7cde90623f644b7ed41cacae /src/usr/hwpf/hwp | |
parent | 4bbf6d1a3927255714b22d1bd95ec19a59781b04 (diff) | |
download | talos-hostboot-ba276714d25f2dc88cd97cc5cafe1aa86b8019e3.tar.gz talos-hostboot-ba276714d25f2dc88cd97cc5cafe1aa86b8019e3.zip |
INITPROC: Hostboot SW245922 Fixes for SW240169 MPIPL OCC not active
Change-Id: I5c2d39eddc7dad42948d6fc5712318cd60a8f6d1
CQ:SW245922
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8709
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp')
-rw-r--r-- | src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C | 132 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/occ/makefile | 5 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.C | 263 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.H | 97 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/proc_chip_ec_feature.xml | 27 |
5 files changed, 501 insertions, 23 deletions
diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C index 3e41680bb..7383526e2 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pfet_control.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ @@ -20,7 +20,7 @@ /* Origin: 30 */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_pfet_control.C,v 1.11 2013/10/29 21:53:32 stillgs Exp $ +// $Id: p8_pfet_control.C,v 1.12 2014/02/06 21:58:40 stillgs Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pfet_control.C,v $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2011 @@ -96,6 +96,7 @@ // Includes // ---------------------------------------------------------------------- #include "p8_pm.H" +#include "p8_pm_utils.H" #include "p8_pfet_control.H" @@ -203,6 +204,20 @@ p8_pfet_control( const fapi::Target& i_target, do { + + uint8_t ipl_mode = 0; + l_rc = FAPI_ATTR_GET(ATTR_IS_MPIPL, NULL, ipl_mode); + if (!l_rc.ok()) + { + FAPI_ERR("fapiGetAttribute of ATTR_IS_MPIPL rc = 0x%x", (uint32_t)l_rc); + break; + } + FAPI_INF("IPL mode = %s", ipl_mode ? "MPIPL" : "NORMAL"); + + l_rc = p8_pm_pcbs_fsm_trace (i_target, i_ex_number, + "start of p8_pfet_control"); + if (!l_rc.ok()) { break; } + // Check for valid operation parameter if ((i_op != VON) && (i_op != VOFF) && (i_op != VOFF_OVERRIDE) && (i_op != NONE)) { @@ -260,6 +275,10 @@ p8_pfet_control( const fapi::Target& i_target, break; } + l_rc = p8_pm_pcbs_fsm_trace (i_target, i_ex_number, + "after of PM enablement"); + if (!l_rc.ok()) { break; } + // Read to allow for Cronus 5.1 or 5.6 to look at the resultant setting address = EX_PMGP0_0x100F0100 + (0x01000000 * i_ex_number); l_rc=fapiGetScom( i_target, address, data ); @@ -476,6 +495,10 @@ p8_pfet_control( const fapi::Target& i_target, FAPI_ERR("PutScom error 0x%08llX", address); break; } + + l_rc = p8_pm_pcbs_fsm_trace (i_target, i_ex_number, + "after of GP3(0) handling"); + if (!l_rc.ok()) { break; } } } @@ -495,6 +518,10 @@ p8_pfet_control( const fapi::Target& i_target, FAPI_ERR("GetScom error 0x%08llX", address); break; } + + l_rc = p8_pm_pcbs_fsm_trace (i_target, i_ex_number, + "before transition choice"); + if (!l_rc.ok()) { break; } // Off if (i_op == VOFF) @@ -527,6 +554,11 @@ p8_pfet_control( const fapi::Target& i_target, pfet_dom_names[i_domain]); break; } + + l_rc = p8_pm_pcbs_fsm_trace (i_target, i_ex_number, + "after VON handling"); + if (!l_rc.ok()) { break; } + } // Error else @@ -616,16 +648,30 @@ p8_pfet_on( const fapi::Target& i_target, b_eco = true; } - l_rc = p8_pfet_ivrm_fsm_fix(i_target, - i_ex_number, - i_domain, - VON); + uint8_t chipHasPFETPoweroffBug = 0; + l_rc = FAPI_ATTR_GET(ATTR_CHIP_EC_PFET_POWEROFF_BUG, + &i_target, + chipHasPFETPoweroffBug); if(!l_rc.ok()) { - FAPI_ERR("PFET IVMR fix error"); + FAPI_ERR("Error querying Chip EC feature: " + "ATTR_CHIP_EC_PFET_POWEROFF_BUG"); break; } + if (chipHasPFETPoweroffBug) + { + l_rc = p8_pfet_ivrm_fsm_fix(i_target, + i_ex_number, + i_domain, + VON); + if(!l_rc.ok()) + { + FAPI_ERR("PFET IVMR fix error"); + break; + } + + } // VCS --------------------- FAPI_INF("Turning on VCS"); @@ -816,17 +862,30 @@ p8_pfet_off( const fapi::Target& i_target, { b_eco = true; } - - l_rc = p8_pfet_ivrm_fsm_fix(i_target, - i_ex_number, - i_domain, - VOFF); + + uint8_t chipHasPFETPoweroffBug = 0; + l_rc = FAPI_ATTR_GET(ATTR_CHIP_EC_PFET_POWEROFF_BUG, + &i_target, + chipHasPFETPoweroffBug); if(!l_rc.ok()) { - FAPI_ERR("PFET IVMR fix error"); + FAPI_ERR("Error querying Chip EC feature: " + "ATTR_CHIP_EC_PFET_POWEROFF_BUG"); break; } + if (chipHasPFETPoweroffBug) + { + l_rc = p8_pfet_ivrm_fsm_fix(i_target, + i_ex_number, + i_domain, + VOFF); + if(!l_rc.ok()) + { + FAPI_ERR("PFET IVMR fix error"); + break; + } + } // Check if iVRM Bypasses are active address = EX_PCBS_iVRM_Control_Status_Reg_0x100F0154 + @@ -1119,16 +1178,30 @@ p8_pfet_off_override( const fapi::Target& i_target, b_eco = true; } - l_rc = p8_pfet_ivrm_fsm_fix(i_target, - i_ex_number, - i_domain, - VOFF); + uint8_t chipHasPFETPoweroffBug = 0; + l_rc = FAPI_ATTR_GET(ATTR_CHIP_EC_PFET_POWEROFF_BUG, + &i_target, + chipHasPFETPoweroffBug); if(!l_rc.ok()) { - FAPI_ERR("PFET IVMR fix error"); + FAPI_ERR("Error querying Chip EC feature: " + "ATTR_CHIP_EC_PFET_POWEROFF_BUG"); break; } + if (chipHasPFETPoweroffBug) + { + l_rc = p8_pfet_ivrm_fsm_fix(i_target, + i_ex_number, + i_domain, + VOFF); + if(!l_rc.ok()) + { + FAPI_ERR("PFET IVMR fix error"); + break; + } + } + // Check if iVRM Bypasses are active address = EX_PCBS_iVRM_Control_Status_Reg_0x100F0154 + (0x01000000 * i_ex_number); @@ -1623,14 +1696,33 @@ p8_pfet_ivrm_fsm_fix(const fapi::Target& i_target, ecmdDataBufferBase core_voff_vret(64); ecmdDataBufferBase eco_voff_vret(64); - + + + FAPI_INF("Beginning FET work-around for IVRM FSM"); do { - // --------------------------------------------------------------------- + // --------------------------------------------------------------------- + + // Determine if Pstates have been previously enabled. If so, the + // work-around was previously run and cannot be run again. + address = EX_PCBSPM_MODE_REG_0x100F0156 + 0x01000000*i_ex_number; + l_rc=fapiGetScom( i_target, address, pmgp0 ); + if(!l_rc.ok()) + { + FAPI_ERR("GetScom error 0x%08llX", address); + break; + } + + if (gp3.isBitSet(0)) + { + FAPI_INF("Skipping PFET work-around as Pstate have already been enabled"); + break; + } + address = EX_GP3_0x100F0012 + 0x01000000*i_ex_number; // Save the setting for later restoration diff --git a/src/usr/hwpf/hwp/occ/makefile b/src/usr/hwpf/hwp/occ/makefile index 51a499680..34d819ef6 100644 --- a/src/usr/hwpf/hwp/occ/makefile +++ b/src/usr/hwpf/hwp/occ/makefile @@ -5,7 +5,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2013 +# COPYRIGHT International Business Machines Corp. 2013,2014 # # p1 # @@ -64,7 +64,8 @@ OBJS = occ.o \ p8_pm_occ_firinit.o \ p8_pm_pba_firinit.o \ p8_pm_pmc_firinit.o \ - p8_cpu_special_wakeup.o + p8_cpu_special_wakeup.o \ + p8_pm_utils.o #These procedures are included per Stradale's request so #they can implement OCC Reset. diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.C b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.C new file mode 100644 index 000000000..da8b70dd2 --- /dev/null +++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.C @@ -0,0 +1,263 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.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: p8_pm_utils.C,v 1.2 2014/02/09 02:01:59 stillgs Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_utils.C,v $ +//------------------------------------------------------------------------------ +// *! (C) Copyright International Business Machines Corp. 2011 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//------------------------------------------------------------------------------ +// *! OWNER NAME: Greg Still Email: stillgs@us.ibm.com +// *! BACKUP: Mike Olsen Email: cmolsen@us.ibm.com +// *! +// *! +/// \file p8_pm_utils.C +/// \brief Utility functions for PM FAPIs +/// +//------------------------------------------------------------------------------ + +#ifndef _P8_PM_UTILS_C_ +#define _P8_PM_UTILS_C_ + +// ---------------------------------------------------------------------- +// Includes +// ---------------------------------------------------------------------- +#include "p8_pm.H" + +extern "C" { + +using namespace fapi; + +#include "p8_pm_utils.H" + + +//------------------------------------------------------------------------------ +/** + * Trace a set of FIRs (Globals and select Locals) + * + * @param[in] i_target Chip target + * @param[in] i_msg String to put out in the trace + * + * @retval ECMD_SUCCESS + */ +fapi::ReturnCode +p8_pm_glob_fir_trace(const fapi::Target& i_target, + const char * i_msg) +{ + fapi::ReturnCode rc; + ecmdDataBufferBase data(64); + uint64_t address; + + CONST_UINT64_T( GLOB_XSTOP_FIR_0x01040000 , ULL(0x01040000) ); + CONST_UINT64_T( GLOB_RECOV_FIR_0x01040001 , ULL(0x01040001) ); + CONST_UINT64_T( TP_LFIR_0x0104000A , ULL(0x0104000A) ); + + do + { + + // Note: i_msg is put on on each record to allow for trace "greps" + // so as to see the "big picture" across when + + // ****************************************************************** + // Check for xstops and recoverables and put in the trace + // ****************************************************************** + address = READ_GLOBAL_XSTOP_FIR_0x570F001B; + GETSCOM(rc, i_target, address, data); + + if (data.getNumBitsSet(0,64)) + { + FAPI_INF("Xstop is **ACTIVE** %s", i_msg); + } + + address = READ_GLOBAL_RECOV_FIR_0x570F001C; + GETSCOM(rc, i_target, address, data); + if (data.getNumBitsSet(0,64)) + { + FAPI_INF("Recoverable attention is **ACTIVE** %s", i_msg); + } + + address = READ_GLOBAL_RECOV_FIR_0x570F001C; + GETSCOM(rc, i_target, address, data); + if (data.getNumBitsSet(0,64)) + { + FAPI_INF("Recoverable attention is **ACTIVE** %s", i_msg); + } + + address = GLOB_XSTOP_FIR_0x01040000; + GETSCOM(rc, i_target, address, data); + if (data.getNumBitsSet(0,64)) + { + FAPI_INF("Glob Xstop FIR is **ACTIVE** %s", i_msg); + } + + address = GLOB_RECOV_FIR_0x01040001; + GETSCOM(rc, i_target, address, data); + if (data.getNumBitsSet(0,64)) + { + FAPI_INF("Glob Recov FIR is **ACTIVE** %s", i_msg); + } + + address = TP_LFIR_0x0104000A; + GETSCOM(rc, i_target, address, data); + if (data.getNumBitsSet(0,64)) + { + FAPI_INF("TP LFIR is **ACTIVE** %s", i_msg); + } + + } while(0); + return rc; +} + +//------------------------------------------------------------------------------ +/** + * Trace PCBS FSMs + * + * @param[in] i_target Chip target + * @param[in] i_msg String to put out in the trace + * + * @retval ECMD_SUCCESS + * @retval ERROR defined in xml + */ +fapi::ReturnCode +p8_pm_pcbs_fsm_trace_chip(const fapi::Target& i_target, + const char * i_msg) +{ + fapi::ReturnCode rc; + ecmdDataBufferBase data(64); + + std::vector<fapi::Target> l_exChiplets; + uint8_t l_ex_number = 0; + + do + { + rc = fapiGetChildChiplets(i_target, + fapi::TARGET_TYPE_EX_CHIPLET, + l_exChiplets, + TARGET_STATE_FUNCTIONAL); + if (rc) + { + FAPI_ERR("fapiGetChildChiplets with rc = 0x%x", (uint32_t)rc); + break; + } + + // For each chiplet + for (uint8_t c=0; c< l_exChiplets.size(); c++) + { + + rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_exChiplets[c], l_ex_number); + if (rc) + { + FAPI_ERR("fapiGetAttribute of ATTR_CHIP_UNIT_POS with rc = 0x%x", (uint32_t)rc); + break; + } + + FAPI_DBG("\tCore number = %d", l_ex_number); + + rc = p8_pm_pcbs_fsm_trace (i_target, l_ex_number, i_msg); + if (!rc.ok()) + { + break; + } + } + + } while(0); + return rc; +} + +//------------------------------------------------------------------------------ +/** + * Trace PCBS FSMs for a given EX + * + * @param[in] i_target Chip target + * @param[in] i_msg String to put out in the trace + * + * @retval ECMD_SUCCESS + */ +fapi::ReturnCode +p8_pm_pcbs_fsm_trace ( const fapi::Target& i_target, + uint32_t i_ex_number, + const char * i_msg) +{ + fapi::ReturnCode rc; + ecmdDataBufferBase data(64); + uint64_t address; + uint64_t ex_offset; + + do + { + ex_offset = i_ex_number * 0x01000000; + + // Note: i_msg is put on on each record to allow for trace "greps" + // so as to see the "big picture" across when + + // ****************************************************************** + // Read PCBS FSM Monitor0 + // ****************************************************************** + address = EX_PCBS_FSM_MONITOR1_REG_0x100F0170 + ex_offset; + GETSCOM(rc, i_target, address, data); + FAPI_INF("PCBS Monitor0 = 0x%016llX; %s target:%s" , + data.getDoubleWord(0), + i_msg, + i_target.toEcmdString()); + + // ****************************************************************** + // Read PCBS FSM Monitor1 + // ****************************************************************** + address = EX_PCBS_FSM_MONITOR2_REG_0x100F0171 + ex_offset; + GETSCOM(rc, i_target, address, data); + FAPI_INF("PCBS Monitor1 = 0x%016llX; %s target:%s" , + data.getDoubleWord(0), + i_msg, + i_target.toEcmdString()); + + // ****************************************************************** + // Read PCBS DPLL CPM PARM REG + // ****************************************************************** + address = EX_DPLL_CPM_PARM_REG_0x100F0152 + ex_offset; + GETSCOM(rc, i_target, address, data); + FAPI_INF("DPLLC Monitor = 0x%016llX; %s target:%s" , + data.getDoubleWord(0), + i_msg, + i_target.toEcmdString()); + + // ****************************************************************** + // Read PCBS PMGP0 + // ****************************************************************** + address = EX_PMGP0_0x100F0100 + ex_offset; + GETSCOM(rc, i_target, address, data); + FAPI_INF("PMGP0 Monitor = 0x%016llX; %s target:%s" , + data.getDoubleWord(0), + i_msg, + i_target.toEcmdString()); + + } while(0); + return rc; +} + + + + +} //end extern + +#endif // _P8_PM_UTILS_H_ + diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.H b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.H new file mode 100644 index 000000000..2a8d9f503 --- /dev/null +++ b/src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.H @@ -0,0 +1,97 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_pm_utils.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: p8_pm_utils.H,v 1.1 2014/02/06 20:05:37 stillgs Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm_utils.H,v $ +//------------------------------------------------------------------------------ +// *| +// *! (C) Copyright International Business Machines Corp. 2011 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +// *| +// *! TITLE : p8_pm_utils.H +// *! DESCRIPTION : Utility functions for PM FAPIs +// *! +// *! OWNER NAME : Greg Still Email: stillgs@us.ibm.com +// *! BACKUP NAME : Michael Olsen Email: cmolsen@us.ibm.com +// *! +//------------------------------------------------------------------------------ + +#ifndef _P8_PM_UTILS_H_ +#define _P8_PM_UTILS_H_ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ + +extern "C" { + + +//------------------------------------------------------------------------------ +// Function prototype +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +/** + * Trace Global FIRs + * + * @param[in] i_target Chip target + * @param[in] i_msg String to put out in the trace + * + * @retval SCOM FAPI RCs + */ +fapi::ReturnCode +p8_pm_glob_fir_trace (const fapi::Target& i_target, + const char * i_msg); + +//------------------------------------------------------------------------------ +/** + * Trace PCBS FSMs + * + * @param[in] i_target Chip target + * @param[in] i_msg String to put out in the trace + * + * @retval SCOM FAPI RCs + */ +fapi::ReturnCode +p8_pm_pcbs_fsm_trace_chip(const fapi::Target& i_target, + const char * i_msg); + + +//------------------------------------------------------------------------------ +/** + * Trace PCBS FSMs for a given EX + * + * @param[in] i_target Chip target + * @param[in] i_msg String to put out in the trace + * + * @retval ECMD_SUCCESS + */ +fapi::ReturnCode +p8_pm_pcbs_fsm_trace ( const fapi::Target& i_target, + uint32_t i_ex_number, + const char * i_msg); + + +} // extern "C" + +#endif // _P8_PM_UTILS_H_ diff --git a/src/usr/hwpf/hwp/proc_chip_ec_feature.xml b/src/usr/hwpf/hwp/proc_chip_ec_feature.xml index 2ef8bb8b5..14a27735e 100644 --- a/src/usr/hwpf/hwp/proc_chip_ec_feature.xml +++ b/src/usr/hwpf/hwp/proc_chip_ec_feature.xml @@ -20,7 +20,7 @@ <!-- Origin: 30 --> <!-- --> <!-- IBM_PROLOG_END_TAG --> -<!-- $Id: proc_chip_ec_feature.xml,v 1.46 2013/12/19 15:53:50 bwieman Exp $ --> +<!-- $Id: proc_chip_ec_feature.xml,v 1.48 2014/02/06 19:50:54 stillgs Exp $ --> <!-- Defines the attributes that are based on EC level --> <attributes> <attribute> @@ -998,4 +998,29 @@ </chip> </chipEcFeature> </attribute> + <attribute> + <id>ATTR_CHIP_EC_PFET_POWEROFF_BUG</id> + <targetType>TARGET_TYPE_PROC_CHIP</targetType> + <description> + True if chip has the PFET power off bug (HW250017) + Murano EC less than 0x20 + Venice EC less than 0x20 + </description> + <chipEcFeature> + <chip> + <name>ENUM_ATTR_NAME_MURANO</name> + <ec> + <value>0x20</value> + <test>LESS_THAN</test> + </ec> + </chip> + <chip> + <name>ENUM_ATTR_NAME_VENICE</name> + <ec> + <value>0x20</value> + <test>LESS_THAN</test> + </ec> + </chip> + </chipEcFeature> + </attribute> </attributes> |