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/p9a_omi_scom.C | |
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/p9a_omi_scom.C')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/initfiles/p9a_omi_scom.C | 62 |
1 files changed, 54 insertions, 8 deletions
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; +} |