diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.C new file mode 100644 index 00000000000..da89cd6ef9a --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.C @@ -0,0 +1,84 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019 */ +/* [+] 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 */ +#include "p9_fbc_ioo_dl_npu_scom.H" +#include +#include +#include + +using namespace fapi2; + + +fapi2::ReturnCode p9_fbc_ioo_dl_npu_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1, const fapi2::Target& TGT2) +{ + { + fapi2::ATTR_EC_Type l_chip_ec; + fapi2::ATTR_NAME_Type l_chip_id; + FAPI_TRY(FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_NAME, TGT1, l_chip_id)); + FAPI_TRY(FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_EC, TGT1, l_chip_ec)); + fapi2::ATTR_PROC_NPU_REGION_ENABLED_Type l_TGT1_ATTR_PROC_NPU_REGION_ENABLED; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_NPU_REGION_ENABLED, TGT1, l_TGT1_ATTR_PROC_NPU_REGION_ENABLED)); + fapi2::ATTR_OPTICS_CONFIG_MODE_Type l_TGT0_ATTR_OPTICS_CONFIG_MODE; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_OPTICS_CONFIG_MODE, TGT0, l_TGT0_ATTR_OPTICS_CONFIG_MODE)); + uint64_t l_def_OBUS_NV_ENABLED = ((l_TGT0_ATTR_OPTICS_CONFIG_MODE == fapi2::ENUM_ATTR_OPTICS_CONFIG_MODE_NV) + && l_TGT1_ATTR_PROC_NPU_REGION_ENABLED); + fapi2::buffer l_scom_buffer; + { + if (((l_chip_id == 0x7) && (l_chip_ec == 0x10)) ) + { + FAPI_TRY(fapi2::getScom( TGT0, 0x901080cull, l_scom_buffer )); + + if (l_def_OBUS_NV_ENABLED) + { + constexpr auto l_PB_IOO_LL0_CONFIG_NV0_NPU_ENABLED_ON = 0x1; + l_scom_buffer.insert<60, 1, 63, uint64_t>(l_PB_IOO_LL0_CONFIG_NV0_NPU_ENABLED_ON ); + } + + if (l_def_OBUS_NV_ENABLED) + { + constexpr auto l_PB_IOO_LL0_CONFIG_NV1_NPU_ENABLED_ON = 0x1; + l_scom_buffer.insert<61, 1, 63, uint64_t>(l_PB_IOO_LL0_CONFIG_NV1_NPU_ENABLED_ON ); + } + + if (l_def_OBUS_NV_ENABLED) + { + constexpr auto l_PB_IOO_LL0_CONFIG_NV2_NPU_ENABLED_ON = 0x1; + l_scom_buffer.insert<62, 1, 63, uint64_t>(l_PB_IOO_LL0_CONFIG_NV2_NPU_ENABLED_ON ); + } + + if (l_def_OBUS_NV_ENABLED) + { + constexpr auto l_PB_IOO_LL0_CONFIG_NV3_NPU_ENABLED_ON = 0x1; + l_scom_buffer.insert<63, 1, 63, uint64_t>(l_PB_IOO_LL0_CONFIG_NV3_NPU_ENABLED_ON ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x901080cull, l_scom_buffer)); + } + } + + }; +fapi_try_exit: + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.H new file mode 100644 index 00000000000..144dc116560 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_npu_scom.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019 */ +/* [+] 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 */ +#ifndef _INIT_P9_FBC_IOO_DL_NPU_SCOM_PROCEDURE_H_ +#define _INIT_P9_FBC_IOO_DL_NPU_SCOM_PROCEDURE_H_ + + +#include +#include +#include + + +typedef fapi2::ReturnCode (*p9_fbc_ioo_dl_npu_scom_FP_t)(const fapi2::Target&, + const fapi2::Target&, const fapi2::Target&); + +extern "C" +{ + + fapi2::ReturnCode p9_fbc_ioo_dl_npu_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1, const fapi2::Target& TGT2); + +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_scom.C index f724cdb5a7a..384d9070f7a 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_scom.C +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_fbc_ioo_dl_scom.C @@ -116,33 +116,6 @@ fapi2::ReturnCode p9_fbc_ioo_dl_scom(const fapi2::Target(l_PB_IOO_LL0_CONFIG_NV0_NPU_ENABLED_ON ); - } - } - - if (((l_chip_id == 0x7) && (l_chip_ec == 0x10)) ) - { - if (l_def_OBUS_NV_ENABLED) - { - constexpr auto l_PB_IOO_LL0_CONFIG_NV1_NPU_ENABLED_ON = 0x1; - l_scom_buffer.insert<61, 1, 63, uint64_t>(l_PB_IOO_LL0_CONFIG_NV1_NPU_ENABLED_ON ); - } - } - - if (((l_chip_id == 0x7) && (l_chip_ec == 0x10)) ) - { - if (l_def_OBUS_NV_ENABLED) - { - constexpr auto l_PB_IOO_LL0_CONFIG_NV2_NPU_ENABLED_ON = 0x1; - l_scom_buffer.insert<62, 1, 63, uint64_t>(l_PB_IOO_LL0_CONFIG_NV2_NPU_ENABLED_ON ); - } - } - if (((l_chip_id == 0x5) && (l_chip_ec == 0x20)) || ((l_chip_id == 0x5) && (l_chip_ec == 0x21)) || ((l_chip_id == 0x5) && (l_chip_ec == 0x22)) || ((l_chip_id == 0x5) && (l_chip_ec == 0x23)) || ((l_chip_id == 0x6) && (l_chip_ec == 0x10)) || ((l_chip_id == 0x6) && (l_chip_ec == 0x11)) || ((l_chip_id == 0x6) && (l_chip_ec == 0x12)) || ((l_chip_id == 0x6) @@ -179,15 +152,6 @@ fapi2::ReturnCode p9_fbc_ioo_dl_scom(const fapi2::Target(l_PB_IOO_LL0_CONFIG_NV3_NPU_ENABLED_ON ); - } - } - if (((l_chip_id == 0x5) && (l_chip_ec == 0x20)) || ((l_chip_id == 0x5) && (l_chip_ec == 0x21)) || ((l_chip_id == 0x5) && (l_chip_ec == 0x22)) || ((l_chip_id == 0x5) && (l_chip_ec == 0x23)) || ((l_chip_id == 0x6) && (l_chip_ec == 0x10)) || ((l_chip_id == 0x6) && (l_chip_ec == 0x11)) || ((l_chip_id == 0x6) && (l_chip_ec == 0x12)) || ((l_chip_id == 0x6)