diff options
author | Andre A. Marin <aamarin@us.ibm.com> | 2019-03-20 09:01:13 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-04-02 13:20:03 -0500 |
commit | ee76c2ca5927122cc9bfc792de240f20b87abe82 (patch) | |
tree | 5a2a256cc16f3b45ba1d3bf166b41b17692ab490 /src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C | |
parent | 8daf280f7d24a3f5b2c553bb39ceda4d0fd32736 (diff) | |
download | talos-hostboot-ee76c2ca5927122cc9bfc792de240f20b87abe82.tar.gz talos-hostboot-ee76c2ca5927122cc9bfc792de240f20b87abe82.zip |
Fix c_str and pos DIMM specialization
Change-Id: Id234f7f14bc4dd90de1f8ea70a4617c513ca1ffa
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/74846
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/74877
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C')
-rw-r--r-- | src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C index 4b1072a61..4a3f7c703 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C @@ -22,3 +22,62 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file explorer_pos.C +/// @brief Tools to return target's position from a fapi2 target +/// +// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 3 +// *HWP Consumed by: HB:FSP + +#include <generic/memory/lib/utils/pos.H> + +namespace mss +{ + +/// +/// +/// @brief Return a DIMM's relative position from a port +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_MEM_PORT>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::EXPLORER> TT; + return pos(i_target) % TT::DIMMS_PER_PORT; +} + +/// +/// @brief Return a DIMM's relative position from an OCMB +/// @tparam MC the type of memory controller (defaults to DEFAULT_MC_TYPE) +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_OCMB_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::EXPLORER> TT; + return pos(i_target) % (TT::DIMMS_PER_PORT * TT::PORTS_PER_OCMB); +} + +/// +/// @brief Return an MEM_PORT's relative position from an OCMB +/// @tparam MC the type of memory controller (defaults to DEFAULT_MC_TYPE) +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_MEM_PORT>::pos_type +relative_pos<fapi2::TARGET_TYPE_OCMB_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_target) +{ + typedef mcTypeTraits<mc_type::EXPLORER> TT; + return pos(i_target) % TT::PORTS_PER_OCMB; +} + +}// mss |