From 26aca87c102a6ebf5e02572fa79d4107f29c8736 Mon Sep 17 00:00:00 2001 From: Lennard Streat Date: Wed, 3 May 2017 11:29:13 -0500 Subject: Cleaning up bugs in cumulus init files. Change-Id: I05d6e9376be605d61629ef01fb921714a728b969 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40105 Tested-by: Jenkins Server Reviewed-by: Thi N. Tran Reviewed-by: SHELTON LEUNG Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45849 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../p9/procedures/hwp/initfiles/p9c_dmi_scom.C | 265 +++++++++++++++++++++ .../p9/procedures/hwp/initfiles/p9c_dmi_scom.H | 45 ++++ .../p9/procedures/hwp/initfiles/p9c_dmi_scom.mk | 27 +++ .../p9/procedures/hwp/initfiles/p9c_mi_scom.C | 104 ++++++++ .../p9/procedures/hwp/initfiles/p9c_mi_scom.H | 45 ++++ .../p9/procedures/hwp/initfiles/p9c_mi_scom.mk | 27 +++ 6 files changed, 513 insertions(+) create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.C create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.H create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.mk create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.C create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.H create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.mk diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.C new file mode 100644 index 000000000..c64eb6c75 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.C @@ -0,0 +1,265 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.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 */ +#include "p9c_dmi_scom.H" +#include +#include +#include + +using namespace fapi2; + +constexpr uint64_t literal_8 = 8; +constexpr uint64_t literal_1 = 1; +constexpr uint64_t literal_32 = 32; +constexpr uint64_t literal_0b0100 = 0b0100; +constexpr uint64_t literal_0b1 = 0b1; +constexpr uint64_t literal_28 = 28; +constexpr uint64_t literal_0x1 = 0x1; +constexpr uint64_t literal_0x3 = 0x3; +constexpr uint64_t literal_0x5 = 0x5; +constexpr uint64_t literal_0x7 = 0x7; +constexpr uint64_t literal_0b1100111111111111111111111 = 0b1100111111111111111111111; +constexpr uint64_t literal_4 = 4; +constexpr uint64_t literal_6 = 6; +constexpr uint64_t literal_0x26 = 0x26; +constexpr uint64_t literal_0x33 = 0x33; +constexpr uint64_t literal_0x40 = 0x40; +constexpr uint64_t literal_0 = 0; +constexpr uint64_t literal_0b0 = 0b0; + +fapi2::ReturnCode p9c_dmi_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1) +{ + { + uint64_t l_def_ENABLE_AMO_CACHING = literal_1; + uint64_t l_def_ENABLE_DYNAMIC_64_128B_READS = literal_1; + uint64_t l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC = literal_1; + uint64_t l_def_ENABLE_PREFETCH_DROP_PROMOTE_PERFORMANCE = literal_1; + fapi2::ATTR_PROC_EPS_READ_CYCLES_T0_Type l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T0; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_EPS_READ_CYCLES_T0, TGT1, l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T0)); + uint64_t l_def_MC_EPSILON_CFG_T0 = ((l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T0 + literal_6) / literal_4); + fapi2::ATTR_PROC_EPS_READ_CYCLES_T1_Type l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T1; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_EPS_READ_CYCLES_T1, TGT1, l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T1)); + uint64_t l_def_MC_EPSILON_CFG_T1 = ((l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T1 + literal_6) / literal_4); + fapi2::ATTR_PROC_EPS_READ_CYCLES_T2_Type l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T2; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_EPS_READ_CYCLES_T2, TGT1, l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T2)); + uint64_t l_def_MC_EPSILON_CFG_T2 = ((l_TGT1_ATTR_PROC_EPS_READ_CYCLES_T2 + literal_6) / literal_4); + uint64_t l_def_ENABLE_MCBUSY = literal_1; + uint64_t l_def_MCICFG_REPLAY_DELAY = literal_1; + fapi2::buffer l_scom_buffer; + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010823ull, l_scom_buffer )); + + l_scom_buffer.insert<40, 6, 58, uint64_t>(literal_8 ); + + if (l_def_ENABLE_AMO_CACHING) + { + l_scom_buffer.insert<22, 6, 58, uint64_t>(literal_32 ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010823ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010824ull, l_scom_buffer )); + + l_scom_buffer.insert<28, 4, 60, uint64_t>(literal_0b0100 ); + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_ENABLE_REFRESH_BLOCK_SQ_OFF = 0x0; + l_scom_buffer.insert<16, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_ENABLE_REFRESH_BLOCK_SQ_OFF ); + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_ENABLE_REFRESH_BLOCK_NSQ_OFF = 0x0; + l_scom_buffer.insert<17, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_ENABLE_REFRESH_BLOCK_NSQ_OFF ); + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_ENABLE_REFRESH_BLOCK_DISP_OFF = 0x0; + l_scom_buffer.insert<18, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_ENABLE_REFRESH_BLOCK_DISP_OFF ); + l_scom_buffer.insert<63, 1, 63, uint64_t>(literal_0b1 ); + l_scom_buffer.insert<50, 5, 59, uint64_t>(literal_28 ); + + if (l_def_ENABLE_DYNAMIC_64_128B_READS) + { + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_EN_64_128_PB_READ_ON = 0x1; + l_scom_buffer.insert<36, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF2_EN_64_128_PB_READ_ON ); + } + + if (l_def_ENABLE_DYNAMIC_64_128B_READS) + { + l_scom_buffer.insert<19, 5, 59, uint64_t>(literal_8 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC) + { + l_scom_buffer.insert<0, 3, 61, uint64_t>(literal_0x1 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC) + { + l_scom_buffer.insert<3, 3, 61, uint64_t>(literal_0x3 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC) + { + l_scom_buffer.insert<6, 3, 61, uint64_t>(literal_0x5 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC) + { + l_scom_buffer.insert<9, 3, 61, uint64_t>(literal_0x7 ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010824ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010825ull, l_scom_buffer )); + + if (l_def_ENABLE_AMO_CACHING) + { + l_scom_buffer.insert<4, 25, 39, uint64_t>(literal_0b1100111111111111111111111 ); + } + + if (l_def_ENABLE_AMO_CACHING) + { + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCAMOC_AMO_SIZE_SELECT_128B_RW_64B_DATA = 0x1; + l_scom_buffer.insert<29, 3, 61, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCAMOC_AMO_SIZE_SELECT_128B_RW_64B_DATA ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_PERFORMANCE) + { + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCAMOC_FORCE_PF_DROP0_OFF = 0x0; + l_scom_buffer.insert<1, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCAMOC_FORCE_PF_DROP0_OFF ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010825ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010826ull, l_scom_buffer )); + + l_scom_buffer.insert<0, 8, 56, uint64_t>(literal_0x1 ); + l_scom_buffer.insert<8, 8, 56, uint64_t>(l_def_MC_EPSILON_CFG_T0 ); + l_scom_buffer.insert<16, 8, 56, uint64_t>(l_def_MC_EPSILON_CFG_T1 ); + l_scom_buffer.insert<24, 8, 56, uint64_t>(l_def_MC_EPSILON_CFG_T1 ); + l_scom_buffer.insert<32, 8, 56, uint64_t>(l_def_MC_EPSILON_CFG_T2 ); + l_scom_buffer.insert<40, 8, 56, uint64_t>(l_def_MC_EPSILON_CFG_T2 ); + FAPI_TRY(fapi2::putScom(TGT0, 0x5010826ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010827ull, l_scom_buffer )); + + if (l_def_ENABLE_MCBUSY) + { + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCBUSYQ_ENABLE_BUSY_COUNTERS_ON = 0x1; + l_scom_buffer.insert<0, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCBUSYQ_ENABLE_BUSY_COUNTERS_ON ); + } + + if (l_def_ENABLE_MCBUSY) + { + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCBUSYQ_BUSY_COUNTER_WINDOW_SELECT_1024_CYCLES = 0x1; + l_scom_buffer.insert<1, 3, 61, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCBUSYQ_BUSY_COUNTER_WINDOW_SELECT_1024_CYCLES ); + } + + if (l_def_ENABLE_MCBUSY) + { + l_scom_buffer.insert<4, 10, 54, uint64_t>(literal_0x26 ); + } + + if (l_def_ENABLE_MCBUSY) + { + l_scom_buffer.insert<14, 10, 54, uint64_t>(literal_0x33 ); + } + + if (l_def_ENABLE_MCBUSY) + { + l_scom_buffer.insert<24, 10, 54, uint64_t>(literal_0x40 ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010827ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x501082bull, l_scom_buffer )); + + if (l_def_ENABLE_AMO_CACHING) + { + constexpr auto l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF3_AMO_LIMIT_SEL_ON = 0x1; + l_scom_buffer.insert<45, 1, 63, uint64_t>(l_MC01_CHAN0_ATCL_CL_CLSCOM_MCPERF3_AMO_LIMIT_SEL_ON ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_PERFORMANCE) + { + l_scom_buffer.insert<15, 4, 60, uint64_t>(literal_0 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_PERFORMANCE) + { + l_scom_buffer.insert<19, 4, 60, uint64_t>(literal_0 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_PERFORMANCE) + { + l_scom_buffer.insert<23, 4, 60, uint64_t>(literal_0 ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_PERFORMANCE) + { + l_scom_buffer.insert<27, 4, 60, uint64_t>(literal_0 ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x501082bull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x701090aull, l_scom_buffer )); + + l_scom_buffer.insert<21, 4, 60, uint64_t>(l_def_MCICFG_REPLAY_DELAY ); + FAPI_TRY(fapi2::putScom(TGT0, 0x701090aull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x701090eull, l_scom_buffer )); + + constexpr auto l_MCP_CHAN0_CHI_MCICFG1Q_ECC_RDC_CFG_FIFO_TENURE_3_OFF = 0x0; + l_scom_buffer.insert<33, 1, 63, uint64_t>(l_MCP_CHAN0_CHI_MCICFG1Q_ECC_RDC_CFG_FIFO_TENURE_3_OFF ); + l_scom_buffer.insert<4, 1, 63, uint64_t>(literal_0b0 ); + l_scom_buffer.insert<5, 1, 63, uint64_t>(literal_0b0 ); + FAPI_TRY(fapi2::putScom(TGT0, 0x701090eull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x7010914ull, l_scom_buffer )); + + constexpr auto l_MCP_CHAN0_CHI_MBSECCQ_DELAY_VALID_1X_OFF = 0x0; + l_scom_buffer.insert<34, 1, 63, uint64_t>(l_MCP_CHAN0_CHI_MBSECCQ_DELAY_VALID_1X_OFF ); + constexpr auto l_MCP_CHAN0_CHI_MBSECCQ_DELAY_NONBYPASS_ON = 0x1; + l_scom_buffer.insert<37, 1, 63, uint64_t>(l_MCP_CHAN0_CHI_MBSECCQ_DELAY_NONBYPASS_ON ); + l_scom_buffer.insert<35, 2, 62, uint64_t>(literal_0 ); + FAPI_TRY(fapi2::putScom(TGT0, 0x7010914ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x7012348ull, l_scom_buffer )); + + if (l_def_ENABLE_AMO_CACHING) + { + constexpr auto l_MCP_CHAN0_WRITE_NEW_WRITE_64B_MODE_ON = 0x1; + l_scom_buffer.insert<9, 1, 63, uint64_t>(l_MCP_CHAN0_WRITE_NEW_WRITE_64B_MODE_ON ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x7012348ull, l_scom_buffer)); + } + + }; +fapi_try_exit: + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.H new file mode 100644 index 000000000..e06e5b6ee --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.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 */ +#ifndef _INIT_P9C_DMI_SCOM_PROCEDURE_H_ +#define _INIT_P9C_DMI_SCOM_PROCEDURE_H_ + + +#include +#include +#include + + +typedef fapi2::ReturnCode (*p9c_dmi_scom_FP_t)(const fapi2::Target&, + const fapi2::Target&); + +extern "C" +{ + + fapi2::ReturnCode p9c_dmi_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1); + +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.mk b/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.mk new file mode 100644 index 000000000..5bb0a3cfc --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.mk @@ -0,0 +1,27 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9c_dmi_scom.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=p9c_dmi_scom +lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments +$(call BUILD_PROCEDURE) \ No newline at end of file diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.C new file mode 100644 index 000000000..620c9a377 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.C @@ -0,0 +1,104 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.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 */ +#include "p9c_mi_scom.H" +#include +#include +#include + +using namespace fapi2; + +constexpr uint64_t literal_7 = 7; +constexpr uint64_t literal_1 = 1; +constexpr uint64_t literal_0x19 = 0x19; +constexpr uint64_t literal_0b0000000000001000 = 0b0000000000001000; + +fapi2::ReturnCode p9c_mi_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1) +{ + { + uint64_t l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC = literal_1; + uint64_t l_def_ENABLE_DYNAMIC_64_128B_READS = literal_1; + uint64_t l_def_ENABLE_ECRESP = literal_1; + uint64_t l_def_ENABLE_AMO_CACHING = literal_1; + fapi2::buffer l_scom_buffer; + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010810ull, l_scom_buffer )); + + l_scom_buffer.insert<46, 4, 60, uint64_t>(literal_7 ); + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC) + { + constexpr auto l_MC01_PBI01_SCOMFIR_MCPERF1_ENABLE_PF_DROP_CMDLIST_ON = 0x1; + l_scom_buffer.insert<61, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCPERF1_ENABLE_PF_DROP_CMDLIST_ON ); + } + + if (l_def_ENABLE_PREFETCH_DROP_PROMOTE_BASIC) + { + l_scom_buffer.insert<32, 7, 57, uint64_t>(literal_0x19 ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010810ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010811ull, l_scom_buffer )); + + constexpr auto l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_CENTAUR_PERFMON_COMMAND_ON = 0x1; + l_scom_buffer.insert<48, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_CENTAUR_PERFMON_COMMAND_ON ); + constexpr auto l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_EMERGENCY_THROTTLE_ON = 0x1; + l_scom_buffer.insert<21, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_EMERGENCY_THROTTLE_ON ); + constexpr auto l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_CENTAUR_CHECKSTOP_COMMAND_ON = 0x1; + l_scom_buffer.insert<22, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_CENTAUR_CHECKSTOP_COMMAND_ON ); + constexpr auto l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_CENTAUR_TRACESTOP_COMMAND_ON = 0x1; + l_scom_buffer.insert<23, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_CENTAUR_TRACESTOP_COMMAND_ON ); + + if (l_def_ENABLE_DYNAMIC_64_128B_READS) + { + constexpr auto l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_64_128B_READ_ON = 0x1; + l_scom_buffer.insert<9, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCMODE0_ENABLE_64_128B_READ_ON ); + } + + if (l_def_ENABLE_ECRESP) + { + constexpr auto l_MC01_PBI01_SCOMFIR_MCMODE0_CENTAURP_ENABLE_ECRESP_ON = 0x1; + l_scom_buffer.insert<7, 1, 63, uint64_t>(l_MC01_PBI01_SCOMFIR_MCMODE0_CENTAURP_ENABLE_ECRESP_ON ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010811ull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010813ull, l_scom_buffer )); + + if (l_def_ENABLE_AMO_CACHING) + { + l_scom_buffer.insert<24, 16, 48, uint64_t>(literal_0b0000000000001000 ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x5010813ull, l_scom_buffer)); + } + + }; +fapi_try_exit: + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.H new file mode 100644 index 000000000..0e12df34d --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.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 */ +#ifndef _INIT_P9C_MI_SCOM_PROCEDURE_H_ +#define _INIT_P9C_MI_SCOM_PROCEDURE_H_ + + +#include +#include +#include + + +typedef fapi2::ReturnCode (*p9c_mi_scom_FP_t)(const fapi2::Target&, + const fapi2::Target&); + +extern "C" +{ + + fapi2::ReturnCode p9c_mi_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1); + +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.mk b/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.mk new file mode 100644 index 000000000..a9a6cf85b --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.mk @@ -0,0 +1,27 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/initfiles/p9c_mi_scom.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=p9c_mi_scom +lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments +$(call BUILD_PROCEDURE) \ No newline at end of file -- cgit v1.2.1