From 308db00a89c9c18c1c5e346f171f36ec34705f31 Mon Sep 17 00:00:00 2001 From: "Richard J. Knight" Date: Wed, 14 Aug 2013 22:28:32 -0500 Subject: Update IPL flow for clocks and memory(Hostboot) Update hostboot code to match version 1.37 of the IPL flow document. - added proc_cen_ref_clk_enable support - added mss_dimm_power_test support - deferred step 12 updates Change-Id: Ief2d55fa9864ac64b847da21f14b897006965d57 RTC:80595 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5817 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton Reviewed-by: A. Patrick Williams III --- src/usr/hwpf/hwp/dram_training/dram_training.C | 97 ++++++++++- src/usr/hwpf/hwp/dram_training/dram_training.H | 55 +++--- src/usr/hwpf/hwp/dram_training/makefile | 5 +- .../mss_dimm_power_test/mss_dimm_power_test.C | 82 +++++++++ .../mss_dimm_power_test/mss_dimm_power_test.H | 86 ++++++++++ src/usr/hwpf/hwp/slave_sbe/makefile | 5 +- .../proc_cen_ref_clk_enable.C | 187 +++++++++++++++++++++ .../proc_cen_ref_clk_enable.H | 86 ++++++++++ .../proc_cen_ref_clk_enable_errors.xml | 39 +++++ src/usr/hwpf/hwp/slave_sbe/slave_sbe.C | 165 ++++++++++++++++++ src/usr/hwpf/hwp/slave_sbe/slave_sbe.H | 53 +++--- src/usr/hwpf/makefile | 3 +- 12 files changed, 811 insertions(+), 52 deletions(-) create mode 100644 src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.C create mode 100644 src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.H create mode 100644 src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.C create mode 100644 src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H create mode 100644 src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable_errors.xml (limited to 'src/usr/hwpf') diff --git a/src/usr/hwpf/hwp/dram_training/dram_training.C b/src/usr/hwpf/hwp/dram_training/dram_training.C index c0f9f43f0..3d2e11639 100644 --- a/src/usr/hwpf/hwp/dram_training/dram_training.C +++ b/src/usr/hwpf/hwp/dram_training/dram_training.C @@ -65,18 +65,16 @@ const uint8_t VPO_NUM_OF_MEMBUF_TO_RUN = UNLIMITED_RUN; // -- prototype includes -- #include "dram_training.H" -// Un-comment these files as they become available: -// #include "host_disable_vddr/host_disable_vddr.H" #include "mem_pll_setup/cen_mem_pll_initf.H" #include "mem_pll_setup/cen_mem_pll_setup.H" #include "mem_startclocks/cen_mem_startclocks.H" -// #include "host_enable_vddr/host_enable_vddr.H" #include "mss_scominit/mss_scominit.H" #include "mss_ddr_phy_reset/mss_ddr_phy_reset.H" #include "mss_draminit/mss_draminit.H" #include "mss_draminit_training/mss_draminit_training.H" #include "mss_draminit_trainadv/mss_draminit_training_advanced.H" #include "mss_draminit_mc/mss_draminit_mc.H" +#include "mss_dimm_power_test/mss_dimm_power_test.H" namespace DRAM_TRAINING { @@ -936,6 +934,99 @@ void* call_mss_draminit_mc( void *io_pArgs ) return l_stepError.getErrorHandle(); } +// +// Wrapper function to call mss_dimm_power_test +// +void* call_mss_dimm_power_test( void *io_pArgs ) +{ + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_mss_dimm_power_test entry" ); + + errlHndl_t l_err = NULL; + + // get a list of mba targets + IStepError l_stepError; + + TARGETING::TargetHandleList l_mbaTargetList; + TARGETING::TargetHandleList::const_iterator pRangeLimitItr; + TARGETING::TargetHandleList::const_iterator pTargetItr; + + // Get all MBA targets + getAllChiplets(l_mbaTargetList, TYPE_MBA, true); + + // Limit the number of MBAs to run in VPO environment to save time. + uint8_t l_mbaLimit = l_mbaTargetList.size(); + if (TARGETING::is_vpo() && (VPO_NUM_OF_MBAS_TO_RUN < l_mbaLimit)) + { + // limit the range to VPO_NUM_OF_MBAS_TO_RUN + pRangeLimitItr = l_mbaTargetList.begin() + VPO_NUM_OF_MBAS_TO_RUN; + } + else + { + // process all targets + pRangeLimitItr = l_mbaTargetList.end(); + + } + // process each target till we reach the limit set above + for ( TARGETING::TargetHandleList::const_iterator pTargetItr + = l_mbaTargetList.begin(); + pTargetItr != pRangeLimitItr; pTargetItr++) + { + // make a local copy of the target for ease of use + const TARGETING::Target* l_mba_target = *pTargetItr; + + // Dump current run on target + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running mss_dimm_power_test HWP on " + "target HUID %.8X", TARGETING::get_huid(l_mba_target)); + + // Cast to a FAPI type of target. + const fapi::Target l_fapi_mba_target( TARGET_TYPE_MBA_CHIPLET, + (const_cast(l_mba_target)) ); + + // call the HWP with each fapi::Target + FAPI_INVOKE_HWP(l_err, mss_dimm_power_test, l_fapi_mba_target); + + if (l_err) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X: mss_dimm_power_test HWP returns error", + l_err->reasonCode()); + + // capture the target data in the elog + ErrlUserDetailsTarget(l_mba_target).addToLog( l_err ); + + /*@ + * @errortype + * @reasoncode ISTEP_DRAM_TRAINING_FAILED + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid ISTEP_MSS_DIMM_POWER_TEST + * @userdata1 bytes 0-1: plid identifying first error + * bytes 2-3: reason code of first error + * @userdata2 bytes 0-1: total number of elogs included + * bytes 2-3: N/A + * @devdesc call to mss_dimm_power_test has failed + */ + l_stepError.addErrorDetails(ISTEP_DRAM_TRAINING_FAILED, + ISTEP_MSS_DIMM_POWER_TEST, + l_err ); + + errlCommit( l_err, HWPF_COMP_ID ); + + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : call_mss_dimm_power_test HWP( )" ); + } + } // end l_mbaNum loop + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_mss_dimm_power_test exit" ); + + return l_stepError.getErrorHandle(); +} + }; // end namespace diff --git a/src/usr/hwpf/hwp/dram_training/dram_training.H b/src/usr/hwpf/hwp/dram_training/dram_training.H index 6092fb99d..40ca07990 100644 --- a/src/usr/hwpf/hwp/dram_training/dram_training.H +++ b/src/usr/hwpf/hwp/dram_training/dram_training.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/hwpf/hwp/dram_training/dram_training.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * 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 other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/dram_training/dram_training.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* 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 */ #ifndef __DRAM_TRAINING_DRAM_TRAINING_H #define __DRAM_TRAINING_DRAM_TRAINING_H @@ -269,6 +268,16 @@ void* call_mss_draminit_trainadv( void * io_pArgs ); * */ void* call_mss_draminit_mc( void * io_pArgs ); +/** + * @brief mss_dimm_power_test + * + * + * param[in,out] io_pArgs - (normally) a pointer to a TaskArgs struct, + * or NULL. + * return any errlogs to istep + * + */ +void* call_mss_dimm_power_test( void * io_pArgs ); }; // end namespace diff --git a/src/usr/hwpf/hwp/dram_training/makefile b/src/usr/hwpf/hwp/dram_training/makefile index 3fe9152b0..527265eec 100644 --- a/src/usr/hwpf/hwp/dram_training/makefile +++ b/src/usr/hwpf/hwp/dram_training/makefile @@ -49,6 +49,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_scominit EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mem_pll_setup EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test ## NOTE: add new object files when you add a new HWP OBJS = dram_training.o \ @@ -68,10 +69,12 @@ OBJS = dram_training.o \ mss_mcbist.o \ mss_mcbist_common.o\ hbVddrMsg.o \ - mss_mcbist_address.o + mss_mcbist_address.o \ + mss_dimm_power_test.o ## NOTE: add a new directory onto the vpaths when you add a new HWP ##@ VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/??? +VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_draminit_training VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_draminit_mc VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dram_training/mss_draminit diff --git a/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.C b/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.C new file mode 100644 index 000000000..7343f2cca --- /dev/null +++ b/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.C @@ -0,0 +1,82 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* 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: mss_dimm_power_test.C,v 1.1 2013/04/18 14:14:10 joabhend Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_dimm_power_test.C,v $ +//------------------------------------------------------------------------------ +// *! (C) Copyright International Business Machines Corp. 2011 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//------------------------------------------------------------------------------ +// *! TITLE : mss_dimm_power_test +// *! DESCRIPTION : see additional comments below +// *! OWNER NAME : Joab Henderson Email: joabhend@us.ibm.com +// *! BACKUP NAME : Michael Pardeik Email: pardeik@us.ibm.com +// *! ADDITIONAL COMMENTS : +// +// DESCRIPTION: +// The purpose of this procedure is to run an insitu power test on ISDIMMs to determine max power draw +// +// TODO: +// +//------------------------------------------------------------------------------ +// Don't forget to create CVS comments when you check in your changes! +//------------------------------------------------------------------------------ +// CHANGE HISTORY: +//------------------------------------------------------------------------------ +// Version:| Author: | Date: | Comment: +//---------|----------|---------|----------------------------------------------- +// 1.1 | joabhend |04-APR-13| Shell code - Only returns success + + + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- +#include +#include + +extern "C" { + + using namespace fapi; + + + // Procedures in this file + fapi::ReturnCode mss_dimm_power_test(const fapi::Target & i_target); + + +//****************************************************************************** +// +//****************************************************************************** + +fapi::ReturnCode mss_dimm_power_test(const fapi::Target & i_target) +{ + // Target is centaur.mba + + fapi::ReturnCode l_rc = fapi::FAPI_RC_SUCCESS; + + return l_rc; +} + + +} //end extern C + diff --git a/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.H b/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.H new file mode 100644 index 000000000..e3501e534 --- /dev/null +++ b/src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.H @@ -0,0 +1,86 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/dram_training/mss_dimm_power_test/mss_dimm_power_test.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* 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: mss_dimm_power_test.H,v 1.1 2013/04/18 14:14:50 joabhend Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_dimm_power_test.H,v $ +//------------------------------------------------------------------------------ +// *! (C) Copyright International Business Machines Corp. 2011 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//------------------------------------------------------------------------------ +// *! TITLE : mss_throttle_to_power.H +// *! DESCRIPTION : see additional comments below +// *! OWNER NAME : Joab Henderson Email: joabhend@us.ibm.com +// *! BACKUP NAME : Michael Pardeik Email: pardeik@us.ibm.com +// *! ADDITIONAL COMMENTS : +// +// Header file for mss_dimm_power_test. +// +//------------------------------------------------------------------------------ +// Don't forget to create CVS comments when you check in your changes! +//------------------------------------------------------------------------------ +// CHANGE HISTORY: +//------------------------------------------------------------------------------ +// Version:| Author: | Date: | Comment: +//---------|----------|---------|----------------------------------------------- +// 1.1 | joabhend |04-APR-13| First Draft. + + + +#ifndef MSS_DIMM_POWER_TEST_H_ +#define MSS_DIMM_POWER_TEST_H_ + +//---------------------------------------------------------------------- +// Includes +//---------------------------------------------------------------------- +#include + +//---------------------------------------------------------------------- +// Defines +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// ENUMs +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +// Data Types +//---------------------------------------------------------------------- + +typedef fapi::ReturnCode (*mss_dimm_power_test_FP_t)(const fapi::Target & i_target); + +extern "C" +{ + +/** + * @brief mss_dimm_power_test procedure. Run power test on ISDIMMs to determine max power draw + * + * @param[in] i_target Reference to centaur.mba target + * + * @return ReturnCode + */ + + fapi::ReturnCode mss_dimm_power_test(const fapi::Target & i_target); + +} // extern "C" + +#endif // MSS_DIMM_POWER_TEST_H_ diff --git a/src/usr/hwpf/hwp/slave_sbe/makefile b/src/usr/hwpf/hwp/slave_sbe/makefile index 8a9b7ed37..a51963441 100644 --- a/src/usr/hwpf/hwp/slave_sbe/makefile +++ b/src/usr/hwpf/hwp/slave_sbe/makefile @@ -39,6 +39,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_revert_sbe_mcs_setup EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_getecid +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable ## NOTE: add new object files when you add a new HWP @@ -47,9 +48,11 @@ OBJS = slave_sbe.o \ proc_check_slave_sbe_seeprom_complete.o \ proc_extract_sbe_rc.o \ proc_read_seeprom.o \ - proc_getecid.o + proc_getecid.o \ + proc_cen_ref_clk_enable.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 VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_revert_sbe_mcs_setup VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_getecid diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.C b/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.C new file mode 100644 index 000000000..faece1ed5 --- /dev/null +++ b/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.C @@ -0,0 +1,187 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* 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 */ +// -*- mode: C++; c-file-style: "linux"; -*- + +// $Id: proc_cen_ref_clk_enable.C,v 1.2 2013/08/14 20:44:47 jmcgill Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_cen_ref_clk_enable.C,v $ +//------------------------------------------------------------------------------ +// *| +// *! (C) Copyright International Business Machines Corp. 2012 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +// *| +// *! TITLE : proc_cen_ref_clk_enable.C +// *! DESCRIPTION : Enable Centaur reference clocks (FAPI) +// *! +// *! OWNER NAME : Benedikt Geukes Email: benedikt.geukes@de.ibm.com +// *! BACKUP NAME : Ralph Koester Email: rkoester@de.ibm.com +// *! +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include "proc_cen_ref_clk_enable.H" + +//------------------------------------------------------------------------------ +// Function definitions +//------------------------------------------------------------------------------ + +extern "C" +{ + + +//------------------------------------------------------------------------------ +// Hardware Procedure +//------------------------------------------------------------------------------ +// parameters: i_target => chip target +// i_attached_centaurs => bitmask representing attached Centaur +// positions +// returns: FAPI_RC_SUCCESS if operation was successful, else error +//------------------------------------------------------------------------------ +fapi::ReturnCode proc_cen_ref_clk_enable(const fapi::Target & i_target, + const uint8_t i_attached_centaurs) +{ + + ecmdDataBufferBase fsi_data(64); + uint32_t rc_ecmd = 0; + fapi::ReturnCode rc; + uint8_t configured_centaurs = 0x00; + std::vector mcs_targets; + + do { + rc = fapiGetScom(i_target, MBOX_FSIGP8_0x00050017, fsi_data); + if (rc) + { + FAPI_ERR("proc_cen_ref_clk_enable: fapiGetScom error (MBOX_FSIGP8_0x00050017)"); + break; + } + + FAPI_INF("proc_cen_ref_clk_enable: got number of attached centaurs: i_attached_centaurs=0x%02X\n", + (int) i_attached_centaurs); + + rc = fapiGetChildChiplets(i_target, + fapi::TARGET_TYPE_MCS_CHIPLET, + mcs_targets, + fapi::TARGET_STATE_FUNCTIONAL); + if (!rc.ok()) + { + FAPI_ERR("proc_cen_ref_clk_enable: Error from fapiGetChildChiplets"); + break; + } + + // loop through MCS chiplets, match with attached Centaurs + for (std::vector::iterator i = mcs_targets.begin(); + (i != mcs_targets.end()) && !rc && !rc_ecmd; + i++) + { + uint8_t mcs_unit_id = 0x00; + uint8_t refclock_bit = 0x00; + + rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, + &(*i), + mcs_unit_id); + if (rc) + { + FAPI_ERR("proc_cen_ref_clk_enable: Error querying ATTR_CHIP_UNIT_POS"); + break; + } + + // continue to next iteration if this MCS is not connected to a Centaur + if (!(i_attached_centaurs & (1 << ((NUM_CENTAUR_POS-1)-mcs_unit_id)))) + { + FAPI_DBG("proc_cen_ref_clk_enable: MCS %d is not connected to a Centaur, skipping...\n", mcs_unit_id); + } + else + { + // mark that we have configured this MCS/Centaur pair + configured_centaurs |= (1 << ((NUM_CENTAUR_POS-1)-mcs_unit_id)); + FAPI_DBG("proc_cen_ref_clk_enable: MCS %d is connected to a Centaur, configured_centaurs: %02X\n", mcs_unit_id,configured_centaurs); + + // query attribute which defines reflock bit associated with this Centaur + rc = FAPI_ATTR_GET(ATTR_DMI_REFCLOCK_SWIZZLE, + &(*i), + refclock_bit); + if (rc) + { + FAPI_ERR("proc_cen_ref_clk_enable: Error querying ATTR_DMI_REFCLOCK_SWIZZLE"); + break; + } + FAPI_DBG("proc_cen_ref_clk_enable: refclock_bit: %02X\n", refclock_bit); + + if ((FSI_GP8_CENTAUR_REFCLOCK_START_BIT + refclock_bit) > FSI_GP8_CENTAUR_REFCLOCK_END_BIT) + { + // bit offset exceeds field range + FAPI_ERR("proc_cen_ref_clk_enable: Translated Centaur refclock enable bit position is out of range!"); + const uint8_t& POSITION = mcs_unit_id; + const uint8_t& REFCLOCK_BIT = refclock_bit; + FAPI_SET_HWP_ERROR(rc, + RC_PROC_CEN_REF_CLK_ENABLE_SWIZZLE_ERR); + break; + } + + rc_ecmd |= fsi_data.setBit(FSI_GP8_CENTAUR_REFCLOCK_START_BIT+ + refclock_bit); + } + } + if (rc) + { + break; + } + if (rc_ecmd) + { + FAPI_ERR("proc_cen_ref_clk_enable: Error (0x%x) setting up ecmdDataBufferBase", rc_ecmd); + rc.setEcmdError(rc_ecmd); + break; + } + + if (configured_centaurs != i_attached_centaurs) + { + FAPI_ERR("proc_cen_ref_clk_enable: Not all Centaurs marked as attached were configured"); + const uint8_t& CONFIGURED = configured_centaurs; + const uint8_t& ATTACHED = i_attached_centaurs; + FAPI_SET_HWP_ERROR(rc, + RC_PROC_CEN_REF_CLK_ENABLE_CONFIG_ERR); + break; + } + + FAPI_INF("proc_cen_ref_clk_enable: Enable refclk for Centaur ..."); + + rc = fapiPutScom(i_target, MBOX_FSIGP8_0x00050017, fsi_data); + if (rc) + { + FAPI_ERR("proc_cen_ref_clk_enable: fapiPutScom error (MBOX_FSIGP8_0x00050017)"); + break; + } + } while(0); // end do + + // mark function exit + FAPI_INF("proc_cen_ref_clk_enable: Exit"); + return rc; +} // end FAPI procedure proc_cen_ref_clk_enable + + +} // extern "C" +/* Local Variables: */ +/* c-basic-offset: 4 */ +/* End: */ diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H b/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H new file mode 100644 index 000000000..ff4507a51 --- /dev/null +++ b/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H @@ -0,0 +1,86 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* 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_cen_ref_clk_enable.H,v 1.1 2013/08/12 18:19:30 jmcgill Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_cen_ref_clk_enable.H,v $ +//------------------------------------------------------------------------------ +// *| +// *! (C) Copyright International Business Machines Corp. 2012 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +// *| +// *! TITLE : proc_cen_ref_clk_enable.H +// *! DESCRIPTION : Enable Centaur reference clocks (FAPI) +// *! +// *! OWNER NAME : Benedikt Geukes Email: benedikt.geukes@de.ibm.com +// *! +//------------------------------------------------------------------------------ + +#ifndef _PROC_CEN_REF_CLK_ENABLE_H_ +#define _PROC_CEN_REF_CLK_ENABLE_H_ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ + +#include +#include "p8_scom_addresses.H" + +//------------------------------------------------------------------------------ +// Structure definitions +//------------------------------------------------------------------------------ + +// function pointer typedef definition for HWP call support +typedef fapi::ReturnCode (*proc_cen_ref_clk_enable_FP_t)(const fapi::Target &, + const uint8_t); + + +//------------------------------------------------------------------------------ +// Constant definitions +//------------------------------------------------------------------------------ + +const uint8_t NUM_CENTAUR_POS = 8; +const uint8_t FSI_GP8_CENTAUR_REFCLOCK_START_BIT = 16; +const uint8_t FSI_GP8_CENTAUR_REFCLOCK_END_BIT = (FSI_GP8_CENTAUR_REFCLOCK_START_BIT + NUM_CENTAUR_POS - 1); + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ + + +extern "C" +{ + +/** + * @brief Enble Centaur reference clocks + * + * @param[in] i_target chip target + * @param[in] i_attached_centaurs Bitmask representing attached Centaur positions + * + * @return ReturnCode + */ + fapi::ReturnCode proc_cen_ref_clk_enable(const fapi::Target & i_target, + const uint8_t i_attached_centaurs); + +} // extern "C" + +#endif // _PROC_CEN_REF_CLK_ENABLE_H diff --git a/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable_errors.xml b/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable_errors.xml new file mode 100644 index 000000000..eff8ecdc9 --- /dev/null +++ b/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable_errors.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + RC_PROC_CEN_REF_CLK_ENABLE_SWIZZLE_ERR + Translated Centaur refclock enable bit position is out of range. + POSITION + REFCLOCK_BIT + + + RC_PROC_CEN_REF_CLK_ENABLE_CONFIG_ERR + Not all Centaurs marked as attached were configured. + CONFIGURED + ATTACHED + + diff --git a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C index e96dd3ea5..859a96389 100644 --- a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C +++ b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.C @@ -52,6 +52,7 @@ #include #include +#include "proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H" #include "slave_sbe.H" #include "proc_revert_sbe_mcs_setup/proc_revert_sbe_mcs_setup.H" #include "proc_check_slave_sbe_seeprom_complete.H" @@ -65,6 +66,8 @@ using namespace TARGETING; namespace SLAVE_SBE { +uint8_t getMembufsAttachedBitMask( TARGETING::Target * i_procChipHandle ); + //****************************************************************************** // call_proc_revert_sbe_mcs_setup function //****************************************************************************** @@ -348,5 +351,167 @@ void* call_proc_xmit_sbe(void *io_pArgs ) return l_stepError.getErrorHandle(); } +//****************************************************************************** +// call_proc_cen_ref_clock_enable +//****************************************************************************** +void* call_proc_cen_ref_clk_enable(void *io_pArgs ) +{ + errlHndl_t l_errl = NULL; + + IStepError l_stepError; + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_cen_ref_clock_enable enter" ); + + TARGETING::TargetHandleList functionalProcChipList; + + getAllChips(functionalProcChipList, TYPE_PROC, true); + + // loop thru the list of processors + for (TargetHandleList::const_iterator + l_proc_iter = functionalProcChipList.begin(); + l_proc_iter != functionalProcChipList.end(); + ++l_proc_iter) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "target HUID %.8X", + TARGETING::get_huid( *l_proc_iter )); + + uint8_t l_membufsAttached = 0; + // get a bit mask of present/functional dimms assocated with + // this processor + l_membufsAttached = getMembufsAttachedBitMask( *l_proc_iter ); + + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "passing target HUID %.8X and 0x%x mask", + TARGETING::get_huid( *l_proc_iter ), l_membufsAttached ); + + if( l_membufsAttached ) + { + + fapi::Target l_fapiProcTarget( fapi::TARGET_TYPE_PROC_CHIP, + *l_proc_iter ); + + // Invoke the HWP passing in the proc target and + // a bit mask indicating connected centaurs + FAPI_INVOKE_HWP(l_errl, + proc_cen_ref_clk_enable, + l_fapiProcTarget, l_membufsAttached ); + + if (l_errl) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : proc_cen_ref_clk_enable", + "failed, returning errorlog" ); + + // capture the target data in the elog + ErrlUserDetailsTarget( *l_proc_iter ).addToLog( l_errl ); + /*@ + * @errortype + * @reasoncode ISTEP_SLAVE_SBE_FAILED + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid ISTEP_PROC_CEN_REF_CLK_ENABLE + * @userdata1 bytes 0-1: plid identifying first error + * bytes 2-3: reason code of first error + * @userdata2 bytes 0-1: total number of elogs included + * bytes 2-3: N/A + * @devdesc call to proc_cen_ref_clk_enable returned an error + * + */ + l_stepError.addErrorDetails( ISTEP_SLAVE_SBE_FAILED, + ISTEP_PROC_CEN_REF_CLK_ENABLE, + l_errl ); + + errlCommit( l_errl, HWPF_COMP_ID ); + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : proc_cen_ref_clk_enable", + "completed ok"); + } + } + } // endfor + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_cen_ref_clock_enable exit" ); + + // end task, returning any errorlogs to IStepDisp + return l_stepError.getErrorHandle(); +} + +//****************************************************************************** +// getMembufsAttachedBitMask - helper function for hwp proc_cen_ref_clk_enable +//****************************************************************************** +uint8_t getMembufsAttachedBitMask( TARGETING::Target * i_procTarget ) +{ + const uint8_t MCS_WITH_ATTACHED_CENTAUR_MASK = 0x80; + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Finding functional membuf chips downstream from " + "proc chip with HUID of 0x%08X", + i_procTarget->getAttr()); + + uint8_t l_attachedMembufs = 0; + + // Get list of functional membuf chips downstream from the given + // proc chip + TARGETING::TargetHandleList functionalMembufChipList; + + getChildAffinityTargets( functionalMembufChipList, + const_cast(i_procTarget ), + TARGETING::CLASS_CHIP, + TARGETING::TYPE_MEMBUF, + true); + + // loop through the functional membufs + for(TARGETING::TargetHandleList::const_iterator pTargetItr + = functionalMembufChipList.begin(); + pTargetItr != functionalMembufChipList.end(); + pTargetItr++) + { + // Find each functional membuf chip's upstream functional MCS + // unit, if any, and accumulate it into the attached membuf + // chips mask + TARGETING::TargetHandleList functionalMcsUnitList; + + getParentAffinityTargets( functionalMcsUnitList, *pTargetItr, + TARGETING::CLASS_UNIT, TARGETING::TYPE_MCS, + true ); + + if(functionalMcsUnitList.empty()) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Functional membuf chip with HUID of 0x%08X " + "is not attached to an upstream functional MCS", + (*pTargetItr)->getAttr< + TARGETING::ATTR_HUID>()); + continue; + } + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Found functional MCS unit with HUID of 0x%08X " + "upstream from functional membuf chip with HUID of 0x%08X", + ((*functionalMcsUnitList.begin())->getAttr< + TARGETING::ATTR_CHIP_UNIT>()), + (*pTargetItr)->getAttr< + TARGETING::ATTR_HUID>()); + l_attachedMembufs |= + ((MCS_WITH_ATTACHED_CENTAUR_MASK) >> + ((*functionalMcsUnitList.begin())->getAttr< + TARGETING::ATTR_CHIP_UNIT>())); + } + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Proc chip with HUID of 0x%08X has attached membuf " + "mask (l_attachedMembufs) of 0x%02X", + i_procTarget->getAttr(), + l_attachedMembufs); + + // return the bitmask + return l_attachedMembufs; + +} } diff --git a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.H b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.H index b0fed944f..38637c85c 100644 --- a/src/usr/hwpf/hwp/slave_sbe/slave_sbe.H +++ b/src/usr/hwpf/hwp/slave_sbe/slave_sbe.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/hwpf/hwp/slave_sbe/slave_sbe.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * 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 other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/slave_sbe/slave_sbe.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* 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 */ #ifndef __SLAVE_SBE_SLAVE_SBE_H #define __SLAVE_SBE_SLAVE_SBE_H @@ -122,6 +121,14 @@ void* call_proc_check_slave_sbe_seeprom_complete(void *io_pArgs); * return any error logs to istep */ void* call_proc_xmit_sbe(void *io_pArgs); +/** + * @brief proc_cen_ref_clk_enable + * + * param[in,out] - pointer to any arguments, usually NULL + * + * return any error logs to istep + */ +void* call_proc_cen_ref_clk_enable(void *io_pArgs); }; // end namespace diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile index 67aa2984f..608f4d082 100644 --- a/src/usr/hwpf/makefile +++ b/src/usr/hwpf/makefile @@ -101,7 +101,8 @@ HWP_ERROR_XML_FILES = hwp/fapiHwpErrorInfo.xml \ hwp/dram_training/mem_startclocks/memory_cen_stopclocks.xml \ hwp/dram_training/mss_scominit/memory_mss_scominit.xml \ hwp/dram_training/mss_draminit_trainadv/memory_mss_mcbist_common.xml \ - hwp/dram_initialization/proc_setup_bars/memory_mss_setup_bars.xml + hwp/dram_initialization/proc_setup_bars/memory_mss_setup_bars.xml \ + hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable_errors.xml ## these get generated into obj/genfiles/AttributeIds.H HWP_ATTR_XML_FILES = hwp/memory_attributes.xml \ -- cgit v1.2.1