summaryrefslogtreecommitdiffstats
path: root/src/import/generic
diff options
context:
space:
mode:
authorAndre Marin <aamarin@us.ibm.com>2019-01-07 16:10:52 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-02-05 17:01:13 -0600
commit605baad67443c4c282d322115e4d5edbaf118d3a (patch)
tree4bfa268e3a1710a2dbf7b9c2cd2ade435c1a0d8c /src/import/generic
parent79fc8b675dfdca19c0f271d938c16dc2aa8911e4 (diff)
downloadtalos-hostboot-605baad67443c4c282d322115e4d5edbaf118d3a.tar.gz
talos-hostboot-605baad67443c4c282d322115e4d5edbaf118d3a.zip
Generalize set fields in pre_data_init
Added a definition file for data engine traits for specialization purposes. Moved pre_data_engine definitions into a common templated version. Change-Id: Ifb204da9cc6eb9d5d36b6eaeb1e1a5e99c97544e Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69411 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Dev-Ready: ANDRE A. MARIN <aamarin@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69423 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/generic')
-rw-r--r--src/import/generic/memory/lib/utils/index.H28
-rw-r--r--src/import/generic/memory/lib/utils/pos.H52
-rw-r--r--src/import/generic/memory/lib/utils/shared/mss_generic_consts.H33
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
OpenPOWER on IntegriCloud