From 91304df7800ff5fa234a221931bf66e39aa2b9a2 Mon Sep 17 00:00:00 2001 From: Caleb Palmer Date: Tue, 26 Jun 2018 08:05:27 -0500 Subject: Row Repair enabled attributes and support function Change-Id: I746bc7809a0fe0efc703f7e27beee7249a57e2b1 Original-Change-Id: Ic7493902fee7dcc9cbfbbddfcf9f58d47c4967c5 RTC: 195638 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/61417 Reviewed-by: Devon A. Baughen Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: Zane C. Shelley Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66833 Reviewed-by: Daniel M. Crowell Tested-by: Daniel M. Crowell --- .../procedures/hwp/memory/p9c_mss_rowRepairFuncs.C | 112 +++++++++++++++++++++ .../procedures/hwp/memory/p9c_mss_rowRepairFuncs.H | 46 +++++++++ .../hwp/memory/p9c_mss_rowRepairFuncs.mk | 29 ++++++ 3 files changed, 187 insertions(+) create mode 100644 src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C create mode 100644 src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.H create mode 100644 src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.mk (limited to 'src') diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C new file mode 100644 index 000000000..83427c5e6 --- /dev/null +++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C @@ -0,0 +1,112 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 + +using namespace fapi2; + +extern "C" +{ + ReturnCode __getPairedDimm( + const Target& i_target, + Target& o_pairedDimm ) + { + std::vector> l_dimms; + Target l_mba; + uint8_t l_curPs = 0; + uint8_t l_curDs = 0; + + // get port slct for our current target + FAPI_TRY( FAPI_ATTR_GET( ATTR_CEN_MBA_PORT, i_target, l_curPs ) ); + + // get dimm slct for our current target + FAPI_TRY( FAPI_ATTR_GET( ATTR_CEN_MBA_DIMM, i_target, l_curDs ) ); + + // get parent mba + l_mba = i_target.getParent(); + + // get connected dimms from mba + l_dimms = l_mba.getChildren(); + + // find the paired dimm + for ( auto const& dimm : l_dimms ) + { + uint8_t l_tmpPs = 0; + FAPI_TRY( FAPI_ATTR_GET( ATTR_CEN_MBA_PORT, dimm, l_tmpPs ) ); + + // DIMM on same port slct + if ( l_tmpPs == l_curPs ) + { + uint8_t l_tmpDs = 0; + FAPI_TRY( FAPI_ATTR_GET( ATTR_CEN_MBA_DIMM, dimm, l_tmpDs ) ); + + // different DIMM from the current one + if ( l_tmpDs != l_curDs ) + { + // found the paired DIMM + o_pairedDimm = dimm; + break; + } + } + } + + fapi_try_exit: + return fapi2::current_err; + } + + ReturnCode is_sPPR_supported( + const Target& i_target, + bool& o_spprSupported ) + { + ATTR_ROW_REPAIR_SUPPORTED_MRW_Type l_rr1; + FAPI_TRY ( FAPI_ATTR_GET( ATTR_ROW_REPAIR_SUPPORTED_MRW, + Target(), l_rr1 ) ); + + ATTR_ROW_REPAIR_SPPR_SUPPORTED_Type l_rr2; + FAPI_TRY( FAPI_ATTR_GET( ATTR_ROW_REPAIR_SPPR_SUPPORTED, i_target, + l_rr2 ) ); + + o_spprSupported = false; + + if ( ENUM_ATTR_ROW_REPAIR_SUPPORTED_MRW_SUPPORTED == l_rr1 && + ENUM_ATTR_ROW_REPAIR_SPPR_SUPPORTED_SUPPORTED == l_rr2 ) + { + // Check paired DIMM as well + Target l_pairedDimm; + FAPI_TRY( __getPairedDimm( i_target, l_pairedDimm ) ); + + ATTR_ROW_REPAIR_SPPR_SUPPORTED_Type l_rr3; + FAPI_TRY( FAPI_ATTR_GET( ATTR_ROW_REPAIR_SPPR_SUPPORTED, + l_pairedDimm, l_rr3 ) ); + + if ( ENUM_ATTR_ROW_REPAIR_SPPR_SUPPORTED_SUPPORTED == l_rr3 ) + { + o_spprSupported = true; + } + } + + fapi_try_exit: + return fapi2::current_err; + } +} diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.H b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.H new file mode 100644 index 000000000..e2ed64690 --- /dev/null +++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.H @@ -0,0 +1,46 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 __P9C_MSS_ROWREPAIRFUNCS__ +#define __P9C_MSS_ROWREPAIRFUNCS__ + +#include + +extern "C" +{ + + /// + /// @brief Check if sPPR (soft post package row repair) is supported on the + // system. + /// @param[in] i_target A DIMM target on the system + // @param[out] o_spprSupported True or false whether sPPR is supported + /// @return FAPI2_RC_SUCCESS if no internal function failed + /// + fapi2::ReturnCode is_sPPR_supported( + const fapi2::Target& i_target, + bool& o_spprSupported ); + +} + +#endif diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.mk b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.mk new file mode 100644 index 000000000..1c8165858 --- /dev/null +++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.mk @@ -0,0 +1,29 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2018 +# [+] 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 00common.mk + +PROCEDURE=p9c_mss_rowRepairFuncs +$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE))) +$(call BUILD_PROCEDURE) -- cgit v1.2.1