diff options
Diffstat (limited to 'src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable')
3 files changed, 0 insertions, 377 deletions
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 deleted file mode 100644 index 0f585da26..000000000 --- a/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.C +++ /dev/null @@ -1,240 +0,0 @@ -/* 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 $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -// $Id: proc_cen_ref_clk_enable.C,v 1.4 2014/04/14 18:57:01 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 -// *! *** *** -// *| -// *! 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_check_master_sbe_seeprom.H" -#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 reg_data(32); - uint32_t rc_ecmd = 0; - fapi::ReturnCode rc; - bool is_master = false; - uint8_t configured_centaurs = 0x00; - std::vector<fapi::Target> mcs_targets; - - - do - { - // determine chip status (master/slave) to differentiate access path to FSI GP8 register - // master: SCOM - // slave: CFAM - rc = proc_check_master_sbe_seeprom(i_target, is_master); - if (!rc.ok()) - { - FAPI_ERR("proc_cen_ref_clk_enable: Error from proc_check_master_sbe_seeprom"); - break; - } - - FAPI_INF("proc_cen_ref_clk_enable: Target %s is %s, attached Centaurs: 0x%02X", - i_target.toEcmdString(), (is_master)?("master"):("slave"), i_attached_centaurs); - - // obtain set of functional MCS chiplets - 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<fapi::Target>::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 fapi::Target& PROC_TARGET = i_target; - const uint8_t& CENTAUR_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 |= reg_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 refclock enable OR data buffer", - 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 fapi::Target& PROC_TARGET = i_target; - const uint8_t& CONFIGURED_CENTAUR_POSITIONS = configured_centaurs; - const uint8_t& ATTACHED_CENTAUR_POSITIONS = 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 functional Centaur chips..."); - if (is_master) - { - ecmdDataBufferBase scom_data(64); - rc = fapiGetScom(i_target, MBOX_FSIGP8_0x00050017, scom_data); - if (rc) - { - FAPI_ERR("proc_cen_ref_clk_enable: fapiGetScom error (MBOX_FSIGP8_0x00050017)"); - break; - } - - rc_ecmd |= scom_data.setOr(reg_data.getWord(0), 0, 32); - if (rc_ecmd) - { - FAPI_ERR("proc_cen_ref_clk_enable: Error (0x%x) setting up FSI GP8 write data buffer (SCOM)", - rc_ecmd); - rc.setEcmdError(rc_ecmd); - break; - } - - rc = fapiPutScom(i_target, MBOX_FSIGP8_0x00050017, scom_data); - if (rc) - { - FAPI_ERR("proc_cen_ref_clk_enable: fapiPutScom error (MBOX_FSIGP8_0x00050017)"); - break; - } - } - else - { - ecmdDataBufferBase cfam_data(32); - rc = fapiGetCfamRegister(i_target, CFAM_FSI_GP8_0x00002817, cfam_data); - if (rc) - { - FAPI_ERR("proc_cen_ref_clk_enable: fapiGetCfamRegister error (CFAM_FSI_GP8_0x00001017)"); - break; - } - - rc_ecmd |= cfam_data.setOr(reg_data.getWord(0), 0, 32); - if (rc_ecmd) - { - FAPI_ERR("proc_cen_ref_clk_enable: Error (0x%x) setting up FSI GP8 write data buffer (CFAM)", - rc_ecmd); - rc.setEcmdError(rc_ecmd); - break; - } - - rc = fapiPutCfamRegister(i_target, CFAM_FSI_GP8_0x00002817, cfam_data); - if (rc) - { - FAPI_ERR("proc_cen_ref_clk_enable: fapiPutCfamRegister error (CFAM_FSI_GP8_0x00001017)"); - 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" 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 deleted file mode 100644 index ee23ec1d7..000000000 --- a/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable.H +++ /dev/null @@ -1,88 +0,0 @@ -/* 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 $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* 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 -// *! *** *** -// *| -// *! 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 <fapi.H> -#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 deleted file mode 100644 index 46a7fabfd..000000000 --- a/src/usr/hwpf/hwp/slave_sbe/proc_cen_ref_clk_enable/proc_cen_ref_clk_enable_errors.xml +++ /dev/null @@ -1,49 +0,0 @@ -<!-- 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_errors.xml $ --> -<!-- --> -<!-- OpenPOWER HostBoot Project --> -<!-- --> -<!-- COPYRIGHT International Business Machines Corp. 2013,2014 --> -<!-- --> -<!-- Licensed under the Apache License, Version 2.0 (the "License"); --> -<!-- you may not use this file except in compliance with the License. --> -<!-- You may obtain a copy of the License at --> -<!-- --> -<!-- http://www.apache.org/licenses/LICENSE-2.0 --> -<!-- --> -<!-- Unless required by applicable law or agreed to in writing, software --> -<!-- distributed under the License is distributed on an "AS IS" BASIS, --> -<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or --> -<!-- implied. See the License for the specific language governing --> -<!-- permissions and limitations under the License. --> -<!-- --> -<!-- IBM_PROLOG_END_TAG --> -<!-- $Id: proc_cen_ref_clk_enable_errors.xml,v 1.2 2014/02/28 17:53:41 jmcgill Exp $ --> -<!-- Error definitions for proc_cen_ref_clk_enable --> -<hwpErrors> - <!-- *********************************************************************** --> - <hwpError> - <rc>RC_PROC_CEN_REF_CLK_ENABLE_SWIZZLE_ERR</rc> - <description>Translated Centaur refclock enable bit position is out of range.</description> - <ffdc>PROC_TARGET</ffdc> - <ffdc>CENTAUR_POSITION</ffdc> - <ffdc>REFCLOCK_BIT</ffdc> - <callout> - <procedure>CODE</procedure> - <priority>HIGH</priority> - </callout> - </hwpError> - <hwpError> - <rc>RC_PROC_CEN_REF_CLK_ENABLE_CONFIG_ERR</rc> - <description>Not all Centaurs marked as attached were configured.</description> - <ffdc>PROC_TARGET</ffdc> - <ffdc>CONFIGURED_CENTAUR_POSITIONS</ffdc> - <ffdc>ATTACHED_CENTAUR_POSITIONS</ffdc> - <callout> - <procedure>CODE</procedure> - <priority>HIGH</priority> - </callout> - </hwpError> -</hwpErrors> |