diff options
Diffstat (limited to 'src/import/chips/p9')
10 files changed, 462 insertions, 103 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.C b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.C new file mode 100644 index 000000000..c2064485a --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.C @@ -0,0 +1,166 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 */ +/// +/// @file p9_chiplet_scominit.C +/// +/// @brief apply fabric SCOM inits +/// + +// +// *HWP HW Owner : Joe McGill <jmcgill@us.ibm.com> +// *HWP FW Owner : Thi N. Tran <thi@us.ibm.com> +// *HWP Team : Nest +// *HWP Level : 2 +// *HWP Consumed by : HB +// + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <p9_chiplet_fabric_scominit.H> +#include <p9_fbc_no_hp_scom.H> +#include <p9_fbc_ioe_tl_scom.H> +#include <p9_fbc_ioe_dl_scom.H> + +#include <p9_xbus_scom_addresses.H> +#include <p9_xbus_scom_addresses_fld.H> +#include <p9_obus_scom_addresses.H> +#include <p9_obus_scom_addresses_fld.H> +#include <p9_misc_scom_addresses.H> +#include <p9_perv_scom_addresses.H> + +//------------------------------------------------------------------------------ +// Constant definitions +//------------------------------------------------------------------------------ +const uint64_t FBC_IOE_TL_FIR_ACTION0 = 0x0000000000000000ULL; +const uint64_t FBC_IOE_TL_FIR_ACTION1 = 0x004B000000000000ULL; +const uint64_t FBC_IOE_TL_FIR_MASK = 0xFF24F0303FFFFFFFULL; + +const uint64_t FBC_IOE_DL_FIR_ACTION0 = 0x0000000000000000ULL; +const uint64_t FBC_IOE_DL_FIR_ACTION1 = 0x0303C00000001FFCULL; +const uint64_t FBC_IOE_DL_FIR_MASK = 0xFCFC3FFFFFFFE003ULL; + +//------------------------------------------------------------------------------ +// Function definitions +//------------------------------------------------------------------------------ + +fapi2::ReturnCode p9_chiplet_fabric_scominit(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target) +{ + fapi2::ReturnCode l_rc; + char l_procTargetStr[fapi2::MAX_ECMD_STRING_LEN]; + char l_chipletTargetStr[fapi2::MAX_ECMD_STRING_LEN]; + fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM; + std::vector<fapi2::Target<fapi2::TARGET_TYPE_XBUS>> l_xbus_chiplets; + std::vector<fapi2::Target<fapi2::TARGET_TYPE_OBUS>> l_obus_chiplets; + + fapi2::ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE_Type l_fbc_optics_cfg_mode = { fapi2::ENUM_ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE_SMP }; + FAPI_DBG("Start"); + + // Get proc target string + fapi2::toString(i_target, l_procTargetStr, sizeof(l_procTargetStr)); + + // apply FBC non-hotplug initfile + FAPI_DBG("Invoking p9.fbc.no_hp.scom.initfile on target %s...", l_procTargetStr); + FAPI_EXEC_HWP(l_rc, p9_fbc_no_hp_scom, i_target, FAPI_SYSTEM); + + if (l_rc) + { + FAPI_ERR("Error from p9_fbc_no_hp_scom"); + fapi2::current_err = l_rc; + goto fapi_try_exit; + } + + // setup IOE (XBUS FBC IO) TL SCOMs + FAPI_DBG("Invoking p9.fbc.ioe_tl.scom.initfile on target %s...", l_procTargetStr); + FAPI_EXEC_HWP(l_rc, p9_fbc_ioe_tl_scom, i_target, FAPI_SYSTEM); + + if (l_rc) + { + FAPI_ERR("Error from p9_fbc_ioe_tl_scom"); + fapi2::current_err = l_rc; + goto fapi_try_exit; + } + + l_xbus_chiplets = i_target.getChildren<fapi2::TARGET_TYPE_XBUS>(); + + if (l_xbus_chiplets.size()) + { + FAPI_TRY(fapi2::putScom(i_target, PU_PB_IOE_FIR_ACTION0_REG, FBC_IOE_TL_FIR_ACTION0), + "Error from putScom (PU_PB_IOE_FIR_ACTION0_REG)"); + FAPI_TRY(fapi2::putScom(i_target, PU_PB_IOE_FIR_ACTION1_REG, FBC_IOE_TL_FIR_ACTION1), + "Error from putScom (PU_PB_IOE_FIR_ACTION1_REG)"); + FAPI_TRY(fapi2::putScom(i_target, PU_PB_IOE_FIR_MASK_REG, FBC_IOE_TL_FIR_MASK), + "Error from putScom (PU_PB_IOE_FIR_MASK_REG)"); + } + + // setup IOE (XBUS FBC IO) DL SCOMs + for (auto l_iter = l_xbus_chiplets.begin(); + l_iter != l_xbus_chiplets.end(); + l_iter++) + { + fapi2::toString(*l_iter, l_chipletTargetStr, sizeof(l_chipletTargetStr)); + FAPI_DBG("Invoking p9.fbc.ioe_dl.scom.initfile on target %s...", l_chipletTargetStr); + FAPI_EXEC_HWP(l_rc, p9_fbc_ioe_dl_scom, *l_iter, i_target); + + if (l_rc) + { + FAPI_ERR("Error from p9_fbc_ioe_dl_scom"); + fapi2::current_err = l_rc; + goto fapi_try_exit; + } + + // configure action registers & unmask + FAPI_TRY(fapi2::putScom(*l_iter, XBUS_LL0_IOEL_FIR_ACTION0_REG, FBC_IOE_DL_FIR_ACTION0), + "Error from putScom (XBUS_LL0_IOEL_FIR_ACTION0_REG)"); + FAPI_TRY(fapi2::putScom(*l_iter, XBUS_LL0_IOEL_FIR_ACTION1_REG, FBC_IOE_DL_FIR_ACTION1), + "Error from putScom (XBUS_LL0_IOEL_FIR_ACTION1_REG)"); + FAPI_TRY(fapi2::putScom(*l_iter, XBUS_LL0_LL0_LL0_IOEL_FIR_MASK_REG, FBC_IOE_DL_FIR_MASK), + "Error from putScom (XBUS_LL0_LL0_LL0_IOEL_FIR_MASK_REG)"); + } + + // set FBC optics config mode attribute + l_obus_chiplets = i_target.getChildren<fapi2::TARGET_TYPE_OBUS>(); + + for (auto l_iter = l_obus_chiplets.begin(); + l_iter != l_obus_chiplets.end(); + l_iter++) + { + uint8_t l_unit_pos; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, *l_iter, l_unit_pos), + "Error from FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS)"); + FAPI_INF("Updating index: %d\n", l_unit_pos); + FAPI_INF(" before: %d\n", l_fbc_optics_cfg_mode[l_unit_pos]); + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_OPTICS_CONFIG_MODE, *l_iter, l_fbc_optics_cfg_mode[l_unit_pos]), + "Error from FAPI_ATTR_GET(ATTR_OPTICS_CONFIG_MODE)"); + FAPI_INF(" after: %d\n", l_fbc_optics_cfg_mode[l_unit_pos]); + } + + FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE, i_target, l_fbc_optics_cfg_mode), + "Error from FAPI_ATTR_SET(ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE)"); + +fapi_try_exit: + FAPI_DBG("End"); + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.H b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.H new file mode 100644 index 000000000..8b15e4f5b --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.H @@ -0,0 +1,69 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 */ +/// +/// @file p9_chiplet_fabric_scominit.H +/// +/// @brief apply fabric SCOM inits +/// + +// +// *HWP HW Owner : Joe McGill <jmcgill@us.ibm.com> +// *HWP FW Owner : Thi N. Tran <thi@us.ibm.com> +// *HWP Team : Nest +// *HWP Level : 2 +// *HWP Consumed by : HB +// + +#ifndef _P9_CHIPLET_FABRIC_SCOMINIT_H_ +#define _P9_CHIPLET_FABRIC_SCOMINIT_H_ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <fapi2.H> + +//------------------------------------------------------------------------------ +// Structure definitions +//------------------------------------------------------------------------------ + +typedef fapi2::ReturnCode (*p9_chiplet_fabric_scominit_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&); + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ + +extern "C" +{ + +/// @brief apply fabric SCOM inits +/// +/// @param[in] i_target Reference to processor chip target +/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. + fapi2::ReturnCode p9_chiplet_fabric_scominit(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target); + +} // extern "C" + +#endif // _P9_CHIPLET_FABRIC_SCOMINIT_H_ + diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.mk b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.mk new file mode 100644 index 000000000..15bc2a985 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.mk @@ -0,0 +1,27 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/nest/p9_chiplet_fabric_scominit.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2017 +# [+] 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 +PROCEDURE=p9_chiplet_fabric_scominit +$(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/initfiles) +$(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.C b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.C index a25974acc..a068dc49d 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.C +++ b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.C @@ -25,7 +25,7 @@ /// /// @file p9_chiplet_scominit.C /// -/// @brief SCOM inits to all chiplets (sans Quad) +/// @brief SCOM inits to all chiplets (sans Quad/fabric) /// // @@ -40,9 +40,6 @@ // Includes //------------------------------------------------------------------------------ #include <p9_chiplet_scominit.H> -#include <p9_fbc_no_hp_scom.H> -#include <p9_fbc_ioe_tl_scom.H> -#include <p9_fbc_ioe_dl_scom.H> #include <p9_fbc_ioo_tl_scom.H> #include <p9_fbc_ioo_dl_scom.H> #include <p9_mcs_scom.H> @@ -61,18 +58,10 @@ //------------------------------------------------------------------------------ // Constant definitions //------------------------------------------------------------------------------ -const uint64_t FBC_IOE_TL_FIR_ACTION0 = 0x0000000000000000ULL; -const uint64_t FBC_IOE_TL_FIR_ACTION1 = 0x004B000000000000ULL; -const uint64_t FBC_IOE_TL_FIR_MASK = 0xFF24F0303FFFFFFFULL; - const uint64_t FBC_IOO_TL_FIR_ACTION0 = 0x0000000000000000ULL; const uint64_t FBC_IOO_TL_FIR_ACTION1 = 0x0002400000000000ULL; const uint64_t FBC_IOO_TL_FIR_MASK = 0xFF6DB0000FFFFFFFULL; -const uint64_t FBC_IOE_DL_FIR_ACTION0 = 0x0000000000000000ULL; -const uint64_t FBC_IOE_DL_FIR_ACTION1 = 0x0303C00000001FFCULL; -const uint64_t FBC_IOE_DL_FIR_MASK = 0xFCFC3FFFFFFFE003ULL; - const uint64_t FBC_IOO_DL_FIR_ACTION0 = 0x0000000000000000ULL; const uint64_t FBC_IOO_DL_FIR_ACTION1 = 0x0303C0000300FFFCULL; const uint64_t FBC_IOO_DL_FIR_MASK = 0xFCFC3FFFFCFF000CULL; @@ -94,6 +83,7 @@ static const uint8_t PERV_OB_CPLT_CONF1_NVC_IOVALID = 0x8; static const uint8_t NV_OB0_MASK = 0x1; static const uint8_t NV_OB3_MASK = 0x2; + //------------------------------------------------------------------------------ // Function definitions //------------------------------------------------------------------------------ @@ -104,7 +94,6 @@ fapi2::ReturnCode p9_chiplet_scominit(const fapi2::Target<fapi2::TARGET_TYPE_PRO char l_procTargetStr[fapi2::MAX_ECMD_STRING_LEN]; char l_chipletTargetStr[fapi2::MAX_ECMD_STRING_LEN]; fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM; - std::vector<fapi2::Target<fapi2::TARGET_TYPE_XBUS>> l_xbus_chiplets; std::vector<fapi2::Target<fapi2::TARGET_TYPE_OBUS>> l_obus_chiplets; std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCS>> l_mcs_targets; std::vector<fapi2::Target<fapi2::TARGET_TYPE_CAPP>> l_capp_targets; @@ -115,9 +104,7 @@ fapi2::ReturnCode p9_chiplet_scominit(const fapi2::Target<fapi2::TARGET_TYPE_PRO uint8_t l_ndl_iovalid = 0; uint8_t l_is_simulation = 0; - fapi2::ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE_Type l_fbc_optics_cfg_mode = { fapi2::ENUM_ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE_SMP }; FAPI_DBG("Start"); - // Get attribute to check if it is dd1 or dd2 FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_P9N_DD1_SPY_NAMES, i_target, l_dd1)); // Get attribute to check if NDL IOValids need set (dd2+) @@ -214,86 +201,9 @@ fapi2::ReturnCode p9_chiplet_scominit(const fapi2::Target<fapi2::TARGET_TYPE_PRO } - // apply FBC non-hotplug initfile - FAPI_DBG("Invoking p9.fbc.no_hp.scom.initfile on target %s...", l_procTargetStr); - FAPI_EXEC_HWP(l_rc, p9_fbc_no_hp_scom, i_target, FAPI_SYSTEM); - - if (l_rc) - { - FAPI_ERR("Error from p9_fbc_no_hp_scom"); - fapi2::current_err = l_rc; - goto fapi_try_exit; - } - - // setup IOE (XBUS FBC IO) TL SCOMs - FAPI_DBG("Invoking p9.fbc.ioe_tl.scom.initfile on target %s...", l_procTargetStr); - FAPI_EXEC_HWP(l_rc, p9_fbc_ioe_tl_scom, i_target, FAPI_SYSTEM); - - if (l_rc) - { - FAPI_ERR("Error from p9_fbc_ioe_tl_scom"); - fapi2::current_err = l_rc; - goto fapi_try_exit; - } - - l_xbus_chiplets = i_target.getChildren<fapi2::TARGET_TYPE_XBUS>(); - - if (l_xbus_chiplets.size()) - { - FAPI_TRY(fapi2::putScom(i_target, PU_PB_IOE_FIR_ACTION0_REG, FBC_IOE_TL_FIR_ACTION0), - "Error from putScom (PU_PB_IOE_FIR_ACTION0_REG)"); - FAPI_TRY(fapi2::putScom(i_target, PU_PB_IOE_FIR_ACTION1_REG, FBC_IOE_TL_FIR_ACTION1), - "Error from putScom (PU_PB_IOE_FIR_ACTION1_REG)"); - FAPI_TRY(fapi2::putScom(i_target, PU_PB_IOE_FIR_MASK_REG, FBC_IOE_TL_FIR_MASK), - "Error from putScom (PU_PB_IOE_FIR_MASK_REG)"); - } - - // setup IOE (XBUS FBC IO) DL SCOMs - for (auto l_iter = l_xbus_chiplets.begin(); - l_iter != l_xbus_chiplets.end(); - l_iter++) - { - fapi2::toString(*l_iter, l_chipletTargetStr, sizeof(l_chipletTargetStr)); - FAPI_DBG("Invoking p9.fbc.ioe_dl.scom.initfile on target %s...", l_chipletTargetStr); - FAPI_EXEC_HWP(l_rc, p9_fbc_ioe_dl_scom, *l_iter, i_target); - - if (l_rc) - { - FAPI_ERR("Error from p9_fbc_ioe_dl_scom"); - fapi2::current_err = l_rc; - goto fapi_try_exit; - } - - // configure action registers & unmask - FAPI_TRY(fapi2::putScom(*l_iter, XBUS_LL0_IOEL_FIR_ACTION0_REG, FBC_IOE_DL_FIR_ACTION0), - "Error from putScom (XBUS_LL0_IOEL_FIR_ACTION0_REG)"); - FAPI_TRY(fapi2::putScom(*l_iter, XBUS_LL0_IOEL_FIR_ACTION1_REG, FBC_IOE_DL_FIR_ACTION1), - "Error from putScom (XBUS_LL0_IOEL_FIR_ACTION1_REG)"); - FAPI_TRY(fapi2::putScom(*l_iter, XBUS_LL0_LL0_LL0_IOEL_FIR_MASK_REG, FBC_IOE_DL_FIR_MASK), - "Error from putScom (XBUS_LL0_LL0_LL0_IOEL_FIR_MASK_REG)"); - } - - // set FBC optics config mode attribute + // invoke IOO (OBUS FBC IO) SCOM initfiles l_obus_chiplets = i_target.getChildren<fapi2::TARGET_TYPE_OBUS>(); - for (auto l_iter = l_obus_chiplets.begin(); - l_iter != l_obus_chiplets.end(); - l_iter++) - { - uint8_t l_unit_pos; - FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, *l_iter, l_unit_pos), - "Error from FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS)"); - FAPI_INF("Updating index: %d\n", l_unit_pos); - FAPI_INF(" before: %d\n", l_fbc_optics_cfg_mode[l_unit_pos]); - FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_OPTICS_CONFIG_MODE, *l_iter, l_fbc_optics_cfg_mode[l_unit_pos]), - "Error from FAPI_ATTR_GET(ATTR_OPTICS_CONFIG_MODE)"); - FAPI_INF(" after: %d\n", l_fbc_optics_cfg_mode[l_unit_pos]); - } - - FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE, i_target, l_fbc_optics_cfg_mode), - "Error from FAPI_ATTR_SET(ATTR_PROC_FABRIC_OPTICS_CONFIG_MODE)"); - - // invoke IOO (OBUS FBC IO) SCOM initfiles FAPI_DBG("Invoking p9.fbc.ioo_tl.scom.initfile on target %s...", l_procTargetStr); FAPI_EXEC_HWP(l_rc, p9_fbc_ioo_tl_scom, i_target); diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.H b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.H index dbf753107..50cea5a9c 100644 --- a/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.H +++ b/src/import/chips/p9/procedures/hwp/nest/p9_chiplet_scominit.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,7 +25,7 @@ /// /// @file p9_chiplet_scominit.H /// -/// @brief SCOM inits to all chiplets (sans Quad) +/// @brief SCOM inits to all chiplets (sans Quad/fabric) /// // @@ -57,7 +57,7 @@ typedef fapi2::ReturnCode (*p9_chiplet_scominit_FP_t)(const fapi2::Target<fapi2: extern "C" { -/// @brief SCOM inits to all chiplets (sans Quad) +/// @brief SCOM inits to all chiplets (sans Quad/fabric) /// /// @param[in] i_target Reference to processor chip target /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.C b/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.C index 24ef3feb4..e27ce5a9e 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,7 +25,7 @@ //------------------------------------------------------------------------------ /// @file p9_chiplet_enable_ridi.C /// -/// @brief Enable RI/DI chip wide +/// @brief Enable RI/DI for all IO chiplets (excluding XBUS) //------------------------------------------------------------------------------ // *HWP HW Owner : Abhishek Agarwal <abagarw8@in.ibm.com> // *HWP HW Backup Owner : Srinivas V Naga <srinivan@in.ibm.com> @@ -50,7 +50,10 @@ fapi2::ReturnCode p9_chiplet_enable_ridi(const FAPI_DBG("Entering ..."); for(auto l_target_cplt : i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV> - (fapi2::TARGET_FILTER_SYNC_MODE_ALL_IO_EXCEPT_NEST, fapi2::TARGET_STATE_FUNCTIONAL)) + (static_cast<fapi2::TargetFilter>(fapi2::TARGET_FILTER_ALL_MC | + fapi2::TARGET_FILTER_ALL_PCI | + fapi2::TARGET_FILTER_ALL_OBUS), + fapi2::TARGET_STATE_FUNCTIONAL)) { FAPI_INF("Call p9_chiplet_enable_ridi_net_ctrl_action_function"); FAPI_TRY(p9_chiplet_enable_ridi_net_ctrl_action_function(l_target_cplt)); @@ -63,7 +66,7 @@ fapi_try_exit: } -/// @brief Enable Drivers/Recievers of MC, ABUS, OBUS, XBUS chiplet +/// @brief Enable Drivers/Recievers of O, PCIE, MC chiplets /// /// @param[in] i_target_chiplet Reference to TARGET_TYPE_PERV target /// @return FAPI2_RC_SUCCESS if success, else error code. diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.H b/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.H index 91060ef7c..e2c39cf1b 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.H +++ b/src/import/chips/p9/procedures/hwp/perv/p9_chiplet_enable_ridi.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,7 +25,7 @@ //------------------------------------------------------------------------------ /// @file p9_chiplet_enable_ridi.H /// -/// @brief Enable RI/DI chip wide +/// @brief Enable RI/DI for all IO chiplets (excluding XBUS) //------------------------------------------------------------------------------ // *HWP HW Owner : Abhishek Agarwal <abagarw8@in.ibm.com> // *HWP HW Backup Owner : Srinivas V Naga <srinivan@in.ibm.com> @@ -46,7 +46,7 @@ typedef fapi2::ReturnCode (*p9_chiplet_enable_ridi_FP_t)( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&); -/// @brief Drop RI/DI for all chiplets being used (A, X, O, Pcie, DMI) +/// @brief Drop RI/DI for O, PCIE, MC /// /// @param[in] i_target_chip Reference to TARGET_TYPE_PROC_CHIP target /// @return FAPI2_RC_SUCCESS if success, else error code. diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.C b/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.C new file mode 100644 index 000000000..bcf1b98bf --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.C @@ -0,0 +1,98 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 */ +//------------------------------------------------------------------------------ +/// @file p9_xbus_enable_ridi.C +/// +/// @brief Enable XBUS RI/DI +//------------------------------------------------------------------------------ +// *HWP HW Owner : Abhishek Agarwal <abagarw8@in.ibm.com> +// *HWP HW Backup Owner : Srinivas V Naga <srinivan@in.ibm.com> +// *HWP FW Owner : Sunil Kumar <skumar8j@in.ibm.com> +// *HWP Team : Perv +// *HWP Level : 2 +// *HWP Consumed by : HB +//------------------------------------------------------------------------------ + + +//## auto_generated +#include "p9_xbus_enable_ridi.H" + +#include "p9_perv_scom_addresses.H" + +static fapi2::ReturnCode p9_xbus_enable_ridi_net_ctrl_action_function( + const fapi2::Target<fapi2::TARGET_TYPE_PERV>& i_target_chiplet); + +fapi2::ReturnCode p9_xbus_enable_ridi(const + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip) +{ + FAPI_DBG("Entering ..."); + + for(auto l_target_cplt : i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV> + (fapi2::TARGET_FILTER_XBUS, fapi2::TARGET_STATE_FUNCTIONAL)) + { + FAPI_INF("Call p9_xbus_enable_ridi_net_ctrl_action_function"); + FAPI_TRY(p9_xbus_enable_ridi_net_ctrl_action_function(l_target_cplt)); + } + + FAPI_DBG("Exiting ..."); + +fapi_try_exit: + return fapi2::current_err; + +} + +/// @brief Enable Drivers/Recievers of MC, ABUS, OBUS, XBUS chiplet +/// +/// @param[in] i_target_chiplet Reference to TARGET_TYPE_PERV target +/// @return FAPI2_RC_SUCCESS if success, else error code. +static fapi2::ReturnCode p9_xbus_enable_ridi_net_ctrl_action_function( + const fapi2::Target<fapi2::TARGET_TYPE_PERV>& i_target_chiplet) +{ + bool l_read_reg = false; + fapi2::buffer<uint64_t> l_data64; + FAPI_DBG("Entering ..."); + + FAPI_INF("Check for chiplet enable"); + //Getting NET_CTRL0 register value + FAPI_TRY(fapi2::getScom(i_target_chiplet, PERV_NET_CTRL0, l_data64)); + l_read_reg = l_data64.getBit<0>(); //l_read_reg = NET_CTRL0.CHIPLET_ENABLE + + if ( l_read_reg ) + { + FAPI_INF("Enable Recievers, Drivers DI1 & DI2"); + //Setting NET_CTRL0 register value + l_data64.flush<0>(); + l_data64.setBit<19>(); //NET_CTRL0.RI_N = 1 + l_data64.setBit<20>(); //NET_CTRL0.DI1_N = 1 + l_data64.setBit<21>(); //NET_CTRL0.DI2_N = 1 + FAPI_TRY(fapi2::putScom(i_target_chiplet, PERV_NET_CTRL0_WOR, l_data64)); + } + + FAPI_DBG("Exiting ..."); + +fapi_try_exit: + return fapi2::current_err; + +} diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.H b/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.H new file mode 100644 index 000000000..bf3ae2dbd --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.H @@ -0,0 +1,60 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017 */ +/* [+] 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 */ +//------------------------------------------------------------------------------ +/// @file p9_xbus_enable_ridi.H +/// +/// @brief Enable RI/DI for XBUS +//------------------------------------------------------------------------------ +// *HWP HW Owner : Abhishek Agarwal <abagarw8@in.ibm.com> +// *HWP HW Backup Owner : Srinivas V Naga <srinivan@in.ibm.com> +// *HWP FW Owner : Sunil kumar <skumar8j@in.ibm.com> +// *HWP Team : Perv +// *HWP Level : 2 +// *HWP Consumed by : HB +//------------------------------------------------------------------------------ + + +#ifndef _P9_XBUS_ENABLE_RIDI_H_ +#define _P9_XBUS_ENABLE_RIDI_H_ + + +#include <fapi2.H> + + +typedef fapi2::ReturnCode (*p9_xbus_enable_ridi_FP_t)( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&); + +/// @brief Drop RI/DI for XBUS +/// +/// @param[in] i_target_chip Reference to TARGET_TYPE_PROC_CHIP target +/// @return FAPI2_RC_SUCCESS if success, else error code. + +extern "C" +{ + fapi2::ReturnCode p9_xbus_enable_ridi(const + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip); +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.mk b/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.mk new file mode 100644 index 000000000..0dd68cee2 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.mk @@ -0,0 +1,26 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/perv/p9_xbus_enable_ridi.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2017 +# [+] 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 +PROCEDURE=p9_xbus_enable_ridi +$(call BUILD_PROCEDURE) |