diff options
-rw-r--r-- | src/import/generic/memory/lib/utils/index.H | 28 | ||||
-rw-r--r-- | src/import/generic/memory/lib/utils/pos.H | 52 | ||||
-rw-r--r-- | src/import/generic/memory/lib/utils/shared/mss_generic_consts.H | 33 |
3 files changed, 52 insertions, 61 deletions
diff --git a/src/import/generic/memory/lib/utils/index.H b/src/import/generic/memory/lib/utils/index.H index 5bec01fbd..828dc3fa6 100644 --- a/src/import/generic/memory/lib/utils/index.H +++ b/src/import/generic/memory/lib/utils/index.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,28 +37,14 @@ #define _MSS_INDEX_H_ #include <fapi2.H> +#include <generic/memory/lib/utils/shared/mss_generic_consts.H> #include <generic/memory/lib/utils/pos.H> -/// -/// @brief Trait classes for the mss::index functions -/// -template<fapi2::TargetType T> -class indexTraits -{ - public: - enum - { - MCS_PER_MC = 2, - PORTS_PER_MCBIST = 4, - PORTS_PER_MCS = 2, - DIMMS_PER_PORT = 2, - MBA_PER_MC = 2, - }; -}; - namespace mss { +// TODO Add mc_type template on mss::index API" + /// /// @brief Return an attribute array index from a fapi2 target /// @tparam T the fapi2::TargetType - derived @@ -76,7 +62,7 @@ inline size_t index(const fapi2::Target<T>& i_target); template<> inline size_t index(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) { - typedef indexTraits<fapi2::TARGET_TYPE_DIMM> TT; + typedef procTraits<proc_type::NIMBUS> TT; return mss::pos(i_target) % TT::DIMMS_PER_PORT; } @@ -88,7 +74,7 @@ inline size_t index(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) template<> inline size_t index(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) { - typedef indexTraits<fapi2::TARGET_TYPE_MCA> TT; + typedef procTraits<proc_type::NIMBUS> TT; return mss::pos(i_target) % TT::PORTS_PER_MCS; } @@ -100,7 +86,7 @@ inline size_t index(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) template<> inline size_t index(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target) { - typedef indexTraits<fapi2::TARGET_TYPE_MCS> TT; + typedef procTraits<proc_type::NIMBUS> TT; return mss::pos(i_target) % TT::MCS_PER_MC; } diff --git a/src/import/generic/memory/lib/utils/pos.H b/src/import/generic/memory/lib/utils/pos.H index 3dfbb5679..be82d5385 100644 --- a/src/import/generic/memory/lib/utils/pos.H +++ b/src/import/generic/memory/lib/utils/pos.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,6 +37,9 @@ #define _MSS_POS_H_ #include <fapi2.H> +#include <generic/memory/lib/utils/shared/mss_generic_consts.H> + +// TODO Add mc_type template on mss::pos API" /// /// @brief Trait classes for the mss::pos functions @@ -49,17 +52,6 @@ class posTraits // uint8_t and some attr_pos, uint32_t. We don't really care // but the type checking in the macros sure does ... typedef uint8_t pos_type; - - enum - { - MC_PER_MODULE = 2, - MCS_PER_MC = 2, - PORTS_PER_MCBIST = 4, - PORTS_PER_MCS = 2, - DIMMS_PER_PORT = 2, - DIMMS_PER_MCS = PORTS_PER_MCS * DIMMS_PER_PORT, - MCS_PER_PROC = MC_PER_MODULE * MCS_PER_MC, - }; }; /// @@ -70,18 +62,6 @@ class posTraits<fapi2::TARGET_TYPE_DIMM> { public: typedef uint32_t pos_type; - - enum - { - MC_PER_MODULE = 2, - MCS_PER_MC = 2, - PORTS_PER_MCBIST = 4, - PORTS_PER_MCS = 2, - DIMMS_PER_PORT = 2, - DIMMS_PER_MCS = PORTS_PER_MCS * DIMMS_PER_PORT, - MCS_PER_PROC = MC_PER_MODULE * MCS_PER_MC, - DIMMS_PER_MCBIST = PORTS_PER_MCBIST * DIMMS_PER_PORT, - }; }; /// @@ -92,13 +72,6 @@ class posTraits<fapi2::TARGET_TYPE_PROC_CHIP> { public: typedef uint32_t pos_type; - - enum - { - MC_PER_MODULE = 2, - MCS_PER_MC = 2, - MCS_PER_PROC = MC_PER_MODULE * MCS_PER_MC, - }; }; namespace mss @@ -161,16 +134,18 @@ fapi_try_exit: /// @brief Return a DIMM's position from a fapi2 target /// @param[in] i_target a target representing the target in question /// @return The position relative to the chip +/// @warning Nimbus implementation only /// template<> inline posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type pos(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) { typedef posTraits<fapi2::TARGET_TYPE_DIMM> TT; + typedef procTraits<proc_type::NIMBUS> T; // Proc 0 is DIMM 0-15, proc 2 is 64-79 - 64 is the stride between processors constexpr uint64_t DIMM_STRIDE_PER_PROC = 64; - constexpr uint64_t TOTAL_DIMM = TT::MC_PER_MODULE * TT::MCS_PER_MC * TT::PORTS_PER_MCS * TT::DIMMS_PER_PORT; + constexpr uint64_t TOTAL_DIMM = T::MC_PER_MODULE * T::MCS_PER_MC * T::PORTS_PER_MCS * T::DIMMS_PER_PORT; TT::pos_type l_pos = 0; @@ -214,7 +189,8 @@ template<> inline posTraits<fapi2::TARGET_TYPE_MCA>::pos_type relative_pos<fapi2::TARGET_TYPE_MCBIST>(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) { - typedef posTraits<fapi2::TARGET_TYPE_MCA> TT; + + typedef procTraits<proc_type::NIMBUS> TT; return pos(i_target) % TT::PORTS_PER_MCBIST; } @@ -227,7 +203,7 @@ template<> inline posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type relative_pos<fapi2::TARGET_TYPE_MCS>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) { - typedef posTraits<fapi2::TARGET_TYPE_DIMM> TT; + typedef procTraits<proc_type::NIMBUS> TT; return pos(i_target) % TT::DIMMS_PER_MCS; } @@ -240,7 +216,7 @@ template<> inline posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type relative_pos<fapi2::TARGET_TYPE_MCA>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) { - typedef posTraits<fapi2::TARGET_TYPE_DIMM> TT; + typedef procTraits<proc_type::NIMBUS> TT; return pos(i_target) % TT::DIMMS_PER_PORT; } @@ -253,7 +229,7 @@ template<> inline posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type relative_pos<fapi2::TARGET_TYPE_MCBIST>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) { - typedef posTraits<fapi2::TARGET_TYPE_DIMM> TT; + typedef procTraits<proc_type::NIMBUS> TT; return pos(i_target) % TT::DIMMS_PER_MCBIST; } @@ -266,7 +242,7 @@ template<> inline posTraits<fapi2::TARGET_TYPE_MCS>::pos_type relative_pos<fapi2::TARGET_TYPE_PROC_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target) { - typedef posTraits<fapi2::TARGET_TYPE_MCS> TT; + typedef procTraits<proc_type::NIMBUS> TT; return pos(i_target) % TT::MCS_PER_PROC; } @@ -279,7 +255,7 @@ template<> inline posTraits<fapi2::TARGET_TYPE_MCA>::pos_type relative_pos<fapi2::TARGET_TYPE_MCS>(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) { - typedef posTraits<fapi2::TARGET_TYPE_MCA> TT; + typedef procTraits<proc_type::NIMBUS> TT; return pos(i_target) % TT::PORTS_PER_MCS; } diff --git a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H index 25d4c5c37..c9049b7f6 100644 --- a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H +++ b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H @@ -123,8 +123,6 @@ enum generic_ffdc_codes BASE_MODULE_TYPE = 0x101C, BAD_SPD_DATA = 0x101D, SET_FIELD = 0x101E, - - // mss_freq functions SELECT_SUPPORTED_FREQ = 0x101F, FREQ_SCOREBOARD_REMOVE_FREQS_ABOVE_LIMIT = 0x1020, FREQ_SCOREBOARD_REMOVE_FREQS_ABOVE_LIMIT_VECTOR = 0x1021, @@ -132,6 +130,12 @@ enum generic_ffdc_codes FREQ_SCOREBOARD_MAX_SUPPORTED_FREQ = 0x1023, FREQ_SCOREBOARD_SUPPORTED_FREQS = 0x1024, LIMIT_FREQ_BY_VPD = 0x1025, + SET_DIMM_TYPE = 0x1026, + SET_DRAM_GEN = 0x1027, + SET_HYBRID = 0x1027, + SET_HYBRID_MEDIA = 0x1028, + SET_MRANKS = 0x1029, + SET_DIMM_RANKS_CNFG = 0x1039, }; /// @@ -255,6 +259,31 @@ enum nibble_mask }; +/// +/// @brief Trait classes for proc_type +/// +template< proc_type P > +class procTraits; + +/// +/// @brief Trait classes for proc_type - NIMBUS specialization +/// +template< > +struct procTraits<proc_type::NIMBUS> +{ + enum + { + MC_PER_MODULE = 2, + MCS_PER_MC = 2, + MCS_PER_PROC = MC_PER_MODULE * MCS_PER_MC, + PORTS_PER_MCBIST = 4, + PORTS_PER_MCS = 2, + DIMMS_PER_PORT = 2, + DIMMS_PER_MCS = PORTS_PER_MCS * DIMMS_PER_PORT, + DIMMS_PER_MCBIST = PORTS_PER_MCBIST * DIMMS_PER_PORT, + }; +}; + }// mss #endif |