diff options
author | Ben Gass <bgass@us.ibm.com> | 2018-09-13 15:34:01 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2018-11-20 17:48:04 -0600 |
commit | 3f1f2186bb80322594a3cc81241c390119d69552 (patch) | |
tree | 7ab9514c3431a99f846658376b438523a0573a71 /src/import/chips/p9/procedures/hwp/initfiles | |
parent | 499916e4586920a5342a64646f3f2ec4bbe4e19d (diff) | |
download | talos-hostboot-3f1f2186bb80322594a3cc81241c390119d69552.tar.gz talos-hostboot-3f1f2186bb80322594a3cc81241c390119d69552.zip |
Adding omi_init procedures.
Change-Id: I176be8901393d62cee0173568e538565444eac01
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66094
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67326
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/initfiles')
9 files changed, 234 insertions, 51 deletions
diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.C index d341c6750..4bf511be5 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.C +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.C @@ -22,11 +22,42 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -/// -/// @file p9a_mcc_omi_scom.C -/// -// *HWP HWP Owner: Benjamin Gass <bgass@us.ibm.com> -// *HWP HWP Backup: Daniel Crowell <dcrowell@us.ibm.com> -// *HWP Team: -// *HWP Level: 2 -// *HWP Consumed by: HB +#include "p9a_mcc_omi_scom.H" +#include <stdint.h> +#include <stddef.h> +#include <fapi2.H> + +using namespace fapi2; + +constexpr uint64_t literal_0b100000 = 0b100000; +constexpr uint64_t literal_0b0001 = 0b0001; +constexpr uint64_t literal_0b1000000 = 0b1000000; +constexpr uint64_t literal_0b011000 = 0b011000; +constexpr uint64_t literal_0b1 = 0b1; + +fapi2::ReturnCode p9a_mcc_omi_scom(const fapi2::Target<fapi2::TARGET_TYPE_MCC>& TGT0, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& TGT1) +{ + { + fapi2::buffer<uint64_t> l_scom_buffer; + { + FAPI_TRY(fapi2::getScom( TGT0, 0x701090aull, l_scom_buffer )); + + l_scom_buffer.insert<2, 6, 58, uint64_t>(literal_0b100000 ); + l_scom_buffer.insert<12, 4, 60, uint64_t>(literal_0b0001 ); + l_scom_buffer.insert<17, 7, 57, uint64_t>(literal_0b1000000 ); + l_scom_buffer.insert<50, 6, 58, uint64_t>(literal_0b011000 ); + l_scom_buffer.insert<58, 6, 58, uint64_t>(literal_0b011000 ); + FAPI_TRY(fapi2::putScom(TGT0, 0x701090aull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x701090bull, l_scom_buffer )); + + l_scom_buffer.insert<0, 1, 63, uint64_t>(literal_0b1 ); + FAPI_TRY(fapi2::putScom(TGT0, 0x701090bull, l_scom_buffer)); + } + + }; +fapi_try_exit: + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.H index a0672c4e6..716aea327 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.H +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.H @@ -22,11 +22,24 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -/// -/// @file p9a_mcc_omi_scom.H -/// -// *HWP HWP Owner: Benjamin Gass <bgass@us.ibm.com> -// *HWP HWP Backup: Daniel Crowell <dcrowell@us.ibm.com> -// *HWP Team: -// *HWP Level: 2 -// *HWP Consumed by: HB +#ifndef _INIT_P9A_MCC_OMI_SCOM_PROCEDURE_H_ +#define _INIT_P9A_MCC_OMI_SCOM_PROCEDURE_H_ + + +#include <stddef.h> +#include <stdint.h> +#include <fapi2.H> + + +typedef fapi2::ReturnCode (*p9a_mcc_omi_scom_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_MCC>&, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>&); + +extern "C" +{ + + fapi2::ReturnCode p9a_mcc_omi_scom(const fapi2::Target<fapi2::TARGET_TYPE_MCC>& TGT0, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& TGT1); + +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.mk b/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.mk index aae7abb0f..29f9597cf 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.mk +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_mcc_omi_scom.mk @@ -22,4 +22,6 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -# Makefile for p9a_mcc_omi_scom HWP +PROCEDURE=p9a_mcc_omi_scom +lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments +$(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.C index 248450065..d6b3a322b 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.C +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.C @@ -22,11 +22,70 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -/// -/// @file p9a_omi_init_scom.C -/// -// *HWP HWP Owner: Benjamin Gass <bgass@us.ibm.com> -// *HWP HWP Backup: Daniel Crowell <dcrowell@us.ibm.com> -// *HWP Team: -// *HWP Level: 2 -// *HWP Consumed by: HB +#include "p9a_omi_init_scom.H" +#include <stdint.h> +#include <stddef.h> +#include <fapi2.H> + +using namespace fapi2; + +constexpr uint64_t literal_0b100 = 0b100; +constexpr uint64_t literal_0b0111 = 0b0111; +constexpr uint64_t literal_0b0011 = 0b0011; + +fapi2::ReturnCode p9a_omi_init_scom(const fapi2::Target<fapi2::TARGET_TYPE_MCC>& TGT0, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& TGT1) +{ + { + fapi2::ATTR_PROC_ENABLE_DL_TMPL_7_Type l_TGT0_ATTR_PROC_ENABLE_DL_TMPL_7; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_ENABLE_DL_TMPL_7, TGT0, l_TGT0_ATTR_PROC_ENABLE_DL_TMPL_7)); + fapi2::ATTR_PROC_ENABLE_DL_TMPL_4_Type l_TGT0_ATTR_PROC_ENABLE_DL_TMPL_4; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_ENABLE_DL_TMPL_4, TGT0, l_TGT0_ATTR_PROC_ENABLE_DL_TMPL_4)); + fapi2::ATTR_PROC_TMPL_0_PACING_Type l_TGT0_ATTR_PROC_TMPL_0_PACING; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_TMPL_0_PACING, TGT0, l_TGT0_ATTR_PROC_TMPL_0_PACING)); + fapi2::ATTR_PROC_TMPL_1_PACING_Type l_TGT0_ATTR_PROC_TMPL_1_PACING; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_TMPL_1_PACING, TGT0, l_TGT0_ATTR_PROC_TMPL_1_PACING)); + fapi2::ATTR_PROC_TMPL_4_PACING_Type l_TGT0_ATTR_PROC_TMPL_4_PACING; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_TMPL_4_PACING, TGT0, l_TGT0_ATTR_PROC_TMPL_4_PACING)); + fapi2::ATTR_PROC_TMPL_7_PACING_Type l_TGT0_ATTR_PROC_TMPL_7_PACING; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_TMPL_7_PACING, TGT0, l_TGT0_ATTR_PROC_TMPL_7_PACING)); + fapi2::buffer<uint64_t> l_scom_buffer; + { + FAPI_TRY(fapi2::getScom( TGT0, 0x701090bull, l_scom_buffer )); + + if ((l_TGT0_ATTR_PROC_ENABLE_DL_TMPL_7 == fapi2::ENUM_ATTR_PROC_ENABLE_DL_TMPL_7_ENABLED)) + { + constexpr auto l_MCP_CHAN0_DSTL_DSTLCFG_TMPL7_ENABLE_ON = 0x1; + l_scom_buffer.insert<2, 1, 63, uint64_t>(l_MCP_CHAN0_DSTL_DSTLCFG_TMPL7_ENABLE_ON ); + } + + if ((l_TGT0_ATTR_PROC_ENABLE_DL_TMPL_4 == fapi2::ENUM_ATTR_PROC_ENABLE_DL_TMPL_4_DISABLED)) + { + constexpr auto l_MCP_CHAN0_DSTL_DSTLCFG_TMPL4_DISABLE_ON = 0x1; + l_scom_buffer.insert<6, 1, 63, uint64_t>(l_MCP_CHAN0_DSTL_DSTLCFG_TMPL4_DISABLE_ON ); + } + + FAPI_TRY(fapi2::putScom(TGT0, 0x701090bull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x701090eull, l_scom_buffer )); + + l_scom_buffer.insert<0, 4, 60, uint64_t>(l_TGT0_ATTR_PROC_TMPL_0_PACING ); + l_scom_buffer.insert<4, 4, 60, uint64_t>(l_TGT0_ATTR_PROC_TMPL_1_PACING ); + l_scom_buffer.insert<8, 4, 60, uint64_t>(l_TGT0_ATTR_PROC_TMPL_4_PACING ); + l_scom_buffer.insert<12, 4, 60, uint64_t>(l_TGT0_ATTR_PROC_TMPL_7_PACING ); + FAPI_TRY(fapi2::putScom(TGT0, 0x701090eull, l_scom_buffer)); + } + { + FAPI_TRY(fapi2::getScom( TGT0, 0x7010a0bull, l_scom_buffer )); + + l_scom_buffer.insert<9, 3, 61, uint64_t>(literal_0b100 ); + l_scom_buffer.insert<12, 4, 60, uint64_t>(literal_0b0111 ); + l_scom_buffer.insert<40, 4, 60, uint64_t>(literal_0b0011 ); + FAPI_TRY(fapi2::putScom(TGT0, 0x7010a0bull, l_scom_buffer)); + } + + }; +fapi_try_exit: + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.H index ab21f81e5..7cf53b7dc 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.H +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.H @@ -22,11 +22,24 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -/// -/// @file p9a_omi_init_scom.H -/// -// *HWP HWP Owner: Benjamin Gass <bgass@us.ibm.com> -// *HWP HWP Backup: Daniel Crowell <dcrowell@us.ibm.com> -// *HWP Team: -// *HWP Level: 2 -// *HWP Consumed by: HB +#ifndef _INIT_P9A_OMI_INIT_SCOM_PROCEDURE_H_ +#define _INIT_P9A_OMI_INIT_SCOM_PROCEDURE_H_ + + +#include <stddef.h> +#include <stdint.h> +#include <fapi2.H> + + +typedef fapi2::ReturnCode (*p9a_omi_init_scom_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_MCC>&, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>&); + +extern "C" +{ + + fapi2::ReturnCode p9a_omi_init_scom(const fapi2::Target<fapi2::TARGET_TYPE_MCC>& TGT0, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& TGT1); + +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.mk b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.mk index 2d7433e51..c36e891d9 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.mk +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_init_scom.mk @@ -22,4 +22,6 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -# Makefile for p9a_omi_init_scom HWP +PROCEDURE=p9a_omi_init_scom +lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments +$(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.C index 8eeb3c1b0..afa709e98 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.C +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.C @@ -22,11 +22,57 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -/// -/// @file p9a_omi_scom.C -/// -// *HWP HWP Owner: Benjamin Gass <bgass@us.ibm.com> -// *HWP HWP Backup: Daniel Crowell <dcrowell@us.ibm.com> -// *HWP Team: -// *HWP Level: 2 -// *HWP Consumed by: HB +#include "p9a_omi_scom.H" +#include <stdint.h> +#include <stddef.h> +#include <fapi2.H> + +using namespace fapi2; + +constexpr uint64_t literal_0 = 0; +constexpr uint64_t literal_2 = 2; +constexpr uint64_t literal_0b1 = 0b1; +constexpr uint64_t literal_1 = 1; + +fapi2::ReturnCode p9a_omi_scom(const fapi2::Target<fapi2::TARGET_TYPE_MI>& TGT0, + const fapi2::Target<fapi2::TARGET_TYPE_OMI>& TGT1, const fapi2::Target<fapi2::TARGET_TYPE_MCC>& TGT2, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& TGT3) +{ + { + fapi2::ATTR_CHIP_UNIT_POS_Type l_TGT1_ATTR_CHIP_UNIT_POS; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, TGT1, l_TGT1_ATTR_CHIP_UNIT_POS)); + uint64_t l_def_OMI_POSITION = (l_TGT1_ATTR_CHIP_UNIT_POS % literal_2); + fapi2::ATTR_CHIP_UNIT_POS_Type l_TGT2_ATTR_CHIP_UNIT_POS; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_UNIT_POS, TGT2, l_TGT2_ATTR_CHIP_UNIT_POS)); + uint64_t l_def_MCC_POSITION = (l_TGT2_ATTR_CHIP_UNIT_POS % literal_2); + fapi2::buffer<uint64_t> l_scom_buffer; + { + FAPI_TRY(fapi2::getScom( TGT0, 0x5010813ull, l_scom_buffer )); + + if (((l_def_MCC_POSITION == literal_0) && (l_def_OMI_POSITION == literal_0))) + { + l_scom_buffer.insert<53, 1, 63, uint64_t>(literal_0b1 ); + } + + if (((l_def_MCC_POSITION == literal_0) && (l_def_OMI_POSITION == literal_1))) + { + l_scom_buffer.insert<54, 1, 63, uint64_t>(literal_0b1 ); + } + + if (((l_def_MCC_POSITION == literal_1) && (l_def_OMI_POSITION == literal_0))) + { + l_scom_buffer.insert<55, 1, 63, uint64_t>(literal_0b1 ); + } + + if (((l_def_MCC_POSITION == literal_1) && (l_def_OMI_POSITION == literal_1))) + { + l_scom_buffer.insert<56, 1, 63, uint64_t>(literal_0b1 ); + } + + 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/p9a_omi_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.H index a840e3dd7..096f23f81 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.H +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.H @@ -22,11 +22,26 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -/// -/// @file p9a_omi_scom.H -/// -// *HWP HWP Owner: Benjamin Gass <bgass@us.ibm.com> -// *HWP HWP Backup: Daniel Crowell <dcrowell@us.ibm.com> -// *HWP Team: -// *HWP Level: 2 -// *HWP Consumed by: HB +#ifndef _INIT_P9A_OMI_SCOM_PROCEDURE_H_ +#define _INIT_P9A_OMI_SCOM_PROCEDURE_H_ + + +#include <stddef.h> +#include <stdint.h> +#include <fapi2.H> + + +typedef fapi2::ReturnCode (*p9a_omi_scom_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_MI>&, + const fapi2::Target<fapi2::TARGET_TYPE_OMI>&, const fapi2::Target<fapi2::TARGET_TYPE_MCC>&, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>&); + +extern "C" +{ + + fapi2::ReturnCode p9a_omi_scom(const fapi2::Target<fapi2::TARGET_TYPE_MI>& TGT0, + const fapi2::Target<fapi2::TARGET_TYPE_OMI>& TGT1, const fapi2::Target<fapi2::TARGET_TYPE_MCC>& TGT2, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& TGT3); + +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.mk b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.mk index 5a3e9e6be..19d3f7804 100644 --- a/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.mk +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.mk @@ -22,4 +22,6 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG -# Makefile for p9a_omi_scom HWP +PROCEDURE=p9a_omi_scom +lib$(PROCEDURE)_COMMONFLAGS+=-fno-var-tracking-assignments +$(call BUILD_PROCEDURE) |