summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lab/sdk/example/C/mss_lab_sfwrite.C6
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C376
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.H1343
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.C243
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.H (renamed from src/import/chips/p9/procedures/hwp/memory/lib/utils/dump_regs.H)34
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_traits_nimbus.H274
-rwxr-xr-xsrc/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.C19
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H16
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C25
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.H8
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H52
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H42
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C10
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H8
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs00.C19
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs01.C19
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs02.C14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs03.C14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs04.C14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs05.C14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs06.C14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.C106
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H249
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C148
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H23
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.C15
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.H7
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.C20
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.H16
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.C18
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.H18
-rw-r--r--[-rwxr-xr-x]src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.C221
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H263
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.C22
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H23
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C24
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H85
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.C21
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.H12
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.C44
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H23
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc.H789
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.C68
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.H331
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.C46
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.H319
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/fw_mark_store.H619
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/galois.H190
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/hw_mark_store.H507
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_aue_trap.H130
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_mpe_trap.H162
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H195
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_rce_trap.H130
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_ue_trap.H130
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/maint_current_trap.H187
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/mark_shadow_reg.H149
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/modal_symbol_count.H573
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/nimbus_mbs_error_vector_trap.H (renamed from src/import/chips/p9/procedures/hwp/memory/lib/ecc/mbs_error_vector_trap.H)90
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/ecc/read_error_count_regs.H648
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_mss_voltage.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_pre_data_engine.C2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/p9n_data_init_traits.H473
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C39
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H26
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/pre_data_init.H438
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.C167
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.H735
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.C175
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.H68
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C126
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.H52
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/freq/nimbus_freq_traits.H3
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.C2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.C12
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H56
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C254
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H593
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C242
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H132
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/address.H494
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C644
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H3342
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist_traits.H644
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C601
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H397
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.C146
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.H104
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H760
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C175
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mss.mk3
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H191
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mss_vpd_decoder.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C17
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.H25
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C28
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.H39
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_training.C30
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/accessor_wrapper.H257
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C183
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H277
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C821
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H320
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle_traits.H122
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H256
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/shared/nimbus_defaults.H3
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C5
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/find_magic.H140
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/hwp_wrappers_nim.C169
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_nimbus_conversions.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_find.H112
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/num.H55
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/adr32s_workarounds.C2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.C254
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.H45
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C73
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H44
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.H4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.C94
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.H (renamed from src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.H)47
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mca_workarounds.C19
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C35
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.H14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C285
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.H46
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.C256
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.H373
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/mss.H10
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_background_scrub.C50
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C8
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C5
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit.C18
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_mc.C12
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training.C3
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training_adv.C6
-rwxr-xr-xsrc/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C3
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C20
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C2
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.C4
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C11
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C6
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C106
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_thermal_init.C5
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C86
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9a_omi_init.C23
158 files changed, 6646 insertions, 18525 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lab/sdk/example/C/mss_lab_sfwrite.C b/src/import/chips/p9/procedures/hwp/memory/lab/sdk/example/C/mss_lab_sfwrite.C
index 58b382a97..8fd2fb737 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lab/sdk/example/C/mss_lab_sfwrite.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lab/sdk/example/C/mss_lab_sfwrite.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,8 +33,10 @@
// *HWP Level: 3
// *HWP Consumed by: Memory
-#include <mss_lab_tools.H>
+#include <generic/memory/lab/mss_lab_tools.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/shared/nimbus_defaults.H>
#include <generic/memory/lib/utils/poll.H>
#include <lib/mcbist/address.H>
#include <lib/mcbist/memdiags.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C
deleted file mode 100644
index 60dc06bcc..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C
+++ /dev/null
@@ -1,376 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2019 */
-/* [+] 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 */
-
-///
-/// @file ccs.C
-/// @brief Run and manage the CCS engine
-///
-// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
-// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#include <fapi2.H>
-
-#include <mss.H>
-#include <lib/ccs/ccs.H>
-#include <lib/fir/check.H>
-#include <lib/phy/mss_lrdimm_training.H>
-
-#ifdef LRDIMM_CAPABLE
- #include <lib/workarounds/quad_encode_workarounds.H>
-#endif
-
-using fapi2::TARGET_TYPE_MCBIST;
-using fapi2::TARGET_TYPE_MCA;
-
-using fapi2::FAPI2_RC_SUCCESS;
-
-namespace mss
-{
-namespace ccs
-{
-
-///
-/// @brief Determines our rank configuration type across all ports
-/// @param[in] i_target the MCBIST target on which to operate
-/// @param[out] o_rank_config the rank configuration
-/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
-///
-fapi2::ReturnCode get_rank_config(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- std::vector<rank_configuration>& o_rank_config)
-{
- o_rank_config.clear();
- // Create one per port, we then use relative indexing to get us the number we need
- o_rank_config = std::vector<rank_configuration>(PORTS_PER_MCBIST);
-
- for(const auto& l_mca : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target))
- {
- rank_configuration l_config;
- FAPI_TRY(get_rank_config(l_mca, l_config));
- o_rank_config[mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(l_mca)] = l_config;
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Determines our rank configuration type
-/// @param[in] i_target the MCA target on which to operate
-/// @param[out] o_rank_config the rank configuration
-/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
-///
-fapi2::ReturnCode get_rank_config(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- rank_configuration& o_rank_config)
-{
- constexpr uint8_t QUAD_RANK_ENABLE = 4;
- o_rank_config = rank_configuration::DUAL_DIRECT;
-
- uint8_t l_num_master_ranks[MAX_DIMM_PER_PORT] = {};
- FAPI_TRY(mss::eff_num_master_ranks_per_dimm(i_target, l_num_master_ranks));
-
- // We only need to check DIMM0
- // Our number of ranks should be the same between DIMM's 0/1
- // Check if we have the right number for encoded mode
- o_rank_config = l_num_master_ranks[0] == QUAD_RANK_ENABLE ?
- rank_configuration::QUAD_ENCODED :
- rank_configuration::DUAL_DIRECT;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Start or stop the CCS engine
-/// @param[in] i_target The MCBIST containing the CCS engine
-/// @param[in] i_start_stop bool MSS_CCS_START for starting, MSS_CCS_STOP otherwise
-/// @return FAPI2_RC_SUCCESS iff success
-///
-template<>
-fapi2::ReturnCode start_stop( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target, const bool i_start_stop )
-{
- typedef ccsTraits<TARGET_TYPE_MCBIST> TT;
-
- fapi2::buffer<uint64_t> l_buf;
-
- // Do we need to read this? We are setting the only bit defined in the scomdef? BRS
- FAPI_TRY(mss::getScom(i_target, TT::CNTLQ_REG, l_buf));
-
- FAPI_TRY( mss::putScom(i_target, TT::CNTLQ_REG,
- i_start_stop ? l_buf.setBit<TT::CCS_START>() : l_buf.setBit<TT::CCS_STOP>()) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Determine the CCS failure type
-/// @param[in] i_target MCBIST target
-/// @param[in] i_type the failure type
-/// @param[in] i_mca The port the CCS instruction is training
-/// @return ReturnCode associated with the fail.
-/// @note FFDC is handled here, caller doesn't need to do it
-///
-fapi2::ReturnCode fail_type( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const uint64_t& i_type,
- const fapi2::Target<TARGET_TYPE_MCA>& i_mca )
-{
- fapi2::ReturnCode l_failing_rc(fapi2::FAPI2_RC_SUCCESS);
- // Including the MCA_TARGET here and below at CAL_TIMEOUT since these problems likely lie at the MCA level
- // So we disable the PORT and hopefully that's it
- // If the problem lies with the MCBIST, it'll just have to loop
- FAPI_ASSERT(STAT_READ_MISCOMPARE != i_type,
- fapi2::MSS_CCS_READ_MISCOMPARE()
- .set_MCBIST_TARGET(i_target)
- .set_FAIL_TYPE(i_type)
- .set_MCA_TARGET(i_mca),
- "%s CCS FAIL Read Miscompare", mss::c_str(i_mca));
-
- // This error is likely due to a bad CCS engine/ MCBIST
- FAPI_ASSERT(STAT_UE_SUE != i_type,
- fapi2::MSS_CCS_UE_SUE()
- .set_FAIL_TYPE(i_type)
- .set_MCBIST_TARGET(i_target),
- "%s CCS FAIL UE or SUE Error", mss::c_str(i_target));
-
- FAPI_ASSERT(STAT_CAL_TIMEOUT != i_type,
- fapi2::MSS_CCS_CAL_TIMEOUT()
- .set_FAIL_TYPE(i_type)
- .set_MCBIST_TARGET(i_target)
- .set_MCA_TARGET(i_mca),
- "%s CCS FAIL Calibration Operation Time Out", mss::c_str(i_mca));
-
- // Problem with the CCS engine
- FAPI_ASSERT(STAT_HUNG != i_type,
- fapi2::MSS_CCS_HUNG().set_MCBIST_TARGET(i_target),
- "%s CCS appears hung", mss::c_str(i_target));
-fapi_try_exit:
- // Due to the PRD update, we need to check for FIR's
- // If any FIR's have lit up, this CCS fail could have been caused by the FIR
- // So, let PRD retrigger this step to see if we can resolve the issue
- return mss::check::fir_or_pll_fail<mss::mc_type::NIMBUS>(i_target, fapi2::current_err);
-}
-
-///
-/// @brief Execute the contents of the CCS array
-/// @param[in] i_target The MCBIST containing the array
-/// @param[in] i_program the MCBIST ccs program - to get the polling parameters
-/// @param[in] i_port The port target that the array is for
-/// @return FAPI2_RC_SUCCESS iff success
-///
-template<>
-fapi2::ReturnCode execute_inst_array(const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- ccs::program<TARGET_TYPE_MCBIST>& i_program,
- const fapi2::Target<TARGET_TYPE_MCA>& i_port)
-{
- typedef ccsTraits<TARGET_TYPE_MCBIST> TT;
-
- fapi2::buffer<uint64_t> status;
-
- FAPI_TRY(start_stop(i_target, mss::START), "%s Error in execute_inst_array", mss::c_str(i_port) );
-
- mss::poll(i_target, TT::STATQ_REG, i_program.iv_poll,
- [&status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
- {
- FAPI_INF("ccs statq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- status = stat_reg;
- return status.getBit<TT::CCS_IN_PROGRESS>() != 1;
- },
- i_program.iv_probes);
-
- // Check for done and success. DONE being the only bit set.
- if (status == STAT_QUERY_SUCCESS)
- {
- FAPI_INF("%s CCS Executed Successfully.", mss::c_str(i_port) );
- goto fapi_try_exit;
- }
-
- // So we failed or we're still in progress. Mask off the fail bits
- // and run this through the FFDC generator.
- // TK: Put the const below into a traits class? -- JLH
- FAPI_TRY( fail_type(i_target, status & 0x1C00000000000000, i_port), "Error in execute_inst_array" );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Execute a set of CCS instructions
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the vector of instructions
-/// @param[in] i_ports the vector of ports
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note assumes the CCS engine has been configured.
-///
-template<>
-fapi2::ReturnCode execute( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- ccs::program<TARGET_TYPE_MCBIST>& i_program,
- const std::vector< fapi2::Target<TARGET_TYPE_MCA> >& i_ports)
-{
- typedef ccsTraits<TARGET_TYPE_MCBIST> TT;
-
- // Subtract one for the idle we insert at the end
- constexpr size_t CCS_INSTRUCTION_DEPTH = 32 - 1;
- constexpr uint64_t CCS_ARR0_ZERO = MCBIST_CCS_INST_ARR0_00;
- constexpr uint64_t CCS_ARR1_ZERO = MCBIST_CCS_INST_ARR1_00;
-
- ccs::instruction_t<TARGET_TYPE_MCBIST> l_des = ccs::des_command<TARGET_TYPE_MCBIST>();
-
- FAPI_INF("loading ccs instructions (%d) for %s", i_program.iv_instructions.size(), mss::c_str(i_target));
-
- auto l_inst_iter = i_program.iv_instructions.begin();
-
- std::vector<rank_configuration> l_rank_configs;
- FAPI_TRY(get_rank_config(i_target, l_rank_configs));
-
- // Stop the CCS engine just for giggles - it might be running ...
- FAPI_TRY( start_stop(i_target, mss::states::STOP), "Error in ccs::execute" );
-
- FAPI_ASSERT( mss::poll(i_target, TT::STATQ_REG, poll_parameters(),
- [](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
- {
- FAPI_INF("ccs statq (stop) 0x%llx, remaining: %d", stat_reg, poll_remaining);
- return stat_reg.getBit<TT::CCS_IN_PROGRESS>() != 1;
- }),
- fapi2::MSS_CCS_HUNG_TRYING_TO_STOP().set_MCBIST_TARGET(i_target) );
-
- while (l_inst_iter != i_program.iv_instructions.end())
- {
-
- // Kick off the CCS engine - per port. No broadcast mode for CCS (per Shelton 9/23/15)
- for (const auto& p : i_ports)
- {
- const auto l_port_index = mss::relative_pos<TARGET_TYPE_MCBIST>(p);
- size_t l_inst_count = 0;
-
- uint64_t l_total_delay = 0;
- uint64_t l_delay = 0;
- uint64_t l_repeat = 0;
- uint8_t l_current_cke = 0;
-
- // Shove the instructions into the CCS engine, in 32 instruction chunks, and execute them
- for (; l_inst_iter != i_program.iv_instructions.end()
- && l_inst_count < CCS_INSTRUCTION_DEPTH; ++l_inst_count, ++l_inst_iter)
- {
- // First, update the current instruction's chip selects for the current port
- FAPI_TRY(l_inst_iter->configure_rank(p, l_rank_configs[l_port_index]), "Error in rank config");
-
- l_inst_iter->arr0.extractToRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_current_cke);
-
- // Make sure this instruction leads to the next. Notice this limits this mechanism to pretty
- // simple (straight line) CCS programs. Anything with a loop or such will need another mechanism.
- l_inst_iter->arr1.insertFromRight<MCBIST_CCS_INST_ARR1_00_GOTO_CMD,
- MCBIST_CCS_INST_ARR1_00_GOTO_CMD_LEN>(l_inst_count + 1);
- FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_inst_iter->arr0), "Error in ccs::execute" );
- FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_inst_iter->arr1), "Error in ccs::execute" );
-
- // arr1 contains a specification of the delay and repeat after this instruction, as well
- // as a repeat. Total up the delays as we go so we know how long to wait before polling
- // the CCS engine for completion
- l_inst_iter->arr1.extractToRight<MCBIST_CCS_INST_ARR1_00_IDLES, MCBIST_CCS_INST_ARR1_00_IDLES_LEN>(l_delay);
- l_inst_iter->arr1.extractToRight<MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT,
- MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT>(l_repeat);
-
- l_total_delay += l_delay * (l_repeat + 1);
-
- FAPI_INF("css inst %d: 0x%016lX 0x%016lX (0x%lx, 0x%lx) delay: 0x%x (0x%x) %s",
- l_inst_count, l_inst_iter->arr0, l_inst_iter->arr1,
- CCS_ARR0_ZERO + l_inst_count, CCS_ARR1_ZERO + l_inst_count,
- l_delay, l_total_delay, mss::c_str(i_target));
- }
-
- // Check our program for any delays. If there isn't a iv_initial_delay configured, then
- // we use the delay we just summed from the instructions.
- if (i_program.iv_poll.iv_initial_delay == 0)
- {
- i_program.iv_poll.iv_initial_delay = cycles_to_ns(i_target, l_total_delay);
- }
-
- if (i_program.iv_poll.iv_initial_sim_delay == 0)
- {
- i_program.iv_poll.iv_initial_sim_delay = cycles_to_simcycles(l_total_delay);
- }
-
- FAPI_INF("executing ccs instructions (%d:%d, %d) for %s",
- i_program.iv_instructions.size(), l_inst_count, i_program.iv_poll.iv_initial_delay, mss::c_str(i_target));
-
- // Deselect
- l_des.arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_current_cke);
-
- // Insert a DES as our last instruction. DES is idle state anyway and having this
- // here as an instruction forces the CCS engine to wait the delay specified in
- // the last instruction in this array (which it otherwise doesn't do.)
- l_des.arr1.setBit<MCBIST_CCS_INST_ARR1_00_END>();
- FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_des.arr0), "Error in ccs::execute" );
- FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_des.arr1), "Error in ccs::execute" );
-
- FAPI_INF("css inst %d fixup: 0x%016lX 0x%016lX (0x%lx, 0x%lx) %s",
- l_inst_count, l_des.arr0, l_des.arr1,
- CCS_ARR0_ZERO + l_inst_count, CCS_ARR1_ZERO + l_inst_count, mss::c_str(i_target));
-
-
- FAPI_INF("executing CCS array for port %d (%s)", l_port_index, mss::c_str(p));
- FAPI_TRY( select_ports( i_target, l_port_index), "Error in ccs execute" );
- FAPI_TRY( execute_inst_array(i_target, i_program, p), "Error in ccs execute" );
- }
- }
-
-#if LRDIMM_CAPABLE
-
- if(mss::workarounds::contains_command_mrs(i_program.iv_instructions))
- {
- // Get ranks in pair bombs out if we can't get any ranks in this pair, so we should be safe here
- for (const auto& p : i_ports)
- {
- FAPI_TRY(mss::workarounds::fix_shadow_register_corruption(p));
- }
- }
-
-#endif
-
-fapi_try_exit:
- i_program.iv_instructions.clear();
- return fapi2::current_err;
-}
-
-///
-/// @brief Nimbus specialization for modeq_copy_cke_to_spare_cke
-/// @param[in] fapi2::Target<TARGET_TYPE_MCBIST>& the target to effect
-/// @param[in,out] the buffer representing the mode register
-/// @param[in] mss::states - mss::ON iff Copy CKE signals to CKE Spare on both ports
-/// @note no-op for p9n
-///
-template<>
-void copy_cke_to_spare_cke<TARGET_TYPE_MCBIST>( const fapi2::Target<TARGET_TYPE_MCBIST>&,
- fapi2::buffer<uint64_t>&, states )
-{
- return;
-}
-
-} // namespace
-} // namespace
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.H b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.H
deleted file mode 100644
index 923b84052..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.H
+++ /dev/null
@@ -1,1343 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2019 */
-/* [+] 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 */
-
-///
-/// @file ccs.H
-/// @brief Run and manage the CCS engine
-///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: HB:FSP
-
-#ifndef _MSS_CCS_H_
-#define _MSS_CCS_H_
-
-#include <fapi2.H>
-
-#include <p9_mc_scom_addresses.H>
-#include <p9_mc_scom_addresses_fld.H>
-
-#include <generic/memory/lib/utils/poll.H>
-#include <generic/memory/lib/utils/buffer_ops.H>
-#include <lib/mc/port.H>
-#include <lib/shared/mss_const.H>
-#include <lib/eff_config/timing.H>
-
-// I have a dream that the CCS engine code can be shared among controllers. So, I drive the
-// engine from a set of traits. This might be folly. Allow me to dream. BRS
-///
-/// @class ccsTraits
-/// @brief Nimbus CCS Engine traits
-///
-template< fapi2::TargetType T >
-class ccsTraits;
-
-template<>
-class ccsTraits<fapi2::TARGET_TYPE_MEMBUF_CHIP>
-{
- public:
-};
-
-template<>
-class ccsTraits<fapi2::TARGET_TYPE_MCBIST>
-{
- public:
- static constexpr uint64_t MODEQ_REG = MCBIST_CCS_MODEQ;
- static constexpr uint64_t MCB_CNTL_REG = MCBIST_MCB_CNTLQ;
- static constexpr uint64_t CNTLQ_REG = MCBIST_CCS_CNTLQ;
- static constexpr uint64_t STATQ_REG = MCBIST_CCS_STATQ;
- static constexpr fapi2::TargetType PORT_TARGET_TYPE = fapi2::TARGET_TYPE_MCA;
-
- enum
- {
- // Non address values that are needed for helper functions
-
- // ODT values used for beautification
- // Attribute locations
- ATTR_ODT_DIMM0_R0 = 0,
- ATTR_ODT_DIMM0_R1 = 1,
- ATTR_ODT_DIMM1_R0 = 4,
- ATTR_ODT_DIMM1_R1 = 5,
-
- // Right justified output - makes it so we can use insertFromRight
- CCS_ODT_DIMM0_R0 = 4,
- CCS_ODT_DIMM0_R1 = 5,
- CCS_ODT_DIMM1_R0 = 6,
- CCS_ODT_DIMM1_R1 = 7,
-
- // Default ODT cycle length is 5 - one for the preamble and 4 for the data
- DEFAULT_ODT_CYCLE_LEN = 5,
-
- // CCS MODEQ
- STOP_ON_ERR = MCBIST_CCS_MODEQ_STOP_ON_ERR,
- UE_DISABLE = MCBIST_CCS_MODEQ_UE_DISABLE,
- DATA_COMPARE_BURST_SEL = MCBIST_CCS_MODEQ_DATA_COMPARE_BURST_SEL,
- DATA_COMPARE_BURST_SEL_LEN = MCBIST_CCS_MODEQ_DATA_COMPARE_BURST_SEL_LEN,
- DDR_CAL_TIMEOUT_CNT = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT,
- DDR_CAL_TIMEOUT_CNT_LEN = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT_LEN,
- CFG_PARITY_AFTER_CMD = MCBIST_CCS_MODEQ_CFG_PARITY_AFTER_CMD,
- COPY_CKE_TO_SPARE_CKE = MCBIST_CCS_MODEQ_COPY_CKE_TO_SPARE_CKE,
- DISABLE_ECC_ARRAY_CHK = MCBIST_CCS_MODEQ_DISABLE_ECC_ARRAY_CHK,
- DISABLE_ECC_ARRAY_CORRECTION = MCBIST_CCS_MODEQ_DISABLE_ECC_ARRAY_CORRECTION,
- CFG_DGEN_FIXED_MODE = MCBIST_CCS_MODEQ_CFG_DGEN_FIXED_MODE,
- DDR_CAL_TIMEOUT_CNT_MULT = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT_MULT,
- DDR_CAL_TIMEOUT_CNT_MULT_LEN = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT_MULT_LEN,
- IDLE_PAT_ADDRESS_0_13 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_0_13,
- IDLE_PAT_ADDRESS_0_13_LEN = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_0_13_LEN,
- IDLE_PAT_ADDRESS_17 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_17,
- IDLE_PAT_BANK_GROUP_1 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_GROUP_1,
- IDLE_PAT_BANK_0_1 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_0_1,
- IDLE_PAT_BANK_0_1_LEN = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_0_1_LEN,
- IDLE_PAT_BANK_GROUP_0 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_GROUP_0,
- IDLE_PAT_ACTN = MCBIST_CCS_MODEQ_IDLE_PAT_ACTN,
- IDLE_PAT_ADDRESS_16 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_16,
- IDLE_PAT_ADDRESS_15 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_15,
- IDLE_PAT_ADDRESS_14 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_14,
- NTTM_MODE = MCBIST_CCS_MODEQ_NTTM_MODE,
- NTTM_RW_DATA_DLY = MCBIST_CCS_MODEQ_NTTM_RW_DATA_DLY,
- NTTM_RW_DATA_DLY_LEN = MCBIST_CCS_MODEQ_NTTM_RW_DATA_DLY_LEN,
- IDLE_PAT_BANK_2 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_2,
- DDR_PARITY_ENABLE = MCBIST_CCS_MODEQ_DDR_PARITY_ENABLE,
- IDLE_PAT_PARITY = MCBIST_CCS_MODEQ_IDLE_PAT_PARITY,
-
- // MCB_CNTRL
- MCB_CNTL_PORT_SEL = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL,
- MCB_CNTL_PORT_SEL_LEN = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL_LEN,
-
- // CCS CNTL
- CCS_START = MCBIST_CCS_CNTLQ_START,
- CCS_STOP = MCBIST_CCS_CNTLQ_STOP,
-
- // CCS STATQ
- CCS_IN_PROGRESS = MCBIST_CCS_STATQ_IP,
-
- // ARR0
- ARR0_DDR_ADDRESS_0_13 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_0_13,
- ARR0_DDR_ADDRESS_0_13_LEN = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_0_13_LEN,
- ARR0_DDR_ADDRESS_0_9 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_0_13, // Useful for rd/wr cmds
- ARR0_DDR_ADDRESS_0_9_LEN = 10, // CA bits are 9:0, total length of 10
- ARR0_DDR_ADDRESS_10 = 10, // ADR10 is the 10th bit from the left in Nimbus ARR0
- ARR0_DDR_ADDRESS_17 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_17,
- ARR0_DDR_BANK_GROUP_1 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_GROUP_1,
- ARR0_DDR_RESETN = MCBIST_CCS_INST_ARR0_00_DDR_RESETN,
- ARR0_DDR_BANK_0_1 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_0_1,
- ARR0_DDR_BANK_0_1_LEN = MCBIST_CCS_INST_ARR0_00_DDR_BANK_0_1_LEN,
- ARR0_DDR_BANK_GROUP_0 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_GROUP_0,
- ARR0_DDR_ACTN = MCBIST_CCS_INST_ARR0_00_DDR_ACTN,
- ARR0_DDR_ADDRESS_16 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_16,
- ARR0_DDR_ADDRESS_15 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_15,
- ARR0_DDR_ADDRESS_14 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_14,
- ARR0_DDR_CKE = MCBIST_CCS_INST_ARR0_00_DDR_CKE,
- ARR0_DDR_CKE_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CKE_LEN,
- ARR0_DDR_CSN_0_1 = MCBIST_CCS_INST_ARR0_00_DDR_CSN_0_1,
- ARR0_DDR_CSN_0_1_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CSN_0_1_LEN,
- ARR0_DDR_CID_0_1 = MCBIST_CCS_INST_ARR0_00_DDR_CID_0_1,
- ARR0_DDR_CID_0_1_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CID_0_1_LEN,
- ARR0_DDR_CSN_2_3 = MCBIST_CCS_INST_ARR0_00_DDR_CSN_2_3,
- ARR0_DDR_CSN_2_3_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CSN_2_3_LEN,
- ARR0_DDR_CID_2 = MCBIST_CCS_INST_ARR0_00_DDR_CID_2,
- ARR0_DDR_ODT = MCBIST_CCS_INST_ARR0_00_DDR_ODT,
- ARR0_DDR_ODT_LEN = MCBIST_CCS_INST_ARR0_00_DDR_ODT_LEN,
- ARR0_DDR_CAL_TYPE = MCBIST_CCS_INST_ARR0_00_DDR_CAL_TYPE,
- ARR0_DDR_CAL_TYPE_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CAL_TYPE_LEN,
- ARR0_DDR_PARITY = MCBIST_CCS_INST_ARR0_00_DDR_PARITY,
- ARR0_DDR_BANK_2 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_2,
- ARR0_LOOP_BREAK_MODE = MCBIST_CCS_INST_ARR0_00_LOOP_BREAK_MODE,
- ARR0_LOOP_BREAK_MODE_LEN = MCBIST_CCS_INST_ARR0_00_LOOP_BREAK_MODE_LEN,
-
- // ARR1
- ARR1_IDLES = MCBIST_CCS_INST_ARR1_00_IDLES,
- ARR1_IDLES_LEN = MCBIST_CCS_INST_ARR1_00_IDLES_LEN,
- ARR1_REPEAT_CMD_CNT = MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT,
- ARR1_REPEAT_CMD_CNT_LEN = MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT_LEN,
- ARR1_READ_OR_WRITE_DATA = MCBIST_CCS_INST_ARR1_00_READ_OR_WRITE_DATA,
- ARR1_READ_OR_WRITE_DATA_LEN = MCBIST_CCS_INST_ARR1_00_READ_OR_WRITE_DATA_LEN,
- ARR1_READ_COMPARE_REQUIRED = MCBIST_CCS_INST_ARR1_00_READ_COMPARE_REQUIRED,
- ARR1_DDR_CAL_RANK = MCBIST_CCS_INST_ARR1_00_DDR_CAL_RANK,
- ARR1_DDR_CAL_RANK_LEN = MCBIST_CCS_INST_ARR1_00_DDR_CAL_RANK_LEN,
- ARR1_DDR_CALIBRATION_ENABLE = MCBIST_CCS_INST_ARR1_00_DDR_CALIBRATION_ENABLE,
- ARR1_END = MCBIST_CCS_INST_ARR1_00_END,
- ARR1_GOTO_CMD = MCBIST_CCS_INST_ARR1_00_GOTO_CMD,
- ARR1_GOTO_CMD_LEN = MCBIST_CCS_INST_ARR1_00_GOTO_CMD_LEN,
-
- };
-};
-
-namespace mss
-{
-
-static constexpr uint64_t CKE_HIGH = 0b1111;
-static constexpr uint64_t CKE_LOW = 0b0000;
-
-// CKE setup for rank 0-7 to support
-// Currently only support 0, 1, 4, 5
-// Not supported ranks will always get 0
-// For self_refresh_entry_command()
-static constexpr uint64_t CKE_ARY_SRE[] =
-{
- // 0, 1, 2, 3,
- 0b0111, 0b1011, 0, 0,
- // 4, 5, 6, 7
- 0b0111, 0b1011, 0, 0
-};
-
-// For self_refresh_exit_command()
-static constexpr uint64_t CKE_ARY_SRX[] =
-{
- // 0, 1, 2, 3,
- 0b1000, 0b0100, 0, 0,
- // 4, 5, 6, 7
- 0b1000, 0b0100, 0, 0
-};
-
-namespace ccs
-{
-
-enum rank_configuration
-{
- DUAL_DIRECT = 0,
- QUAD_ENCODED = 1,
- // Note: we don't include QUAD_DIRECT in here
- // That's because it uses 4 CS and is board wiring dependent
- // Not sure if it would use CS23 or CID01 for CS2/3
-};
-
-///
-/// @brief Enums for CCS return codes
-///
-enum
-{
- // Success is defined as done-bit set, no others.
- STAT_QUERY_SUCCESS = 0x4000000000000000,
-
- // Bit positions 3:5
- STAT_READ_MISCOMPARE = 0x1000000000000000,
- STAT_UE_SUE = 0x0800000000000000,
- STAT_CAL_TIMEOUT = 0x0400000000000000,
-
- // If the fail type isn't one of these, we're hung
- STAT_HUNG = 0x0ull,
-};
-
-///
-/// @class instruction_t
-/// @brief Class for ccs instructions
-/// @tparam T fapi2::TargetType representing the target of the CCS instructions
-/// @note A ccs instruction is data (array 0) and some control information (array 1)cc
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-class instruction_t
-{
- public:
- fapi2::buffer<uint64_t> arr0;
- fapi2::buffer<uint64_t> arr1;
- // The MCA indexed rank on which to operate. If this is invalid, all ranks will be disabled
- uint64_t iv_rank;
- // We want to have a switch to update rank or not. A user might want to setup CS in some weird way
- // In that case, they don't want us "fixing" their CS values
- // We'll default the rank to be updated - we want to send out CS properly
- bool iv_update_rank;
-
- ///
- /// @brief intstruction_t ctor
- /// @param[in] i_rank the rank this instruction is headed for
- /// @param[in] i_arr0 the initial value for arr0, defaults to 0
- /// @param[in] i_arr1 the initial value for arr1, defaults to 0
- /// @param[in] i_update_rank true if the rank should be updated before being sent, defaults to true
- ///
- instruction_t( uint64_t i_rank = NO_CHIP_SELECT_ACTIVE,
- const fapi2::buffer<uint64_t> i_arr0 = 0,
- const fapi2::buffer<uint64_t> i_arr1 = 0,
- const bool i_update_rank = true):
- arr0(i_arr0),
- arr1(i_arr1),
- iv_rank(i_rank),
- iv_update_rank(i_update_rank)
- {
- // Skip setting up the rank if hte user doesn't want us to
- if(iv_update_rank)
- {
- // Set the chip selects to be 1's (not active)
- // We'll fix these up before executing the instructions
- arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1,
- TT::ARR0_DDR_CSN_0_1_LEN>(0b11);
- arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3,
- TT::ARR0_DDR_CSN_2_3_LEN>(0b11);
- }
- }
-
- ///
- /// @brief Updates the rank based upon the passed in rank configuration encoding
- /// @param[in] i_target the port target for this instruction - for error logging
- /// @param[in] i_rank_config the rank configuration
- /// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
- ///
- fapi2::ReturnCode configure_rank(const fapi2::Target<TT::PORT_TARGET_TYPE>& i_target,
- const rank_configuration i_rank_config )
- {
- // If this instrunction is set to not update the rank, then don't update the rank
- if(!iv_update_rank)
- {
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- // Regardless of rank configurations, if we have NO_CHIP_SELECT_ACTIVE, deactivate all CS
- if(iv_rank == NO_CHIP_SELECT_ACTIVE)
- {
- arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1, TT::ARR0_DDR_CSN_0_1_LEN>(0b11);
- arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3, TT::ARR0_DDR_CSN_2_3_LEN>(0b11);
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- // First, check rank - we need to make sure that we have a valid rank
- FAPI_ASSERT(iv_rank < MAX_MRANK_PER_PORT,
- fapi2::MSS_INVALID_RANK()
- .set_MCA_TARGET(i_target)
- .set_RANK(iv_rank)
- .set_FUNCTION(ffdc_function_codes::CCS_INST_CONFIGURE_RANK),
- "%s rank out of bounds rank%u", mss::c_str(i_target), iv_rank);
-
- // Now the fun happens and we can deal with the actual encoding
-
- // If we're quad mode, setup the encoding accordingly
- if(i_rank_config == rank_configuration::QUAD_ENCODED)
- {
- // CS 0/1 are first, while CID0/1 are second
- // In quad enabled mode, CID acts as a "package select"
- // It selects R0/2 vs R1/3
- // CS0 vs CS1 selects the low vs high rank in the package
- // CS0 will select rank 0/1
- // CS1 will select rank 2/3
-
- // Note: this is to workaround a Nimbus CCS bug
- // 1) Nimbus thinks that CID0 is a CID not part of the CS for encoded mode
- // 2) CID1 doesn't matter for quad encode
- // 3) we only access ranks 2,3 in encoded mode
- // 4) we can fake out parity by adding in another 1, so let's do that with CID1
- // This is easier than calculating our own parity
- // CS0 H, CS1 L, CID0-> L => Rank 2
-
- static const std::pair<uint64_t, uint64_t> CS_N[mss::MAX_RANK_PER_DIMM] =
- {
- // CS0 L, CS1 H, CID0-> L => Rank 0
- { 0b01, 0b00 },
-
- // CS0 L, CS1 H, CID0-> H => Rank 1
- { 0b01, 0b11 },
-
- // CS0 H, CS1 L, CID0-> L => Rank 2
- { 0b10, 0b00 },
-
- // CS0 H, CS1 L, CID0-> H => Rank 3
- { 0b10, 0b11 },
- };
-
- const auto l_dimm_rank = mss::index(iv_rank);
- const bool l_is_dimm0 = iv_rank < MAX_RANK_PER_DIMM;
- constexpr uint64_t NON_DIMM_CS = 0b11;
-
- // Assigns the CS based upon which DIMM we're at
- const auto CS01 = l_is_dimm0 ? CS_N[l_dimm_rank].first : NON_DIMM_CS;
- const auto CS23 = l_is_dimm0 ? NON_DIMM_CS : CS_N[l_dimm_rank].first;
-
- // Setup that rank
- arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1,
- TT::ARR0_DDR_CSN_0_1_LEN>(CS01);
- arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3,
- TT::ARR0_DDR_CSN_2_3_LEN>(CS23);
- arr0.insertFromRight<TT::ARR0_DDR_CID_0_1,
- TT::ARR0_DDR_CID_0_1_LEN>(CS_N[l_dimm_rank].second);
- }
-
- // Otherwise, setup for dual-direct mode (our only other supported mode at the moment)
- else
- {
- // For DIMM0 .first is the CSN_0_1 setting, .second is the CSN_2_3 setting.
- // For DIMM1 .first is the CSN_2_3 setting, .second is the CSN_0_1 setting.
- static const std::pair<uint64_t, uint64_t> CS_N[mss::MAX_RANK_PER_DIMM] =
- {
- // CS0 L CS1 H => CS2 => H CS3 => H Rank 0
- { 0b01, 0b11 },
-
- // CS0 H CS1 L => CS2 => H CS3 => H Rank 1
- { 0b10, 0b11 },
-
- // CS0 H CS1 H => CS2 => L CS3 => H Rank 2
- { 0b11, 0b01 },
-
- // CS0 H CS1 H => CS2 => H CS3 => L Rank 3
- { 0b11, 0b10 },
- };
-
- const auto l_dimm_rank = mss::index(iv_rank);
- const bool l_is_dimm0 = iv_rank < MAX_RANK_PER_DIMM;
-
- // Assigns the CS based upon which DIMM we're at
- const auto CS01 = l_is_dimm0 ? CS_N[l_dimm_rank].first : CS_N[l_dimm_rank].second;
- const auto CS23 = l_is_dimm0 ? CS_N[l_dimm_rank].second : CS_N[l_dimm_rank].first;
-
- // Setup that rank
- arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1,
- TT::ARR0_DDR_CSN_0_1_LEN>(CS01);
- arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3,
- TT::ARR0_DDR_CSN_2_3_LEN>(CS23);
-
- // Check that we don't have a rank out of bounds case here
- // We can only have that if
- // 1) we are DIMM1
- // 2) our DIMM rank is greater than the maximum allowed number of ranks on DIMM1
- // So, we pass always if we're DIMM0, or if our DIMM rank is less than the maximum number of DIMM's on rank 1
- FAPI_ASSERT(l_dimm_rank < MAX_RANKS_DIMM1 || l_is_dimm0,
- fapi2::MSS_INVALID_RANK()
- .set_MCA_TARGET(i_target)
- .set_RANK(iv_rank)
- .set_FUNCTION(ffdc_function_codes::CCS_INST_CONFIGURE_RANK),
- "%s rank out of bounds rank%u", mss::c_str(i_target), iv_rank);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
- fapi_try_exit:
- return fapi2::current_err;
- }
-
- ///
- /// @brief Equals comparison operator
- /// @param[in] i_rhs - the instruction to compare to
- /// @return True if both instructions are equal
- ///
- inline bool operator==( const instruction_t<T>& i_rhs ) const
- {
- return arr0 == i_rhs.arr0 &&
- arr1 == i_rhs.arr1 &&
- iv_rank == i_rhs.iv_rank &&
- iv_update_rank == i_rhs.iv_update_rank;
- }
-};
-
-///
-/// @brief Determines our rank configuration type across all ports
-/// @param[in] i_target the MCA target on which to operate
-/// @param[out] o_rank_config the rank configuration
-/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
-///
-fapi2::ReturnCode get_rank_config(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- std::vector<rank_configuration>& o_rank_config);
-
-///
-/// @brief Determines our rank configuration type
-/// @param[in] i_target the MCA target on which to operate
-/// @param[out] o_rank_config the rank configuration
-/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
-///
-fapi2::ReturnCode get_rank_config(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- rank_configuration& o_rank_config);
-
-///
-/// @brief A class representing a series of CCS instructions, and the
-/// CCS engine parameters associated with running the instructions
-/// @tparam T fapi2::TargetType representing the fapi2 target which
-/// @tparam P fapi2::TargetType representing the port
-/// contains the CCS engine (e.g., fapi2::TARGET_TYPE_MCBIST)
-template< fapi2::TargetType T, fapi2::TargetType P = fapi2::TARGET_TYPE_MCA >
-class program
-{
- public:
- // Setup our poll parameters so the CCS executer can see
- // whether to use the delays in the instruction stream or not
- program(): iv_poll(0, 0)
- {}
-
- // Vector of instructions
- std::vector< instruction_t<T> > iv_instructions;
- poll_parameters iv_poll;
-
- // Vector of polling probes
- std::vector< poll_probe<P> > iv_probes;
-};
-
-///
-/// @brief Common setup for all MRS/RCD instructions
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in,out] i_arr0 fapi2::buffer<uint64_t> representing the ARR0 of the instruction
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-static void mrs_rcd_helper( fapi2::buffer<uint64_t>& i_arr0 )
-{
- //
- // Generic DDR4 MRS setup (RCD is an MRS)
- //
- // CKE is high Note: P8 set all 4 of these high - not sure if that's correct. BRS
- i_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_HIGH);
-
- // ACT is high
- i_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // RAS, CAS, WE low
- i_arr0.clearBit<TT::ARR0_DDR_ADDRESS_16>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_15>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_14>();
-}
-
-///
-/// @brief Setup activate command instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> act_command( const uint64_t i_rank)
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- // Set all CKE to high
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_HIGH);
-
- // ACT is high
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ACTN>();
-
- // RAS low, CAS low, WE low
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ADDRESS_16>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_15>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_14>();
-
- // Just leaving the row addresses to all 0 for now
- // row, bg, ba set to 0
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ADDRESS_17>();
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ADDRESS_0_13, TT::ARR0_DDR_ADDRESS_0_13_LEN>();
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_BANK_GROUP_1>();
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_BANK_GROUP_0>();
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_BANK_0_1, TT::ARR0_DDR_BANK_0_1_LEN>();
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_BANK_2>();
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Create, initialize an RCD (RCW - JEDEC) CCS command
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the DIMM this instruction is headed for
-/// @param[in] i_turn_on_cke flag that states whether we want CKE on for this RCW (defaulted to true)
-/// @return the RCD CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> rcd_command( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const bool i_sim,
- const bool i_turn_on_cke = true)
-{
- fapi2::buffer<uint64_t> rcd_boilerplate_arr0;
- fapi2::buffer<uint64_t> rcd_boilerplate_arr1;
-
- //
- // Generic DDR4 MRS setup (RCD is an MRS)
- //
- mrs_rcd_helper<fapi2::TARGET_TYPE_MCBIST>(rcd_boilerplate_arr0);
-
- // Not adding i_turn_on_cke in the mrs_rcd helper because we only need this
- // for RCWs and there is no need to complicate/change the MRS cmd API with
- // uneeded functionality. Little duplication, but this isolates the change.
- if( !i_sim )
- {
- const uint64_t l_cke = i_turn_on_cke ? CKE_HIGH : CKE_LOW;
- rcd_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_cke);
- }
-
- //
- // RCD setup
- //
- // DDR4: Set BG1 to 0 during an MRS.
- // BG0, BA1:BA0 to 0b111 selects RCW (aka MR7).
- rcd_boilerplate_arr0.clearBit<TT::ARR0_DDR_BANK_GROUP_1>()
- .template insertFromRight<TT::ARR0_DDR_BANK_0_1, TT::ARR0_DDR_BANK_0_1_LEN>(0b11)
- .template setBit<TT::ARR0_DDR_BANK_GROUP_0>();
-
- // RCD always goes to the 0th rank on the DIMM; either 0 or 4.
- return instruction_t<T>((mss::index(i_target) == 0) ? 0 : 4, rcd_boilerplate_arr0, rcd_boilerplate_arr1);
-}
-
-///
-/// @brief Create, initialize an MRS CCS command
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_mrs the specific MRS
-/// @return the MRS CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> mrs_command (const uint64_t i_rank,
- const uint64_t i_mrs )
-{
- fapi2::buffer<uint64_t> rcd_boilerplate_arr0;
- fapi2::buffer<uint64_t> rcd_boilerplate_arr1;
- fapi2::buffer<uint8_t> mrs(i_mrs);
-
- //
- // Generic DDR4 MRS setup (RCD is an MRS)
- //
- mrs_rcd_helper<fapi2::TARGET_TYPE_MCBIST>(rcd_boilerplate_arr0);
-
- //
- // MRS setup
- //
- // DDR4: Set BG1 to 0. BG0, BA1:BA0 to i_mrs
- rcd_boilerplate_arr0.clearBit<TT::ARR0_DDR_BANK_GROUP_1>();
- mss::swizzle<TT::ARR0_DDR_BANK_0_1, 3, 7>(mrs, rcd_boilerplate_arr0);
- FAPI_DBG("mrs rcd boiler 0x%llx 0x%llx", uint8_t(mrs), uint64_t(rcd_boilerplate_arr0));
- return instruction_t<T>(i_rank, rcd_boilerplate_arr0, rcd_boilerplate_arr1);
-}
-
-///
-/// @brief Create, initialize a JEDEC Device Deselect CCS command
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_idle the idle time to the next command (default to 0)
-/// @return the Device Deselect CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> des_command(const uint16_t i_idle = 0)
-{
- fapi2::buffer<uint64_t> rcd_boilerplate_arr0;
- fapi2::buffer<uint64_t> rcd_boilerplate_arr1;
-
- // ACT is high. It's a no-care in the spec but it seems to raise questions when
- // people look at the trace, so lets set it high.
- rcd_boilerplate_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // CKE is high Note: P8 set all 4 of these high - not sure if that's correct. BRS
- rcd_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_HIGH);
-
- // Insert idle
- rcd_boilerplate_arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>( i_idle );
-
- // ACT is high no-care
- // RAS, CAS, WE no-care
-
- // Device Deslect wants CS_n always high (select nothing using rank NO_CHIP_SELECT_ACTIVE)
- return instruction_t<T>( NO_CHIP_SELECT_ACTIVE,
- rcd_boilerplate_arr0,
- rcd_boilerplate_arr1);
-}
-
-///
-/// @brief Converts an ODT attribute to CCS array input
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_attr_value ODT attribute value
-/// @return CCS value for the ODT's
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline uint8_t convert_odt_attr_to_ccs(const fapi2::buffer<uint8_t>& i_attr_value)
-{
- // ODT value buffer
- fapi2::buffer<uint8_t> l_ccs_value;
- l_ccs_value.template writeBit<TT::CCS_ODT_DIMM0_R0>(i_attr_value.template getBit<TT::ATTR_ODT_DIMM0_R0>())
- .template writeBit<TT::CCS_ODT_DIMM0_R1>(i_attr_value.template getBit<TT::ATTR_ODT_DIMM0_R1>())
- .template writeBit<TT::CCS_ODT_DIMM0_R0>(i_attr_value.template getBit<TT::ATTR_ODT_DIMM0_R0>())
- .template writeBit<TT::CCS_ODT_DIMM1_R0>(i_attr_value.template getBit<TT::ATTR_ODT_DIMM1_R0>())
- .template writeBit<TT::CCS_ODT_DIMM1_R1>(i_attr_value.template getBit<TT::ATTR_ODT_DIMM1_R1>());
-
- return uint8_t(l_ccs_value);
-}
-
-///
-/// @brief Create, initialize a JEDEC Device Deselect CCS command
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_odt_values CCS defined ODT values
-/// @param[in] i_cycles the number of cycles to hold the ODT for - defaults to DEFAULT_ODT_CYCLE_LEN
-/// @return the Device Deselect CCS instruction
-/// @note This technically is not a JEDEC command, but is needed for CCS to hold the ODT cycles
-/// CCS by design does not repeat or latch ODT's appropriately
-/// As such, it's up to the programmers to hold the ODT's appropriately
-/// This "command" will greatly help us do that
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> odt_command(const uint8_t i_odt_values, const uint64_t i_cycles = TT::DEFAULT_ODT_CYCLE_LEN)
-{
- auto l_odt_cmd = des_command<T>();
- l_odt_cmd.arr0.template insertFromRight<TT::ARR0_DDR_ODT, TT::ARR0_DDR_ODT_LEN>(i_odt_values);
- l_odt_cmd.arr1.template insertFromRight<TT::ARR1_REPEAT_CMD_CNT, TT::ARR1_REPEAT_CMD_CNT_LEN>(i_cycles);
-
- return l_odt_cmd;
-}
-
-
-///
-/// @brief Create, initialize a NTTM read CCS command
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @return the Device Deselect CCS instruction
-/// @note need to setup 4 cycles delay
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> nttm_read_command()
-{
- // setup 4 cycles delay
- constexpr uint64_t NTTM_READ_DELAY = 4;
- // No.. there's no field for this one. it's an undocumented bit
- constexpr uint64_t NTTM_MODE_FORCE_READ = 33;
-
- // get the des_command
- auto l_command = des_command<T>();
- // set to CCS_INST_ARR1 register
- l_command.arr1.template setBit<NTTM_MODE_FORCE_READ>();
- l_command.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>(NTTM_READ_DELAY);
-
- return l_command;
-}
-
-///
-/// @brief Create, initialize a JEDEC Device Power Down Entry CCS command
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @return the Device Deselect CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> pde_command()
-{
- fapi2::buffer<uint64_t> rcd_boilerplate_arr0;
- fapi2::buffer<uint64_t> rcd_boilerplate_arr1;
-
- // Power Down Entry just like a DES, but we set CKE low
- instruction_t<T> l_inst = des_command<T>();
-
- // CKE is low. Note: P8 set all 4 of these low - not sure if that's correct.
- l_inst.arr0.template insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_LOW);
-
- l_inst.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>( mss::tcpded() );
-
- return l_inst;
-}
-
-///
-/// @brief Create, initialize an instruction which indicates an initial cal
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rp the rank-pair (rank) to cal
-/// @return the initial cal instruction
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> initial_cal_command(const uint64_t i_rp)
-{
- // An initial cal arr0 looks just like a DES, but we set the initial cal bits
- instruction_t<T> l_inst = des_command<T>();
-
- // ACT is low - per Centaur spec (Shelton to confirm for Nimbus) BRS
- l_inst.arr0.template clearBit<TT::ARR0_DDR_ACTN>();
-
- l_inst.arr0.template insertFromRight<TT::ARR0_DDR_CAL_TYPE, TT::ARR0_DDR_CAL_TYPE_LEN>(0b1100);
- l_inst.arr1.template setBit<TT::ARR1_DDR_CALIBRATION_ENABLE>();
-
-#ifdef USE_LOTS_OF_IDLES
- // Idles is 0xFFFF - per Centaur spec (Shelton to confirm for Nimbus) BRS
- l_inst.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>(0xFFFF);
-#else
- l_inst.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>(0x0);
-#endif
-
- // The rank we're calibrating is enacoded - it's an int. So rank 3 is 0011 not 0001
- l_inst.arr1.template insertFromRight<TT::ARR1_DDR_CAL_RANK, TT::ARR1_DDR_CAL_RANK_LEN>(i_rp);
-
- return l_inst;
-}
-
-///
-/// @brief Setup ZQ Long instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the DIMM this instruction is headed for
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_idle the idle time to the next command (default to 0)
-/// @return the MRS CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> zqcl_command( const uint64_t i_rank,
- const uint16_t i_idle = 0 )
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- // CKE is high Note: P8 set all 4 of these high - not sure if that's correct. BRS
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_HIGH);
-
- // ACT is high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // RAS/CAS high, WE low
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_16>()
- .template setBit<TT::ARR0_DDR_ADDRESS_15>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_14>();
-
- // ADDR10/AP is high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_10>();
-
- // Insert idle
- l_boilerplate_arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>( i_idle );
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Setup read command helper function
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_bank_addr bank address bits [BG0:BG1] = [62:63] (right aligned)
-/// @param[in] i_bank_group_addr bank group address bits [BA0:BA1] = [62:63] (right aligned)
-/// @param[in] i_column_addr column address bits [A0:A9] = [54:63] (right aligned)
-/// @return the read command CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-static fapi2::buffer<uint64_t> read_cmd_boilerplate( const uint64_t i_rank,
- const fapi2::buffer<uint64_t>& i_bank_addr = 0,
- const fapi2::buffer<uint64_t>& i_bank_group_addr = 0,
- const fapi2::buffer<uint64_t>& i_column_addr = 0)
-{
- // TODO - RTC 166175 Encapsulate command truth table in a subclass for ccs.H
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
-
- // CKE is high Note: P8 set all 4 of these high - not sure if that's correct. AAM
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE,
- TT::ARR0_DDR_CKE_LEN>(CKE_HIGH);
-
- // ACT is high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // RAS high, CAS low, WE high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_16>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_15>()
- .template setBit<TT::ARR0_DDR_ADDRESS_14>();
-
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_BANK_0_1,
- TT::ARR0_DDR_BANK_0_1_LEN>(i_bank_addr);
-
- // Bank Group takes a little effort - the bits aren't contiguous
- constexpr uint64_t BG0_BIT = 62;
- constexpr uint64_t BG1_BIT = 63;
-
- l_boilerplate_arr0.writeBit<TT::ARR0_DDR_BANK_GROUP_0>(i_bank_group_addr.getBit<BG0_BIT>())
- .template writeBit<TT::ARR0_DDR_BANK_GROUP_1>(i_bank_group_addr.getBit<BG1_BIT>());
-
- // CA is A[0:9]
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_ADDRESS_0_9,
- TT::ARR0_DDR_ADDRESS_0_9_LEN>(i_column_addr);
-
- return l_boilerplate_arr0;
-}
-
-///
-/// @brief Setup write command (Fixed BL8 or BC4) instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_bank_addr bank address bits [BA0:BA1] = [62:63] (right aligned)
-/// @param[in] i_bank_group_addr bank group address bits [BG0:BG1] = [62:63] (right aligned)
-/// @param[in] i_column_addr column address bits [A0:A9] = [54:63] (right aligned)
-/// @return the write command CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> wr_command( const uint64_t i_rank,
- const fapi2::buffer<uint64_t>& i_bank_addr = 0,
- const fapi2::buffer<uint64_t>& i_bank_group_addr = 0,
- const fapi2::buffer<uint64_t>& i_column_addr = 0)
-{
- // WR's and RD's are very similar, so we just use the RD command boiler plate and modify the command to a WR
- fapi2::buffer<uint64_t> l_boilerplate_arr0 = read_cmd_boilerplate<T>(i_rank,
- i_bank_addr,
- i_bank_group_addr,
- i_column_addr);
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- // RAS high, CAS low, WE low
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_16>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_15>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_14>();
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Setup read command (Fixed BL8 or BC4) instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_bank_addr bank address bits [BA0:BA1] = [62:63] (right aligned)
-/// @param[in] i_bank_group_addr bank group address bits [BG0:BG1] = [62:63] (right aligned)
-/// @param[in] i_column_addr column address bits [A0:A9] = [54:63] (right aligned)
-/// @return the read command CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> rd_command( const uint64_t i_rank,
- const fapi2::buffer<uint64_t>& i_bank_addr = 0,
- const fapi2::buffer<uint64_t>& i_bank_group_addr = 0,
- const fapi2::buffer<uint64_t>& i_column_addr = 0)
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- l_boilerplate_arr0 = read_cmd_boilerplate<fapi2::TARGET_TYPE_MCBIST>(i_rank,
- i_bank_addr,
- i_bank_group_addr,
- i_column_addr);
-
- // Setup ADDR10/AP based on read type
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ADDRESS_10>();
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Setup read w/auto precharge command (Fixed BL8 or BC4) instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_bank_addr bank address bits [BG0:BG1] = [62:63] (right aligned)
-/// @param[in] i_bank_group_addr bank group address bits [BA0:BA1] = [62:63] (right aligned)
-/// @param[in] i_column_addr column address bits [A0:A9] = [54:63] (right aligned)
-/// @return the read command CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> rda_command( const uint64_t i_rank,
- const fapi2::buffer<uint64_t>& i_bank_addr = 0,
- const fapi2::buffer<uint64_t>& i_bank_group_addr = 0,
- const fapi2::buffer<uint64_t>& i_column_addr = 0)
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- l_boilerplate_arr0 = read_cmd_boilerplate<fapi2::TARGET_TYPE_MCBIST>(i_rank,
- i_bank_addr,
- i_bank_group_addr,
- i_column_addr);
-
- // Setup ADDR10/AP based on read type
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_10>();
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Setup precharge all banks command instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_idle the idle time to the next command (default to 0)
-/// @return the precharge all banks command CCS instruction
-/// @note THIS IS DDR4 ONLY RIGHT NOW. We can (and possibly should) specialize this
-/// for the controller (Nimbus v Centaur) and then correct for DRAM generation (not included
-/// in this template definition)
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> precharge_all_command( const uint64_t i_rank,
- const uint16_t i_idle = 0 )
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- // CKE is high Note: P8 set all 4 of these high - not sure if that's correct. AAM
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_HIGH);
-
- // ACT is high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // RAS low, CAS high, WE low
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ADDRESS_16>()
- .template setBit<TT::ARR0_DDR_ADDRESS_15>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_14>();
-
- // Setup ADDR10/AP high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_10>();
-
- // Insert idle
- l_boilerplate_arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>( i_idle );
-
- // From DDR4 Spec table 17:
- // All other bits from the command truth table or 'V', for valid (1 or 0)
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Setup self-refresh entry command instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_idle the idle time to the next command (default to 0)
-/// @return the self-refresh entry command CCS instruction
-/// @note THIS IS FOR DDR4 NON-LRDIMM ONLY RIGHT NOW
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> self_refresh_entry_command( const uint64_t i_rank, const uint16_t i_idle = 0 )
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- // Set all CKE to high except the rank passed in
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_ARY_SRE[i_rank]);
-
- // ACT is high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // RAS low, CAS low, WE high
- l_boilerplate_arr0.clearBit<TT::ARR0_DDR_ADDRESS_16>()
- .template clearBit<TT::ARR0_DDR_ADDRESS_15>()
- .template setBit<TT::ARR0_DDR_ADDRESS_14>();
-
- // Insert idle
- l_boilerplate_arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>( i_idle );
-
- // From DDR4 Spec table 17:
- // All other bits from the command truth table are 'V', for valid (1 or 0)
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-///
-/// @brief Setup self-refresh exit using NOP command instruction
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_rank the rank on this dimm
-/// @param[in] i_idle the idle time to the next command (default to 0)
-/// @return the self-refresh exit command CCS instruction
-/// @note Using NOP in case SDRAM is in gear down mode and max power saving mode exit
-/// @note THIS IS FOR DDR4 NON-LRDIMM ONLY RIGHT NOW
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline instruction_t<T> self_refresh_exit_command( const uint64_t i_rank, const uint16_t i_idle = 0 )
-{
- fapi2::buffer<uint64_t> l_boilerplate_arr0;
- fapi2::buffer<uint64_t> l_boilerplate_arr1;
-
- // Set all CKE to low except the rank passed in
- l_boilerplate_arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(CKE_ARY_SRX[i_rank]);
-
- // ACT is high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ACTN>();
-
- // RAS high, CAS high, WE high
- l_boilerplate_arr0.setBit<TT::ARR0_DDR_ADDRESS_16>()
- .template setBit<TT::ARR0_DDR_ADDRESS_15>()
- .template setBit<TT::ARR0_DDR_ADDRESS_14>();
-
- // Insert idle
- l_boilerplate_arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>( i_idle );
-
- // From DDR4 Spec table 17:
- // All other bits from the command truth table are 'V', for valid (1 or 0)
-
- return instruction_t<T>(i_rank, l_boilerplate_arr0, l_boilerplate_arr1);
-}
-
-//
-// These functions are a little sugar to keep callers from doing the traits-dance to get the
-// appropriate bit field
-//
-
-///
-/// @brief Select the port(s) to be used by the CCS
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the target to effect
-/// @param[in] i_ports the buffer representing the ports
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline fapi2::ReturnCode select_ports( const fapi2::Target<T>& i_target, uint64_t i_ports)
-{
- fapi2::buffer<uint64_t> l_data;
- fapi2::buffer<uint64_t> l_ports;
-
- // Not handling multiple ports here, can't do that for CCS. BRS
- FAPI_TRY( l_ports.setBit(i_ports) );
-
- FAPI_TRY( mss::getScom(i_target, TT::MCB_CNTL_REG, l_data) );
- l_data.insert<TT::MCB_CNTL_PORT_SEL, TT::MCB_CNTL_PORT_SEL_LEN>(l_ports);
- FAPI_TRY( mss::putScom(i_target, TT::MCB_CNTL_REG, l_data) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief User sets to a '1'b to tell the Hdw to stop CCS whenever failure occurs. When a
-/// '0'b, Hdw will continue CCS even if a failure occurs.
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-/// @param[in] i_value true iff stop whenever failure occurs.
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline void stop_on_err( const fapi2::Target<T>&, fapi2::buffer<uint64_t>& io_buffer, const states i_value)
-{
- io_buffer.writeBit<TT::STOP_ON_ERR>(i_value);
-}
-
-///
-/// @brief Disable ECC checking on the CCS arrays
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline void disable_ecc( const fapi2::Target<T>&, fapi2::buffer<uint64_t>& io_buffer)
-{
- io_buffer.setBit<TT::DISABLE_ECC_ARRAY_CHK>()
- .template setBit<TT::DISABLE_ECC_ARRAY_CORRECTION>();
-}
-
-///
-/// @brief User sets to a '1'b to force the Hdw to ignore any array ue or sue errors
-/// during CCS command fetching.
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-/// @param[in] i_value true iff ignore any array ue or sue errors.
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline void ue_disable( const fapi2::Target<T>&, fapi2::buffer<uint64_t>& io_buffer, const states i_value)
-{
- io_buffer.writeBit<TT::UE_DISABLE>(i_value);
-}
-
-///
-/// @brief User sets to a '1'b to force the Hdw to delay parity a cycle
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-/// @param[in] i_value mss::ON iff delay parity a cycle
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline void parity_after_cmd( const fapi2::Target<T>&, fapi2::buffer<uint64_t>& io_buffer, const states i_value)
-{
- io_buffer.writeBit<TT::CFG_PARITY_AFTER_CMD>(i_value);
-}
-
-///
-/// @brief DDr calibration counter
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-/// @param[in] i_count the count to wait for DDR cal to complete.
-/// @param[in] i_mult the DDR calibration time multiplaction factor
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline void cal_count( const fapi2::Target<T>&, fapi2::buffer<uint64_t>& io_buffer,
- const uint64_t i_count, const uint64_t i_mult)
-{
- io_buffer.insertFromRight<TT::DDR_CAL_TIMEOUT_CNT, TT::DDR_CAL_TIMEOUT_CNT_LEN>(i_count);
- io_buffer.insertFromRight<TT::DDR_CAL_TIMEOUT_CNT_MULT, TT::DDR_CAL_TIMEOUT_CNT_MULT_LEN>(i_mult);
-}
-
-///
-/// @brief Copy CKE signals to CKE Spare on both ports NOTE: DOESN'T APPLY FOR NIMBUS. NO
-/// SPARE CHIPS TO COPY TO. 0 - Spare CKEs not copied with values from CKE(0:1) and
-/// CKE(4:5) 1 - Port A CKE(0:1) copied to Port A CKE(2:3), Port A CKE(4:5) copied
-/// to Port A CKE(6:7), Port B CKE(0:1) copied to Port B CKE(2:3) and Port B CKE(4:5)
-/// copied to Port B CKE(6:7)
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the ccsTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-/// @param[in] i_value mss::ON iff Copy CKE signals to CKE Spare on both ports
-/// @note no-op for p9n
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-void copy_cke_to_spare_cke( const fapi2::Target<T>&, fapi2::buffer<uint64_t>& io_buffer, const states i_value);
-
-///
-/// @brief Read the modeq register appropriate for this target
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the target to effect
-/// @param[in,out] io_buffer the buffer representing the mode register
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline fapi2::ReturnCode read_mode( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& io_buffer)
-{
- FAPI_DBG("read mode 0x%llx", TT::MODEQ_REG);
- return mss::getScom(i_target, TT::MODEQ_REG, io_buffer);
-}
-
-///
-/// @brief Write the modeq register appropriate for this target
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the target to effect
-/// @param[in] i_buffer the buffer representing the mode register
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline fapi2::ReturnCode write_mode( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_buffer)
-{
- return mss::putScom(i_target, TT::MODEQ_REG, i_buffer);
-}
-
-///
-/// @brief config the NTTM
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_mcbist the target to operate
-/// @param[in] i_nttm_mode NTTM we need to turn on or off (i.e. ON, OFF)
-/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-inline fapi2::ReturnCode configure_nttm( const fapi2::Target<T>& i_target,
- const mss::states i_nttm_mode)
-{
- fapi2::buffer<uint64_t> l_data;
-
- FAPI_TRY(read_mode(i_target, l_data));
-
- l_data.writeBit<TT::NTTM_MODE>(i_nttm_mode);
-
- FAPI_TRY(write_mode(i_target, l_data));
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Execute a set of CCS instructions - multiple ports
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the vector of instructions
-/// @param[in] i_ports the vector of ports
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, fapi2::TargetType P, typename TT = ccsTraits<T> >
-fapi2::ReturnCode execute( const fapi2::Target<T>& i_target,
- ccs::program<T>& i_program,
- const std::vector< fapi2::Target<P> >& i_ports);
-
-///
-/// @brief Execute a set of CCS instructions - single port
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam P the target of the CCS instruction (the port)
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the vector of instructions
-/// @param[in] i_port The target that's being programmed by the array
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, fapi2::TargetType P, typename TT = ccsTraits<T> >
-fapi2::ReturnCode execute( const fapi2::Target<T>& i_target,
- ccs::program<T>& i_program,
- const fapi2::Target<P>& i_port)
-{
- // Mmm. Might want to find a better way to do this - seems expensive. BRS
- std::vector< fapi2::Target<P> > l_ports{ i_port };
- return execute(i_target, i_program, l_ports);
-}
-
-///
-/// @brief Execute a CCS array already loaded in to the engine
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam P the target of the CCS instruction (the port)
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the MCBIST ccs program - to get the polling parameters
-/// @param[in] i_port the port associated with the MCBIST array
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, fapi2::TargetType P, typename TT = ccsTraits<T> >
-fapi2::ReturnCode execute_inst_array(const fapi2::Target<T>& i_target,
- ccs::program<T>& i_program,
- const fapi2::Target<P>& i_port);
-
-///
-/// @brief Start or stop the CCS engine
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target The MCBIST containing the CCS engine
-/// @param[in] i_start_stop bool MSS_CCS_START for starting MSS_CCS_STOP otherwise
-/// @return FAPI2_RC_SUCCESS iff success
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-fapi2::ReturnCode start_stop( const fapi2::Target<T>& i_target, const bool i_start_stop );
-
-///
-/// @brief Query the status of the CCS engine
-/// @tparam T the target type of the chiplet which executes the CCS instruction
-/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
-/// @param[in] i_target The MCBIST containing the CCS engine
-/// @param[out] io_status The query result first being the result, second the type
-/// @return FAPI2_RC_SUCCESS iff success
-///
-template< fapi2::TargetType T, typename TT = ccsTraits<T> >
-fapi2::ReturnCode status_query( const fapi2::Target<T>& i_target, std::pair<uint64_t, uint64_t>& io_status );
-
-///
-/// @brief Determine the CCS failure type
-/// @param[in] i_target MCBIST target
-/// @param[in] i_type the failure type
-/// @param[in] i_mca The port the CCS instruction is training
-/// @return ReturnCode associated with the fail.
-/// @note FFDC is handled here, caller doesn't need to do it
-///
-fapi2::ReturnCode fail_type( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- const uint64_t& i_type,
- const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_mca );
-
-} // ends namespace ccs
-}
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.C b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.C
new file mode 100644
index 000000000..d3725beee
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.C
@@ -0,0 +1,243 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file ccs_nimbus.C
+/// @brief Run and manage the CCS engine
+///
+// *HWP HWP Owner: Matthew Hickman <Matthew.Hickman@ibm.com>
+// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+
+#include <mss.H>
+#include <lib/fir/check.H>
+#include <lib/phy/mss_lrdimm_training.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+#include <lib/ccs/ccs_nimbus.H>
+
+#ifdef LRDIMM_CAPABLE
+ #include <lib/workarounds/quad_encode_workarounds.H>
+#endif
+
+using fapi2::TARGET_TYPE_MCBIST;
+using fapi2::TARGET_TYPE_MCA;
+using fapi2::FAPI2_RC_SUCCESS;
+
+// Generates linkage
+constexpr std::pair<uint64_t, uint64_t> ccsTraits<mss::mc_type::NIMBUS>::CS_N[];
+constexpr std::pair<uint64_t, uint64_t> ccsTraits<mss::mc_type::NIMBUS>::CS_ND[];
+
+namespace mss
+{
+namespace ccs
+{
+
+///
+/// @brief Select the port(s) to be used by the CCS - EXPLORER specialization
+/// @param[in] i_target the target to effect
+/// @param[in] i_ports the buffer representing the ports
+///
+template<>
+fapi2::ReturnCode select_ports<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ uint64_t i_ports)
+{
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
+ fapi2::buffer<uint64_t> l_data;
+ fapi2::buffer<uint64_t> l_ports;
+
+ // Not handling multiple ports here, can't do that for CCS. BRS
+ FAPI_TRY( l_ports.setBit(i_ports) );
+
+ FAPI_TRY( mss::getScom(i_target, TT::MCB_CNTL_REG, l_data) );
+ l_data.insert<TT::MCB_CNTL_PORT_SEL, TT::MCB_CNTL_PORT_SEL_LEN>(l_ports);
+ FAPI_TRY( mss::putScom(i_target, TT::MCB_CNTL_REG, l_data) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Execute a set of CCS instructions - multiple ports - NIMBUS specialization
+/// @param[in] i_program the vector of instructions
+/// @param[in] i_ports the vector of ports
+/// @return FAPI2_RC_SUCCSS iff ok
+///
+template<>
+fapi2::ReturnCode cleanup_from_execute<fapi2::TARGET_TYPE_MCA, mss::mc_type::NIMBUS>(const ccs::program& i_program,
+ const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >& i_ports)
+{
+#if LRDIMM_CAPABLE
+
+ if(mss::workarounds::contains_command_mrs(i_program.iv_instructions))
+ {
+ // Get ranks in pair bombs out if we can't get any ranks in this pair, so we should be safe here
+ for (const auto& p : i_ports)
+ {
+ FAPI_TRY(mss::workarounds::fix_shadow_register_corruption(p));
+ }
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+
+#else
+ return fapi2::FAPI2_RC_SUCCESS;
+
+#endif
+}
+
+///
+/// @brief Determine the CCS failure type
+/// @param[in] i_target MCBIST target
+/// @param[in] i_type the failure type
+/// @param[in] i_port The port the CCS instruction is training
+/// @return ReturnCode associated with the fail.
+/// @note FFDC is handled here, caller doesn't need to do it
+///
+template<>
+fapi2::ReturnCode fail_type( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
+ const uint64_t i_type,
+ const fapi2::Target<TARGET_TYPE_MCA>& i_port )
+{
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
+
+ fapi2::ReturnCode l_failing_rc(fapi2::FAPI2_RC_SUCCESS);
+ // Including the MCA_TARGET here and below at CAL_TIMEOUT since these problems likely lie at the MCA level
+ // So we disable the PORT and hopefully that's it
+ // If the problem lies with the MCBIST, it'll just have to loop
+ FAPI_ASSERT(TT::STAT_READ_MISCOMPARE != i_type,
+ fapi2::MSS_NIMBUS_CCS_READ_MISCOMPARE()
+ .set_MCBIST_TARGET(i_target)
+ .set_FAIL_TYPE(i_type)
+ .set_MCA_TARGET(i_port),
+ "%s CCS FAIL Read Miscompare", mss::c_str(i_port));
+
+ // This error is likely due to a bad CCS engine/ MCBIST
+ FAPI_ASSERT(TT::STAT_UE_SUE != i_type,
+ fapi2::MSS_NIMBUS_CCS_UE_SUE()
+ .set_FAIL_TYPE(i_type)
+ .set_MCBIST_TARGET(i_target),
+ "%s CCS FAIL UE or SUE Error", mss::c_str(i_target));
+
+ FAPI_ASSERT(TT::STAT_CAL_TIMEOUT != i_type,
+ fapi2::MSS_NIMBUS_CCS_CAL_TIMEOUT()
+ .set_FAIL_TYPE(i_type)
+ .set_MCBIST_TARGET(i_target)
+ .set_MCA_TARGET(i_port),
+ "%s CCS FAIL Calibration Operation Time Out", mss::c_str(i_port));
+
+ // Problem with the CCS engine
+ FAPI_ASSERT(TT::STAT_HUNG != i_type,
+ fapi2::MSS_NIMBUS_CCS_HUNG().set_MCBIST_TARGET(i_target),
+ "%s CCS appears hung", mss::c_str(i_target));
+fapi_try_exit:
+ // Due to the PRD update, we need to check for FIR's
+ // If any FIR's have lit up, this CCS fail could have been caused by the FIR
+ // So, let PRD retrigger this step to see if we can resolve the issue
+ return mss::check::fir_or_pll_fail<mss::mc_type::NIMBUS>(i_target, fapi2::current_err);
+}
+
+///
+/// @brief Create, initialize an instruction which indicates an initial cal
+/// @tparam TT the CCS traits of the chiplet which executes the CCS instruction
+/// @param[in] i_rp the rank-pair (rank) to cal
+/// @return the initial cal instruction
+///
+instruction_t initial_cal_command(const uint64_t i_rp)
+{
+ using TT = ccsTraits<mss::mc_type::NIMBUS>;
+
+ // An initial cal arr0 looks just like a DES, but we set the initial cal bits
+ instruction_t l_inst = des_command();
+
+ // ACT is low - per Centaur spec (Shelton to confirm for Nimbus) BRS
+ l_inst.arr0.template clearBit<TT::ARR0_DDR_ACTN>();
+
+ l_inst.arr0.template insertFromRight<TT::ARR0_DDR_CAL_TYPE, TT::ARR0_DDR_CAL_TYPE_LEN>(0b1100);
+ l_inst.arr1.template setBit<TT::ARR1_DDR_CALIBRATION_ENABLE>();
+
+#ifdef USE_LOTS_OF_IDLES
+ // Idles is 0xFFFF - per Centaur spec (Shelton to confirm for Nimbus) BRS
+ l_inst.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>(0xFFFF);
+#else
+ l_inst.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>(0x0);
+#endif
+
+ // The rank we're calibrating is enacoded - it's an int. So rank 3 is 0011 not 0001
+ l_inst.arr1.template insertFromRight<TT::ARR1_DDR_CAL_RANK, TT::ARR1_DDR_CAL_RANK_LEN>(i_rp);
+
+ return l_inst;
+}
+
+///
+/// @brief Nimbus specialization for modeq_copy_cke_to_spare_cke
+/// @param[in] fapi2::Target<TARGET_TYPE_MCBIST>& the target to effect
+/// @param[in,out] the buffer representing the mode register
+/// @param[in] mss::states - mss::ON iff Copy CKE signals to CKE Spare on both ports
+/// @note no-op for p9n
+///
+template<>
+void copy_cke_to_spare_cke<TARGET_TYPE_MCBIST>( const fapi2::Target<TARGET_TYPE_MCBIST>&,
+ fapi2::buffer<uint64_t>&, states )
+{
+ return;
+}
+
+///
+/// @brief Updates the initial delays based upon the total delays passed in - Nimbus specialization
+/// @param[in] i_target the target type on which to operate
+/// @param[in] i_delay the calculated delays from CCS
+/// @param[in,out] io_program the program for which to update the delays
+/// @return FAPI2_RC_SUCCSS iff ok
+///
+template<>
+fapi2::ReturnCode update_initial_delays<fapi2::TARGET_TYPE_MCBIST, mss::mc_type::NIMBUS>
+( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const uint64_t i_delay,
+ ccs::program& io_program)
+{
+ // Check our program for any delays. If there isn't a iv_initial_delay configured, then
+ // we use the delay we just summed from the instructions.
+ if (io_program.iv_poll.iv_initial_delay == 0)
+ {
+ io_program.iv_poll.iv_initial_delay = cycles_to_ns(i_target, i_delay);
+ }
+
+ if (io_program.iv_poll.iv_initial_sim_delay == 0)
+ {
+ io_program.iv_poll.iv_initial_sim_delay = cycles_to_simcycles(i_delay);
+ }
+
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+} // namespace ccs
+} // namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/dump_regs.H b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.H
index 1154694e9..ec0a73dc7 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/dump_regs.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/utils/dump_regs.H $ */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_nimbus.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -24,31 +24,35 @@
/* IBM_PROLOG_END_TAG */
///
-/// @file dump_regs.H
-/// @brief Dump registers
+/// @file ccs_nimbus.C
+/// @brief Run and manage the CCS engine
///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP HWP Owner: Matthew Hickman <Matthew.Hickman@ibm.com>
// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 3
-// *HWP Consumed by: HB:FSP
+// *HWP Consumed by: FSP:HB
-#ifndef _MSS_DUMP_REGS_H_
-#define _MSS_DUMP_REGS_H_
+#ifndef _MSS_CCS_NIMBUS_H_
+#define _MSS_CCS_NIMBUS_H_
#include <fapi2.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
namespace mss
{
+namespace ccs
+{
///
-/// @brief Dump the registers of a target
-/// @tparam T, the fapi2::TargetType
-/// @param[in] i_target the target in question
-/// @return fapi2::FAPI2_RC_SUCCESS if ok
+/// @brief Create, initialize an instruction which indicates an initial cal
+/// @param[in] i_rp the rank-pair (rank) to cal
+/// @return the initial cal instruction
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode dump_regs( const fapi2::Target<T>& i_target );
+instruction_t initial_cal_command(const uint64_t i_rp);
+
+} // namespace ccs
+} // namespace mss
-}
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_traits_nimbus.H b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_traits_nimbus.H
new file mode 100644
index 000000000..c3b93cd5d
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_traits_nimbus.H
@@ -0,0 +1,274 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs_traits_nimbus.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file ccs_traits_nimbus.H
+/// @brief Run and manage the CCS engine
+///
+// *HWP HWP Owner: Matthew Hickman <Matthew.Hickman@ibm.com>
+// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#ifndef _MSS_CCS_TRAITS_NIMBUS_H_
+#define _MSS_CCS_TRAITS_NIMBUS_H_
+
+#include <fapi2.H>
+#include <p9_mc_scom_addresses.H>
+#include <p9_mc_scom_addresses_fld.H>
+#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <lib/shared/mss_const.H>
+#include <lib/mss_attribute_accessors.H>
+#include <generic/memory/lib/ccs/ccs_traits.H>
+
+///
+/// @class ccsTraits
+/// @brief Nimbus CCS Engine traits
+///
+template<>
+class ccsTraits<mss::mc_type::NIMBUS>
+{
+ public:
+ static constexpr fapi2::TargetType PORT_TARGET_TYPE = fapi2::TARGET_TYPE_MCA;
+ static constexpr uint64_t MODEQ_REG = MCBIST_CCS_MODEQ;
+ static constexpr uint64_t MCB_CNTL_REG = MCBIST_MCB_CNTLQ;
+ static constexpr uint64_t CNTLQ_REG = MCBIST_CCS_CNTLQ;
+ static constexpr uint64_t STATQ_REG = MCBIST_CCS_STATQ;
+
+ static constexpr uint64_t PORTS_PER_MC_TARGET = mss::PORTS_PER_MCBIST;
+ static constexpr uint64_t CCS_MAX_DIMM_PER_PORT = mss::MAX_DIMM_PER_PORT;
+ static constexpr uint64_t CCS_MAX_MRANK_PER_PORT = mss::MAX_MRANK_PER_PORT;
+ static constexpr uint64_t CCS_MAX_RANK_PER_DIMM = mss::MAX_RANK_PER_DIMM;
+ static constexpr uint64_t CCS_MAX_RANKS_DIMM1 = mss::MAX_RANKS_DIMM1;
+
+ static constexpr uint64_t NTTM_READ_DELAY = 0x40;
+ static constexpr uint64_t NTTM_MODE_FORCE_READ = 33;
+
+
+ // Command Pass Disable Delay Time for Nimbus
+ static constexpr uint64_t TIMING_TCPDED = 4;
+
+ enum
+ {
+ // Non address values that are needed for helper functions
+
+ // ODT values used for beautification
+ // Attribute locations
+ ATTR_ODT_DIMM0_R0 = 0,
+ ATTR_ODT_DIMM0_R1 = 1,
+ ATTR_ODT_DIMM1_R0 = 4,
+ ATTR_ODT_DIMM1_R1 = 5,
+
+ // Right justified output - makes it so we can use insertFromRight
+ CCS_ODT_DIMM0_R0 = 4,
+ CCS_ODT_DIMM0_R1 = 5,
+ CCS_ODT_DIMM1_R0 = 6,
+ CCS_ODT_DIMM1_R1 = 7,
+
+ // Default ODT cycle length is 5 - one for the preamble and 4 for the data
+ DEFAULT_ODT_CYCLE_LEN = 5,
+
+ // CCS MODEQ
+ STOP_ON_ERR = MCBIST_CCS_MODEQ_STOP_ON_ERR,
+ UE_DISABLE = MCBIST_CCS_MODEQ_UE_DISABLE,
+ DATA_COMPARE_BURST_SEL = MCBIST_CCS_MODEQ_DATA_COMPARE_BURST_SEL,
+ DATA_COMPARE_BURST_SEL_LEN = MCBIST_CCS_MODEQ_DATA_COMPARE_BURST_SEL_LEN,
+ DDR_CAL_TIMEOUT_CNT = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT,
+ DDR_CAL_TIMEOUT_CNT_LEN = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT_LEN,
+ CFG_PARITY_AFTER_CMD = MCBIST_CCS_MODEQ_CFG_PARITY_AFTER_CMD,
+ COPY_CKE_TO_SPARE_CKE = MCBIST_CCS_MODEQ_COPY_CKE_TO_SPARE_CKE,
+ DISABLE_ECC_ARRAY_CHK = MCBIST_CCS_MODEQ_DISABLE_ECC_ARRAY_CHK,
+ DISABLE_ECC_ARRAY_CORRECTION = MCBIST_CCS_MODEQ_DISABLE_ECC_ARRAY_CORRECTION,
+ CFG_DGEN_FIXED_MODE = MCBIST_CCS_MODEQ_CFG_DGEN_FIXED_MODE,
+ DDR_CAL_TIMEOUT_CNT_MULT = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT_MULT,
+ DDR_CAL_TIMEOUT_CNT_MULT_LEN = MCBIST_CCS_MODEQ_DDR_CAL_TIMEOUT_CNT_MULT_LEN,
+ IDLE_PAT_ADDRESS_0_13 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_0_13,
+ IDLE_PAT_ADDRESS_0_13_LEN = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_0_13_LEN,
+ IDLE_PAT_ADDRESS_17 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_17,
+ IDLE_PAT_BANK_GROUP_1 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_GROUP_1,
+ IDLE_PAT_BANK_0_1 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_0_1,
+ IDLE_PAT_BANK_0_1_LEN = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_0_1_LEN,
+ IDLE_PAT_BANK_GROUP_0 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_GROUP_0,
+ IDLE_PAT_ACTN = MCBIST_CCS_MODEQ_IDLE_PAT_ACTN,
+ IDLE_PAT_ADDRESS_16 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_16,
+ IDLE_PAT_ADDRESS_15 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_15,
+ IDLE_PAT_ADDRESS_14 = MCBIST_CCS_MODEQ_IDLE_PAT_ADDRESS_14,
+ NTTM_MODE = MCBIST_CCS_MODEQ_NTTM_MODE,
+ NTTM_RW_DATA_DLY = MCBIST_CCS_MODEQ_NTTM_RW_DATA_DLY,
+ NTTM_RW_DATA_DLY_LEN = MCBIST_CCS_MODEQ_NTTM_RW_DATA_DLY_LEN,
+ IDLE_PAT_BANK_2 = MCBIST_CCS_MODEQ_IDLE_PAT_BANK_2,
+ DDR_PARITY_ENABLE = MCBIST_CCS_MODEQ_DDR_PARITY_ENABLE,
+ IDLE_PAT_PARITY = MCBIST_CCS_MODEQ_IDLE_PAT_PARITY,
+
+ // MCB_CNTRL
+ MCB_CNTL_PORT_SEL = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL,
+ MCB_CNTL_PORT_SEL_LEN = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL_LEN,
+
+ // CCS CNTL
+ CCS_START = MCBIST_CCS_CNTLQ_START,
+ CCS_STOP = MCBIST_CCS_CNTLQ_STOP,
+
+ // CCS STATQ
+ CCS_IN_PROGRESS = MCBIST_CCS_STATQ_IP,
+
+ // ARR0
+ ARR0_DDR_ADDRESS_0_13 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_0_13,
+ ARR0_DDR_ADDRESS_0_13_LEN = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_0_13_LEN,
+ ARR0_DDR_ADDRESS_0_9 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_0_13, // Useful for rd/wr cmds
+ ARR0_DDR_ADDRESS_0_9_LEN = 10, // CA bits are 9:0, total length of 10
+ ARR0_DDR_ADDRESS_10 = 10, // ADR10 is the 10th bit from the left in Nimbus ARR0
+ ARR0_DDR_ADDRESS_17 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_17,
+ ARR0_DDR_BANK_GROUP_1 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_GROUP_1,
+ ARR0_DDR_RESETN = MCBIST_CCS_INST_ARR0_00_DDR_RESETN,
+ ARR0_DDR_BANK_0_1 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_0_1,
+ ARR0_DDR_BANK_0_1_LEN = MCBIST_CCS_INST_ARR0_00_DDR_BANK_0_1_LEN,
+ ARR0_DDR_BANK_GROUP_0 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_GROUP_0,
+ ARR0_DDR_ACTN = MCBIST_CCS_INST_ARR0_00_DDR_ACTN,
+ ARR0_DDR_ADDRESS_16 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_16,
+ ARR0_DDR_ADDRESS_15 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_15,
+ ARR0_DDR_ADDRESS_14 = MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_14,
+ ARR0_DDR_CKE = MCBIST_CCS_INST_ARR0_00_DDR_CKE,
+ ARR0_DDR_CKE_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CKE_LEN,
+ ARR0_DDR_CSN_0_1 = MCBIST_CCS_INST_ARR0_00_DDR_CSN_0_1,
+ ARR0_DDR_CSN_0_1_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CSN_0_1_LEN,
+ ARR0_DDR_CID_0_1 = MCBIST_CCS_INST_ARR0_00_DDR_CID_0_1,
+ ARR0_DDR_CID_0_1_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CID_0_1_LEN,
+ ARR0_DDR_CSN_2_3 = MCBIST_CCS_INST_ARR0_00_DDR_CSN_2_3,
+ ARR0_DDR_CSN_2_3_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CSN_2_3_LEN,
+ ARR0_DDR_CID_2 = MCBIST_CCS_INST_ARR0_00_DDR_CID_2,
+ ARR0_DDR_ODT = MCBIST_CCS_INST_ARR0_00_DDR_ODT,
+ ARR0_DDR_ODT_LEN = MCBIST_CCS_INST_ARR0_00_DDR_ODT_LEN,
+ ARR0_DDR_CAL_TYPE = MCBIST_CCS_INST_ARR0_00_DDR_CAL_TYPE,
+ ARR0_DDR_CAL_TYPE_LEN = MCBIST_CCS_INST_ARR0_00_DDR_CAL_TYPE_LEN,
+ ARR0_DDR_PARITY = MCBIST_CCS_INST_ARR0_00_DDR_PARITY,
+ ARR0_DDR_BANK_2 = MCBIST_CCS_INST_ARR0_00_DDR_BANK_2,
+ ARR0_LOOP_BREAK_MODE = MCBIST_CCS_INST_ARR0_00_LOOP_BREAK_MODE,
+ ARR0_LOOP_BREAK_MODE_LEN = MCBIST_CCS_INST_ARR0_00_LOOP_BREAK_MODE_LEN,
+
+ // ARR1
+ ARR1_IDLES = MCBIST_CCS_INST_ARR1_00_IDLES,
+ ARR1_IDLES_LEN = MCBIST_CCS_INST_ARR1_00_IDLES_LEN,
+ ARR1_REPEAT_CMD_CNT = MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT,
+ ARR1_REPEAT_CMD_CNT_LEN = MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT_LEN,
+ ARR1_READ_OR_WRITE_DATA = MCBIST_CCS_INST_ARR1_00_READ_OR_WRITE_DATA,
+ ARR1_READ_OR_WRITE_DATA_LEN = MCBIST_CCS_INST_ARR1_00_READ_OR_WRITE_DATA_LEN,
+ ARR1_READ_COMPARE_REQUIRED = MCBIST_CCS_INST_ARR1_00_READ_COMPARE_REQUIRED,
+ ARR1_DDR_CAL_RANK = MCBIST_CCS_INST_ARR1_00_DDR_CAL_RANK,
+ ARR1_DDR_CAL_RANK_LEN = MCBIST_CCS_INST_ARR1_00_DDR_CAL_RANK_LEN,
+ ARR1_DDR_CALIBRATION_ENABLE = MCBIST_CCS_INST_ARR1_00_DDR_CALIBRATION_ENABLE,
+ ARR1_END = MCBIST_CCS_INST_ARR1_00_END,
+ ARR1_GOTO_CMD = MCBIST_CCS_INST_ARR1_00_GOTO_CMD,
+ ARR1_GOTO_CMD_LEN = MCBIST_CCS_INST_ARR1_00_GOTO_CMD_LEN,
+
+ // CCS array constants
+ CCS_ARRAY_LEN = 32,
+ CCS_ARR0_START = MCBIST_CCS_INST_ARR0_00,
+ CCS_ARR1_START = MCBIST_CCS_INST_ARR1_00,
+ };
+
+ ///
+ /// @brief Enums for CCS return codes
+ ///
+ enum
+ {
+ // Success is defined as done-bit set, no others.
+ STAT_QUERY_SUCCESS = 0x4000000000000000,
+
+ // Bit positions 3:5
+ STAT_ERR_MASK = 0x1C00000000000000,
+ STAT_READ_MISCOMPARE = 0x1000000000000000,
+ STAT_UE_SUE = 0x0800000000000000,
+ STAT_CAL_TIMEOUT = 0x0400000000000000,
+
+ // If the fail type isn't one of these, we're hung
+ STAT_HUNG = 0x0ull,
+ };
+
+
+ // CSN Regular Settings
+ static constexpr std::pair<uint64_t, uint64_t> CS_N[mss::MAX_RANK_PER_DIMM] =
+ {
+ // CS0 L, CS1 H, CID0-> L => Rank 0
+ { 0b01, 0b00 },
+
+ // CS0 L, CS1 H, CID0-> H => Rank 1
+ { 0b01, 0b11 },
+
+ // CS0 H, CS1 L, CID0-> L => Rank 2
+ { 0b10, 0b00 },
+
+ // CS0 H, CS1 L, CID0-> H => Rank 3
+ { 0b10, 0b11 },
+ };
+
+
+ // CSN Setup for Dual Direct Mode
+ // For DIMM0 .first is the CSN_0_1 setting, .second is the CSN_2_3 setting.
+ // For DIMM1 .first is the CSN_2_3 setting, .second is the CSN_0_1 setting.
+ static constexpr std::pair<uint64_t, uint64_t> CS_ND[mss::MAX_RANK_PER_DIMM] =
+ {
+ // CS0 L CS1 H => CS2 => H CS3 => H Rank 0
+ { 0b01, 0b11 },
+
+ // CS0 H CS1 L => CS2 => H CS3 => H Rank 1
+ { 0b10, 0b11 },
+
+ // CS0 H CS1 H => CS2 => L CS3 => H Rank 2
+ { 0b11, 0b01 },
+
+ // CS0 H CS1 H => CS2 => H CS3 => L Rank 3
+ { 0b11, 0b10 },
+ };
+
+ ///
+ /// @brief Gets the attribute for checking our rank configuration
+ /// @param[in] i_target the port target on which to operate
+ /// @param[out] o_ranks the rank data
+ /// @return SUCCESS iff the code executes successfully
+ ///
+ static fapi2::ReturnCode get_rank_config_attr(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint8_t (&o_array)[2])
+ {
+ return mss::eff_num_master_ranks_per_dimm(i_target, o_array);
+ }
+
+ ///
+ /// @brief Gets the attribute for checking our rank configuration
+ /// @param[in] i_target the port target on which to operate
+ /// @param[out] o_ranks the rank data
+ /// @return The fully setup nimbus error
+ ///
+ static fapi2::MSS_CCS_HUNG_TRYING_TO_STOP setup_trying_to_stop_err(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>&
+ i_target)
+ {
+ return fapi2::MSS_CCS_HUNG_TRYING_TO_STOP().set_MCBIST_TARGET(i_target);
+ }
+
+ // Lab values
+ static constexpr uint64_t LAB_MRS_CMD = 0x000008F000000000;
+};
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.C
index ae62be201..1b42026a4 100755
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -34,10 +34,15 @@
// *HWP Consumed by: FSP:HB
#include <fapi2.H>
-
#include <mss.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/shared/mss_const.H>
+
#include <lib/dimm/bcw_load.H>
#include <lib/dimm/bcw_load_ddr4.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
@@ -58,7 +63,7 @@ template<>
fapi2::ReturnCode bcw_load<TARGET_TYPE_MCBIST>( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
{
// A vector of CCS instructions. We'll ask the targets to fill it, and then we'll execute it
- ccs::program<TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
// Clear the initial delays. This will force the CCS engine to recompute the delay based on the
// instructions in the CCS instruction vector
@@ -91,7 +96,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_bcw_load<DEFAULT_KIND>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_type = 0;
uint8_t l_gen = 0;
@@ -121,7 +126,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_bcw_load<KIND_LRDIMM_DDR4>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_DBG("perform bcw_load for %s [expecting lrdimm (ddr4)]", mss::c_str(i_target));
FAPI_TRY( bcw_load_ddr4(i_target, io_inst), "Failed bcw load for lrdimm %s", mss::c_str(i_target));
@@ -138,7 +143,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_bcw_load<KIND_RDIMM_DDR4>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_INF("Skipping BCW loading for %s since this is valid only for LRDIMMs", mss::c_str(i_target));
return fapi2::FAPI2_RC_SUCCESS;
@@ -152,7 +157,7 @@ fapi2::ReturnCode perform_bcw_load<KIND_RDIMM_DDR4>( const fapi2::Target<TARGET_
///
template<>
fapi2::ReturnCode perform_bcw_load<FORCE_DISPATCH>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_type = 0;
uint8_t l_gen = 0;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H
index be5f1bfc5..4bdfe0033 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,10 +39,14 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/shared/mss_kind.H>
+
namespace mss
{
@@ -113,7 +117,7 @@ struct perform_bcw_load_overload< KIND_LRDIMM_DDR4 >
template< mss::kind_t K = FORCE_DISPATCH >
typename std::enable_if< perform_bcw_load_overload<DEFAULT_KIND>::available, fapi2::ReturnCode>::type
perform_bcw_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
//
// We know we registered overloads for perform_bcw_load, so we need the entry point to
@@ -129,7 +133,7 @@ perform_bcw_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
template<>
fapi2::ReturnCode perform_bcw_load<FORCE_DISPATCH>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Perform the bcw_load operations (DEFAULT_KIND specialization)
@@ -139,7 +143,7 @@ fapi2::ReturnCode perform_bcw_load<FORCE_DISPATCH>( const fapi2::Target<fapi2::T
///
template<>
fapi2::ReturnCode perform_bcw_load<DEFAULT_KIND>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
//
// Boilerplate dispatcher
@@ -157,7 +161,7 @@ fapi2::ReturnCode perform_bcw_load<DEFAULT_KIND>( const fapi2::Target<fapi2::TAR
template< kind_t K, bool B = perform_bcw_load_overload<K>::available >
inline fapi2::ReturnCode perform_bcw_load_dispatch( const kind_t& i_kind,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// We dispatch to another kind if:
// We don't have an overload defined (B == false)
@@ -182,7 +186,7 @@ inline fapi2::ReturnCode perform_bcw_load_dispatch( const kind_t& i_kind,
template<>
inline fapi2::ReturnCode perform_bcw_load_dispatch<DEFAULT_KIND>(const kind_t&,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
return perform_bcw_load<DEFAULT_KIND>(i_target, io_inst);
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C
index 266e7ce56..0712939f3 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.C
@@ -36,11 +36,13 @@
#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/utils/mss_nimbus_conversions.H>
#include <lib/eff_config/timing.H>
-#include <lib/ccs/ccs.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/bcw_load_ddr4.H>
#include <lib/dimm/ddr4/control_word_ddr4.H>
#include <lib/dimm/ddr4/data_buffer_ddr4.H>
@@ -48,6 +50,7 @@
#include <lib/workarounds/ccs_workarounds.H>
#include <generic/memory/lib/spd/spd_utils.H>
+
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_MCS;
@@ -67,10 +70,8 @@ namespace mss
/// @return FAPI2_RC_SUCCESS if and only if ok
///
fapi2::ReturnCode bcw_load_ddr4( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
- constexpr uint64_t SAFE_DELAY = 2000; // Waiting a safe amount of time as the LRDIMM spec
- // doesn't give us an explicit value for this delay
FAPI_INF("bcw_load_ddr4 %s", mss::c_str(i_target) );
uint8_t l_sim = 0;
@@ -104,21 +105,21 @@ fapi2::ReturnCode bcw_load_ddr4( const fapi2::Target<TARGET_TYPE_DIMM>& i_target
{ FUNC_SPACE_0, DQ_DRIVER_CW, eff_dimm_ddr4_bc03, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, MDQ_RTT_CW, eff_dimm_ddr4_bc04, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, MDQ_DRIVER_CW, eff_dimm_ddr4_bc05, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
- { FUNC_SPACE_0, CMD_SPACE_CW, eff_dimm_ddr4_bc06, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
- { FUNC_SPACE_0, RANK_PRESENCE_CW, eff_dimm_ddr4_bc07, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
+ { FUNC_SPACE_0, CMD_SPACE_CW, eff_dimm_ddr4_bc06, BCW_SAFE_DELAY , CW4_DATA_LEN, cw_info::BCW}, // using tmrd_l2 causes an error - safe delay works
+ { FUNC_SPACE_0, RANK_PRESENCE_CW, eff_dimm_ddr4_bc07, BCW_SAFE_DELAY , CW4_DATA_LEN, cw_info::BCW}, // using tmrd_l2 causes an error - safe delay works
{ FUNC_SPACE_0, RANK_SELECTION_CW, eff_dimm_ddr4_bc08, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, POWER_SAVING_CW, eff_dimm_ddr4_bc09, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, OPERATING_SPEED, eff_dimm_ddr4_bc0a, l_tDLLK , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, VOLT_AND_SLEW_RATE_CW, eff_dimm_ddr4_bc0b, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
- { FUNC_SPACE_0, BUFF_TRAIN_MODE_CW, eff_dimm_ddr4_bc0c, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
+ { FUNC_SPACE_0, BUFF_TRAIN_MODE_CW, eff_dimm_ddr4_bc0c, mss::tmrd_l2() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, LDQ_OPERATION_CW, eff_dimm_ddr4_bc0d, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, PARITY_CW, eff_dimm_ddr4_bc0e, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
{ FUNC_SPACE_0, ERROR_STATUS_CW, eff_dimm_ddr4_bc0f, mss::tmrc() , CW4_DATA_LEN, cw_info::BCW},
// 8-bit BCW's now
// Function space 0 - we're already there, so that's nice
- { FUNC_SPACE_0, BUFF_CONFIG_CW, eff_dimm_ddr4_f0bc1x, mss::tmrc(), CW8_DATA_LEN, cw_info::BCW},
- { FUNC_SPACE_0, LRDIMM_OPERATING_SPEED, eff_dimm_ddr4_f0bc6x, SAFE_DELAY, CW8_DATA_LEN, cw_info::BCW},
+ { FUNC_SPACE_0, BUFF_CONFIG_CW, eff_dimm_ddr4_f0bc1x, mss::tmrd_l2() , CW8_DATA_LEN, cw_info::BCW},
+ { FUNC_SPACE_0, LRDIMM_OPERATING_SPEED, eff_dimm_ddr4_f0bc6x, BCW_SAFE_DELAY, CW8_DATA_LEN, cw_info::BCW},
// Function space 2
{ FUNC_SPACE_2, FUNC_SPACE_SELECT_CW, FUNC_SPACE_2, mss::tmrd(), CW8_DATA_LEN, cw_info::BCW},
@@ -126,8 +127,8 @@ fapi2::ReturnCode bcw_load_ddr4( const fapi2::Target<TARGET_TYPE_DIMM>& i_target
// Function space 5
{ FUNC_SPACE_5, FUNC_SPACE_SELECT_CW, FUNC_SPACE_5, mss::tmrd(), CW8_DATA_LEN, cw_info::BCW},
- { FUNC_SPACE_5, HOST_VREF_CW, eff_dimm_ddr4_f5bc5x, SAFE_DELAY, CW8_DATA_LEN, cw_info::BCW},
- { FUNC_SPACE_5, DRAM_VREF_CW, eff_dimm_ddr4_f5bc6x, SAFE_DELAY, CW8_DATA_LEN, cw_info::BCW},
+ { FUNC_SPACE_5, HOST_VREF_CW, eff_dimm_ddr4_f5bc5x, BCW_SAFE_DELAY, CW8_DATA_LEN, cw_info::BCW},
+ { FUNC_SPACE_5, DRAM_VREF_CW, eff_dimm_ddr4_f5bc6x, BCW_SAFE_DELAY, CW8_DATA_LEN, cw_info::BCW},
// Function space 6
{ FUNC_SPACE_6, FUNC_SPACE_SELECT_CW, FUNC_SPACE_6, mss::tmrd(), CW8_DATA_LEN, cw_info::BCW},
@@ -142,7 +143,7 @@ fapi2::ReturnCode bcw_load_ddr4( const fapi2::Target<TARGET_TYPE_DIMM>& i_target
};
// DES first - make sure those CKE go high and stay there
- io_inst.push_back(mss::ccs::des_command<TARGET_TYPE_MCBIST>());
+ io_inst.push_back(mss::ccs::des_command());
// Issues the CW's
FAPI_TRY( control_word_engine(i_target, l_bcw_info, l_sim, io_inst),
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.H
index 7e68d32d0..31ef02983 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/bcw_load_ddr4.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,7 +38,9 @@
#include <fapi2.H>
#include <vector>
-#include <lib/ccs/ccs.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
namespace mss
{
@@ -51,6 +53,6 @@ namespace mss
/// @return FAPI2_RC_SUCCESS if and only if ok
///
fapi2::ReturnCode bcw_load_ddr4( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
}
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H
index ab28d5b82..60b3c077b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/control_word_ddr4.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -40,9 +40,10 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
-
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <lib/ccs/ccs.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
namespace mss
{
@@ -276,7 +277,6 @@ struct cw_data
/// @brief Control word engine that sets the CCS instruction
/// @tparam T the buffer control word type (4 bit or 8 bit)
/// @tparam TT traits type defaults to cwTraits<T>
-/// @tparam OT the TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_data control word data to send
/// @param[in] i_sim true if in simulation mode
@@ -284,12 +284,12 @@ struct cw_data
/// @param[out] o_instruction CCS instruction we created
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< control_word T, typename TT = cwTraits<T>, fapi2::TargetType OT >
+template< control_word T, typename TT = cwTraits<T> >
fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const cw_data& i_data,
const bool i_sim,
const bool i_turn_on_cke,
- ccs::instruction_t<OT>& o_instruction)
+ ccs::instruction_t& o_instruction)
{
// You're probably asking "Why always turn off CKE's? What is this madness?"
// Well, due to a vendor sensitivity, we need to have the CKE's off until we run RC09 at the very end
@@ -298,7 +298,7 @@ fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIM
// Therefore, we want to setup all RCW commands to have CKE's off across both DIMM's
// We then manually turn on the CKE's associated with a specific DIMM
constexpr bool CKE_OFF = false;
- ccs::instruction_t<OT> l_inst = ccs::rcd_command<OT>(i_target, i_sim, CKE_OFF);
+ ccs::instruction_t l_inst = ccs::rcd_command(i_target, i_sim, CKE_OFF);
// Turn on the CKE's for the ranks we're not touching, if it's needed
// Note: we only have the whole CKE field, not the per DIMM one by default
@@ -359,7 +359,6 @@ fapi_try_exit:
/// @brief Control word engine that sets the CCS instruction
/// @tparam T the buffer control word type (4 bit or 8 bit)
/// @tparam TT traits type defaults to cwTraits<T>
-/// @tparam OT the TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_data control word data to send
/// @param[in] i_sim true if in simulation mode
@@ -367,14 +366,14 @@ fapi_try_exit:
/// @param[in] i_turn_on_cke flag that states whether we want CKE on for this RCW (defaulted to true)
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< control_word T, typename TT = cwTraits<T>, fapi2::TargetType OT >
+template< control_word T, typename TT = cwTraits<T> >
fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const cw_data& i_data,
const bool i_sim,
- std::vector< ccs::instruction_t<OT> >& io_inst,
+ std::vector< ccs::instruction_t >& io_inst,
const bool i_turn_on_cke = true)
{
- ccs::instruction_t<OT> l_inst;
+ ccs::instruction_t l_inst;
FAPI_TRY(control_word_engine<T>(i_target, i_data, i_sim, i_turn_on_cke, l_inst));
io_inst.push_back(l_inst);
@@ -386,7 +385,6 @@ fapi_try_exit:
/// @brief Control word engine that sets the CCS instruction
/// @tparam T the buffer control word type (4 bit or 8 bit)
/// @tparam TT traits type defaults to cwTraits<T>
-/// @tparam OT the TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_data_list a vector of control word data to send
/// @param[in] i_sim true if in simulation mode
@@ -394,11 +392,11 @@ fapi_try_exit:
/// @param[in] i_turn_on_cke flag that states whether we want CKE on for all RCWs in the vector (defaulted to true)
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< control_word T, typename TT = cwTraits<T>, fapi2::TargetType OT >
+template< control_word T, typename TT = cwTraits<T> >
fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const std::vector<cw_data>& i_data_list,
const bool i_sim,
- std::vector< ccs::instruction_t<OT> >& io_inst,
+ std::vector< ccs::instruction_t >& io_inst,
const bool i_turn_on_cke = true)
{
FAPI_ASSERT( !i_data_list.empty(),
@@ -495,7 +493,6 @@ struct cw_info
///
/// @brief Control word engine that sets the CCS instruction
-/// @tparam OT the TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_info control word data and information about how to send it
/// @param[in] i_sim true if in simulation mode
@@ -503,12 +500,11 @@ struct cw_info
/// @param[out] o_instruction CCS instruction we created
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType OT >
-fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const cw_info& i_info,
- const bool i_sim,
- const bool i_turn_on_cke,
- ccs::instruction_t<OT>& o_instruction)
+inline fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const cw_info& i_info,
+ const bool i_sim,
+ const bool i_turn_on_cke,
+ ccs::instruction_t& o_instruction)
{
// BCW 4-bit
if(i_info.iv_is_bcw && i_info.iv_data_len == CW4_DATA_LEN)
@@ -548,7 +544,6 @@ fapi_try_exit:
///
/// @brief Control word engine that sets the CCS instruction
-/// @tparam OT the TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_info_list a vector of control word data to send
/// @param[in] i_sim true if in simulation mode
@@ -556,12 +551,11 @@ fapi_try_exit:
/// @param[in] i_turn_on_cke flag that states whether we want CKE on for all RCWs in the vector (defaulted to true)
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType OT >
-fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const std::vector<cw_info>& i_info_list,
- const bool i_sim,
- std::vector< ccs::instruction_t<OT> >& io_inst,
- const bool i_turn_on_cke = true)
+inline fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const std::vector<cw_info>& i_info_list,
+ const bool i_sim,
+ std::vector< ccs::instruction_t >& io_inst,
+ const bool i_turn_on_cke = true)
{
FAPI_ASSERT( !i_info_list.empty(),
fapi2::MSS_EMPTY_VECTOR().
@@ -571,7 +565,7 @@ fapi2::ReturnCode control_word_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIM
for (const auto& l_info : i_info_list)
{
- ccs::instruction_t<OT> l_inst;
+ ccs::instruction_t l_inst;
FAPI_TRY( control_word_engine(i_target, l_info, i_sim, i_turn_on_cke, l_inst) );
io_inst.push_back(l_inst);
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H
index d2bffc509..8cdb81f55 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/data_buffer_ddr4.H
@@ -44,6 +44,9 @@
#include <lib/phy/dp16.H>
#include <lib/dimm/ddr4/control_word_ddr4.H>
#include <lib/eff_config/timing.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
namespace mss
{
@@ -96,6 +99,9 @@ enum db02_def : size_t
HOST_VREF_CW = 0x5, // Func space 5
DRAM_VREF_CW = 0x6, // Func space 5
BUFF_TRAIN_CONFIG_CW = 0x4, // Func space 6
+
+ // Safe delays for BCW's
+ BCW_SAFE_DELAY = 2000,
};
namespace ddr4
@@ -132,7 +138,7 @@ enum command : size_t
///
inline fapi2::ReturnCode function_space_select(const fapi2::Target< fapi2::TARGET_TYPE_DIMM >& i_target,
const uint64_t i_func_space,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_ASSERT(i_func_space <= MAX_FUNC_SPACE,
fapi2::MSS_LRDIMM_FUNC_SPACE_OUT_OF_RANGE()
@@ -243,13 +249,13 @@ fapi_try_exit:
template< mss::control_word T >
static fapi2::ReturnCode settings_boilerplate(const fapi2::Target< fapi2::TARGET_TYPE_DIMM >& i_target,
const cw_data& i_data,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_sim = 0;
mss::is_simulation(l_sim);
// DES first - make sure those CKE go high and stay there
- io_inst.push_back(mss::ccs::des_command<fapi2::TARGET_TYPE_MCBIST>());
+ io_inst.push_back(mss::ccs::des_command());
FAPI_TRY( function_space_select(i_target, i_data.iv_func_space, io_inst),
"%s. Failed to select function space %d",
@@ -271,17 +277,15 @@ fapi_try_exit:
///
/// @brief Sets data buffer training mode control word
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target the DIMM target
/// @param[in] i_mode buffer training mode
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff ok
/// @note Sets buffer control word (BC0C) setting
///
-template< fapi2::TargetType T >
inline fapi2::ReturnCode set_buffer_training( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const training i_mode,
- std::vector< ccs::instruction_t<T> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
// This doesn't need to be reused so it is left local to this function scope
static const std::vector< std::pair<training, uint64_t> > BUFF_TRAINING =
@@ -302,7 +306,7 @@ inline fapi2::ReturnCode set_buffer_training( const fapi2::Target<fapi2::TARGET_
uint64_t l_encoding = 0;
fapi2::Assert(find_value_from_key(BUFF_TRAINING, i_mode, l_encoding));
- cw_data l_data(FUNC_SPACE_0, BUFF_TRAIN_MODE_CW, l_encoding, mss::tmrc());
+ cw_data l_data(FUNC_SPACE_0, BUFF_TRAIN_MODE_CW, l_encoding, mss::tmrd_l2());
FAPI_TRY( settings_boilerplate<BCW_4BIT>(i_target, l_data, io_inst) );
fapi_try_exit:
@@ -362,17 +366,15 @@ fapi_try_exit:
///
/// @brief Sets rank presence control word
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target the DIMM target
/// @param[in] i_num_package_ranks num of package ranks for LRDIMM
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff ok
/// @note Sets buffer control word (BC07) setting
///
-template< fapi2::TargetType T>
inline fapi2::ReturnCode set_rank_presence( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_num_package_ranks,
- std::vector< ccs::instruction_t<T> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
// Helper function handles error checking
uint64_t l_encoding = 0;
@@ -391,7 +393,6 @@ fapi_try_exit:
///
/// @brief Sets Upper/Lower nibble DRAM interface receive enable training control word
/// @tparam T the nibble of in training (upper/lower)
-/// @tparam OT TargetType of the CCS instruction
/// @param[in] i_target the DIMM target
/// @param[in] i_rank DIMM0 rank [0:3] or DIMM1 rank [4:7]
/// @param[in] i_trained_timing the delay MDQS receive enable timing
@@ -399,11 +400,11 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff ok
/// @note Sets buffer control word ( F[3:0]BC2x ) setting
///
-template< mss::nibble N, fapi2::TargetType OT>
+template< mss::nibble N >
fapi2::ReturnCode set_mrep_timing_control( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_trained_timing,
- std::vector< ccs::instruction_t<OT> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
constexpr size_t MAX_DELAY = 63;
@@ -430,17 +431,15 @@ fapi_try_exit:
///
/// @brief Sets command space control word
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target the DIMM target
/// @param[in] i_command command name
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff ok
/// @note Sets buffer control word (BC06) setting
///
-template< fapi2::TargetType T>
inline fapi2::ReturnCode set_command_space( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const command i_command,
- std::vector< ccs::instruction_t<T> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
constexpr uint64_t MAX_VALID_CMD = 4;
@@ -453,9 +452,8 @@ inline fapi2::ReturnCode set_command_space( const fapi2::Target<fapi2::TARGET_TY
}
// From the DDR4DB02 Spec: BC06 - Command Space Control Word
- // After issuing a data buffer command via writes to BC06 waiting for tMRC(16 tCK)
- // is required before the next DRAM command or BCW write can be issued.
- cw_data l_data(FUNC_SPACE_0, CMD_SPACE_CW, i_command, mss::tmrc());
+ // Waiting safe delay here as we've seen issues in the lab where the required tMRD_l2 isn't sufficient
+ cw_data l_data(FUNC_SPACE_0, CMD_SPACE_CW, i_command, BCW_SAFE_DELAY);
FAPI_TRY( settings_boilerplate<BCW_4BIT>(i_target, l_data, io_inst) );
fapi_try_exit:
@@ -464,17 +462,15 @@ fapi_try_exit:
///
/// @brief Sets per buffer addressibility (PBA) mode
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target the DIMM target
/// @param[in] i_state mss::ON or mss::OFF
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff ok
/// @note Sets DA0 setting for buffer control word (F0BC1x)
///
-template< fapi2::TargetType T>
inline fapi2::ReturnCode set_pba_mode( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mss::states i_state,
- std::vector< ccs::instruction_t<T> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
// PBA position is really bit 0, but we're right justified on our bit ordering here, so it's bit7
constexpr uint64_t PBA_POSITION = 7;
@@ -495,7 +491,7 @@ inline fapi2::ReturnCode set_pba_mode( const fapi2::Target<fapi2::TARGET_TYPE_DI
FAPI_TRY(mss::eff_dimm_ddr4_f0bc1x(i_target, l_nominal_bc_value));
{
- cw_data l_data(FUNC_SPACE_0, BUFF_CONFIG_CW, l_nominal_bc_value, mss::tmrc());
+ cw_data l_data(FUNC_SPACE_0, BUFF_CONFIG_CW, l_nominal_bc_value, mss::tmrd_l2());
l_data.iv_data.writeBit<PBA_POSITION>(i_state);
FAPI_INF("%s data 0x%02x", mss::c_str(i_target), l_data.iv_data);
FAPI_TRY( settings_boilerplate<BCW_8BIT>(i_target, l_data, io_inst) );
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C
index 7676df23b..be59fe5e0 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.C
@@ -36,11 +36,15 @@
#include <lib/shared/nimbus_defaults.H>
#include <vector>
#include <fapi2.H>
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
#include <lib/dimm/ddr4/latch_wr_vref.H>
#include <lib/dimm/rank.H>
#include <lib/workarounds/ccs_workarounds.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_DIMM;
@@ -62,7 +66,7 @@ namespace ddr4
fapi2::ReturnCode add_latch_wr_vref_commands( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs06_data& i_mrs06,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// JEDEC has a 3 step latching process for WR VREF
// 1) enter into VREFDQ training mode, with the desired range value is XXXXXX
@@ -111,7 +115,7 @@ fapi2::ReturnCode latch_wr_vref_commands_by_rank_pair( const fapi2::Target<fapi2
const auto l_mcbist = find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
// Warning: l_dimm is not a valid Target and will crash Cronus if used before it gets filled in by mss::rank::get_dimm_target_from_rank
fapi2::Target<fapi2::TARGET_TYPE_DIMM> l_dimm;
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST, fapi2::TARGET_TYPE_MCA> l_program;
+ ccs::program l_program;
std::vector<uint64_t> l_ranks;
// Gets the ranks on which to latch the VREF's
@@ -173,7 +177,7 @@ fapi2::ReturnCode setup_latch_wr_vref_commands_by_rank( const fapi2::Target<fapi
const uint64_t i_rank,
const uint8_t i_train_range,
const uint8_t i_train_value,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// Check to make sure our ctor worked ok
mrs06_data l_mrs06( i_target, fapi2::current_err );
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H
index 0cb2a285e..4874000b8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/latch_wr_vref.H
@@ -38,10 +38,14 @@
#include <vector>
#include <fapi2.H>
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/dimm/mrs_load.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
#include <lib/eff_config/timing.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
namespace mss
{
@@ -65,7 +69,7 @@ enum wr_vref_override : uint8_t
fapi2::ReturnCode add_latch_wr_vref_commands( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs06_data& i_mrs06,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Add latching commands for WR VREF to the instruction array
@@ -121,7 +125,7 @@ fapi2::ReturnCode setup_latch_wr_vref_commands_by_rank( const fapi2::Target<fapi
const uint64_t i_rank,
const uint8_t i_train_range,
const uint8_t i_train_value,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
} // close namespace DDR4
} // close namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs00.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs00.C
index 71deb5bbe..0f0229a71 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs00.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs00.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,7 +36,12 @@
#include <fapi2.H>
#include <mss.H>
+#include <lib/shared/mss_const.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_DIMM;
@@ -91,7 +96,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs00(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -113,7 +118,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs00(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs00_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Map from Write Recovery attribute value to bits in the MRS.
@@ -202,7 +207,7 @@ fapi_try_exit:
/// @param[out] o_cas_latency the cas latency
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs00_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs00_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_burst_length,
uint8_t& o_read_burst_type,
@@ -248,7 +253,7 @@ fapi2::ReturnCode mrs00_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank ths rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs00_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs00_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
uint8_t l_burst_length = 0;
@@ -264,10 +269,10 @@ fapi2::ReturnCode mrs00_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs00_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs00_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs00;
-fapi2::ReturnCode (*mrs00_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs00_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs00_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs01.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs01.C
index 834ee1ead..cc5896c5c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs01.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs01.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,7 +36,12 @@
#include <fapi2.H>
#include <mss.H>
+#include <lib/shared/mss_const.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_DIMM;
@@ -86,7 +91,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs01(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -108,7 +113,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs01(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs01_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Little table to map Output Driver Imepdance Control. 34Ohm is index 0,
@@ -188,7 +193,7 @@ fapi_try_exit:
/// @param[out] o_rtt_nom the rtt_nom setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs01_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs01_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_dll_enable,
uint8_t& o_wrl_enable,
@@ -226,7 +231,7 @@ fapi2::ReturnCode mrs01_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank ths rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs01_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs01_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
uint8_t l_dll_enable = 0;
@@ -243,10 +248,10 @@ fapi2::ReturnCode mrs01_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs01_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs01_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs01;
-fapi2::ReturnCode (*mrs01_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs01_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs01_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs02.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs02.C
index fe819814b..43f90a0ee 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs02.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs02.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -81,7 +81,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs02(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -105,7 +105,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs02(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs02_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
constexpr uint64_t CWL_LENGTH = 3;
@@ -170,7 +170,7 @@ fapi_try_exit:
/// @param[out] o_rtt_wr the rtt_wr setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs02_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs02_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_write_crc,
fapi2::buffer<uint8_t>& o_lpasr,
@@ -199,7 +199,7 @@ fapi2::ReturnCode mrs02_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank ths rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs02_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs02_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
uint8_t l_write_crc = 0;
@@ -212,10 +212,10 @@ fapi2::ReturnCode mrs02_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs02_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs02_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs02;
-fapi2::ReturnCode (*mrs02_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs02_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs02_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs03.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs03.C
index 06b9eb88c..4c797864b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs03.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs03.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -106,7 +106,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs03(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -130,7 +130,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs03(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs03_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
//Some consts for the swizzle action
@@ -186,7 +186,7 @@ fapi_try_exit:
/// @param[out] o_read_fromat the mpr read format setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs03_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs03_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_mpr_mode,
uint8_t& o_geardown,
@@ -228,7 +228,7 @@ fapi2::ReturnCode mrs03_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs03_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs03_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
uint8_t l_mpr_mode = 0;
@@ -246,10 +246,10 @@ fapi2::ReturnCode mrs03_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs03_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs03_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs03;
-fapi2::ReturnCode (*mrs03_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs03_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs03_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs04.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs04.C
index b28dae69e..736f338de 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs04.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs04.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -105,7 +105,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs04(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -127,7 +127,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs04(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs04_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
constexpr uint64_t CS_CMD_LATENCY_LENGTH = 3;
@@ -186,7 +186,7 @@ fapi_try_exit:
/// @param[out] o_cs_cmd_latency_buffer the cs to cmd/addr latency mode setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs04_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs04_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_max_pd_mode,
uint8_t& o_temp_refresh_range,
@@ -232,7 +232,7 @@ fapi2::ReturnCode mrs04_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs04_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs04_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
uint8_t l_max_pd_mode = 0;
@@ -255,10 +255,10 @@ fapi2::ReturnCode mrs04_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs04_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs04_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs04;
-fapi2::ReturnCode (*mrs04_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs04_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs04_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs05.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs05.C
index a4c5be8c6..e9be70395 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs05.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs05.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -91,7 +91,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs05(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -113,7 +113,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs05(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs05_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
constexpr uint64_t CA_PARITY_LATENCY_LENGTH = 3;
@@ -188,7 +188,7 @@ fapi_try_exit:
/// @param[out] o_rtt_park_buffer the rtt_park setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs05_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs05_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_crc_error_clear,
uint8_t& o_ca_parity_error_status,
@@ -231,7 +231,7 @@ fapi2::ReturnCode mrs05_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank ths rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs05_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs05_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
fapi2::buffer<uint8_t> l_ca_parity_latency_buffer;
@@ -252,10 +252,10 @@ fapi2::ReturnCode mrs05_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs05_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs05_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs05;
-fapi2::ReturnCode (*mrs05_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs05_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs05_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs06.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs06.C
index bfc1fc885..554271727 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs06.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs06.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -79,7 +79,7 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs06(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
// Check to make sure our ctor worked ok
@@ -101,7 +101,7 @@ fapi_try_exit:
///
fapi2::ReturnCode mrs06(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs06_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank)
{
@@ -159,7 +159,7 @@ fapi_try_exit:
/// @param[out] o_vrefdq_train_value_buffer the vrefdq training value
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs06_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs06_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_vrefdq_train_range,
uint8_t& o_vrefdq_train_enable,
@@ -188,7 +188,7 @@ fapi2::ReturnCode mrs06_decode_helper(const ccs::instruction_t<TARGET_TYPE_MCBIS
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs06_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs06_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank)
{
fapi2::buffer<uint8_t> l_tccd_l_buffer;
@@ -202,10 +202,10 @@ fapi2::ReturnCode mrs06_decode(const ccs::instruction_t<TARGET_TYPE_MCBIST>& i_i
fapi2::ReturnCode (*mrs06_data::make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs06_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank) = &mrs06;
-fapi2::ReturnCode (*mrs06_data::decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode (*mrs06_data::decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank) = &mrs06_decode;
} // ns ddr4
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.C
index cec455f6a..3ac509b6c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -62,7 +62,7 @@ template< >
fapi2::ReturnCode mrs_engine( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs_data<fapi2::TARGET_TYPE_MCBIST>& i_data,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
FAPI_TRY( mrs_engine(i_target, i_data, i_rank, i_data.iv_delay, io_inst) );
@@ -138,7 +138,7 @@ namespace ddr4
/// @return FAPI2_RC_SUCCESS if and only if ok
///
fapi2::ReturnCode mrs_load( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_INF("ddr4::mrs_load %s", mss::c_str(i_target));
@@ -146,28 +146,82 @@ fapi2::ReturnCode mrs_load( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
const size_t DOUBLE_TMRD = 2 * mss::tmrd();
const size_t DOUBLE_TMOD = 2 * mss::tmod(i_target);
- static const std::vector< mrs_data<TARGET_TYPE_MCBIST> > MRS_DATA =
+ // tDLLK to wait for DLL Reset
+ uint64_t tDLLK = 0;
+ FAPI_TRY( mss::tdllk(i_target, tDLLK) );
+
{
- // JEDEC ordering of MRS per DDR4 power on sequence
- { 3, mrs03, mrs03_decode, DOUBLE_TMRD },
- { 6, mrs06, mrs06_decode, DOUBLE_TMRD },
- { 5, mrs05, mrs05_decode, DOUBLE_TMRD },
- { 4, mrs04, mrs04_decode, DOUBLE_TMRD },
- { 2, mrs02, mrs02_decode, DOUBLE_TMRD },
- { 1, mrs01, mrs01_decode, DOUBLE_TMRD },
- // We need to wait tmod before zqcl, a non-mrs command
- { 0, mrs00, mrs00_decode, DOUBLE_TMOD },
- };
-
- std::vector< uint64_t > l_ranks;
- FAPI_TRY( mss::rank::ranks(i_target, l_ranks) );
-
- // Load MRS
- for (const auto& d : MRS_DATA)
+ const std::vector< mrs_data<TARGET_TYPE_MCBIST> > MRS_DATA =
+ {
+ // JEDEC ordering of MRS per DDR4 power on sequence
+ { 3, mrs03, mrs03_decode, DOUBLE_TMRD },
+ { 6, mrs06, mrs06_decode, DOUBLE_TMRD },
+ { 5, mrs05, mrs05_decode, DOUBLE_TMRD },
+ { 4, mrs04, mrs04_decode, DOUBLE_TMRD },
+ { 2, mrs02, mrs02_decode, DOUBLE_TMRD },
+ { 1, mrs01, mrs01_decode, DOUBLE_TMRD },
+ // We need to wait tmod before zqcl, a non-mrs command
+ // Adding Per Glancy's request, to ensure DLL locking time
+ { 0, mrs00, mrs00_decode, DOUBLE_TMOD + tDLLK },
+ };
+
+ std::vector< uint64_t > l_ranks;
+ FAPI_TRY( mss::rank::ranks(i_target, l_ranks) );
+
+ // Load MRS
+ for (const auto& d : MRS_DATA)
+ {
+ for (const auto& r : l_ranks)
+ {
+ FAPI_TRY( mrs_engine(i_target, d, r, io_inst) );
+ }
+ }
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Perform the mrs_load DDR4 operations for nvdimm restore - TARGET_TYPE_DIMM specialization
+/// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+/// @param[in] io_inst a vector of CCS instructions we should add to
+/// @return FAPI2_RC_SUCCESS if and only if ok
+///
+fapi2::ReturnCode mrs_load_nvdimm( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
+ std::vector< ccs::instruction_t >& io_inst)
+{
+ FAPI_INF("ddr4::mrs_load_nvdimm %s", mss::c_str(i_target));
+
+ // tDLLK to wait for DLL Reset
+ uint64_t tDLLK = 0;
+ FAPI_TRY( mss::tdllk(i_target, tDLLK) );
+
{
- for (const auto& r : l_ranks)
+ const std::vector< mrs_data<TARGET_TYPE_MCBIST> > MRS_DATA =
+ {
+ // JEDEC ordering of MRS per DDR4 NVDIMM restore sequence
+ // Need to perform DLL off to on procedure (mrs01&mrs00)
+ // before all the other MRS's
+ { 1, mrs01, mrs01_decode, mss::tmrd() },
+ { 0, mrs00, mrs00_decode, mss::tmod(i_target) + tDLLK },
+ { 3, mrs03, mrs03_decode, mss::tmrd() },
+ { 6, mrs06, mrs06_decode, mss::tmrd() },
+ { 5, mrs05, mrs05_decode, mss::tmrd() },
+ { 4, mrs04, mrs04_decode, mss::tmrd() },
+ { 2, mrs02, mrs02_decode, mss::tmrd() },
+ };
+
+ std::vector< uint64_t > l_ranks;
+ FAPI_TRY( mss::rank::ranks(i_target, l_ranks) );
+
+ // Load MRS
+ for (const auto& d : MRS_DATA)
{
- FAPI_TRY( mrs_engine(i_target, d, r, io_inst) );
+ for (const auto& r : l_ranks)
+ {
+ FAPI_TRY( mrs_engine(i_target, d, r, io_inst) );
+ }
}
}
@@ -234,7 +288,7 @@ fapi_try_exit:
template<>
fapi2::ReturnCode rtt_nom_override(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_rtt_nom_override_disable = 0;
uint8_t l_rtt_wr_value[MAX_RANK_PER_DIMM] = {0};
@@ -274,7 +328,7 @@ fapi_try_exit:
template<>
fapi2::ReturnCode rtt_wr_disable(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_rtt_wr_value[MAX_RANK_PER_DIMM] = {0};
@@ -302,7 +356,7 @@ fapi_try_exit:
template<>
fapi2::ReturnCode rtt_nom_restore(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_rtt_nom_override_disable = 0;
uint8_t l_rtt_nom_value[MAX_RANK_PER_DIMM] = {0};
@@ -335,7 +389,7 @@ fapi_try_exit:
template<>
fapi2::ReturnCode rtt_wr_restore(const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// Get original RTT_WR value
uint8_t l_rtt_wr_value[MAX_RANK_PER_DIMM] = {0};
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H
index bd8277daa..5e6aa5c35 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/mrs_load_ddr4.H
@@ -41,6 +41,9 @@
#include <generic/memory/lib/utils/c_str.H>
#include <lib/dimm/mrs_load.H>
#include <lib/eff_config/timing.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
namespace mss
{
@@ -99,13 +102,11 @@ enum rtt_nom_settings
///
/// @brief Mirror (front to back) the ADR bits of a CCS instruction - implementation
-/// @tparam T typename of the ccs::instruction_t
/// @param[in, out] io_inst reference to a CCS instruction to be mirrored
/// @return FAPI2_RC_SUCESS iff ok
/// @note written this way so this is easier to test
///
-template<fapi2::TargetType T>
-void address_mirror_impl(ccs::instruction_t<T>& io_inst)
+inline void address_mirror_impl(ccs::instruction_t& io_inst)
{
// Nothing fancy here, just mirror the bits we're told to mirror in Table 14 — Address Mirroring and Inversion
mss::template swap<A3, A4>(io_inst.arr0);
@@ -118,17 +119,15 @@ void address_mirror_impl(ccs::instruction_t<T>& io_inst)
///
/// @brief Mirror (front to back) the ADR bits of a CCS instruction
-/// @tparam T typename of the ccs::instruction_t
/// @param[in] i_target target to use to get mirroring attribute
/// @param[in] i_rank the rank in question
/// @param[in, out] io_inst reference to a CCS instruction to be mirrored
/// @return FAPI2_RC_SUCESS iff ok
/// @note assumes the input is from an even number rank
///
-template<fapi2::TargetType T>
-fapi2::ReturnCode address_mirror(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint64_t i_rank,
- ccs::instruction_t<T>& io_inst)
+inline fapi2::ReturnCode address_mirror(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint64_t i_rank,
+ ccs::instruction_t& io_inst)
{
// We only mirror if the mirroring attribute is set.
uint8_t l_mirror = 0;
@@ -147,19 +146,17 @@ fapi_try_exit:
///
/// @brief Invert (side to side) the ADR bits of a CCS instruction
-/// @tparam T the target type of the ccs instruction
/// @param[in] i_target the DIMM target of the ccs command
/// @param[in] i_inst const reference to a CCS instruction.
/// @param[in] l_is_a17 Boolean for whether A17 bit is enabled or not
/// @return ccs instruction with the ADR bits inverted (side-to-side)
///
-template<fapi2::TargetType T>
-ccs::instruction_t<T> address_invert(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const ccs::instruction_t<T>& i_inst,
- const bool i_is_a17 = false)
+inline ccs::instruction_t address_invert(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const ccs::instruction_t& i_inst,
+ const bool i_is_a17 = false)
{
// Copy the input as the output doesn't all change.
- ccs::instruction_t<T> i_out(i_inst);
+ ccs::instruction_t i_out(i_inst);
// Nothing fancy here, just negate the bits we're told to negate in Table 14 — Address Mirroring and Inversion
mss::template negate<A3>(i_out.arr0);
@@ -189,7 +186,6 @@ ccs::instruction_t<T> address_invert(const fapi2::Target<fapi2::TARGET_TYPE_DIMM
///
/// @brief Helper function to make a CCS instruction for an MRS
-/// @tparam T TargetType of the CCS instruction
/// @tparam D the mrs data structure to send out
/// @param[in] i_target a fapi2::Target DIMM
/// @param[in] i_data the completed MRS data to send
@@ -197,11 +193,11 @@ ccs::instruction_t<T> address_invert(const fapi2::Target<fapi2::TARGET_TYPE_DIMM
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, typename D >
+template< typename D >
static inline fapi2::ReturnCode make_ccs_helper( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const D& i_data,
const uint64_t i_rank,
- ccs::instruction_t<T>& io_inst )
+ ccs::instruction_t& io_inst )
{
FAPI_TRY( D::make_ccs_instruction(i_target, i_data, io_inst, i_rank),
"Failed making a CCS instruction for templated MRS data. MR%d rank %d on %s",
@@ -219,11 +215,10 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template< >
-inline fapi2::ReturnCode make_ccs_helper(
- const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const mrs_data<fapi2::TARGET_TYPE_MCBIST>& i_data,
- const uint64_t i_rank,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst )
+inline fapi2::ReturnCode make_ccs_helper( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const mrs_data<fapi2::TARGET_TYPE_MCBIST>& i_data,
+ const uint64_t i_rank,
+ ccs::instruction_t& io_inst )
{
FAPI_TRY( i_data.iv_func(i_target, io_inst, i_rank),
"Failed making a CCS instruction for mrs_data<TARGET_TYPE_MCBIST> specialization. MR%d rank %d on %s",
@@ -235,17 +230,16 @@ fapi_try_exit:
///
/// @brief Helper function to decode MRS and trace CCS instructions
-/// @tparam T TargetType of the CCS instruction
/// @tparam D the mrs data structure to send out
/// @param[in] i_data the completed MRS data to send
/// @param[in] i_rank the rank to send to
/// @param[in] i_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, typename D >
+template< typename D >
static inline fapi2::ReturnCode decode_helper(const D& i_data,
const uint64_t i_rank,
- const ccs::instruction_t<T>& i_inst )
+ const ccs::instruction_t& i_inst )
{
// Dump out the 'decoded' MRS and trace the CCS instructions.
FAPI_TRY( D::decode(i_inst, i_rank),
@@ -278,7 +272,7 @@ fapi2::ReturnCode is_a17_needed(const fapi2::Target<T>& i_target,
template< >
inline fapi2::ReturnCode decode_helper(const mrs_data<fapi2::TARGET_TYPE_MCBIST>& i_data,
const uint64_t i_rank,
- const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst )
+ const ccs::instruction_t& i_inst )
{
// Dump out the 'decoded' MRS and trace the CCS instructions.
FAPI_TRY( i_data.iv_dumper(i_inst, i_rank),
@@ -292,7 +286,6 @@ fapi_try_exit:
///
/// @brief Sets up MRS CCS instructions
-/// @tparam T TargetType of the CCS instruction
/// @tparam D the mrs data structure to send out
/// @param[in] i_target a fapi2::Target DIMM
/// @param[in] i_data the completed MRS data to send
@@ -301,15 +294,15 @@ fapi_try_exit:
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, typename D >
+template< typename D >
fapi2::ReturnCode mrs_engine( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const D& i_data,
const uint64_t i_rank,
const uint64_t i_delay_in_cycles,
- std::vector< ccs::instruction_t<T> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
- ccs::instruction_t<T> l_inst_a_side = ccs::mrs_command<T>(i_rank, i_data.iv_mrs);
- ccs::instruction_t<T> l_inst_b_side;
+ ccs::instruction_t l_inst_a_side = ccs::mrs_command(i_rank, i_data.iv_mrs);
+ ccs::instruction_t l_inst_b_side;
bool l_is_a17 = false;
// Thou shalt send 2 MRS, one for the a-side and the other inverted for the b-side.
@@ -355,7 +348,6 @@ fapi_try_exit:
///
/// @brief Sets up MRS CCS instructions
-/// @tparam T TargetType of the CCS instruction
/// @tparam D the mrs data structure to send out
/// @param[in] i_target a fapi2::Target DIMM
/// @param[in] i_data the completed MRS data to send
@@ -363,11 +355,11 @@ fapi_try_exit:
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, typename D >
+template< typename D >
fapi2::ReturnCode mrs_engine( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const D& i_data,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst );
+ std::vector< ccs::instruction_t >& io_inst );
namespace ddr4
{
@@ -395,7 +387,7 @@ class mrs06_data;
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs00(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -406,7 +398,7 @@ fapi2::ReturnCode mrs00(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs01(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -417,7 +409,7 @@ fapi2::ReturnCode mrs01(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs02(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
/// @brief Configure the ARR0 of the CCS isntruction for mrs03
@@ -427,7 +419,7 @@ fapi2::ReturnCode mrs02(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs03(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
/// @brief Configure the ARR0 of the CCS isntruction for mrs04
@@ -437,7 +429,7 @@ fapi2::ReturnCode mrs03(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs04(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
/// @brief Configure the ARR0 of the CCS isntruction for mrs05
@@ -447,7 +439,7 @@ fapi2::ReturnCode mrs04(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs05(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
/// @brief Configure the ARR0 of the CCS isntruction for mrs06
@@ -457,7 +449,7 @@ fapi2::ReturnCode mrs05(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @return FAPI2_RC_SUCCESS iff OK
///
fapi2::ReturnCode mrs06(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
/// }@
@@ -478,7 +470,7 @@ fapi2::ReturnCode mrs06(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs00(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs00_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -491,7 +483,7 @@ fapi2::ReturnCode mrs00(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs01(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs01_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -504,7 +496,7 @@ fapi2::ReturnCode mrs01(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs02(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs02_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -517,7 +509,7 @@ fapi2::ReturnCode mrs02(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs03(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs03_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -530,7 +522,7 @@ fapi2::ReturnCode mrs03(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs04(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs04_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -543,7 +535,7 @@ fapi2::ReturnCode mrs04(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs05(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs05_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
///
@@ -556,7 +548,7 @@ fapi2::ReturnCode mrs05(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode mrs06(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs06_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
/// }@
@@ -579,7 +571,7 @@ fapi2::ReturnCode mrs06(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
/// @param[out] o_cas_latency the cas latency
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs00_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs00_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_burst_length,
uint8_t& o_read_burst_type,
@@ -595,7 +587,7 @@ fapi2::ReturnCode mrs00_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs00_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs00_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -611,7 +603,7 @@ fapi2::ReturnCode mrs00_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIS
/// @param[out] o_rtt_nom the rtt_nom setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs01_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs01_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_dll_enable,
uint8_t& o_wrl_enable,
@@ -628,7 +620,7 @@ fapi2::ReturnCode mrs01_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs01_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs01_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -641,7 +633,7 @@ fapi2::ReturnCode mrs01_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIS
/// @param[out] o_rtt_wr the rtt_wr setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs02_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs02_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_write_crc,
fapi2::buffer<uint8_t>& o_lpasr,
@@ -655,7 +647,7 @@ fapi2::ReturnCode mrs02_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs02_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs02_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -672,7 +664,7 @@ fapi2::ReturnCode mrs02_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIS
/// @param[out] o_read_fromat the mpr read format setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs03_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs03_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_mpr_mode,
uint8_t& o_geardown,
@@ -690,7 +682,7 @@ fapi2::ReturnCode mrs03_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs03_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs03_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -709,7 +701,7 @@ fapi2::ReturnCode mrs03_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIS
/// @param[out] o_cs_cmd_latency_buffer the cs to cmd/addr latency mode setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs04_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs04_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_max_pd_mode,
uint8_t& o_temp_refresh_range,
@@ -730,7 +722,7 @@ fapi2::ReturnCode mrs04_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs04_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs04_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -748,7 +740,7 @@ fapi2::ReturnCode mrs04_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIS
/// @param[out] o_rtt_park_buffer the rtt_park setting
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs05_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs05_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_crc_error_clear,
uint8_t& o_ca_parity_error_status,
@@ -767,7 +759,7 @@ fapi2::ReturnCode mrs05_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs05_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs05_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -780,7 +772,7 @@ fapi2::ReturnCode mrs05_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIS
/// @param[out] o_vrefdq_train_value_buffer the vrefdq training value
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs06_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs06_decode_helper(const ccs::instruction_t& i_inst,
const uint64_t i_rank,
uint8_t& o_vrefdq_train_range,
uint8_t& o_vrefdq_train_enable,
@@ -794,7 +786,7 @@ fapi2::ReturnCode mrs06_decode_helper(const ccs::instruction_t<fapi2::TARGET_TYP
/// @param[in] i_rank the rank in question
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode mrs06_decode(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+fapi2::ReturnCode mrs06_decode(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -818,10 +810,10 @@ struct mrs00_data
// dynaimc polymorphism and I avoid that where possible.
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs00_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -909,10 +901,10 @@ struct mrs01_data
// Helper function needed by the lab tooling to find our instruction maker and our dumper
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs01_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -1011,10 +1003,10 @@ struct mrs02_data
// Helper function needed by the lab tooling to find our instruction maker and our dumper
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs02_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -1091,10 +1083,10 @@ struct mrs03_data
// Helper function needed by the lab tooling to find our instruction maker and our dumper
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs03_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -1196,10 +1188,10 @@ struct mrs04_data
// Helper function needed by the lab tooling to find our instruction maker and our dumper
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs04_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -1322,10 +1314,10 @@ struct mrs05_data
// Helper function needed by the lab tooling to find our instruction maker and our dumper
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs05_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -1436,10 +1428,10 @@ struct mrs06_data
// Helper function needed by the lab tooling to find our instruction maker and our dumper
static fapi2::ReturnCode (*make_ccs_instruction)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const mrs06_data& i_data,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst,
+ ccs::instruction_t& io_inst,
const uint64_t i_rank);
- static fapi2::ReturnCode (*decode)(const ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& i_inst,
+ static fapi2::ReturnCode (*decode)(const ccs::instruction_t& i_inst,
const uint64_t i_rank);
///
@@ -1516,7 +1508,16 @@ struct mrs06_data
/// @return FAPI2_RC_SUCCESS if and only if ok
///
fapi2::ReturnCode mrs_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
+
+///
+/// @brief Perform the mrs_load DDR4 operations for nvdimm restore - TARGET_TYPE_DIMM specialization
+/// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+/// @param[in] io_inst a vector of CCS instructions we should add to
+/// @return FAPI2_RC_SUCCESS if and only if ok
+///
+fapi2::ReturnCode mrs_load_nvdimm( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Sets WR LVL mode
@@ -1720,18 +1721,16 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction to set WR LVL Mode
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_mode setting for WR LVL mode
/// @param[in] i_rank DIMM rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode wr_lvl(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const mss::states i_mode,
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode wr_lvl(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const mss::states i_mode,
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
// Spec states we need to use tmod for our delay, so we do
const uint64_t l_delay = mss::tmod(i_target);
@@ -1754,18 +1753,16 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction to set MPR Mode
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_mode setting for MPR mode
/// @param[in] i_rank DIMM rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode mpr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_mode,
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode mpr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint8_t i_mode,
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
// From DDR4 spec section 4.10.3 MPR Reads:
// tMRD and tMOD must be satisfied after enabling/disabling MPR mode
@@ -1789,7 +1786,6 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction to set MPR Mode
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_mode setting for MPR mode
/// @param[in] i_rd_format MPR read format
@@ -1797,12 +1793,11 @@ fapi_try_exit:
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode mpr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_mode,
- const uint8_t i_rd_format,
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode mpr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint8_t i_mode,
+ const uint8_t i_rd_format,
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
// From DDR4 spec section 4.10.3 MPR Reads:
// tMRD and tMOD must be satisfied after enabling/disabling MPR mode
@@ -1830,18 +1825,16 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction to set RTT_NOM value
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_value values to set to RTT_NOM
/// @param[in] i_rank DIMM rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode rtt_nom_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_value[MAX_RANK_PER_DIMM],
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode rtt_nom_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint8_t i_value[MAX_RANK_PER_DIMM],
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
// tMRD (clock cycles) must be satisfied after an MRS command
constexpr uint64_t l_delay = mss::tmrd();
@@ -1864,18 +1857,16 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction to set RTT_WR value
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_value values to set to RTT_WR
/// @param[in] i_rank DIMM rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode rtt_wr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_value[MAX_RANK_PER_DIMM],
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode rtt_wr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint8_t i_value[MAX_RANK_PER_DIMM],
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
// tMRD (clock cycles) must be satisfied after an MRS command
constexpr uint64_t l_delay = mss::tmrd();
@@ -1898,23 +1889,21 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction for an MPR read
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_mode MPR location
/// @param[in] i_rank DIMM rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode mpr_read( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint64_t i_mpr_loc,
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode mpr_read( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint64_t i_mpr_loc,
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
// Right now we only have support for RD and RDA
// Unclear if we want the API select the type of read command right now
// Note the auto precharge is ignored with MPR mode on so we just do a read cmd
- ccs::instruction_t<T> l_inst = ccs::rd_command<T> (i_rank, i_mpr_loc);
+ ccs::instruction_t l_inst = ccs::rd_command (i_rank, i_mpr_loc);
// In MPR Mode:
// Reads (back-to-back) from Page 0 may use tCCD_S or tCCD_L timing between read commands
@@ -1948,18 +1937,16 @@ fapi_try_exit:
///
/// @brief Makes CCS instruction to set precharge all command
-/// @tparam T TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_rank DIMM rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode precharge_all( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint64_t i_rank,
- std::vector< ccs::instruction_t<T> >& io_inst )
+inline fapi2::ReturnCode precharge_all( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint64_t i_rank,
+ std::vector< ccs::instruction_t >& io_inst )
{
- ccs::instruction_t<T> l_inst = ccs::precharge_all_command<T> (i_rank);
+ ccs::instruction_t l_inst = ccs::precharge_all_command (i_rank);
// From the DDR4 Spec tRP is the precharge command period
uint8_t l_delay = 0;
@@ -1995,58 +1982,54 @@ fapi2::ReturnCode rtt_wr_to_rtt_nom_helper(const fapi2::Target<T>& i_target,
///
/// @brief Executes CCS instructions to set RTT_WR value into RTT_NOM
/// @tparam T TargetType of the DIMM
-/// @tparam CT TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_rank selected rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, fapi2::TargetType CT >
+template< fapi2::TargetType T >
fapi2::ReturnCode rtt_nom_override(const fapi2::Target<T>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<CT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Executes CCS instructions to disable RTT_WR
/// @tparam T TargetType of the DIMM
-/// @tparam CT TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_rank selected rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, fapi2::TargetType CT >
+template< fapi2::TargetType T >
fapi2::ReturnCode rtt_wr_disable(const fapi2::Target<T>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<CT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Executes CCS instructions to restore original value to RTT_NOM
/// @tparam T TargetType of the DIMM
-/// @tparam CT TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_rank selected rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, fapi2::TargetType CT >
+template< fapi2::TargetType T >
fapi2::ReturnCode rtt_nom_restore(const fapi2::Target<T>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<CT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Executes CCS instructions to restore original value to RTT_WR
/// @tparam T TargetType of the DIMM
-/// @tparam CT TargetType of the CCS instruction
/// @param[in] i_target a DIMM target
/// @param[in] i_rank selected rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS if and only if ok
///
-template< fapi2::TargetType T, fapi2::TargetType CT >
+template< fapi2::TargetType T >
fapi2::ReturnCode rtt_wr_restore(const fapi2::Target<T>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<CT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
} // ddr4
} // mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C
index 869e18f25..8c19b99f9 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018,2019 */
+/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,23 +33,25 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
-#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
#include <vector>
+#include <lib/shared/mss_const.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/ddr4/nvdimm_utils.H>
#include <lib/mc/mc.H>
-#include <lib/ccs/ccs.H>
#include <lib/dimm/rank.H>
#include <lib/mss_attribute_accessors.H>
+#include <lib/mcbist/mcbist.H>
+#include <lib/utils/mss_nimbus_conversions.H>
#include <generic/memory/lib/utils/poll.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/utils/mc/gen_mss_port.H>
#include <lib/mcbist/address.H>
#include <lib/mcbist/memdiags.H>
-#include <lib/mcbist/mcbist.H>
#include <lib/mcbist/settings.H>
-#include <lib/utils/mss_nimbus_conversions.H>
#include <generic/memory/lib/utils/pos.H>
#include <lib/mc/port.H>
#include <lib/phy/dp16.H>
@@ -82,7 +84,7 @@ fapi2::ReturnCode get_maint_addr_mode_en( const fapi2::Target<fapi2::TARGET_TYPE
mss::states& o_state )
{
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- typedef mcbistTraits<TARGET_TYPE_MCBIST> TT;
+ typedef mcbistTraits<> TT;
fapi2::buffer<uint64_t> l_data;
FAPI_TRY( mss::getScom(l_mcbist, TT::MCBAGRAQ_REG, l_data),
@@ -105,7 +107,7 @@ fapi2::ReturnCode change_maint_addr_mode_en( const fapi2::Target<fapi2::TARGET_T
const mss::states i_state )
{
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- typedef mcbistTraits<TARGET_TYPE_MCBIST> TT;
+ typedef mcbistTraits<> TT;
fapi2::buffer<uint64_t> l_data;
FAPI_TRY( mss::getScom(l_mcbist, TT::MCBAGRAQ_REG, l_data),
@@ -213,10 +215,10 @@ fapi2::ReturnCode self_refresh_exit_helper( const fapi2::Target<fapi2::TARGET_TY
mss::mcbist::address l_start = 0, l_end = 0;
mss::mcbist::end_boundary l_end_boundary = mss::mcbist::end_boundary::STOP_AFTER_SLAVE_RANK;
l_start.set_port(l_port);
- mss::mcbist::stop_conditions l_stop_conditions;
+ mss::mcbist::stop_conditions<> l_stop_conditions;
// Read with targeted scrub
- FAPI_TRY ( mss::memdiags::targeted_scrub(l_mcbist,
+ FAPI_TRY ( mss::memdiags::targeted_scrub<mss::mc_type::NIMBUS>(l_mcbist,
l_stop_conditions,
l_start,
l_end,
@@ -264,10 +266,14 @@ template<>
fapi2::ReturnCode self_refresh_entry( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target )
{
fapi2::buffer<uint64_t> l_mbarpc0_data, l_mbastr0_data;
+ const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
// Entry time to 0 for immediate entry
constexpr uint64_t l_str_entry_time = 0;
+ // Stop mcbist (scrub) in case of MPIPL. It will get restarted in the later istep
+ FAPI_TRY(mss::mcbist::start_stop(l_mcbist, mss::states::STOP));
+
// Step 1 - In MBARPC0Q, disable power domain control, set domain to MAXALL_MIN0,
// and disable minimum domain reduction (allow immediate entry of STR)
FAPI_TRY(mss::mc::read_mbarpc0(i_target, l_mbarpc0_data));
@@ -322,49 +328,6 @@ fapi_try_exit:
}
///
-/// @brief Disable powerdown mode in rc09
-/// @param[in] i_target, a fapi2::Target<TARGET_TYPE_DIMM>
-/// @param[in,out] io_inst a vector of CCS instructions we should add to
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-fapi2::ReturnCode rc09_disable_powerdown( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
-{
- FAPI_INF("rc09_disable_powerdown %s", mss::c_str(i_target));
-
- constexpr uint8_t POWER_DOWN_BIT = 4;
- constexpr bool l_sim = false;
- constexpr uint8_t FS0 = 0; // Function space 0
- constexpr uint64_t CKE_HIGH = mss::ON;
- fapi2::buffer<uint8_t> l_rc09_cw = 0;
- std::vector<uint64_t> l_ranks;
-
- FAPI_TRY(mss::eff_dimm_ddr4_rc09(i_target, l_rc09_cw));
-
- // Clear power down enable bit.
- l_rc09_cw.clearBit<POWER_DOWN_BIT>();
-
- FAPI_TRY( mss::rank::ranks(i_target, l_ranks) );
-
- // DES to ensure we exit powerdown properly
- FAPI_DBG("deselect for %s", mss::c_str(i_target));
- io_inst.push_back( ccs::des_command<TARGET_TYPE_MCBIST>() );
-
- static const cw_data l_rc09_4bit_data( FS0, 9, l_rc09_cw, mss::tmrd() );
-
- // Load RC09
- FAPI_TRY( control_word_engine<RCW_4BIT>(i_target, l_rc09_4bit_data, l_sim, io_inst, CKE_HIGH),
- "Failed to load 4-bit RC09 control word for %s",
- mss::c_str(i_target));
-
- // Hold the CKE high
- mss::ccs::workarounds::hold_cke_high(io_inst);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
/// @brief Load the rcd control words
/// @param[in] i_target, a fapi2::Target<TARGET_TYPE_DIMM>
/// @param[in,out] io_inst a vector of CCS instructions we should add to
@@ -373,11 +336,11 @@ fapi_try_exit:
/// with NVDIMMs
///
fapi2::ReturnCode rcd_load_nvdimm( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_INF("rcd_load_nvdimm %s", mss::c_str(i_target));
- constexpr uint64_t CKE_LOW = mss::OFF;
+ constexpr uint64_t CKE_HIGH = mss::ON;
constexpr bool l_sim = false;
// Per DDR4RCD02, tSTAB is us. We want this in cycles for the CCS.
@@ -425,17 +388,19 @@ fapi2::ReturnCode rcd_load_nvdimm( const fapi2::Target<TARGET_TYPE_DIMM>& i_targ
};
// Load 4-bit data
- FAPI_TRY( control_word_engine<RCW_4BIT>(i_target, l_rcd_4bit_data, l_sim, io_inst, CKE_LOW),
+ // Keeping the CKE high as this will be done not in powerdown/STR mode. Not affected for
+ // the RCD supplier on nvdimm
+ FAPI_TRY( control_word_engine<RCW_4BIT>(i_target, l_rcd_4bit_data, l_sim, io_inst, CKE_HIGH),
"Failed to load 4-bit control words for %s",
mss::c_str(i_target));
// Load 8-bit data
- FAPI_TRY( control_word_engine<RCW_8BIT>(i_target, l_rcd_8bit_data, l_sim, io_inst, CKE_LOW),
+ FAPI_TRY( control_word_engine<RCW_8BIT>(i_target, l_rcd_8bit_data, l_sim, io_inst, CKE_HIGH),
"Failed to load 8-bit control words for %s",
mss::c_str(i_target));
// Load RC09 with CKE_LOW
- FAPI_TRY( control_word_engine<RCW_4BIT>(i_target, l_rc09_4bit_data, l_sim, io_inst, CKE_LOW),
+ FAPI_TRY( control_word_engine<RCW_4BIT>(i_target, l_rc09_4bit_data, l_sim, io_inst, CKE_HIGH),
"Failed to load 4-bit RC09 control word for %s",
mss::c_str(i_target));
@@ -456,34 +421,13 @@ fapi2::ReturnCode rcd_restore( const fapi2::Target<TARGET_TYPE_MCA>& i_target )
std::vector<uint64_t> l_ranks;
// A vector of CCS instructions. We'll ask the targets to fill it, and then we'll execute it
- ccs::program<TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
// Clear the initial delays. This will force the CCS engine to recompute the delay based on the
// instructions in the CCS instruction vector
l_program.iv_poll.iv_initial_delay = 0;
l_program.iv_poll.iv_initial_sim_delay = 0;
- // We expect to come in with the port in STR. Before proceeding with
- // restoring the RCD, power down needs to be disabled first on the RCD so
- // the rest of the CWs can be restored with CKE low
- for ( const auto& d : mss::find_targets<TARGET_TYPE_DIMM>(i_target) )
- {
- FAPI_DBG("rc09_disable_powerdown for %s", mss::c_str(d));
- FAPI_TRY( rc09_disable_powerdown(d, l_program.iv_instructions),
- "Failed rc09_disable_powerdown() for %s", mss::c_str(d) );
- }// dimms
-
- // Exit STR first so CKE is back to high and rcd isn't ignoring us
- FAPI_TRY( self_refresh_exit( i_target ) );
-
- FAPI_TRY( mss::ccs::workarounds::nvdimm::execute(l_mcbist, l_program, i_target),
- "Failed to execute ccs for %s", mss::c_str(i_target) );
-
- // Now, drive CKE back to low via STR entry instead of pde (we have data in the drams!)
- FAPI_TRY( self_refresh_entry( i_target ) );
-
- l_program = ccs::program<TARGET_TYPE_MCBIST>(); //Reset the program
-
// Now, fill the program with instructions to program the RCD
for ( const auto& d : mss::find_targets<TARGET_TYPE_DIMM>(i_target) )
{
@@ -513,7 +457,7 @@ fapi2::ReturnCode post_restore_zqcal( const fapi2::Target<fapi2::TARGET_TYPE_MCA
const auto& l_mcbist = mss::find_target<TARGET_TYPE_MCBIST>(i_target);
std::vector<uint64_t> l_ranks;
uint8_t l_trp[MAX_DIMM_PER_PORT];
- ccs::program<TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
// Get tRP
FAPI_TRY(mss::eff_dram_trp(mss::find_target<fapi2::TARGET_TYPE_MCS>(i_target), l_trp));
@@ -526,9 +470,9 @@ fapi2::ReturnCode post_restore_zqcal( const fapi2::Target<fapi2::TARGET_TYPE_MCA
for ( const auto r : l_ranks)
{
FAPI_DBG("precharge_all_command for %s", mss::c_str(d));
- l_program.iv_instructions.push_back( ccs::precharge_all_command<TARGET_TYPE_MCBIST>(r, l_trp[0]) );
+ l_program.iv_instructions.push_back( ccs::precharge_all_command(r, l_trp[0]) );
FAPI_DBG("zqcal_command for %s", mss::c_str(d));
- l_program.iv_instructions.push_back( ccs::zqcl_command<TARGET_TYPE_MCBIST>(r, mss::tzqinit()) );
+ l_program.iv_instructions.push_back( ccs::zqcl_command(r, mss::tzqinit()) );
}
}// dimms
@@ -608,12 +552,12 @@ fapi2::ReturnCode post_restore_transition( const fapi2::Target<fapi2::TARGET_TYP
FAPI_TRY(get_refresh_overrun_mask(i_target, l_refresh_overrun_mask));
FAPI_TRY(change_refresh_overrun_mask(i_target, mss::states::ON));
- // Restore the rcd
- FAPI_TRY( rcd_restore( i_target ) );
-
// Exit STR
FAPI_TRY( self_refresh_exit( i_target ) );
+ // Restore the rcd
+ FAPI_TRY( rcd_restore( i_target ) );
+
// Load the MRS
FAPI_TRY( mss::mrs_load( i_target, NVDIMM_WORKAROUND ) );
@@ -635,6 +579,26 @@ fapi_try_exit:
}
///
+/// @brief Helper to change the BAR valid state. Consumed by hostboot
+/// @param[in] i_target the target associated with this subroutine
+/// @return FAPI2_RC_SUCCESS iff setup was successful
+///
+fapi2::ReturnCode change_bar_valid_state( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ const uint8_t i_state)
+{
+ const auto& l_mcs = mss::find_target<fapi2::TARGET_TYPE_MCS>(i_target);
+ fapi2::buffer<uint64_t> l_data;
+
+ FAPI_TRY( mss::getScom(l_mcs, MCS_MCFGP, l_data) );
+ l_data.writeBit<MCS_MCFGP_VALID>(i_state);
+ FAPI_INF("Changing MCS_MCFGP_VALID to %d on %s", i_state, mss::c_str(l_mcs));
+ FAPI_TRY( mss::putScom(l_mcs, MCS_MCFGP, l_data) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
/// @brief Preload the CCS with the EPOW sequence
/// @param[in] i_target the target associated with this subroutine
/// @return FAPI2_RC_SUCCESS iff setup was successful
@@ -643,15 +607,15 @@ fapi_try_exit:
///
fapi2::ReturnCode preload_epow_sequence( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target )
{
- typedef ccsTraits<fapi2::TARGET_TYPE_MCBIST> TT;
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
const auto& l_mcbist = mss::find_target<TARGET_TYPE_MCBIST>(i_target);
const auto& l_dimms = mss::find_targets<TARGET_TYPE_DIMM>(i_target);
constexpr uint64_t CS_N_ACTIVE = 0b00;
uint8_t l_trp = 0;
uint16_t l_trfc = 0;
std::vector<uint64_t> l_ranks;
- ccs::program<TARGET_TYPE_MCBIST> l_program;
- ccs::instruction_t<TARGET_TYPE_MCBIST> l_inst;
+ ccs::program l_program;
+ ccs::instruction_t l_inst;
// Get tRP and tRFC
FAPI_TRY(mss::eff_dram_trp(i_target, l_trp));
@@ -662,14 +626,14 @@ fapi2::ReturnCode preload_epow_sequence( const fapi2::Target<fapi2::TARGET_TYPE_
// Start the program with DES and wait for tRFC
// All CKE = high, all CSn = high, Reset_n = high, wait tRFC
- l_inst = ccs::des_command<TARGET_TYPE_MCBIST>(l_trfc);
+ l_inst = ccs::des_command(l_trfc);
l_inst.arr0.setBit<TT::ARR0_DDR_RESETN>();
FAPI_INF("des_command() arr0 = 0x%016lx , arr1 = 0x%016lx", l_inst.arr0, l_inst.arr1);
l_program.iv_instructions.push_back(l_inst);
// Precharge all command
// All CKE = high, all CSn = low, Reset_n = high, wait tRP
- l_inst = ccs::precharge_all_command<TARGET_TYPE_MCBIST>(0, l_trp);
+ l_inst = ccs::precharge_all_command(0, l_trp);
l_inst.arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1, TT::ARR0_DDR_CSN_0_1_LEN>(CS_N_ACTIVE);
l_inst.arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3, TT::ARR0_DDR_CSN_2_3_LEN>(CS_N_ACTIVE);
l_inst.arr0.setBit<TT::ARR0_DDR_RESETN>();
@@ -678,7 +642,7 @@ fapi2::ReturnCode preload_epow_sequence( const fapi2::Target<fapi2::TARGET_TYPE_
// Self-refresh entry command
// All CKE = low, all CSn = low, Reset_n = high, wait tCKSRE
- l_inst = ccs::self_refresh_entry_command<TARGET_TYPE_MCBIST>(0, mss::tcksre(l_dimms[0]));
+ l_inst = ccs::self_refresh_entry_command(0, mss::tcksre(l_dimms[0]));
l_inst.arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1, TT::ARR0_DDR_CSN_0_1_LEN>(CS_N_ACTIVE);
l_inst.arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3, TT::ARR0_DDR_CSN_2_3_LEN>(CS_N_ACTIVE);
l_inst.arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(mss::CKE_LOW);
@@ -688,7 +652,7 @@ fapi2::ReturnCode preload_epow_sequence( const fapi2::Target<fapi2::TARGET_TYPE_
// Push in an empty instruction for RESETn
// All CKE = low, all CSn = high (default), Reset_n = low
- l_inst = ccs::instruction_t<TARGET_TYPE_MCBIST>();
+ l_inst = ccs::instruction_t();
FAPI_INF("Assert RESETn arr0 = 0x%016lx , arr1 = 0x%016lx", l_inst.arr0, l_inst.arr1);
l_program.iv_instructions.push_back(l_inst);
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H
index a3c4914a4..8345cae05 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.H
@@ -34,11 +34,11 @@
// *HWP Consumed by: FSP:HB
#include <fapi2.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/shared/mss_const.H>
-#include <lib/ccs/ccs.H>
#include <lib/phy/dp16.H>
#include <lib/mc/port.H>
+#include <generic/memory/lib/ccs/ccs.H>
namespace mss
{
@@ -182,15 +182,6 @@ template< fapi2::TargetType T >
fapi2::ReturnCode self_refresh_exit( const fapi2::Target<T>& i_target );
///
-/// @brief Disable powerdown mode in rc09
-/// @param[in] i_target, a fapi2::Target<TARGET_TYPE_DIMM>
-/// @param[in,out] io_inst a vector of CCS instructions we should add to
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-fapi2::ReturnCode rc09_disable_powerdown( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
-
-///
/// @brief Load the rcd control words
/// @param[in] i_target, a fapi2::Target<TARGET_TYPE_DIMM>
/// @param[in,out] io_inst a vector of CCS instructions we should add to
@@ -199,7 +190,7 @@ fapi2::ReturnCode rc09_disable_powerdown( const fapi2::Target<fapi2::TARGET_TYPE
/// with NVDIMMs
///
fapi2::ReturnCode rcd_load_nvdimm( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Restore the rcd after restoring the nvdimm data
@@ -237,6 +228,14 @@ template< fapi2::TargetType T >
fapi2::ReturnCode post_restore_transition( const fapi2::Target<T>& i_target );
///
+/// @brief Helper to change the BAR valid state. Consumed by hostboot
+/// @param[in] i_target the target associated with this subroutine
+/// @return FAPI2_RC_SUCCESS iff setup was successful
+///
+fapi2::ReturnCode change_bar_valid_state( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ const uint8_t i_state);
+
+///
/// @brief Preload the CCS with the EPOW sequence
/// @param[in] i_target the target associated with this subroutine
/// @return FAPI2_RC_SUCCESS iff setup was successful
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.C
index c1cab4997..a864ea8d2 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.C
@@ -35,10 +35,11 @@
#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
-
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ccs/ccs.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/ddr4/data_buffer_ddr4.H>
#include <lib/phy/phy_cntrl.H>
#include <lib/dimm/ddr4/pba.H>
@@ -113,7 +114,7 @@ fapi_try_exit:
///
fapi2::ReturnCode enter( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target )
{
- ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
@@ -145,7 +146,7 @@ fapi_try_exit:
///
fapi2::ReturnCode exit( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target )
{
- ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
@@ -200,10 +201,10 @@ fapi2::ReturnCode execute_commands( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>
// Issue PBA commands
{
- ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
// Inserts the DES command to ensure we keep our CKE high
- l_program.iv_instructions.push_back(mss::ccs::des_command<fapi2::TARGET_TYPE_MCBIST>());
+ l_program.iv_instructions.push_back(mss::ccs::des_command());
// Makes a copy of the vector, so we can do the function space swaps correctly
auto l_bcws = i_bcws;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.H
index 34706d492..c2d47fed3 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pba.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,8 +39,9 @@
#include <fapi2.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ccs/ccs.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/ddr4/data_buffer_ddr4.H>
#include <map>
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.C
index a89cee0e2..8eb698a62 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,10 +37,13 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
+#include <lib/shared/mss_const.H>
+#include <lib/mc/port.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ccs/ccs.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/mrs_load.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
#include <lib/dimm/ddr4/latch_wr_vref.H>
@@ -49,6 +52,7 @@
#include <lib/dimm/ddr4/pda.H>
#include <lib/workarounds/ccs_workarounds.H>
+
namespace mss
{
@@ -209,7 +213,7 @@ fapi_try_exit:
///
fapi2::ReturnCode add_enable( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
mss::ddr4::mrs03_data l_mrs03( i_target, fapi2::current_err );
FAPI_TRY( fapi2::current_err, "%s Unable to construct MRS03 data from attributes", mss::c_str(i_target));
@@ -232,7 +236,7 @@ fapi_try_exit:
fapi2::ReturnCode enter( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank )
{
- ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
@@ -261,7 +265,7 @@ fapi_try_exit:
///
fapi2::ReturnCode add_disable( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst )
+ std::vector< ccs::instruction_t >& io_inst )
{
mss::ddr4::mrs03_data l_mrs03( i_target, fapi2::current_err );
FAPI_TRY( fapi2::current_err, "%s Unable to construct MRS03 data from attributes", mss::c_str(i_target));
@@ -284,7 +288,7 @@ fapi_try_exit:
fapi2::ReturnCode exit( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank )
{
- ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
@@ -344,7 +348,7 @@ fapi2::ReturnCode execute_wr_vref_latch( const fapi2::Target<fapi2::TARGET_TYPE_
// Issue MRS commands
{
- ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
FAPI_TRY(mss::ddr4::add_latch_wr_vref_commands( i_target,
i_mrs,
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.H
index 379b0a2ba..c28dcceac 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/pda.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,14 +38,18 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
+#include <lib/mc/port.H>
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ccs/ccs.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/phy/write_cntrl.H>
#include <lib/dimm/mrs_load.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
+
#include <map>
namespace mss
@@ -170,7 +174,7 @@ fapi2::ReturnCode blast_dram_config( const fapi2::Target<fapi2::TARGET_TYPE_MCA>
///
fapi2::ReturnCode add_enable( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst );
+ std::vector< ccs::instruction_t >& io_inst );
///
/// @brief Enters into and configures PDA mode
@@ -190,7 +194,7 @@ fapi2::ReturnCode enter( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
fapi2::ReturnCode add_disable( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst );
+ std::vector< ccs::instruction_t >& io_inst );
///
/// @brief Exits out of and disables PDA mode
@@ -313,7 +317,7 @@ class commands
// Check for a valid rank
FAPI_ASSERT(mss::rank::is_rank_on_dimm(i_target, i_rank),
fapi2::MSS_INVALID_RANK().
- set_MCA_TARGET(mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target)).
+ set_PORT_TARGET(mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target)).
set_RANK(i_rank).
set_FUNCTION(mss::ffdc_function_codes::PDA_ADD_COMMAND),
"%s does not have rank %lu", mss::c_str(i_target), i_rank);
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.C
index 6e53bddd8..e522f970f 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,13 +36,17 @@
#include <lib/shared/nimbus_defaults.H>
#include <vector>
#include <fapi2.H>
+#include <lib/shared/mss_const.H>
#include <lib/dimm/ddr4/zqcal.H>
#include <lib/dimm/ddr4/data_buffer_ddr4.H>
-#include <lib/ccs/ccs.H>
+#include <lib/mc/port.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/eff_config/timing.H>
#include <lib/workarounds/ccs_workarounds.H>
+
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_DIMM;
@@ -61,15 +65,15 @@ namespace mss
template<>
fapi2::ReturnCode setup_dram_zqcal( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
- ccs::instruction_t<TARGET_TYPE_MCBIST> l_inst;
+ ccs::instruction_t l_inst;
uint64_t tDLLK = 0;
FAPI_TRY( mss::tdllk(i_target, tDLLK) );
// Note: this isn't general - assumes Nimbus via MCBIST instruction here BRS
- l_inst = ccs::zqcl_command<TARGET_TYPE_MCBIST>(i_rank);
+ l_inst = ccs::zqcl_command(i_rank);
// Doubling tZQ to better margin per lab request
{
@@ -98,7 +102,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode setup_data_buffer_zqcal( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// For LRDIMMs, program BCW to send ZQCal Long command to all data buffers
// in broadcast mode
@@ -128,7 +132,7 @@ template<>
fapi2::ReturnCode setup_and_execute_zqcal( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const fapi2::buffer<uint32_t>& i_cal_steps_enabled)
{
- mss::ccs::program<TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
for ( const auto& d : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target) )
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.H
index d78a512f1..d80febc3b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/zqcal.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,7 +38,11 @@
#include <vector>
#include <fapi2.H>
-#include <lib/ccs/ccs.H>
+#include <lib/mc/port.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
namespace mss
{
@@ -46,28 +50,26 @@ namespace mss
///
/// @brief Setup DRAM ZQCL
/// @tparam T the target type associated with this cal
-/// @tparam TT the target type of the CCS instruction
/// @param[in] i_target the target associated with this cal
/// @param[in] i_rank the current rank
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-template< fapi2::TargetType T, fapi2::TargetType TT >
+template< fapi2::TargetType T >
fapi2::ReturnCode setup_dram_zqcal( const fapi2::Target<T>& i_target,
const uint64_t i_rank,
- std::vector< ccs::instruction_t<TT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Setup LRDIMM data buffer ZQCL
/// @tparam T the target type associated with this cal
-/// @tparam TT the target type of the CCS instruction
/// @param[in] i_target the target associated with this cal
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-template< fapi2::TargetType T, fapi2::TargetType TT >
+template< fapi2::TargetType T >
fapi2::ReturnCode setup_data_buffer_zqcal( const fapi2::Target<T>& i_target,
- std::vector< ccs::instruction_t<TT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Setup and execute DRAM ZQCL
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.C
index 38f6e9bae..2c3a3a757 100755..100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.C
@@ -44,13 +44,14 @@
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
#include <lib/dimm/rank.H>
#include <lib/utils/mss_nimbus_conversions.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/dimm/eff_dimm.H>
#include <lib/dimm/mrs_load.H>
#include <lib/shared/mss_kind.H>
#include <lib/phy/dp16.H>
#include <lib/mss_attribute_accessors_manual.H>
#include <generic/memory/lib/utils/freq/gen_mss_freq.H>
+#include <lib/workarounds/eff_config_workarounds.H>
namespace mss
{
@@ -366,16 +367,6 @@ enum invalid_freq_function_encoding : uint8_t
F0BC6X = 0x60,
};
-///
-/// @brief encoding for MSS_INVALID_TIMING so we can look up functions based on encoding
-///
-enum invalid_timing_function_encoding : uint8_t
-{
- TRRD_S = 0,
- TRRD_L = 1,
- TFAW = 2,
-};
-
/////////////////////////
// Non-member function implementations
/////////////////////////
@@ -1577,6 +1568,7 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_dimm::dimm_rc03()
{
+ constexpr uint8_t NVDIMM_RCW_WORKAROUND_VALUE = 0x08;
fapi2::buffer<uint8_t> l_buffer;
uint8_t l_attrs_dimm_rc03[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
@@ -1599,6 +1591,10 @@ fapi2::ReturnCode eff_dimm::dimm_rc03()
l_buffer.insertFromRight<CA_START, LEN>(l_ca_output_drive)
.insertFromRight<CS_START, LEN>(l_cs_output_drive);
}
+
+ // Update the value if the NVDIMM workaround is needed
+ FAPI_TRY(mss::workarounds::eff_config::nvdimm_rc_drive_strength(iv_dimm, NVDIMM_RCW_WORKAROUND_VALUE, l_buffer));
+
// Retrieve MCS attribute data
FAPI_TRY( eff_dimm_ddr4_rc03(iv_mcs, &l_attrs_dimm_rc03[0][0]) );
@@ -1618,6 +1614,7 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_dimm::dimm_rc04()
{
+ constexpr uint8_t NVDIMM_RCW_WORKAROUND_VALUE = 0x0a;
uint8_t l_attrs_dimm_rc04[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
uint8_t l_odt_output_drive = 0;
uint8_t l_cke_output_drive = 0;
@@ -1641,6 +1638,9 @@ fapi2::ReturnCode eff_dimm::dimm_rc04()
.insertFromRight<ODT_START, LEN>(l_odt_output_drive);
}
+ // Update the value if the NVDIMM workaround is needed
+ FAPI_TRY(mss::workarounds::eff_config::nvdimm_rc_drive_strength(iv_dimm, NVDIMM_RCW_WORKAROUND_VALUE, l_buffer));
+
// Retrieve MCS attribute data
FAPI_TRY( eff_dimm_ddr4_rc04(iv_mcs, &l_attrs_dimm_rc04[0][0]) );
@@ -1660,6 +1660,7 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_dimm::dimm_rc05()
{
+ constexpr uint8_t NVDIMM_RCW_WORKAROUND_VALUE = 0x0a;
uint8_t l_attrs_dimm_rc05[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
uint8_t l_a_side_output_drive = 0;
uint8_t l_b_side_output_drive = 0;
@@ -1683,6 +1684,9 @@ fapi2::ReturnCode eff_dimm::dimm_rc05()
.insertFromRight<A_START, LEN>(l_a_side_output_drive);
}
+ // Update the value if the NVDIMM workaround is needed
+ FAPI_TRY(mss::workarounds::eff_config::nvdimm_rc_drive_strength(iv_dimm, NVDIMM_RCW_WORKAROUND_VALUE, l_buffer));
+
// Retrieve MCS attribute data
FAPI_TRY( eff_dimm_ddr4_rc05(iv_mcs, &l_attrs_dimm_rc05[0][0]) );
@@ -2960,36 +2964,44 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::vref_dq_train_value_and_range()
{
- constexpr uint8_t VREF_73PERCENT = 0x14;
- constexpr uint8_t VREF_83PERCENT = 0x24;
- constexpr uint8_t TRAIN_VALUE[NUM_VALID_RANKS_CONFIGS] =
- {
- VREF_73PERCENT, // 2 ranks per DIMM
- VREF_83PERCENT, // 4 ranks per DIMM
- };
- // Yes, range1 has a value of 0 this is taken from the JEDEC spec
- constexpr uint8_t RANGE1 = 0x00;
- constexpr uint8_t TRAIN_RANGE[NUM_VALID_RANKS_CONFIGS] =
- {
- RANGE1,
- RANGE1,
- };
-
-
+ // Bits for range decode from the SPD
+ constexpr uint8_t RANK0 = 7;
+ constexpr uint8_t RANK1 = 6;
+ constexpr uint8_t RANK2 = 5;
+ constexpr uint8_t RANK3 = 4;
uint8_t l_vref_dq_train_value[PORTS_PER_MCS][MAX_DIMM_PER_PORT][MAX_RANK_PER_DIMM] = {};
uint8_t l_vref_dq_train_range[PORTS_PER_MCS][MAX_DIMM_PER_PORT][MAX_RANK_PER_DIMM] = {};
+ fapi2::buffer<uint8_t > l_range;
// Gets the attributes
FAPI_TRY( eff_vref_dq_train_value(iv_mcs, &l_vref_dq_train_value[0][0][0]) );
FAPI_TRY( eff_vref_dq_train_range(iv_mcs, &l_vref_dq_train_range[0][0][0]) );
- // Using hardcoded values for 2R settings from the IBM SI team
- // It should be good enough to get us going
- for(uint64_t l_rank = 0; l_rank < MAX_RANK_PER_DIMM; ++l_rank)
- {
- l_vref_dq_train_value[iv_port_index][iv_dimm_index][mss::index(l_rank)] = TRAIN_VALUE[iv_master_ranks_index];
- l_vref_dq_train_range[iv_port_index][iv_dimm_index][mss::index(l_rank)] = TRAIN_RANGE[iv_master_ranks_index];
- }
+ // Value is easy, just drop the values in from the SPD
+ FAPI_TRY( iv_spd_decoder.dram_vref_dq_rank0(l_vref_dq_train_value[iv_port_index][iv_dimm_index][ATTR_RANK0]));
+ FAPI_TRY( iv_spd_decoder.dram_vref_dq_rank1(l_vref_dq_train_value[iv_port_index][iv_dimm_index][ATTR_RANK1]));
+ FAPI_TRY( iv_spd_decoder.dram_vref_dq_rank2(l_vref_dq_train_value[iv_port_index][iv_dimm_index][ATTR_RANK2]));
+ FAPI_TRY( iv_spd_decoder.dram_vref_dq_rank3(l_vref_dq_train_value[iv_port_index][iv_dimm_index][ATTR_RANK3]));
+
+ // Range requires some decoding
+ FAPI_TRY( iv_spd_decoder.dram_vref_dq_range(l_range));
+
+ // Do the decode for each rank
+ l_vref_dq_train_range[iv_port_index][iv_dimm_index][ATTR_RANK0] = l_range.getBit<RANK0>() ?
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE2 :
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE1;
+
+ l_vref_dq_train_range[iv_port_index][iv_dimm_index][ATTR_RANK1] = l_range.getBit<RANK1>() ?
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE2 :
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE1;
+
+ l_vref_dq_train_range[iv_port_index][iv_dimm_index][ATTR_RANK2] = l_range.getBit<RANK2>() ?
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE2 :
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE1;
+
+ l_vref_dq_train_range[iv_port_index][iv_dimm_index][ATTR_RANK3] = l_range.getBit<RANK3>() ?
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE2 :
+ fapi2::ENUM_ATTR_EFF_VREF_DQ_TRAIN_RANGE_RANGE1;
FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_VREF_DQ_TRAIN_VALUE, iv_mcs, l_vref_dq_train_value),
"Failed setting attribute for ATTR_EFF_VREF_DQ_TRAIN_VALUE");
@@ -4090,7 +4102,7 @@ fapi2::ReturnCode eff_dimm::dram_trrd_s()
l_trrd_s_in_nck);
}
- FAPI_TRY( trrd_s( iv_dimm, iv_dram_width, l_jedec_trrd) );
+ FAPI_TRY( trrd_s( iv_dimm, iv_dram_width, iv_freq, l_jedec_trrd) );
// Taking the worst case between the required minimum JEDEC value and the proposed value from SPD
if (l_jedec_trrd != l_trrd_s_in_nck)
@@ -4166,7 +4178,7 @@ fapi2::ReturnCode eff_dimm::dram_trrd_l()
l_trrd_l_in_nck);
}
- FAPI_TRY( trrd_l( iv_dimm, iv_dram_width, l_jedec_trrd) );
+ FAPI_TRY( trrd_l( iv_dimm, iv_dram_width, iv_freq, l_jedec_trrd) );
// Taking the worst case between the required minimum JEDEC value and the proposed value from SPD
if (l_jedec_trrd != l_trrd_l_in_nck)
@@ -4265,7 +4277,7 @@ fapi2::ReturnCode eff_dimm::dram_tfaw()
l_tfaw_in_nck);
}
- FAPI_TRY( mss::tfaw(iv_dimm, iv_dram_width, l_jedec_tfaw_in_nck), "Failed tfaw()" );
+ FAPI_TRY( mss::tfaw(iv_dimm, iv_dram_width, iv_freq, l_jedec_tfaw_in_nck), "Failed tfaw()" );
// Taking the worst case between the required minimum JEDEC value and the proposed value from SPD
if (l_jedec_tfaw_in_nck != l_tfaw_in_nck)
@@ -4334,11 +4346,15 @@ fapi2::ReturnCode eff_dimm::dram_tras()
// which will give the best timing value for the dimm
// (like 2400 MT/s) which may be different than the system
// speed (if we were being limited by VPD or MRW restrictions)
- const uint64_t l_tras_in_ps = mss::tras(iv_dimm);
+ uint64_t l_tras_in_ps;
+ uint64_t l_freq = 0;
+ uint8_t l_tras_in_nck = 0;
// Calculate nck
std::vector<uint8_t> l_attrs_dram_tras(PORTS_PER_MCS, 0);
- uint8_t l_tras_in_nck = 0;
+
+ FAPI_TRY( freq(mss::find_target<fapi2::TARGET_TYPE_MCBIST>(iv_dimm), l_freq) );
+ l_tras_in_ps = mss::tras(iv_dimm, l_freq);
// Cast needed for calculations to be done on the same integral type
// as required by template deduction. We have iv_tCK_in_ps as a signed
@@ -4471,20 +4487,22 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::dram_rtt_nom()
{
- constexpr uint8_t DRAM_RTT_VALUES[NUM_VALID_RANKS_CONFIGS] =
- {
- 0b111, // 2R - 34Ohm
- 0b111, // 4R - 34Ohm
- };
+ std::vector< uint64_t > l_ranks;
+ uint8_t l_decoder_val = 0;
uint8_t l_mcs_attrs[PORTS_PER_MCS][MAX_DIMM_PER_PORT][MAX_RANK_PER_DIMM] = {};
FAPI_TRY( eff_dram_rtt_nom(iv_mcs, &l_mcs_attrs[0][0][0]) );
- for(uint64_t l_rank = 0; l_rank < MAX_RANK_PER_DIMM; ++l_rank)
+ // Get the value from the LRDIMM SPD
+ FAPI_TRY( iv_spd_decoder.dram_rtt_nom(iv_freq, l_decoder_val));
+
+ // Plug into every rank position for the attribute so it'll fit the same style as the RDIMM value
+ // Same value for every rank for LRDIMMs
+ FAPI_TRY(mss::rank::ranks(iv_dimm, l_ranks));
+
+ for (const auto& l_rank : l_ranks)
{
- // Gets the ODT scheme for the DRAM for this DIMM - we only want to toggle ODT to the DIMM we are writing to
- // We do a bitwise mask here to only get the ODT for the current DIMM
- l_mcs_attrs[iv_port_index][iv_dimm_index][mss::index(l_rank)] = DRAM_RTT_VALUES[iv_master_ranks_index];
+ l_mcs_attrs[iv_port_index][iv_dimm_index][mss::index(l_rank)] = l_decoder_val;
}
FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_DRAM_RTT_NOM, iv_mcs, l_mcs_attrs) );
@@ -4553,25 +4571,22 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::dram_rtt_wr()
{
- constexpr uint8_t DRAM_RTT_VALUES[NUM_VALID_RANKS_CONFIGS] =
- {
- 0b000, // 2R - disable
- 0b001, // 4R - 120Ohm
- };
+ std::vector< uint64_t > l_ranks;
+ uint8_t l_decoder_val = 0;
uint8_t l_mcs_attrs[PORTS_PER_MCS][MAX_DIMM_PER_PORT][MAX_RANK_PER_DIMM] = {};
FAPI_TRY( eff_dram_rtt_wr(iv_mcs, &l_mcs_attrs[0][0][0]) );
- // The host is in charge of ensuring good termination from the buffer to the DRAM
- // That means that we need to know and set the settings
- // Currently, our SI team thinks that the 2R single drop open power settings will work for BUP
- // We're going to hard code in those settings the above story can be used as a catchall to improve settings if need be
- // Loops through all ranks
- for(uint64_t l_rank = 0; l_rank < MAX_RANK_PER_DIMM; ++l_rank)
+ // Get the value from the LRDIMM SPD
+ FAPI_TRY( iv_spd_decoder.dram_rtt_wr(iv_freq, l_decoder_val));
+
+ // Plug into every rank position for the attribute so it'll fit the same style as the RDIMM value
+ // Same value for every rank for LRDIMMs
+ FAPI_TRY(mss::rank::ranks(iv_dimm, l_ranks));
+
+ for (const auto& l_rank : l_ranks)
{
- // Gets the ODT scheme for the DRAM for this DIMM - we only want to toggle ODT to the DIMM we are writing to
- // We do a bitwise mask here to only get the ODT for the current DIMM
- l_mcs_attrs[iv_port_index][iv_dimm_index][l_rank] = DRAM_RTT_VALUES[iv_master_ranks_index];
+ l_mcs_attrs[iv_port_index][iv_dimm_index][mss::index(l_rank)] = l_decoder_val;
}
// Set the attribute
@@ -4632,28 +4647,27 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::dram_rtt_park()
{
- constexpr uint8_t DRAM_RTT_VALUES[NUM_VALID_RANKS_CONFIGS] =
- {
- 0b000, // 2R - disable
- 0b010, // 4R - 120Ohm
- };
-
uint8_t l_mcs_attrs[PORTS_PER_MCS][MAX_DIMM_PER_PORT][MAX_RANK_PER_DIMM] = {};
+ uint8_t l_decoder_val_01 = 0;
+ uint8_t l_decoder_val_23 = 0;
FAPI_TRY( eff_dram_rtt_park(iv_mcs, &l_mcs_attrs[0][0][0]) );
- // The host is in charge of ensuring good termination from the buffer to the DRAM
- // That means that we need to know and set the settings
- // Currently, our SI team thinks that the 2R single drop open power settings will work for BUP
- // We're going to hard code in those settings the above story can be used as a catchall to improve settings if need be
- // Loops through all ranks
- for(uint64_t l_rank = 0; l_rank < MAX_RANK_PER_DIMM; ++l_rank)
- {
- // Gets the ODT scheme for the DRAM for this DIMM - we only want to toggle ODT to the DIMM we are writing to
- // We do a bitwise mask here to only get the ODT for the current DIMM
- l_mcs_attrs[iv_port_index][iv_dimm_index][mss::index(l_rank)] = DRAM_RTT_VALUES[iv_master_ranks_index];
- }
+ // Get the value from the LRDIMM SPD
+ FAPI_TRY( iv_spd_decoder.dram_rtt_park_ranks0_1(iv_freq, l_decoder_val_01),
+ "%s failed to decode RTT_PARK for ranks 0/1", mss::c_str(iv_mcs) );
+ FAPI_TRY( iv_spd_decoder.dram_rtt_park_ranks2_3(iv_freq, l_decoder_val_23),
+ "%s failed to decode RTT_PARK for ranks 2/3", mss::c_str(iv_mcs) );
+ // Setting the four rank values for this dimm
+ // Rank 0 and 1 have the same value, l_decoder_val_01
+ // Rank 2 and 3 have the same value, l_decoder_val_23
+ l_mcs_attrs[iv_port_index][iv_dimm_index][ATTR_RANK0] = l_decoder_val_01;
+ l_mcs_attrs[iv_port_index][iv_dimm_index][ATTR_RANK1] = l_decoder_val_01;
+ l_mcs_attrs[iv_port_index][iv_dimm_index][ATTR_RANK2] = l_decoder_val_23;
+ l_mcs_attrs[iv_port_index][iv_dimm_index][ATTR_RANK3] = l_decoder_val_23;
+
+ // Set the attribute
FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_DRAM_RTT_PARK, iv_mcs, l_mcs_attrs) );
fapi_try_exit:
@@ -4956,13 +4970,18 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::dimm_bc04()
{
+ uint8_t l_decoder_val = 0;
// Retrieve MCS attribute data
uint8_t l_attrs_dimm_bc04[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
FAPI_TRY( eff_dimm_ddr4_bc04(iv_mcs, &l_attrs_dimm_bc04[0][0]) );
- // Taken from SI spreadsheet and JEDEC - we want 60 Ohms, so 0x01 for a value
- l_attrs_dimm_bc04[iv_port_index][iv_dimm_index] = 0x01;
+ // So the encoding from the SPD is the same as the encoding for the buffer control encoding
+ // Simple grab and insert
+ // Value is checked in decoder function for validity
+ FAPI_TRY( iv_spd_decoder.data_buffer_mdq_rtt(iv_freq, l_decoder_val) );
+ l_attrs_dimm_bc04[iv_port_index][iv_dimm_index] = l_decoder_val;
+ // Update MCS attribute
FAPI_INF("%s: BC04 settting (MDQ_RTT): %d", mss::c_str(iv_dimm), l_attrs_dimm_bc04[iv_port_index][iv_dimm_index] );
FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_DIMM_DDR4_BC04, iv_mcs, l_attrs_dimm_bc04) );
@@ -4980,20 +4999,20 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::dimm_bc05()
{
- // Taken from the SI spreadsheet - we want 34 Ohms so 0x01
- fapi2::buffer<uint8_t> l_result(0x01);
+ uint8_t l_decoder_val = 0;
// Retrieve MCS attribute data
uint8_t l_attrs_dimm_bc05[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
FAPI_TRY( eff_dimm_ddr4_bc05(iv_mcs, &l_attrs_dimm_bc05[0][0]) );
- // Using a writeBit for clarity sake
- // Enabling DQ/DQS drivers
- l_result.writeBit<BC05_DRAM_DQ_DRIVER_DISABLE_POS>(BC05_DRAM_DQ_DRIVER_ENABLE);
- l_attrs_dimm_bc05[iv_port_index][iv_dimm_index] = l_result;
+ // Same as BC04, grab from SPD and put into BC
+ FAPI_TRY( iv_spd_decoder.data_buffer_mdq_drive_strength(iv_freq, l_decoder_val) );
+ l_attrs_dimm_bc05[iv_port_index][iv_dimm_index] = l_decoder_val;
- FAPI_INF("%s: BC05 settting (MDQ Drive Strength): 0x%02x", mss::c_str(iv_dimm),
+ FAPI_INF("%s: BC05 settting (MDQ Drive Strength): %d", mss::c_str(iv_dimm),
l_attrs_dimm_bc05[iv_port_index][iv_dimm_index] );
+
+ // Updates the attribute
FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_DIMM_DDR4_BC05, iv_mcs, l_attrs_dimm_bc05) );
fapi_try_exit:
@@ -5514,20 +5533,17 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::dimm_f5bc6x()
{
- constexpr uint8_t VREF_73PERCENT = 0x14;
- constexpr uint8_t VREF_83PERCENT = 0x24;
- constexpr uint8_t RD_VREF[NUM_VALID_RANKS_CONFIGS] =
- {
- VREF_73PERCENT, // 2 ranks per DIMM
- VREF_83PERCENT, // 4 ranks per DIMM
- };
+ uint8_t l_decode = 0;
uint8_t l_attrs_dimm_f5bc6x[PORTS_PER_MCS][MAX_DIMM_PER_PORT] = {};
// Retrieve MCS attribute data
FAPI_TRY( eff_dimm_ddr4_f5bc6x(iv_mcs, &l_attrs_dimm_f5bc6x[0][0]) );
+ // Gets the SPD value
+ FAPI_TRY( iv_spd_decoder.data_buffer_vref_dq(l_decode));
+
// F5BC6x is just the VREF training range
- l_attrs_dimm_f5bc6x[iv_port_index][iv_dimm_index] = RD_VREF[iv_master_ranks_index];
+ l_attrs_dimm_f5bc6x[iv_port_index][iv_dimm_index] = l_decode;
FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_EFF_DIMM_DDR4_F5BC6x, iv_mcs, l_attrs_dimm_f5bc6x),
"Failed setting attribute for ATTR_EFF_DIMM_DDR4_F5BC6x");
@@ -5678,7 +5694,7 @@ fapi2::ReturnCode eff_dimm::decode_vpd(const fapi2::Target<TARGET_TYPE_MCS>& i_t
set_MAX(mss::VPD_KEYWORD_MAX).
set_ACTUAL(l_vpd_info.iv_size).
set_KEYWORD(fapi2::MemVpdData::MT).
- set_MCS_TARGET(i_target),
+ set_VPD_TARGET(i_target),
"VPD MT keyword size retrieved: %d, is larger than max: %d for %s",
l_vpd_info.iv_size, mss::VPD_KEYWORD_MAX, mss::c_str(i_target));
@@ -5702,7 +5718,7 @@ fapi2::ReturnCode eff_dimm::decode_vpd(const fapi2::Target<TARGET_TYPE_MCS>& i_t
set_MAX(mss::VPD_KEYWORD_MAX).
set_ACTUAL(l_vpd_info.iv_size).
set_KEYWORD(fapi2::MemVpdData::MR).
- set_MCS_TARGET(i_target),
+ set_VPD_TARGET(i_target),
"VPD MR keyword size retrieved: %d, is larger than max: %d for %s",
l_vpd_info.iv_size, mss::VPD_KEYWORD_MAX, mss::c_str(i_target));
@@ -5723,7 +5739,7 @@ fapi2::ReturnCode eff_dimm::decode_vpd(const fapi2::Target<TARGET_TYPE_MCS>& i_t
set_MAX(mss::VPD_KEYWORD_MAX).
set_ACTUAL(l_vpd_info.iv_size).
set_KEYWORD(fapi2::MemVpdData::CK).
- set_MCS_TARGET(i_target),
+ set_VPD_TARGET(i_target),
"VPD CK keyword size retrieved: %d, is larger than max: %d for %s",
l_vpd_info.iv_size, mss::VPD_KEYWORD_MAX, mss::c_str(i_target));
@@ -5742,7 +5758,7 @@ fapi2::ReturnCode eff_dimm::decode_vpd(const fapi2::Target<TARGET_TYPE_MCS>& i_t
set_MAX(mss::VPD_KEYWORD_MAX).
set_ACTUAL(l_vpd_info.iv_size).
set_KEYWORD(fapi2::MemVpdData::DQ).
- set_MCS_TARGET(i_target),
+ set_VPD_TARGET(i_target),
"VPD DQ keyword size retrieved: %d, is larger than max: %d for %s",
l_vpd_info.iv_size, mss::VPD_KEYWORD_MAX, mss::c_str(i_target));
@@ -5989,10 +6005,13 @@ fapi_try_exit:
///
fapi2::ReturnCode eff_lrdimm::odt_wr()
{
+ // Values were obtained experimentally
+ // For 2R, opposite termination is ideal
+ // For 4R, terminating everything is ideal
constexpr uint8_t DRAM_ODT_VALUES[NUM_VALID_RANKS_CONFIGS][MAX_RANK_PER_DIMM] =
{
{ 0x44, 0x88, 0x00, 0x00, }, // 2 ranks per DIMM
- { 0x44, 0x88, 0x44, 0x88, }, // 4 ranks per DIMM
+ { 0xcc, 0xcc, 0xcc, 0xcc, }, // 4 ranks per DIMM
};
// Masks on the ODT for a specific DIMM
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H
index f60adaf7c..477b7114c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/eff_dimm.H
@@ -38,7 +38,7 @@
#include <generic/memory/lib/spd/common/rcw_settings.H>
#include <lib/spd/spd_factory.H>
#include <lib/eff_config/timing.H>
-#include <generic/memory/lib/data_engine/pre_data_init.H>
+#include <lib/eff_config/pre_data_init.H>
#include <generic/memory/lib/spd/spd_utils.H>
namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H
deleted file mode 100644
index ee707c821..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H
+++ /dev/null
@@ -1,263 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,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 */
-
-///
-/// @file dimm.H
-/// @brief Encapsulation for dimms of all types
-///
-// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
-// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: HB:FSP
-
-#ifndef _MSS_DIMM_H_
-#define _MSS_DIMM_H_
-
-#include <fapi2.H>
-
-#include <lib/mss_attribute_accessors.H>
-#include <generic/memory/lib/utils/c_str.H>
-
-namespace mss
-{
-
-namespace dimm
-{
-
-///
-/// @class mss::dimm::kind
-/// @brief A class containing information about a dimm like ranks, density, configuration - what kind of dimm is it?
-///
-class kind
-{
- public:
-
- ///
- /// @brief Generate a vector of DIMM kind from a vector of DIMM
- /// @param[in] i_dimm a vector of DIMM
- /// @return std::vector of dimm::kind relating to the DIMM passed in
- ///
- static std::vector<kind> vector(const std::vector<fapi2::Target<fapi2::TARGET_TYPE_DIMM>>& i_dimm)
- {
- std::vector<kind> l_kinds;
-
- for (const auto& d : i_dimm)
- {
- l_kinds.push_back( kind(d) );
- }
-
- return l_kinds;
- }
-
- ///
- /// @brief operator=() - assign kinds (needed to sort vectors of kinds)
- /// @param[in] i_rhs the right hand side of the assignment statement
- /// @return reference to this
- ///
- inline kind& operator=(const kind& i_rhs)
- {
- iv_target = i_rhs.iv_target;
- iv_master_ranks = i_rhs.iv_master_ranks;
- iv_total_ranks = i_rhs.iv_total_ranks;
- iv_dram_density = i_rhs.iv_dram_density;
- iv_dram_width = i_rhs.iv_dram_width;
- iv_dram_generation = i_rhs.iv_dram_generation;
- iv_dimm_type = i_rhs.iv_dimm_type;
- iv_rows = i_rhs.iv_rows;
- iv_size = i_rhs.iv_size;
- iv_mfgid = i_rhs.iv_mfgid;
- iv_stack_type = i_rhs.iv_stack_type;
- iv_hybrid = i_rhs.iv_hybrid;
- iv_hybrid_memory_type = i_rhs.iv_hybrid_memory_type;
- iv_rcd_mfgid = i_rhs.iv_rcd_mfgid;
- return *this;
- }
-
- ///
- /// @brief operator==() - are two kinds the same?
- /// @param[in] i_rhs the right hand side of the comparison statement
- /// @return bool true iff the two kind are of the same kind
- /// @warning this does not compare the targets (iv_target,) just the values
- /// Also does not compare the mfgid as that's not really part of the DIMM kind but is additional information
- ///
- inline bool operator==(const kind& i_rhs) const
- {
- return ((iv_master_ranks == i_rhs.iv_master_ranks) &&
- (iv_total_ranks == i_rhs.iv_total_ranks) &&
- (iv_dram_density == i_rhs.iv_dram_density) &&
- (iv_dram_width == i_rhs.iv_dram_width) &&
- (iv_dram_generation == i_rhs.iv_dram_generation) &&
- (iv_dimm_type == i_rhs.iv_dimm_type) &&
- (iv_rows == i_rhs.iv_rows) &&
- (iv_size == i_rhs.iv_size) &&
- (iv_stack_type == i_rhs.iv_stack_type) &&
- (iv_hybrid == i_rhs.iv_hybrid) &&
- (iv_hybrid_memory_type == i_rhs.iv_hybrid_memory_type) &&
- (iv_rcd_mfgid == i_rhs.iv_rcd_mfgid));
- }
-
- ///
- /// @brief operator!=() - are two kinds different?
- /// @param[in] i_rhs the right hand side of the comparison statement
- /// @return bool true iff the two kind are of different
- /// @warning this does not compare the targets (iv_target,) just the values
- ///
- inline bool operator!=(const kind& i_rhs) const
- {
- return !(this->operator==(i_rhs));
- }
-
- ///
- /// @brief Construct a dimm::kind data structure - information about the kind of DIMM this is
- /// @param[in] i_target a DIMM target
- ///
- kind(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target):
- iv_target(i_target)
- {
- FAPI_TRY( mss::eff_dram_gen(i_target, iv_dram_generation) );
- FAPI_TRY( mss::eff_dimm_type(i_target, iv_dimm_type) );
- FAPI_TRY( mss::eff_dram_density(i_target, iv_dram_density) );
- FAPI_TRY( mss::eff_dram_width(i_target, iv_dram_width) );
- FAPI_TRY( mss::eff_num_master_ranks_per_dimm(i_target, iv_master_ranks) );
- FAPI_TRY( mss::eff_num_ranks_per_dimm(i_target, iv_total_ranks) );
- FAPI_TRY( mss::eff_dram_row_bits(i_target, iv_rows) );
- FAPI_TRY( mss::eff_dimm_size(i_target, iv_size) );
- FAPI_TRY( mss::eff_dram_mfg_id(i_target, iv_mfgid) );
- FAPI_TRY( mss::eff_prim_stack_type( i_target, iv_stack_type) );
- FAPI_TRY( mss::eff_hybrid( i_target, iv_hybrid ));
- FAPI_TRY( mss::eff_hybrid_memory_type( i_target, iv_hybrid_memory_type ));
- FAPI_TRY( mss::eff_rcd_mfg_id(i_target, iv_rcd_mfgid) );
- return;
-
- fapi_try_exit:
- // Not 100% sure what to do here ...
- FAPI_ERR("error initializing DIMM structure: %s 0x%016lx", mss::c_str(i_target), uint64_t(fapi2::current_err));
- fapi2::Assert(false);
- }
-
- ///
- /// @brief Construct a DIMM kind used to identify this DIMM for tables.
- /// @param[in] i_master_ranks number of master ranks on the DIMM
- /// @param[in] i_total_ranks total number of ranks on the DIMM
- /// @param[in] i_dram_density density of the DRAM
- /// @param[in] i_dram_width width of the DRAM
- /// @param[in] i_dram_generation DRAM generation
- /// @param[in] i_dimm_type DIMM type (e.g. RDIMM)
- /// @param[in] i_rows number of rows in the DRAM
- /// @param[in] i_size the overal size of the DIMM in GB
- /// @param[in] i_mfgid the dram manufacturer id of the dimm, defaulted to 0
- /// @param[in] i_stack_type dram die type, single die package or 3DS
- /// @param[in] i_hybrid, default not hybrid
- /// @param[in] i_hybrid_memory_type, defult none
- /// @param[in] i_rcd_mfgid dimm register and data buffer manufacturer id, default 0
- /// @note can't be constexpr as fapi2::Target doesn't have a constexpr ctor.
- ///
- kind( const uint8_t i_master_ranks,
- const uint8_t i_total_ranks,
- const uint8_t i_dram_density,
- const uint8_t i_dram_width,
- const uint8_t i_dram_generation,
- const uint8_t i_dimm_type,
- const uint8_t i_rows,
- const uint32_t i_size,
- const uint16_t i_mfgid = 0,
- const uint8_t i_stack_type = fapi2::ENUM_ATTR_EFF_PRIM_STACK_TYPE_SDP,
- const uint8_t i_hybrid = fapi2::ENUM_ATTR_EFF_HYBRID_NOT_HYBRID,
- const uint8_t i_hybrid_memory_type = fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NONE,
- const uint16_t i_rcd_mfgid = 0):
- iv_target(0),
- iv_master_ranks(i_master_ranks),
- iv_total_ranks(i_total_ranks),
- iv_dram_density(i_dram_density),
- iv_dram_width(i_dram_width),
- iv_dram_generation(i_dram_generation),
- iv_dimm_type(i_dimm_type),
- iv_rows(i_rows),
- // TK consider calculating size rather than requiring it be set.
- iv_size(i_size),
- iv_mfgid(i_mfgid),
- iv_stack_type(i_stack_type),
- iv_hybrid(i_hybrid),
- iv_hybrid_memory_type(i_hybrid_memory_type),
- iv_rcd_mfgid(i_rcd_mfgid)
- {
- // Bit of an idiot-check to be sure a hand-crafted dimm::kind make sense wrt slaves, masters, packages, etc.
- // Both of these are checked in eff_config. If they are messed up, they should be caught there
- if (iv_master_ranks > iv_total_ranks)
- {
- FAPI_ERR("Not enough total ranks? master: %d total: %d",
- iv_master_ranks,
- iv_total_ranks);
- fapi2::Assert(false);
- }
-
- if ((iv_total_ranks % iv_master_ranks) != 0)
- {
- FAPI_ERR("total or master ranks seems incorrect. master: %d total: %d",
- iv_master_ranks,
- iv_total_ranks);
- fapi2::Assert(false);
- }
- }
-
- fapi2::Target<fapi2::TARGET_TYPE_DIMM> iv_target;
- uint8_t iv_master_ranks;
- uint8_t iv_total_ranks;
- uint8_t iv_dram_density;
- uint8_t iv_dram_width;
- uint8_t iv_dram_generation;
- uint8_t iv_dimm_type;
- uint8_t iv_rows;
- uint32_t iv_size;
- uint16_t iv_mfgid;
- uint8_t iv_stack_type;
- uint8_t iv_hybrid;
- uint8_t iv_hybrid_memory_type;
- uint16_t iv_rcd_mfgid;
-
- ///
- /// @brief equal_config
- /// @param[in] i_input_compare the i_kind to compare against
- /// @return bool true iff the two kind are of the same kind for xlate purposes
- /// @warning this does not compare the targets (iv_target,), mfgid, prim_stack_type nor hybrid type
- ///
- inline bool equal_config(const kind& i_input_compare) const
- {
- return ((iv_master_ranks == i_input_compare.iv_master_ranks) &&
- (iv_total_ranks == i_input_compare.iv_total_ranks) &&
- (iv_dram_density == i_input_compare.iv_dram_density) &&
- (iv_dram_width == i_input_compare.iv_dram_width) &&
- (iv_dram_generation == i_input_compare.iv_dram_generation) &&
- (iv_dimm_type == i_input_compare.iv_dimm_type) &&
- (iv_rows == i_input_compare.iv_rows) &&
- (iv_size == i_input_compare.iv_size));
- }
-};
-
-}
-
-}
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.C
index aae4cce28..8928a6f98 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.C
@@ -62,7 +62,7 @@ fapi2::ReturnCode mrs_load<TARGET_TYPE_MCA>( const fapi2::Target<TARGET_TYPE_MCA
const auto& l_mcbist = mss::find_target<TARGET_TYPE_MCBIST>(i_target);
// A vector of CCS instructions. We'll ask the targets to fill it, and then we'll execute it
- ccs::program<TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
// Clear the initial delays. This will force the CCS engine to recompute the delay based on the
// instructions in the CCS instruction vector
@@ -72,7 +72,17 @@ fapi2::ReturnCode mrs_load<TARGET_TYPE_MCA>( const fapi2::Target<TARGET_TYPE_MCA
for ( const auto& d : find_targets<TARGET_TYPE_DIMM>(i_target) )
{
FAPI_DBG("mrs load for %s", mss::c_str(d));
- FAPI_TRY( perform_mrs_load(d, l_program.iv_instructions) );
+
+ // TK - break out the nvdimm stuff into function
+ if (i_nvdimm_workaround)
+ {
+ FAPI_DBG("nvdimm workaround detected. loading mrs for restore sequence");
+ FAPI_TRY( ddr4::mrs_load_nvdimm(d, l_program.iv_instructions) );
+ }
+ else
+ {
+ FAPI_TRY( perform_mrs_load(d, l_program.iv_instructions) );
+ }
}
// We have to configure the CCS engine to let it know which port these instructions are
@@ -121,7 +131,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_mrs_load<DEFAULT_KIND>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_type = 0;
uint8_t l_gen = 0;
@@ -151,7 +161,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_mrs_load<KIND_RDIMM_DDR4>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_DBG("perform mrs_load for %s [expecting rdimm (ddr4)]", mss::c_str(i_target));
FAPI_TRY( ddr4::mrs_load(i_target, io_inst) );
@@ -168,7 +178,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_mrs_load<KIND_LRDIMM_DDR4>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_DBG("perform mrs_load for %s [expecting lrdimm (ddr4)]", mss::c_str(i_target));
FAPI_TRY( ddr4::mrs_load(i_target, io_inst) );
@@ -186,7 +196,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_mrs_load<FORCE_DISPATCH>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
uint8_t l_type = 0;
uint8_t l_gen = 0;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H
index f19679bc7..f18050f12 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/mrs_load.H
@@ -38,10 +38,13 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/shared/mss_kind.H>
-#include <lib/ccs/ccs.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
namespace mss
{
@@ -90,15 +93,15 @@ struct mrs_data
// The attribute getter. For MRS we pass in the ARR0 of the CCS instruction
// as that allows us to encapsulate the attribute processing and the bit
// manipulation in one function.
- fapi2::ReturnCode (*iv_func)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&, ccs::instruction_t<T>&, const uint64_t);
- fapi2::ReturnCode (*iv_dumper)(const ccs::instruction_t<T>&, const uint64_t);
+ fapi2::ReturnCode (*iv_func)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&, ccs::instruction_t&, const uint64_t);
+ fapi2::ReturnCode (*iv_dumper)(const ccs::instruction_t&, const uint64_t);
// The delay needed after this MRS word is written
uint64_t iv_delay;
mrs_data( const uint64_t i_mrs,
- fapi2::ReturnCode (*i_func)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&, ccs::instruction_t<T>&, const uint64_t),
- fapi2::ReturnCode (*i_dumper)(const ccs::instruction_t<T>&, const uint64_t),
+ fapi2::ReturnCode (*i_func)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&, ccs::instruction_t&, const uint64_t),
+ fapi2::ReturnCode (*i_dumper)(const ccs::instruction_t&, const uint64_t),
const uint64_t i_delay ):
iv_mrs(i_mrs),
iv_func(i_func),
@@ -174,7 +177,7 @@ struct perform_mrs_load_overload< KIND_LRDIMM_DDR4 >
template< mss::kind_t K = FORCE_DISPATCH >
typename std::enable_if< perform_mrs_load_overload<DEFAULT_KIND>::available, fapi2::ReturnCode>::type
perform_mrs_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Function to perform mrs load overloads
@@ -186,7 +189,7 @@ perform_mrs_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
///
template<>
fapi2::ReturnCode perform_mrs_load<FORCE_DISPATCH>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Function to perform mrs load overloads
/// @param[in] i_target the dimm target for the mrs's
@@ -197,7 +200,7 @@ fapi2::ReturnCode perform_mrs_load<FORCE_DISPATCH>( const fapi2::Target<fapi2::T
///
template<>
fapi2::ReturnCode perform_mrs_load<DEFAULT_KIND>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Function to perform mrs load overloads
/// @param[in] i_kind the i_target's dimm_kind struct
@@ -208,7 +211,7 @@ fapi2::ReturnCode perform_mrs_load<DEFAULT_KIND>( const fapi2::Target<fapi2::TAR
template< kind_t K, bool B = perform_mrs_load_overload<K>::available >
inline fapi2::ReturnCode perform_mrs_load_dispatch( const kind_t& i_kind,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// We dispatch to another kind if:
// We don't have an overload defined (B == false)
@@ -232,7 +235,7 @@ inline fapi2::ReturnCode perform_mrs_load_dispatch( const kind_t& i_kind,
template<>
inline fapi2::ReturnCode perform_mrs_load_dispatch<DEFAULT_KIND>(const kind_t&,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
return perform_mrs_load<DEFAULT_KIND>(i_target, io_inst);
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C
deleted file mode 100644
index fa45be920..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C
+++ /dev/null
@@ -1,24 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2019 */
-/* [+] 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 */
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H
new file mode 100644
index 000000000..6c8d16bc0
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H
@@ -0,0 +1,85 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/dimm/nimbus_kind.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file nimbus_kind.H
+/// @brief Encapsulation for dimms of all types
+///
+// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
+// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#ifndef _MSS_NIMBUS_KIND_H_
+#define _MSS_NIMBUS_KIND_H_
+
+#include <fapi2.H>
+
+#include <lib/shared/mss_const.H>
+#include <lib/mss_attribute_accessors.H>
+#include <generic/memory/lib/utils/c_str.H>
+#include <generic/memory/lib/utils/dimm/kind.H>
+
+namespace mss
+{
+
+namespace dimm
+{
+
+///
+/// @class mss::dimm::kind specilization for NIMBUS
+/// @brief A class containing information about a dimm like ranks, density, configuration - what kind of dimm is it?
+///
+template<>
+inline kind<mss::mc_type::NIMBUS>::kind(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) :
+ iv_target(i_target),
+ iv_module_height(0)
+{
+ FAPI_TRY( mss::eff_dram_gen(i_target, iv_dram_generation) );
+ FAPI_TRY( mss::eff_dimm_type(i_target, iv_dimm_type) );
+ FAPI_TRY( mss::eff_dram_density(i_target, iv_dram_density) );
+ FAPI_TRY( mss::eff_dram_width(i_target, iv_dram_width) );
+ FAPI_TRY( mss::eff_num_master_ranks_per_dimm(i_target, iv_master_ranks) );
+ FAPI_TRY( mss::eff_num_ranks_per_dimm(i_target, iv_total_ranks) );
+ FAPI_TRY( mss::eff_dram_row_bits(i_target, iv_rows) );
+ FAPI_TRY( mss::eff_dimm_size(i_target, iv_size) );
+ FAPI_TRY( mss::eff_dram_mfg_id(i_target, iv_mfgid) );
+ FAPI_TRY( mss::eff_prim_stack_type( i_target, iv_stack_type) );
+ FAPI_TRY( mss::eff_hybrid( i_target, iv_hybrid ));
+ FAPI_TRY( mss::eff_hybrid_memory_type( i_target, iv_hybrid_memory_type ));
+ FAPI_TRY( mss::eff_rcd_mfg_id(i_target, iv_rcd_mfgid) );
+ return;
+
+fapi_try_exit:
+ // Not 100% sure what to do here ...
+ FAPI_ERR("error initializing DIMM structure: %s 0x%016lx", mss::c_str(i_target), uint64_t(fapi2::current_err));
+ fapi2::Assert(false);
+}
+
+
+} //ns dimm
+} //ns mss
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.C
index 37af40a5b..1026634b1 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2019 */
+/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -902,6 +902,25 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief Return a vector of rank numbers which represent the ranks for this dimm
+/// @param[in] i_dimm_target TARGET_TYPE_DIMM
+/// @param[out] o_ranks a vector of ranks for dimm (numbers)
+/// @return FAPI2_RC_SUCCESS iff all is ok
+///
+template<>
+fapi2::ReturnCode ranks_on_dimm_helper<mss::mc_type::NIMBUS>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&
+ i_dimm_target,
+ std::vector<uint64_t>& o_ranks)
+{
+ std::vector<uint64_t> l_ranks;
+ FAPI_TRY( mss::rank::ranks(i_dimm_target, l_ranks) );
+ o_ranks = l_ranks;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
} // namespace rank
} // namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.H
index 901ed1a8c..130697bbb 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rank.H
@@ -41,7 +41,7 @@
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
#include <generic/memory/lib/utils/scom.H>
-#include <lib/utils/num.H>
+#include <generic/memory/lib/utils/num.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/shared/mss_const.H>
#include <lib/phy/phy_cntrl.H>
@@ -1033,7 +1033,7 @@ inline fapi2::ReturnCode set_rank_field( const fapi2::Target<T>& i_target,
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK()
.set_RANK(i_rank)
- .set_MCA_TARGET(i_target)
+ .set_PORT_TARGET(i_target)
.set_FUNCTION(SET_RANK_FIELD),
"%s Invalid rank (%d) in set_rank_field",
mss::c_str(i_target),
@@ -1101,7 +1101,7 @@ inline fapi2::ReturnCode get_rank_field( const fapi2::Target<T>& i_target,
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK()
.set_RANK(i_rank)
- .set_MCA_TARGET(i_target)
+ .set_PORT_TARGET(i_target)
.set_FUNCTION(GET_RANK_FIELD),
"%s Invalid rank (%d) in get_ranks_in_pair",
mss::c_str(i_target),
@@ -1171,7 +1171,7 @@ inline fapi2::ReturnCode set_pair_valid( const fapi2::Target<T>& i_target,
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK()
.set_RANK(i_rank)
- .set_MCA_TARGET(i_target)
+ .set_PORT_TARGET(i_target)
.set_FUNCTION(SET_PAIR_VALID),
"%s Invalid rank (%d) in get_ranks_in_pair",
mss::c_str(i_target),
@@ -1243,7 +1243,7 @@ inline fapi2::ReturnCode get_pair_valid( const fapi2::Target<T> i_target,
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK()
.set_RANK(i_rank)
- .set_MCA_TARGET(i_target)
+ .set_PORT_TARGET(i_target)
.set_FUNCTION(GET_PAIR_VALID),
"%s Invalid rank (%d) passed into get get_pair_valid",
mss::c_str(i_target),
@@ -1350,7 +1350,7 @@ fapi2::ReturnCode get_ranks_in_pair( const fapi2::Target<T>& i_target,
FAPI_ASSERT( l_ordinal < MAX_RANK_PER_DIMM,
fapi2::MSS_INVALID_RANK()
.set_RANK(l_ordinal)
- .set_MCA_TARGET(i_target)
+ .set_PORT_TARGET(i_target)
.set_FUNCTION(GET_RANKS_IN_PAIR),
"%s Invalid rank (%d) in set_ranks_in_pair",
mss::c_str(i_target),
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.C
index c999666cd..17bba3a88 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,7 +38,7 @@
#include <mss.H>
#include <lib/dimm/rcd_load.H>
#include <lib/dimm/rcd_load_ddr4.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
@@ -60,7 +60,7 @@ fapi2::ReturnCode rcd_load<TARGET_TYPE_MCA>( const fapi2::Target<TARGET_TYPE_MCA
const auto& l_mcbist = mss::find_target<TARGET_TYPE_MCBIST>(i_target);
// A vector of CCS instructions. We'll ask the targets to fill it, and then we'll execute it
- ccs::program<TARGET_TYPE_MCBIST> l_program;
+ ccs::program l_program;
uint8_t l_sim = 0;
// Clear the initial delays. This will force the CCS engine to recompute the delay based on the
@@ -76,7 +76,7 @@ fapi2::ReturnCode rcd_load<TARGET_TYPE_MCA>( const fapi2::Target<TARGET_TYPE_MCA
// So we use the power down entry command to achieve this
if(!l_sim)
{
- l_program.iv_instructions.push_back( ccs::pde_command<TARGET_TYPE_MCBIST>() );
+ l_program.iv_instructions.push_back( ccs::pde_command() );
}
FAPI_DBG("rcd load for %s", mss::c_str(d));
@@ -119,7 +119,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_rcd_load<DEFAULT_KIND>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& i_inst)
+ std::vector< ccs::instruction_t >& i_inst)
{
uint8_t l_type = 0;
uint8_t l_gen = 0;
@@ -149,7 +149,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_rcd_load<KIND_RDIMM_DDR4>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& i_inst)
+ std::vector< ccs::instruction_t >& i_inst)
{
uint8_t l_sim = 0;
FAPI_TRY( mss::is_simulation(l_sim) );
@@ -170,7 +170,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_rcd_load<KIND_LRDIMM_DDR4>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& i_inst)
+ std::vector< ccs::instruction_t >& i_inst)
{
uint8_t l_sim = 0;
FAPI_TRY( mss::is_simulation(l_sim) );
@@ -191,7 +191,7 @@ fapi_try_exit:
///
template<>
fapi2::ReturnCode perform_rcd_load<FORCE_DISPATCH>( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& i_inst)
+ std::vector< ccs::instruction_t >& i_inst)
{
uint8_t l_type = 0;
uint8_t l_gen = 0;
@@ -206,4 +206,32 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief Helper function to bring CKE high and hold for 400 cycles
+/// @param[in] i_target MCA target on which to operate
+/// @return FAPI2_RC_SUCCESS if and only if ok
+///
+fapi2::ReturnCode draminit_cke_helper( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target)
+{
+
+ auto l_des = mss::ccs::des_command();
+ mss::ccs::program l_program;
+
+ // Also a Deselect command must be registered as required from the Spec.
+ // Register DES instruction, which pulls CKE high. Idle 400 cycles, and then begin RCD loading
+ // Note: This only is sent to one of the MCA as we still have the mux_addr_sel bit set, meaning
+ // we'll PDE/DES all DIMM at the same time.
+ l_des.arr1.insertFromRight<MCBIST_CCS_INST_ARR1_00_IDLES, MCBIST_CCS_INST_ARR1_00_IDLES_LEN>(400);
+ l_program.iv_instructions.push_back(l_des);
+
+ FAPI_TRY( mss::ccs::execute(mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target),
+ l_program,
+ i_target),
+ "%s Failed execute in p9_mss_draminit",
+ mss::c_str(i_target) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
} // namespace
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H
index b9ee410d6..bfb73ae92 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,9 +39,11 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
-
#include <generic/memory/lib/utils/c_str.H>
#include <lib/shared/mss_kind.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
namespace mss
{
@@ -112,7 +114,7 @@ struct perform_rcd_load_overload< KIND_LRDIMM_DDR4 >
template< mss::kind_t K = FORCE_DISPATCH >
typename std::enable_if< perform_rcd_load_overload<DEFAULT_KIND>::available, fapi2::ReturnCode>::type
perform_rcd_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& i_inst);
+ std::vector< ccs::instruction_t >& i_inst);
//
// We know we registered overloads for perform_rcd_load, so we need the entry point to
@@ -121,11 +123,11 @@ perform_rcd_load( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
//
template<>
fapi2::ReturnCode perform_rcd_load<FORCE_DISPATCH>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& i_inst);
+ std::vector< ccs::instruction_t >& i_inst);
template<>
fapi2::ReturnCode perform_rcd_load<DEFAULT_KIND>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& i_inst);
+ std::vector< ccs::instruction_t >& i_inst);
///
/// @brief Start the rcd_load_dispatch boilerplate -- specialization for recursion dispatcher
@@ -137,7 +139,7 @@ fapi2::ReturnCode perform_rcd_load<DEFAULT_KIND>( const fapi2::Target<fapi2::TAR
template< kind_t K, bool B = perform_rcd_load_overload<K>::available >
inline fapi2::ReturnCode perform_rcd_load_dispatch( const kind_t& i_kind,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& i_inst)
+ std::vector< ccs::instruction_t >& i_inst)
{
// We dispatch to another kind if:
// We don't have an overload defined (B == false)
@@ -162,10 +164,17 @@ inline fapi2::ReturnCode perform_rcd_load_dispatch( const kind_t& i_kind,
template<>
inline fapi2::ReturnCode perform_rcd_load_dispatch<DEFAULT_KIND>(const kind_t&,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& i_inst)
+ std::vector< ccs::instruction_t >& i_inst)
{
return perform_rcd_load<DEFAULT_KIND>(i_target, i_inst);
}
+///
+/// @brief Helper function to bring CKE high and hold for 400 cycles
+/// @param[in] i_target MCA target on which to operate
+/// @return FAPI2_RC_SUCCESS if and only if ok
+///
+fapi2::ReturnCode draminit_cke_helper( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target);
+
}
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.C
index 690b7e180..d9cc10e5b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -60,7 +60,7 @@ namespace mss
///
fapi2::ReturnCode rcd_load_ddr4( const fapi2::Target<TARGET_TYPE_DIMM>& i_target,
const bool i_sim,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
FAPI_INF("rcd_load_ddr4 %s", mss::c_str(i_target));
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H
index bb70c20b6..0c6f8162c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/rcd_load_ddr4.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,6 +53,6 @@ namespace mss
///
fapi2::ReturnCode rcd_load_ddr4( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const bool i_sim,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
}
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc.H
deleted file mode 100644
index 5a657edac..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc.H
+++ /dev/null
@@ -1,789 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,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 */
-
-///
-/// @file ecc.H
-/// @brief Top level API for MSS ECC
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_ECC_H_
-#define _MSS_ECC_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/address.H>
-#include <lib/ecc/ecc_traits.H>
-#include <lib/ecc/galois.H>
-#include <lib/ecc/hw_mark_store.H>
-#include <lib/ecc/fw_mark_store.H>
-#include <lib/ecc/mainline_nce_trap.H>
-#include <lib/ecc/mainline_rce_trap.H>
-#include <lib/ecc/mainline_mpe_trap.H>
-#include <lib/ecc/mainline_ue_trap.H>
-#include <lib/ecc/mainline_aue_trap.H>
-#include <lib/ecc/mbs_error_vector_trap.H>
-#include <lib/ecc/maint_current_trap.H>
-#include <lib/ecc/read_error_count_regs.H>
-#include <lib/ecc/modal_symbol_count.H>
-#include <lib/ecc/mark_shadow_reg.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-///
-/// @brief Get Hardware Mark Store
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_rank the desired rank
-/// @param[out] o_galois the Galois code of the mark
-/// @param[out] o_confirmed true if the mark is a chipmark
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_hwms( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- uint64_t& o_galois,
- mss::states& o_confirmed )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::hwms::read(i_target, i_rank, l_buffer) );
- mss::ecc::hwms::get_chipmark(l_buffer, o_galois);
- mss::ecc::hwms::get_confirmed(l_buffer, o_confirmed);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Set Hardware Mark Store
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_rank the desired rank
-/// @param[in] i_galois the Galois code of the mark, or set to 0 to clear mark
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode set_hwms( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_galois )
-{
- fapi2::buffer<uint64_t> l_buffer;
- uint8_t l_symbol = 0;
-
- // galois value of 0 means to clear the mark so only fill in fields if non-zero
- if (i_galois != 0)
- {
- // check for valid Galois code
- FAPI_TRY( mss::ecc::galois_to_symbol( (uint8_t)i_galois, l_symbol) );
-
- mss::ecc::hwms::set_chipmark(l_buffer, i_galois);
- mss::ecc::hwms::set_confirmed(l_buffer, mss::YES);
- mss::ecc::hwms::set_exit_1(l_buffer, mss::YES);
- }
-
- FAPI_TRY( mss::ecc::hwms::write(i_target, i_rank, l_buffer) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Firmware Mark Store
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_rank the desired rank
-/// @param[out] o_galois the Galois code of the mark
-/// @param[out] o_type the type code of the mark
-/// @param[out] o_region the region code of the mark
-/// @param[out] o_address the starting address of the mark
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_fwms( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- uint64_t& o_galois,
- mss::ecc::fwms::mark_type& o_type,
- mss::ecc::fwms::mark_region& o_region,
- mss::mcbist::address& o_address )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::fwms::read(i_target, i_rank, l_buffer) );
- mss::ecc::fwms::get_mark(l_buffer, o_galois);
- mss::ecc::fwms::get_type(l_buffer, o_type);
- mss::ecc::fwms::get_region(l_buffer, o_region);
- mss::ecc::fwms::get_address(l_buffer, o_address);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Set Firmware Mark Store
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_rank the desired rank
-/// @param[in] i_galois the Galois code of the mark, or set to 0 to clear mark
-/// @param[in] i_type the type code of the mark
-/// @param[in] i_region the region code of the mark
-/// @param[in] i_address the starting address of the mark
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode set_fwms( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_galois,
- const mss::ecc::fwms::mark_type i_type,
- const mss::ecc::fwms::mark_region i_region,
- const mss::mcbist::address i_address )
-{
- fapi2::buffer<uint64_t> l_buffer = 0;
- uint8_t l_symbol = 0;
-
- // galois value of 0 means to clear the mark so only fill in fields if non-zero
- if (i_galois != 0)
- {
- // check for valid Galois code
- FAPI_TRY( mss::ecc::galois_to_symbol( (uint8_t)i_galois, l_symbol) );
-
- mss::ecc::fwms::set_mark(l_buffer, i_galois);
- mss::ecc::fwms::set_type(l_buffer, i_type);
- mss::ecc::fwms::set_region(l_buffer, i_region);
- mss::ecc::fwms::set_address(l_buffer, i_address);
- mss::ecc::fwms::set_exit_1(l_buffer, mss::YES);
- }
-
- FAPI_TRY( mss::ecc::fwms::write(i_target, i_rank, l_buffer) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Query Hardware Marks
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_marks vector of Galois codes of any marks set
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-/// @note no rank information is returned
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_hw_marks( const fapi2::Target<T>& i_target,
- std::vector<uint64_t>& o_marks )
-{
- fapi2::buffer<uint64_t> l_buffer;
- uint64_t l_galois = 0;
- auto l_confirmed = mss::states::NO;
-
- o_marks.clear();
-
- for (uint64_t l_rank = 0; l_rank < MAX_MRANK_PER_PORT; ++l_rank)
- {
- FAPI_TRY( get_hwms(i_target, l_rank, l_galois, l_confirmed) );
-
- if (l_confirmed == mss::states::YES)
- {
- o_marks.push_back(l_galois);
- }
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Query Firmware Marks
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_marks vector of Galois codes of any marks set
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-/// @note no rank information is returned
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_fw_marks( const fapi2::Target<T>& i_target,
- std::vector<uint64_t>& o_marks )
-{
- fapi2::buffer<uint64_t> l_buffer;
- uint64_t l_galois = 0;
- auto l_type = mss::ecc::fwms::mark_type::CHIP;
- auto l_region = mss::ecc::fwms::mark_region::UNIVERSAL;
- mss::mcbist::address l_address;
-
- o_marks.clear();
-
- for (uint64_t l_rank = 0; l_rank < MAX_MRANK_PER_PORT; ++l_rank)
- {
- FAPI_TRY( get_fwms(i_target, l_rank, l_galois, l_type, l_region, l_address) );
-
- if (l_region != mss::ecc::fwms::mark_region::DISABLED)
- {
- o_marks.push_back(l_galois);
- }
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline NCE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the trap address of the last mainline nce
-/// @param[out] o_on_rce mss::YES if nce is part of an rce
-/// @param[out] o_is_tce mss::YES if nce is a tce
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_nce_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address,
- mss::states& o_on_rce,
- mss::states& o_is_tce )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mainline_nce_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_nce_trap::get_address(l_buffer, o_address);
- mss::ecc::mainline_nce_trap::get_nce_on_rce(l_buffer, o_on_rce);
- mss::ecc::mainline_nce_trap::get_nce_is_tce(l_buffer, o_is_tce);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline NCE error vector traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_galois the Galois code
-/// @param[out] o_magnitude the magnitude of the error
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_nce_error_vector_trap( const fapi2::Target<T>& i_target,
- uint64_t& o_galois,
- uint64_t& o_magnitude )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mbs_error_vector_trap::read(i_target, l_buffer) );
- mss::ecc::mbs_error_vector_trap::get_nce_galois(i_target, l_buffer, o_galois);
- mss::ecc::mbs_error_vector_trap::get_nce_magnitude(i_target, l_buffer, o_magnitude);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline TCE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the trap address of the last mainline nce
-/// @param[out] o_on_rce mss::YES if nce is part of an rce
-/// @param[out] o_is_tce mss::YES if nce is a tce
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_tce_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address,
- mss::states& o_on_rce,
- mss::states& o_is_tce )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mainline_nce_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_nce_trap::get_address(l_buffer, o_address);
- mss::ecc::mainline_nce_trap::get_nce_on_rce(l_buffer, o_on_rce);
- mss::ecc::mainline_nce_trap::get_nce_is_tce(l_buffer, o_is_tce);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline TCE error vector traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_nce_galois the Galois code
-/// @param[out] o_nce_magnitude the magnitude of the error
-/// @param[out] o_tce_galois the Galois code
-/// @param[out] o_tce_magnitude the magnitude of the error
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_tce_error_vector_trap( const fapi2::Target<T>& i_target,
- uint64_t& o_nce_galois,
- uint64_t& o_nce_magnitude,
- uint64_t& o_tce_galois,
- uint64_t& o_tce_magnitude )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mbs_error_vector_trap::read(i_target, l_buffer) );
- mss::ecc::mbs_error_vector_trap::get_nce_galois(i_target, l_buffer, o_nce_galois);
- mss::ecc::mbs_error_vector_trap::get_nce_magnitude(i_target, l_buffer, o_nce_magnitude);
- mss::ecc::mbs_error_vector_trap::get_tce_galois(i_target, l_buffer, o_tce_galois);
- mss::ecc::mbs_error_vector_trap::get_tce_magnitude(i_target, l_buffer, o_tce_magnitude);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline MPE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the trap address of the last mainline mpe
-/// @param[out] o_on_rce mss::YES if mpe is part of an rce
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_mpe_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address,
- mss::states& o_on_rce )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mainline_mpe_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_mpe_trap::get_address(l_buffer, o_address);
- mss::ecc::mainline_mpe_trap::get_mpe_on_rce(l_buffer, o_on_rce);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline RCE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the trap address of the last mainline rce
-/// @param[out] o_nce_on_rce mss::YES if nce is part of an rce
-/// @param[out] o_tce_on_rce mss::YES if tce is part of an rce
-/// @param[out] o_mpe_on_rce mss::YES if mpe is part of an rce
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_rce_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address,
- mss::states& o_nce_on_rce,
- mss::states& o_tce_on_rce,
- mss::states& o_mpe_on_rce )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mainline_rce_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_rce_trap::get_address(l_buffer, o_address);
-
- FAPI_TRY( mss::ecc::mainline_nce_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_nce_trap::get_nce_on_rce(l_buffer, o_nce_on_rce);
- mss::ecc::mainline_nce_trap::get_nce_is_tce(l_buffer, o_tce_on_rce);
-
- FAPI_TRY( mss::ecc::mainline_mpe_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_mpe_trap::get_mpe_on_rce(l_buffer, o_mpe_on_rce);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline UE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the trap address of the last mainline ue
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_ue_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mainline_ue_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_ue_trap::get_address(l_buffer, o_address);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Mainline AUE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the trap address of the last mainline aue
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_aue_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mainline_aue_trap::read(i_target, l_buffer) );
- mss::ecc::mainline_aue_trap::get_address(l_buffer, o_address);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get IMPE address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_chipmark the mark location (Galois code) of the last mark placed
-/// @param[out] o_rank the rank of the last mark placed
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_impe_addr_trap( const fapi2::Target<T>& i_target,
- uint64_t& o_chipmark,
- uint64_t& o_rank )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mark_shadow_reg::read(i_target, l_buffer) );
- mss::ecc::mark_shadow_reg::get_chipmark(l_buffer, o_chipmark);
- mss::ecc::mark_shadow_reg::get_rank(l_buffer, o_rank);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Maint Current address traps
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_address the last address executed
-/// @param[out] o_port_trap port value if MCBCFGQ_cfg_current_addr_trap_update_dis == 0
-/// @param[out] o_dimm_trap dimm value if MCBCFGQ_cfg_current_addr_trap_update_dis == 0
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_maint_current_addr_trap( const fapi2::Target<T>& i_target,
- mss::mcbist::address& o_address,
- uint64_t& o_port_trap,
- uint64_t& o_dimm_trap )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::maint_current_trap::read(i_target, l_buffer) );
- mss::ecc::maint_current_trap::get_address(l_buffer, o_address);
- mss::ecc::maint_current_trap::get_port(l_buffer, o_port_trap);
- mss::ecc::maint_current_trap::get_dimm(l_buffer, o_dimm_trap);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Per Symbol Error Counts
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_error_counts vector of symbol error counts
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode get_per_symbol_error_counts( const fapi2::Target<T>& i_target,
- std::vector<uint64_t>& o_error_counts )
-{
- fapi2::buffer<uint64_t> l_buffer;
- uint64_t l_count = 0;
- o_error_counts.clear();
-
- for (uint64_t l_index = 0; l_index < TT::NUM_MBSSYM_REGS; ++l_index)
- {
- FAPI_TRY( mss::ecc::modal_symbol_count::read(i_target, l_index, l_buffer) );
-
- for (uint64_t l_symbol = 0; l_symbol < TT::MODAL_SYMBOL_COUNTERS_PER_REG; ++l_symbol)
- {
- l_count = 0;
- mss::ecc::modal_symbol_count::get_count(l_buffer, l_symbol, l_count);
- o_error_counts.push_back(l_count);
- }
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Intermittent NCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of intermittent NCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_intermittent_nce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg0::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg0::get_intermittent_ce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Soft NCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of soft NCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_soft_nce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg0::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg0::get_soft_ce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Hard NCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of hard NCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_hard_nce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg0::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg0::get_hard_ce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Intermittent MCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of intermittent MCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_intermittent_mce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg0::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg0::get_intermittent_mce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Soft MCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of soft MCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_soft_mce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg0::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg0::get_soft_mce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get Hard MCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of hard MCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_hard_mce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg1::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg1::get_hard_mce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get ICE (IMPE) error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of ICE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_ice_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg1::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg1::get_ice_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get UE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of UE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_ue_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg1::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg1::get_ue_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get AUE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of AUE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_aue_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg1::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg1::get_aue_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get RCE error count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_count count of RCE events
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_rce_count( const fapi2::Target<T>& i_target,
- uint64_t& o_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::read_error_count_reg1::read(i_target, l_buffer) );
- mss::ecc::read_error_count_reg1::get_rce_count(l_buffer, o_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Get MCE symbol count
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_symbol0_count count of symbol 0 errors
-/// @param[out] o_symbol1_count count of symbol 1 errors
-/// @param[out] o_symbol2_count count of symbol 2 errors
-/// @param[out] o_symbol3_count count of symbol 3 errors
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode get_mce_symbol_count( const fapi2::Target<T>& i_target,
- uint64_t& o_symbol0_count,
- uint64_t& o_symbol1_count,
- uint64_t& o_symbol2_count,
- uint64_t& o_symbol3_count )
-{
- fapi2::buffer<uint64_t> l_buffer;
-
- FAPI_TRY( mss::ecc::mark_symbol_count_reg::read(i_target, l_buffer) );
- mss::ecc::mark_symbol_count_reg::get_symbol0_count(l_buffer, o_symbol0_count);
- mss::ecc::mark_symbol_count_reg::get_symbol1_count(l_buffer, o_symbol1_count);
- mss::ecc::mark_symbol_count_reg::get_symbol2_count(l_buffer, o_symbol2_count);
- mss::ecc::mark_symbol_count_reg::get_symbol3_count(l_buffer, o_symbol3_count);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Clear all MAINT.ECC counters
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the fapi2 target
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode clear_all_counters( const fapi2::Target<T>& i_target )
-{
- return ( mss::mcbist::reset_errors(i_target) );
-}
-
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.C b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.C
deleted file mode 100644
index de58c465c..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.C
+++ /dev/null
@@ -1,68 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file ecc_traits.C
-/// @brief Traits class for the MC ECC syndrome registers
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#include <fapi2.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-// we need these declarations here in order for the linker to see the definitions
-// in the eccTraits class
-constexpr const uint64_t eccTraits<fapi2::TARGET_TYPE_MCA>::MAINLINE_NCE_REGS[];
-constexpr const uint64_t eccTraits<fapi2::TARGET_TYPE_MCA>::MAINLINE_RCE_REGS[];
-constexpr const uint64_t eccTraits<fapi2::TARGET_TYPE_MCA>::MAINLINE_MPE_REGS[];
-constexpr const uint64_t eccTraits<fapi2::TARGET_TYPE_MCA>::MAINLINE_UE_REGS[];
-constexpr const uint64_t eccTraits<fapi2::TARGET_TYPE_MCA>::MAINLINE_AUE_REGS[];
-constexpr const uint64_t eccTraits<fapi2::TARGET_TYPE_MCA>::ERROR_VECTOR_REGS[];
-
-constexpr const uint8_t eccTraits<fapi2::TARGET_TYPE_MCA>::symbol2galois[];
-constexpr const uint8_t eccTraits<fapi2::TARGET_TYPE_MCA>::symbol2dq[];
-
-// Definition of the symbol error count registers
-const std::vector< uint64_t > eccTraits<fapi2::TARGET_TYPE_MCBIST>::SYMBOL_COUNT_REG =
-{
- MCBIST_MBSSYMEC0Q,
- MCBIST_MBSSYMEC1Q,
- MCBIST_MBSSYMEC2Q,
- MCBIST_MBSSYMEC3Q,
- MCBIST_MBSSYMEC4Q,
- MCBIST_MBSSYMEC5Q,
- MCBIST_MBSSYMEC6Q,
- MCBIST_MBSSYMEC7Q,
- MCBIST_MBSSYMEC8Q,
-};
-
-} // close namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.H
deleted file mode 100644
index 7be0ef146..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.H
+++ /dev/null
@@ -1,331 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file ecc_traits.H
-/// @brief Traits class for the MC ECC syndrome registers
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_ECC_TRAITS_H_
-#define _MSS_ECC_TRAITS_H_
-
-#include <p9_mc_scom_addresses.H>
-#include <p9_mc_scom_addresses_fld.H>
-#include <lib/shared/mss_const.H>
-
-namespace mss
-{
-
-///
-/// @class eccTraits
-/// @brief a collection of traits associated with the MC ECC interface
-/// @tparam T fapi2::TargetType representing the memory controller
-///
-template< fapi2::TargetType T >
-class eccTraits;
-
-///
-/// @class eccTraits
-/// @brief a collection of traits associated with the Centaur MC ECC interface
-///
-template<>
-class eccTraits<fapi2::TARGET_TYPE_MBA>
-{
-};
-
-///
-/// @class eccTraits
-/// @brief a collection of traits associated with the Nimbus MC ECC interface
-///
-template<>
-class eccTraits<fapi2::TARGET_TYPE_MCA>
-{
- public:
- // MCA ECC registers - must be 64 bits.
- static constexpr uint64_t HARDWARE_MS0_REG = MCA_HWMS0;
- static constexpr uint64_t HARDWARE_MS1_REG = MCA_WDF_HWMS1;
- static constexpr uint64_t HARDWARE_MS2_REG = MCA_HWMS2;
- static constexpr uint64_t HARDWARE_MS3_REG = MCA_HWMS3;
- static constexpr uint64_t HARDWARE_MS4_REG = MCA_HWMS4;
- static constexpr uint64_t HARDWARE_MS5_REG = MCA_HWMS5;
- static constexpr uint64_t HARDWARE_MS6_REG = MCA_HWMS6;
- static constexpr uint64_t HARDWARE_MS7_REG = MCA_HWMS7;
- static constexpr uint64_t FIRMWARE_MS0_REG = MCA_FWMS0;
- static constexpr uint64_t FIRMWARE_MS1_REG = MCA_WREITE_FWMS1;
- static constexpr uint64_t FIRMWARE_MS2_REG = MCA_FWMS2;
- static constexpr uint64_t FIRMWARE_MS3_REG = MCA_FWMS3;
- static constexpr uint64_t FIRMWARE_MS4_REG = MCA_FWMS4;
- static constexpr uint64_t FIRMWARE_MS5_REG = MCA_FWMS5;
- static constexpr uint64_t FIRMWARE_MS6_REG = MCA_FWMS6;
- static constexpr uint64_t FIRMWARE_MS7_REG = MCA_FWMS7;
- static constexpr uint64_t MARK_SHADOW_REG = MCA_MSR;
-
- // MCBIST ECC registers - Register API uses an MCA target instead
- // of MCBIST since MCA's relative position is needed to find
- // correct reg+field
- constexpr static const uint64_t MAINLINE_NCE_REGS[] =
- {
- MCBIST_MBNCER0Q,
- MCBIST_MBNCER1Q,
- MCBIST_MBNCER2Q,
- MCBIST_MBNCER3Q,
- };
-
- constexpr static const uint64_t MAINLINE_RCE_REGS[] =
- {
- MCBIST_MBRCER0Q,
- MCBIST_MBRCER1Q,
- MCBIST_MBRCER2Q,
- MCBIST_MBRCER3Q
- };
-
- constexpr static const uint64_t MAINLINE_MPE_REGS[] =
- {
- MCBIST_MBMPER0Q,
- MCBIST_MBMPER1Q,
- MCBIST_MBMPER2Q,
- MCBIST_MBMPER3Q
- };
-
- constexpr static const uint64_t MAINLINE_UE_REGS[] =
- {
- MCBIST_MBUER0Q,
- MCBIST_MBUER1Q,
- MCBIST_MBUER2Q,
- MCBIST_MBUER3Q
- };
-
- constexpr static const uint64_t MAINLINE_AUE_REGS[] =
- {
- MCBIST_MBAUER0Q,
- MCBIST_MBAUER1Q,
- MCBIST_MBAUER2Q,
- MCBIST_MBAUER3Q
- };
-
- // Note that these registers store info for a pair of ports
- // (thus the duplication)
- constexpr static const uint64_t ERROR_VECTOR_REGS[] =
- {
- MCBIST_MBSEVR0Q,
- MCBIST_MBSEVR0Q,
- MCBIST_MBSEVR1Q,
- MCBIST_MBSEVR1Q
- };
-
- // Fields, can be any size.
- enum
- {
- HARDWARE_MS_CHIPMARK = MCA_HWMS0_CHIPMARK,
- HARDWARE_MS_CHIPMARK_LEN = MCA_HWMS0_CHIPMARK_LEN,
- HARDWARE_MS_CONFIRMED = MCA_HWMS0_CONFIRMED,
- HARDWARE_MS_EXIT1 = MCA_HWMS0_EXIT_1,
- FIRMWARE_MS_MARK = MCA_FWMS0_MARK,
- FIRMWARE_MS_MARK_LEN = MCA_FWMS0_MARK_LEN,
- FIRMWARE_MS_TYPE = MCA_FWMS0_TYPE,
- FIRMWARE_MS_REGION = MCA_FWMS0_REGION,
- FIRMWARE_MS_REGION_LEN = MCA_FWMS0_REGION_LEN,
- FIRMWARE_MS_ADDRESS = MCA_FWMS0_ADDRESS,
- FIRMWARE_MS_ADDRESS_LEN = MCA_FWMS0_ADDRESS_LEN,
- FIRMWARE_MS_EXIT1 = MCA_FWMS0_EXIT_1,
- NCE_ADDR_TRAP = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_ADDR_TRAP,
- NCE_ADDR_TRAP_LEN = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_ADDR_TRAP_LEN,
- NCE_ON_RCE = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_ON_RCE,
- NCE_IS_TCE = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_IS_TCE,
- RCE_ADDR_TRAP = MCBIST_MBRCER0Q_PORT_0_MAINLINE_RCE_ADDR_TRAP,
- RCE_ADDR_TRAP_LEN = MCBIST_MBRCER0Q_PORT_0_MAINLINE_RCE_ADDR_TRAP_LEN,
- MPE_ADDR_TRAP = MCBIST_MBMPER0Q_PORT_0_MAINLINE_MPE_ADDR_TRAP,
- MPE_ADDR_TRAP_LEN = MCBIST_MBMPER0Q_PORT_0_MAINLINE_MPE_ADDR_TRAP_LEN,
- MPE_ON_RCE = MCBIST_MBMPER0Q_PORT_0_MAINLINE_MPE_ON_RCE,
- UE_ADDR_TRAP = MCBIST_MBUER0Q_PORT_0_MAINLINE_UE_ADDR_TRAP,
- UE_ADDR_TRAP_LEN = MCBIST_MBUER0Q_PORT_0_MAINLINE_UE_ADDR_TRAP_LEN,
- AUE_ADDR_TRAP = MCBIST_MBAUER0Q_PORT_0_MAINLINE_AUE_ADDR_TRAP,
- AUE_ADDR_TRAP_LEN = MCBIST_MBAUER0Q_PORT_0_MAINLINE_AUE_ADDR_TRAP_LEN,
- P0_NCE_GALOIS = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_GALOIS_FIELD,
- P0_NCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_GALOIS_FIELD_LEN,
- P0_NCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_MAGNITUDE_FIELD,
- P0_NCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_MAGNITUDE_FIELD_LEN,
- P0_TCE_GALOIS = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_GALOIS_FIELD,
- P0_TCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_GALOIS_FIELD_LEN,
- P0_TCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_MAGNITUDE_FIELD,
- P0_TCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_MAGNITUDE_FIELD_LEN,
- P1_NCE_GALOIS = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_GALOIS_FIELD,
- P1_NCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_GALOIS_FIELD_LEN,
- P1_NCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_MAGNITUDE_FIELD,
- P1_NCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_MAGNITUDE_FIELD_LEN,
- P1_TCE_GALOIS = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_GALOIS_FIELD,
- P1_TCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_GALOIS_FIELD_LEN,
- P1_TCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_MAGNITUDE_FIELD,
- P1_TCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_MAGNITUDE_FIELD_LEN,
- CURRENT_ADDR_TRAP = MCBIST_MCBMCATQ_CFG_CURRENT_ADDR_TRAP,
- CURRENT_ADDR_TRAP_LEN = MCBIST_MCBMCATQ_CFG_CURRENT_ADDR_TRAP_LEN,
- CURRENT_PORT = MCBIST_MCBMCATQ_CFG_CURRENT_PORT_TRAP,
- CURRENT_PORT_LEN = MCBIST_MCBMCATQ_CFG_CURRENT_PORT_TRAP_LEN,
- CURRENT_DIMM = MCBIST_MCBMCATQ_CFG_CURRENT_DIMM_TRAP,
- SHADOW_CHIPMARK = MCA_MSR_CHIPMARK,
- SHADOW_CHIPMARK_LEN = MCA_MSR_CHIPMARK_LEN,
- SHADOW_RANK = MCA_MSR_RANK,
- SHADOW_RANK_LEN = MCA_MSR_RANK_LEN,
-
- };
-
- // Symbol to Galois code mapping table
- // Reference: Nimbus workbook, Section 13.1.6.2: Firmware Mark Store
- constexpr static const uint8_t symbol2galois[] =
- {
- 0x80, 0xa0, 0x90, 0xf0,
- 0x08, 0x0a, 0x09, 0x0f,
- 0x98, 0xda, 0xb9, 0x7f,
- 0x91, 0xd7, 0xb2, 0x78,
- 0x28, 0xea, 0x49, 0x9f,
- 0x9a, 0xd4, 0xbd, 0x76,
- 0x60, 0xb0, 0xc0, 0x20,
- 0x06, 0x0b, 0x0c, 0x02,
- 0xc6, 0xfb, 0x1c, 0x42,
- 0xca, 0xf4, 0x1d, 0x46,
- 0xd6, 0x8b, 0x3c, 0xc2,
- 0xcb, 0xf3, 0x1f, 0x4e,
- 0xe0, 0x10, 0x50, 0xd0,
- 0x0e, 0x01, 0x05, 0x0d,
- 0x5e, 0x21, 0xa5, 0x3d,
- 0x5b, 0x23, 0xaf, 0x3e,
- 0xfe, 0x61, 0x75, 0x5d,
- 0x51, 0x27, 0xa2, 0x38
- };
-
- // Symbol to DQ index mapping table
- // Reference: Nimbus workbook, Section 13.1.6.2: Firmware Mark Store
- constexpr static const uint8_t symbol2dq[] =
- {
- 71, 70, 69, 68,
- 67, 66, 65, 64,
- 63, 62, 61, 60,
- 55, 54, 53, 52,
- 47, 46, 45, 44,
- 39, 38, 37, 36,
- 31, 30, 29, 28,
- 23, 22, 21, 20,
- 15, 14, 13, 12,
- 7, 6, 5, 4,
- 59, 58, 57, 56,
- 51, 50, 49, 48,
- 43, 42, 41, 40,
- 35, 34, 33, 32,
- 27, 26, 25, 24,
- 19, 18, 17, 16,
- 11, 10, 9, 8,
- 3, 2, 1, 0
- };
-
-};
-
-///
-/// @class eccTraits
-/// @brief a collection of traits associated with the Nimbus MC ECC interface
-///
-template<>
-class eccTraits<fapi2::TARGET_TYPE_MCBIST>
-{
- public:
- // MCBIST ECC registers - must be 64 bits.
- static constexpr uint64_t READ_ERROR_COUNT_REG0 = MCBIST_MBSEC0Q;
- static constexpr uint64_t READ_ERROR_COUNT_REG1 = MCBIST_MBSEC1Q;
- static constexpr uint64_t MARK_SYMBOL_COUNT_REG = MCBIST_MBSMSECQ;
- static constexpr uint64_t MODAL_SYM_COUNT0_REG = MCBIST_MBSSYMEC0Q;
- static constexpr uint64_t MODAL_SYM_COUNT1_REG = MCBIST_MBSSYMEC1Q;
- static constexpr uint64_t MODAL_SYM_COUNT2_REG = MCBIST_MBSSYMEC2Q;
- static constexpr uint64_t MODAL_SYM_COUNT3_REG = MCBIST_MBSSYMEC3Q;
- static constexpr uint64_t MODAL_SYM_COUNT4_REG = MCBIST_MBSSYMEC4Q;
- static constexpr uint64_t MODAL_SYM_COUNT5_REG = MCBIST_MBSSYMEC5Q;
- static constexpr uint64_t MODAL_SYM_COUNT6_REG = MCBIST_MBSSYMEC6Q;
- static constexpr uint64_t MODAL_SYM_COUNT7_REG = MCBIST_MBSSYMEC7Q;
- static constexpr uint64_t MODAL_SYM_COUNT8_REG = MCBIST_MBSSYMEC8Q;
-
- // Stores the symbol counter registers in a vector for easier access for MCBIST
- static const std::vector<uint64_t> SYMBOL_COUNT_REG;
-
- // Fields, can be any size.
- enum
- {
- INTERMITTENT_CE_COUNT = MCBIST_MBSEC0Q_INTERMITTENT_CE_COUNT,
- INTERMITTENT_CE_COUNT_LEN = MCBIST_MBSEC0Q_INTERMITTENT_CE_COUNT_LEN,
- SOFT_CE_COUNT = MCBIST_MBSEC0Q_SOFT_CE_COUNT,
- SOFT_CE_COUNT_LEN = MCBIST_MBSEC0Q_SOFT_CE_COUNT_LEN,
- HARD_CE_COUNT = MCBIST_MBSEC0Q_HARD_CE_COUNT,
- HARD_CE_COUNT_LEN = MCBIST_MBSEC0Q_HARD_CE_COUNT_LEN,
- INTERMITTENT_MCE_COUNT = MCBIST_MBSEC0Q_INTERMITTENT_MCE_COUNT,
- INTERMITTENT_MCE_COUNT_LEN = MCBIST_MBSEC0Q_INTERMITTENT_MCE_COUNT_LEN,
- SOFT_MCE_COUNT = MCBIST_MBSEC0Q_SOFT_MCE_COUNT,
- SOFT_MCE_COUNT_LEN = MCBIST_MBSEC0Q_SOFT_MCE_COUNT_LEN,
- HARD_MCE_COUNT = MCBIST_MBSEC1Q_HARD_MCE_COUNT,
- HARD_MCE_COUNT_LEN = MCBIST_MBSEC1Q_HARD_MCE_COUNT_LEN,
- ICE_COUNT = MCBIST_MBSEC1Q_ICE_COUNT,
- ICE_COUNT_LEN = MCBIST_MBSEC1Q_ICE_COUNT_LEN,
- UE_COUNT = MCBIST_MBSEC1Q_UE_COUNT,
- UE_COUNT_LEN = MCBIST_MBSEC1Q_UE_COUNT_LEN,
- AUE_COUNT = MCBIST_MBSEC1Q_AUE,
- AUE_COUNT_LEN = MCBIST_MBSEC1Q_AUE_LEN,
- RCE_COUNT = MCBIST_MBSEC1Q_RCE_COUNT,
- RCE_COUNT_LEN = MCBIST_MBSEC1Q_RCE_COUNT_LEN,
- SYMBOL0_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL0_COUNT,
- SYMBOL0_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL0_COUNT_LEN,
- SYMBOL1_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL1_COUNT,
- SYMBOL1_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL1_COUNT_LEN,
- SYMBOL2_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL2_COUNT,
- SYMBOL2_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL2_COUNT_LEN,
- SYMBOL3_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL3_COUNT,
- SYMBOL3_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL3_COUNT_LEN,
- MODAL_SYMBOL_COUNTER_00 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_00,
- MODAL_SYMBOL_COUNTER_00_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_00_LEN,
- MODAL_SYMBOL_COUNTER_01 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_01,
- MODAL_SYMBOL_COUNTER_01_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_01_LEN,
- MODAL_SYMBOL_COUNTER_02 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_02,
- MODAL_SYMBOL_COUNTER_02_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_02_LEN,
- MODAL_SYMBOL_COUNTER_03 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_03,
- MODAL_SYMBOL_COUNTER_03_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_03_LEN,
- MODAL_SYMBOL_COUNTER_04 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_04,
- MODAL_SYMBOL_COUNTER_04_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_04_LEN,
- MODAL_SYMBOL_COUNTER_05 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_05,
- MODAL_SYMBOL_COUNTER_05_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_05_LEN,
- MODAL_SYMBOL_COUNTER_06 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_06,
- MODAL_SYMBOL_COUNTER_06_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_06_LEN,
- MODAL_SYMBOL_COUNTER_07 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_07,
- MODAL_SYMBOL_COUNTER_07_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_07_LEN,
-
- // and a couple constants
- NUM_MBSSYM_REGS = 9,
- MODAL_SYMBOL_COUNTERS_PER_REG = 8,
- };
-
-};
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.C b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.C
index 196e6d509..3fd43e6a3 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.C
@@ -22,3 +22,49 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file ecc_traits_nimbus.C
+/// @brief Traits class for the MC ECC syndrome registers
+///
+// *HWP HWP Owner: Matthew Hickman <Matthew.Hickman@ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+#include <lib/shared/mss_const.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/ecc/ecc_traits_nimbus.H>
+
+namespace mss
+{
+
+// we need these declarations here in order for the linker to see the definitions
+// in the eccTraits class
+constexpr const uint64_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::MAINLINE_NCE_REGS[];
+constexpr const uint64_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::MAINLINE_RCE_REGS[];
+constexpr const uint64_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::MAINLINE_MPE_REGS[];
+constexpr const uint64_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::MAINLINE_UE_REGS[];
+constexpr const uint64_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::MAINLINE_AUE_REGS[];
+constexpr const uint64_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::ERROR_VECTOR_REGS[];
+
+constexpr const uint8_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::symbol2galois[];
+constexpr const uint8_t eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>::symbol2dq[];
+
+// Definition of the symbol error count registers
+const std::vector< uint64_t > eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCBIST>::SYMBOL_COUNT_REG =
+{
+ MCBIST_MBSSYMEC0Q,
+ MCBIST_MBSSYMEC1Q,
+ MCBIST_MBSSYMEC2Q,
+ MCBIST_MBSSYMEC3Q,
+ MCBIST_MBSSYMEC4Q,
+ MCBIST_MBSSYMEC5Q,
+ MCBIST_MBSSYMEC6Q,
+ MCBIST_MBSSYMEC7Q,
+ MCBIST_MBSSYMEC8Q,
+};
+
+} // close namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.H
index 55acc5ffc..6a13b0c41 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits_nimbus.H
@@ -22,3 +22,322 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file ecc_traits_nimbus.H
+/// @brief Traits class for the MC ECC syndrome registers
+///
+// *HWP HWP Owner: Matthew Hickman <Matthew.Hickman@ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB
+
+#ifndef _MSS_ECC_TRAITS_NIMBUS_H_
+#define _MSS_ECC_TRAITS_NIMBUS_H_
+
+#include <p9_mc_scom_addresses.H>
+#include <p9_mc_scom_addresses_fld.H>
+#include <lib/shared/mss_const.H>
+#include <generic/memory/lib/ecc/ecc_traits.H>
+
+namespace mss
+{
+
+///
+/// @class eccTraits
+/// @brief a collection of traits associated with the Nimbus MC ECC interface
+///
+template<>
+class eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>
+{
+ public:
+ // MCA ECC registers - must be 64 bits.
+ static constexpr uint64_t HARDWARE_MS0_REG = MCA_HWMS0;
+ static constexpr uint64_t HARDWARE_MS1_REG = MCA_WDF_HWMS1;
+ static constexpr uint64_t HARDWARE_MS2_REG = MCA_HWMS2;
+ static constexpr uint64_t HARDWARE_MS3_REG = MCA_HWMS3;
+ static constexpr uint64_t HARDWARE_MS4_REG = MCA_HWMS4;
+ static constexpr uint64_t HARDWARE_MS5_REG = MCA_HWMS5;
+ static constexpr uint64_t HARDWARE_MS6_REG = MCA_HWMS6;
+ static constexpr uint64_t HARDWARE_MS7_REG = MCA_HWMS7;
+ static constexpr uint64_t FIRMWARE_MS0_REG = MCA_FWMS0;
+ static constexpr uint64_t FIRMWARE_MS1_REG = MCA_WREITE_FWMS1;
+ static constexpr uint64_t FIRMWARE_MS2_REG = MCA_FWMS2;
+ static constexpr uint64_t FIRMWARE_MS3_REG = MCA_FWMS3;
+ static constexpr uint64_t FIRMWARE_MS4_REG = MCA_FWMS4;
+ static constexpr uint64_t FIRMWARE_MS5_REG = MCA_FWMS5;
+ static constexpr uint64_t FIRMWARE_MS6_REG = MCA_FWMS6;
+ static constexpr uint64_t FIRMWARE_MS7_REG = MCA_FWMS7;
+ static constexpr uint64_t MARK_SHADOW_REG = MCA_MSR;
+ static constexpr uint64_t ECC_MAX_MRANK_PER_PORT = MAX_MRANK_PER_PORT;
+ static constexpr uint64_t ECC_MAX_DQ_BITS = MAX_DQ_BITS;
+ static constexpr uint64_t ECC_MAX_SYMBOLS = MAX_DQ_BITS;
+
+ // MCBIST ECC registers - Register API uses an MCA target instead
+ // of MCBIST since MCA's relative position is needed to find
+ // correct reg+field
+ constexpr static const uint64_t MAINLINE_NCE_REGS[] =
+ {
+ MCBIST_MBNCER0Q,
+ MCBIST_MBNCER1Q,
+ MCBIST_MBNCER2Q,
+ MCBIST_MBNCER3Q,
+ };
+
+ constexpr static const uint64_t MAINLINE_RCE_REGS[] =
+ {
+ MCBIST_MBRCER0Q,
+ MCBIST_MBRCER1Q,
+ MCBIST_MBRCER2Q,
+ MCBIST_MBRCER3Q
+ };
+
+ constexpr static const uint64_t MAINLINE_MPE_REGS[] =
+ {
+ MCBIST_MBMPER0Q,
+ MCBIST_MBMPER1Q,
+ MCBIST_MBMPER2Q,
+ MCBIST_MBMPER3Q
+ };
+
+ constexpr static const uint64_t MAINLINE_UE_REGS[] =
+ {
+ MCBIST_MBUER0Q,
+ MCBIST_MBUER1Q,
+ MCBIST_MBUER2Q,
+ MCBIST_MBUER3Q
+ };
+
+ constexpr static const uint64_t MAINLINE_AUE_REGS[] =
+ {
+ MCBIST_MBAUER0Q,
+ MCBIST_MBAUER1Q,
+ MCBIST_MBAUER2Q,
+ MCBIST_MBAUER3Q
+ };
+
+ // Note that these registers store info for a pair of ports
+ // (thus the duplication)
+ constexpr static const uint64_t ERROR_VECTOR_REGS[] =
+ {
+ MCBIST_MBSEVR0Q,
+ MCBIST_MBSEVR0Q,
+ MCBIST_MBSEVR1Q,
+ MCBIST_MBSEVR1Q
+ };
+
+ // Fields, can be any size.
+ enum
+ {
+ HARDWARE_MS_CHIPMARK = MCA_HWMS0_CHIPMARK,
+ HARDWARE_MS_CHIPMARK_LEN = MCA_HWMS0_CHIPMARK_LEN,
+ HARDWARE_MS_CONFIRMED = MCA_HWMS0_CONFIRMED,
+ HARDWARE_MS_EXIT1 = MCA_HWMS0_EXIT_1,
+ FIRMWARE_MS_MARK = MCA_FWMS0_MARK,
+ FIRMWARE_MS_MARK_LEN = MCA_FWMS0_MARK_LEN,
+ FIRMWARE_MS_TYPE = MCA_FWMS0_TYPE,
+ FIRMWARE_MS_REGION = MCA_FWMS0_REGION,
+ FIRMWARE_MS_REGION_LEN = MCA_FWMS0_REGION_LEN,
+ FIRMWARE_MS_ADDRESS = MCA_FWMS0_ADDRESS,
+ FIRMWARE_MS_ADDRESS_LEN = MCA_FWMS0_ADDRESS_LEN,
+ FIRMWARE_MS_EXIT1 = MCA_FWMS0_EXIT_1,
+ NCE_ADDR_TRAP = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_ADDR_TRAP,
+ NCE_ADDR_TRAP_LEN = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_ADDR_TRAP_LEN,
+ NCE_ON_RCE = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_ON_RCE,
+ NCE_IS_TCE = MCBIST_MBNCER0Q_PORT_0_MAINLINE_NCE_IS_TCE,
+ RCE_ADDR_TRAP = MCBIST_MBRCER0Q_PORT_0_MAINLINE_RCE_ADDR_TRAP,
+ RCE_ADDR_TRAP_LEN = MCBIST_MBRCER0Q_PORT_0_MAINLINE_RCE_ADDR_TRAP_LEN,
+ MPE_ADDR_TRAP = MCBIST_MBMPER0Q_PORT_0_MAINLINE_MPE_ADDR_TRAP,
+ MPE_ADDR_TRAP_LEN = MCBIST_MBMPER0Q_PORT_0_MAINLINE_MPE_ADDR_TRAP_LEN,
+ MPE_ON_RCE = MCBIST_MBMPER0Q_PORT_0_MAINLINE_MPE_ON_RCE,
+ UE_ADDR_TRAP = MCBIST_MBUER0Q_PORT_0_MAINLINE_UE_ADDR_TRAP,
+ UE_ADDR_TRAP_LEN = MCBIST_MBUER0Q_PORT_0_MAINLINE_UE_ADDR_TRAP_LEN,
+ AUE_ADDR_TRAP = MCBIST_MBAUER0Q_PORT_0_MAINLINE_AUE_ADDR_TRAP,
+ AUE_ADDR_TRAP_LEN = MCBIST_MBAUER0Q_PORT_0_MAINLINE_AUE_ADDR_TRAP_LEN,
+ P0_NCE_GALOIS = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_GALOIS_FIELD,
+ P0_NCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_GALOIS_FIELD_LEN,
+ P0_NCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_MAGNITUDE_FIELD,
+ P0_NCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_NCE_MAGNITUDE_FIELD_LEN,
+ P0_TCE_GALOIS = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_GALOIS_FIELD,
+ P0_TCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_GALOIS_FIELD_LEN,
+ P0_TCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_MAGNITUDE_FIELD,
+ P0_TCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_0_MAINLINE_TCE_MAGNITUDE_FIELD_LEN,
+ P1_NCE_GALOIS = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_GALOIS_FIELD,
+ P1_NCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_GALOIS_FIELD_LEN,
+ P1_NCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_MAGNITUDE_FIELD,
+ P1_NCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_NCE_MAGNITUDE_FIELD_LEN,
+ P1_TCE_GALOIS = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_GALOIS_FIELD,
+ P1_TCE_GALOIS_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_GALOIS_FIELD_LEN,
+ P1_TCE_MAGNITUDE = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_MAGNITUDE_FIELD,
+ P1_TCE_MAGNITUDE_LEN = MCBIST_MBSEVR0Q_PORT_1_MAINLINE_TCE_MAGNITUDE_FIELD_LEN,
+ CURRENT_ADDR_TRAP = MCBIST_MCBMCATQ_CFG_CURRENT_ADDR_TRAP,
+ CURRENT_ADDR_TRAP_LEN = MCBIST_MCBMCATQ_CFG_CURRENT_ADDR_TRAP_LEN,
+ CURRENT_PORT = MCBIST_MCBMCATQ_CFG_CURRENT_PORT_TRAP,
+ CURRENT_PORT_LEN = MCBIST_MCBMCATQ_CFG_CURRENT_PORT_TRAP_LEN,
+ CURRENT_DIMM = MCBIST_MCBMCATQ_CFG_CURRENT_DIMM_TRAP,
+ SHADOW_CHIPMARK = MCA_MSR_CHIPMARK,
+ SHADOW_CHIPMARK_LEN = MCA_MSR_CHIPMARK_LEN,
+ SHADOW_RANK = MCA_MSR_RANK,
+ SHADOW_RANK_LEN = MCA_MSR_RANK_LEN,
+
+ // Address trap format
+ TRAP_ADDRESS_PORT = 0,
+ TRAP_ADDRESS_PORT_LEN = 2,
+ TRAP_ADDRESS_DIMM = 2,
+ TRAP_ADDRESS_DIMM_LEN = 1,
+ TRAP_ADDRESS_MRANK = 3,
+ TRAP_ADDRESS_MRANK_LEN = 2,
+ TRAP_ADDRESS_SRANK = 5,
+ TRAP_ADDRESS_SRANK_LEN = 3,
+ TRAP_ADDRESS_ROW = 8,
+ TRAP_ADDRESS_ROW_LEN = 18,
+ TRAP_ADDRESS_COL = 26,
+ TRAP_ADDRESS_COL_LEN = 7,
+ TRAP_ADDRESS_BANK = 33,
+ TRAP_ADDRESS_BANK_LEN = 3,
+ TRAP_ADDRESS_BANK_GROUP = 36,
+ TRAP_ADDRESS_BANK_GROUP_LEN = 2,
+
+ TRAP_ADDRESS = 0,
+ TRAP_ADDRESS_LEN = 38,
+ };
+
+ // Symbol to Galois code mapping table
+ // Reference: Nimbus workbook, Section 13.1.6.2: Firmware Mark Store
+ constexpr static const uint8_t symbol2galois[] =
+ {
+ 0x80, 0xa0, 0x90, 0xf0,
+ 0x08, 0x0a, 0x09, 0x0f,
+ 0x98, 0xda, 0xb9, 0x7f,
+ 0x91, 0xd7, 0xb2, 0x78,
+ 0x28, 0xea, 0x49, 0x9f,
+ 0x9a, 0xd4, 0xbd, 0x76,
+ 0x60, 0xb0, 0xc0, 0x20,
+ 0x06, 0x0b, 0x0c, 0x02,
+ 0xc6, 0xfb, 0x1c, 0x42,
+ 0xca, 0xf4, 0x1d, 0x46,
+ 0xd6, 0x8b, 0x3c, 0xc2,
+ 0xcb, 0xf3, 0x1f, 0x4e,
+ 0xe0, 0x10, 0x50, 0xd0,
+ 0x0e, 0x01, 0x05, 0x0d,
+ 0x5e, 0x21, 0xa5, 0x3d,
+ 0x5b, 0x23, 0xaf, 0x3e,
+ 0xfe, 0x61, 0x75, 0x5d,
+ 0x51, 0x27, 0xa2, 0x38
+ };
+
+ // Symbol to DQ index mapping table
+ // Reference: Nimbus workbook, Section 13.1.6.2: Firmware Mark Store
+ constexpr static const uint8_t symbol2dq[] =
+ {
+ 71, 70, 69, 68,
+ 67, 66, 65, 64,
+ 63, 62, 61, 60,
+ 55, 54, 53, 52,
+ 47, 46, 45, 44,
+ 39, 38, 37, 36,
+ 31, 30, 29, 28,
+ 23, 22, 21, 20,
+ 15, 14, 13, 12,
+ 7, 6, 5, 4,
+ 59, 58, 57, 56,
+ 51, 50, 49, 48,
+ 43, 42, 41, 40,
+ 35, 34, 33, 32,
+ 27, 26, 25, 24,
+ 19, 18, 17, 16,
+ 11, 10, 9, 8,
+ 3, 2, 1, 0
+ };
+
+};
+
+///
+/// @class eccTraits
+/// @brief a collection of traits associated with the Nimbus MC ECC interface
+///
+template<>
+class eccTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCBIST>
+{
+ public:
+ // MCBIST ECC registers - must be 64 bits.
+ static constexpr uint64_t READ_ERROR_COUNT_REG0 = MCBIST_MBSEC0Q;
+ static constexpr uint64_t READ_ERROR_COUNT_REG1 = MCBIST_MBSEC1Q;
+ static constexpr uint64_t MARK_SYMBOL_COUNT_REG = MCBIST_MBSMSECQ;
+ static constexpr uint64_t MODAL_SYM_COUNT0_REG = MCBIST_MBSSYMEC0Q;
+ static constexpr uint64_t MODAL_SYM_COUNT1_REG = MCBIST_MBSSYMEC1Q;
+ static constexpr uint64_t MODAL_SYM_COUNT2_REG = MCBIST_MBSSYMEC2Q;
+ static constexpr uint64_t MODAL_SYM_COUNT3_REG = MCBIST_MBSSYMEC3Q;
+ static constexpr uint64_t MODAL_SYM_COUNT4_REG = MCBIST_MBSSYMEC4Q;
+ static constexpr uint64_t MODAL_SYM_COUNT5_REG = MCBIST_MBSSYMEC5Q;
+ static constexpr uint64_t MODAL_SYM_COUNT6_REG = MCBIST_MBSSYMEC6Q;
+ static constexpr uint64_t MODAL_SYM_COUNT7_REG = MCBIST_MBSSYMEC7Q;
+ static constexpr uint64_t MODAL_SYM_COUNT8_REG = MCBIST_MBSSYMEC8Q;
+ static constexpr uint64_t MPE_ADDR_TRAP_REG = MCBIST_MCBMCATQ;
+ static constexpr uint64_t ECC_MAX_MRANK_PER_PORT = MAX_MRANK_PER_PORT;
+ static constexpr uint64_t ECC_MAX_DQ_BITS = MAX_DQ_BITS;
+ static constexpr uint64_t ECC_MAX_SYMBOLS = MAX_DQ_BITS;
+
+ // Stores the symbol counter registers in a vector for easier access for MCBIST
+ static constexpr uint64_t REQUIRED_NUMBER_OF_SYMBOL_REGS = 9;
+ static const std::vector<uint64_t> SYMBOL_COUNT_REG;
+
+ // Fields, can be any size.
+ enum
+ {
+ INTERMITTENT_CE_COUNT = MCBIST_MBSEC0Q_INTERMITTENT_CE_COUNT,
+ INTERMITTENT_CE_COUNT_LEN = MCBIST_MBSEC0Q_INTERMITTENT_CE_COUNT_LEN,
+ SOFT_CE_COUNT = MCBIST_MBSEC0Q_SOFT_CE_COUNT,
+ SOFT_CE_COUNT_LEN = MCBIST_MBSEC0Q_SOFT_CE_COUNT_LEN,
+ HARD_CE_COUNT = MCBIST_MBSEC0Q_HARD_CE_COUNT,
+ HARD_CE_COUNT_LEN = MCBIST_MBSEC0Q_HARD_CE_COUNT_LEN,
+ INTERMITTENT_MCE_COUNT = MCBIST_MBSEC0Q_INTERMITTENT_MCE_COUNT,
+ INTERMITTENT_MCE_COUNT_LEN = MCBIST_MBSEC0Q_INTERMITTENT_MCE_COUNT_LEN,
+ SOFT_MCE_COUNT = MCBIST_MBSEC0Q_SOFT_MCE_COUNT,
+ SOFT_MCE_COUNT_LEN = MCBIST_MBSEC0Q_SOFT_MCE_COUNT_LEN,
+ HARD_MCE_COUNT = MCBIST_MBSEC1Q_HARD_MCE_COUNT,
+ HARD_MCE_COUNT_LEN = MCBIST_MBSEC1Q_HARD_MCE_COUNT_LEN,
+ ICE_COUNT = MCBIST_MBSEC1Q_ICE_COUNT,
+ ICE_COUNT_LEN = MCBIST_MBSEC1Q_ICE_COUNT_LEN,
+ UE_COUNT = MCBIST_MBSEC1Q_UE_COUNT,
+ UE_COUNT_LEN = MCBIST_MBSEC1Q_UE_COUNT_LEN,
+ AUE_COUNT = MCBIST_MBSEC1Q_AUE,
+ AUE_COUNT_LEN = MCBIST_MBSEC1Q_AUE_LEN,
+ RCE_COUNT = MCBIST_MBSEC1Q_RCE_COUNT,
+ RCE_COUNT_LEN = MCBIST_MBSEC1Q_RCE_COUNT_LEN,
+ SYMBOL0_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL0_COUNT,
+ SYMBOL0_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL0_COUNT_LEN,
+ SYMBOL1_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL1_COUNT,
+ SYMBOL1_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL1_COUNT_LEN,
+ SYMBOL2_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL2_COUNT,
+ SYMBOL2_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL2_COUNT_LEN,
+ SYMBOL3_COUNT = MCBIST_MBSMSECQ_MCE_SYMBOL3_COUNT,
+ SYMBOL3_COUNT_LEN = MCBIST_MBSMSECQ_MCE_SYMBOL3_COUNT_LEN,
+ MODAL_SYMBOL_COUNTER_00 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_00,
+ MODAL_SYMBOL_COUNTER_00_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_00_LEN,
+ MODAL_SYMBOL_COUNTER_01 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_01,
+ MODAL_SYMBOL_COUNTER_01_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_01_LEN,
+ MODAL_SYMBOL_COUNTER_02 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_02,
+ MODAL_SYMBOL_COUNTER_02_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_02_LEN,
+ MODAL_SYMBOL_COUNTER_03 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_03,
+ MODAL_SYMBOL_COUNTER_03_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_03_LEN,
+ MODAL_SYMBOL_COUNTER_04 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_04,
+ MODAL_SYMBOL_COUNTER_04_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_04_LEN,
+ MODAL_SYMBOL_COUNTER_05 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_05,
+ MODAL_SYMBOL_COUNTER_05_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_05_LEN,
+ MODAL_SYMBOL_COUNTER_06 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_06,
+ MODAL_SYMBOL_COUNTER_06_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_06_LEN,
+ MODAL_SYMBOL_COUNTER_07 = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_07,
+ MODAL_SYMBOL_COUNTER_07_LEN = MCBIST_MBSSYMEC0Q_MODAL_SYMBOL_COUNTER_07_LEN,
+
+ // and a couple constants
+ NUM_MBSSYM_REGS = 9,
+ MODAL_SYMBOL_COUNTERS_PER_REG = 8,
+ };
+
+};
+
+} // close namespace mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/fw_mark_store.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/fw_mark_store.H
deleted file mode 100644
index c27603b6b..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/fw_mark_store.H
+++ /dev/null
@@ -1,619 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/fw_mark_store.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file fw_mark_store.H
-/// @brief Subroutines for the MC firmware mark store registers
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_FW_MARK_STORE_H_
-#define _MSS_FW_MARK_STORE_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <lib/ecc/ecc_traits.H>
-#include <lib/shared/mss_const.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace fwms
-{
-
-///
-/// @brief chip mark type enums
-///
-enum mark_type
-{
- SYMBOL = 1,
- CHIP = 0
-};
-
-///
-/// @brief Chip Mark Region. Used for region field values in the FWMS regs
-///
-enum mark_region
-{
- DISABLED = 0b000,
- RESERVED = 0b001,
- BANK = 0b010,
- BANKGROUP = 0b011,
- SRANK = 0b100,
- MRANK = 0b101,
- DIMM = 0b110,
- UNIVERSAL = 0b111
-};
-
-///
-/// @brief Read Firmware Mark Store (FWMS) register
-/// @tparam R master rank number
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< uint64_t R, fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read_rank( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- static_assert((R < MAX_MRANK_PER_PORT), "Master rank index failed range check");
- FAPI_TRY( mss::getScom(i_target, (TT::FIRMWARE_MS0_REG + R), o_data) );
- FAPI_INF("read_rank<%d>: 0x%016lx", R, o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 0 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank0( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<0>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 1 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank1( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<1>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 2 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank2( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<2>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 3 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank3( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<3>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 4 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank4( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<4>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 5 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank5( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<5>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 6 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank6( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<6>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) rank 7 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank7( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<7>(i_target, o_data) );
-}
-
-///
-/// @brief Read Firmware Mark Store (FWMS) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_rank the master rank index
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- fapi2::buffer<uint64_t>& o_data )
-{
- switch (i_rank)
- {
- case(0):
- return ( read_rank0(i_target, o_data) );
-
- case(1):
- return ( read_rank1(i_target, o_data) );
-
- case(2):
- return ( read_rank2(i_target, o_data) );
-
- case(3):
- return ( read_rank3(i_target, o_data) );
-
- case(4):
- return ( read_rank4(i_target, o_data) );
-
- case(5):
- return ( read_rank5(i_target, o_data) );
-
- case(6):
- return ( read_rank6(i_target, o_data) );
-
- case(7):
- return ( read_rank7(i_target, o_data) );
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_RANK_PASSED()
- .set_RANK(i_rank)
- .set_TARGET(i_target)
- .set_FUNCTION(FWMS_READ),
- "%s Invalid rank passed to fwms::ecc::read (%d)",
- mss::c_str(i_target),
- i_rank);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) register
-/// @tparam R master rank number
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< uint64_t R, fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write_rank( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- static_assert((R < MAX_MRANK_PER_PORT), "Master rank index failed range check");
- FAPI_TRY( mss::putScom(i_target, (TT::FIRMWARE_MS0_REG + R), i_data) );
- FAPI_INF("write_rank<%d>: 0x%016lx", R, i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 0 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank0( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<0>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 1 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank1( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<1>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 2 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank2( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<2>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 3 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank3( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<3>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 4 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank4( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<4>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 5 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank5( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<5>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 6 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank6( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<6>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) rank 7 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank7( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<7>(i_target, i_data) );
-}
-
-///
-/// @brief Write Firmware Mark Store (FWMS) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_rank the master rank index
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const fapi2::buffer<uint64_t>& i_data )
-{
- switch (i_rank)
- {
- case(0):
- return ( write_rank0(i_target, i_data) );
-
- case(1):
- return ( write_rank1(i_target, i_data) );
-
- case(2):
- return ( write_rank2(i_target, i_data) );
-
- case(3):
- return ( write_rank3(i_target, i_data) );
-
- case(4):
- return ( write_rank4(i_target, i_data) );
-
- case(5):
- return ( write_rank5(i_target, i_data) );
-
- case(6):
- return ( write_rank6(i_target, i_data) );
-
- case(7):
- return ( write_rank7(i_target, i_data) );
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_RANK_PASSED()
- .set_RANK(i_rank)
- .set_TARGET(i_target)
- .set_FUNCTION(FWMS_WRITE),
- "%s Invalid rank passed to fwms::ecc::write (%d)",
- mss::c_str(i_target),
- i_rank);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_mark
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note FWMS0_MARK: mark (Galois field code)
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_mark( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::FIRMWARE_MS_MARK, TT::FIRMWARE_MS_MARK_LEN>(i_value);
- FAPI_INF("set_mark: 0x%02lx", i_value);
-}
-
-///
-/// @brief get_mark
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note FWMS0_MARK: mark (Galois field code)
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_mark( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::FIRMWARE_MS_MARK, TT::FIRMWARE_MS_MARK_LEN>(o_value);
- FAPI_INF("get_mark: 0x%02lx", o_value);
-}
-
-///
-/// @brief set_type
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note FWMS0_TYPE: mark type
-/// @note Dial enums:
-/// @note SYMBOL=>0b1
-/// @note CHIP=>0b0
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_type( fapi2::buffer<uint64_t>& io_data, const mark_type i_value )
-{
- io_data.writeBit<TT::FIRMWARE_MS_TYPE>(i_value);
- FAPI_INF("set_type: 0x%01lx", i_value);
-}
-
-///
-/// @brief get_type
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note FWMS0_TYPE: mark type
-/// @note Dial enums:
-/// @note SYMBOL=>0b1
-/// @note CHIP=>0b0
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_type( const fapi2::buffer<uint64_t>& i_data, mark_type& o_value )
-{
- o_value = mark_type(i_data.getBit<TT::FIRMWARE_MS_TYPE>());
- FAPI_INF("get_type: 0x%01lx", o_value);
-}
-
-///
-/// @brief set_region
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note FWMS0_REGION: Selects mark region (address range to which mark applies)
-/// @note Dial enums:
-/// @note DISABLED=>0b000
-/// @note RESERVED=>0b001
-/// @note BANK=>0b010
-/// @note BANKGROUP=>0b011
-/// @note SRANK=>0b100
-/// @note MRANK=>0b101
-/// @note DIMM=>0b110
-/// @note UNIVERSAL=>0b111
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_region( fapi2::buffer<uint64_t>& io_data, const mark_region i_value )
-{
- io_data.insertFromRight<TT::FIRMWARE_MS_REGION, TT::FIRMWARE_MS_REGION_LEN>(i_value);
- FAPI_INF("set_region: 0x%02lx", i_value);
-}
-
-///
-/// @brief get_region
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note FWMS0_REGION: Selects mark region (address range to which mark applies)
-/// @note Dial enums:
-/// @note DISABLED=>0b000
-/// @note RESERVED=>0b001
-/// @note BANK=>0b010
-/// @note BANKGROUP=>0b011
-/// @note SRANK=>0b100
-/// @note MRANK=>0b101
-/// @note DIMM=>0b110
-/// @note UNIVERSAL=>0b111
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_region( const fapi2::buffer<uint64_t>& i_data, mark_region& o_value )
-{
- uint64_t l_temp = 0;
- i_data.extractToRight<TT::FIRMWARE_MS_REGION, TT::FIRMWARE_MS_REGION_LEN>(l_temp);
- o_value = mark_region(l_temp);
- FAPI_INF("get_region: 0x%02lx", o_value);
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- // construct fwms::address from mcbist::address
- const auto l_addr = address<T>(i_address);
- io_data.insert<TT::FIRMWARE_MS_ADDRESS, TT::FIRMWARE_MS_ADDRESS_LEN, TT::FIRMWARE_MS_ADDRESS>(l_addr);
- FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- // construct fwms::address from i_data
- const auto l_addr = address<T>(uint64_t(i_data));
- // construct mcbist::address from fwms::address
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-///
-/// @brief set_exit_1
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_state mss::YES or mss::NO - desired state
-/// @note FWMS0_EXIT_1: When set, bypass-enabled reads using this mark will use exit 1
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_exit_1( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::FIRMWARE_MS_EXIT1>(i_state);
- FAPI_INF("set_exit_1: 0x%01lx", i_state);
-}
-
-///
-/// @brief get_exit_1
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_state mss::YES or mss::NO - representing the state of the field
-/// @note FWMS0_EXIT_1: When set, bypass-enabled reads using this mark will use exit 1
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_exit_1( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
-{
- o_state = (i_data.getBit<TT::FIRMWARE_MS_EXIT1>() == false) ? mss::NO : mss::YES;
- FAPI_INF("get_exit_1: 0x%01lx", o_state);
-}
-
-} // close namespace fwms
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/galois.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/galois.H
deleted file mode 100644
index 981350955..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/galois.H
+++ /dev/null
@@ -1,190 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/galois.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
-/* [+] 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 */
-
-///
-/// @file galois.H
-/// @brief Translate ECC mark Galois codes to symbol and DQ
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: HB:FSP
-
-#ifndef _MSS_ECC_GALOIS_H_
-#define _MSS_ECC_GALOIS_H_
-
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-///
-/// @brief Return symbol value from a given Galois code
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_galois the Galois code
-/// @param[out] o_symbol symbol value represented by given Galois code
-/// @return FAPI2_RC_SUCCESS iff all is ok
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-fapi2::ReturnCode galois_to_symbol( const uint8_t i_galois, uint8_t& o_symbol )
-{
- const auto& l_p = std::find(TT::symbol2galois, (TT::symbol2galois + MAX_DQ_BITS), i_galois);
-
- FAPI_ASSERT( l_p != (TT::symbol2galois + MAX_DQ_BITS),
- fapi2::MSS_INVALID_GALOIS_TO_SYMBOL()
- .set_GALOIS(i_galois),
- "Invalid Galois code: 0x%02x",
- i_galois);
-
- o_symbol = (l_p - TT::symbol2galois);
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return Galois code from a given symbol value
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_symbol the symbol value
-/// @param[out] o_galois Galois code represented by given symbol
-/// @return FAPI2_RC_SUCCESS iff all is ok
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-fapi2::ReturnCode symbol_to_galois( const uint8_t i_symbol, uint8_t& o_galois )
-{
- FAPI_ASSERT( i_symbol < MAX_DQ_BITS,
- fapi2::MSS_INVALID_SYMBOL_FOR_GALOIS()
- .set_SYMBOL(i_symbol),
- "Invalid symbol: %d",
- i_symbol);
-
- o_galois = TT::symbol2galois[i_symbol];
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return symbol value from a given DQ index
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_dq the DQ index
-/// @param[out] o_symbol symbol value represented by given DQ index
-/// @return FAPI2_RC_SUCCESS iff all is ok
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-fapi2::ReturnCode dq_to_symbol( const uint8_t i_dq, uint8_t& o_symbol )
-{
- const auto& l_p = std::find(TT::symbol2dq, (TT::symbol2dq + MAX_DQ_BITS), i_dq);
-
- FAPI_ASSERT( l_p != (TT::symbol2dq + MAX_DQ_BITS),
- fapi2::MSS_INVALID_DQ_TO_SYMBOL()
- .set_DQ(i_dq),
- "Invalid DQ index: %d",
- i_dq);
-
- o_symbol = (l_p - TT::symbol2dq);
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return DQ index from a given symbol value
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_symbol the symbol value
-/// @param[out] o_dq DQ index represented by given symbol value
-/// @return FAPI2_RC_SUCCESS iff all is ok
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-fapi2::ReturnCode symbol_to_dq( const uint8_t i_symbol, uint8_t& o_dq )
-{
- FAPI_ASSERT( i_symbol < MAX_DQ_BITS,
- fapi2::MSS_INVALID_SYMBOL_TO_DQ()
- .set_SYMBOL(i_symbol),
- "symbol_to_dq: invalid symbol: %d",
- i_symbol);
-
- o_dq = TT::symbol2dq[i_symbol];
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return DQ index from a given Galois code
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_galois the Galois code
-/// @param[out] o_dq DQ index represented by given Galois code
-/// @return FAPI2_RC_SUCCESS iff all is ok
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-fapi2::ReturnCode galois_to_dq( const uint8_t i_galois, uint8_t& o_dq )
-{
- uint8_t l_symbol = 0;
-
- FAPI_TRY( galois_to_symbol<T>(i_galois, l_symbol), "Failed galois_to_symbol");
- FAPI_TRY( symbol_to_dq<T>(l_symbol, o_dq), "Failed symbol_to_dq" );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return Galois code from a given DQ index
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_dq the DQ index
-/// @param[out] o_galois Galois code represented by given symbol
-/// @return FAPI2_RC_SUCCESS iff all is ok
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-fapi2::ReturnCode dq_to_galois( const uint8_t i_dq, uint8_t& o_galois )
-{
- uint8_t l_symbol = 0;
-
- FAPI_TRY( mss::ecc::dq_to_symbol<T>(i_dq, l_symbol), "Failed dq_to_symbol");
- FAPI_TRY( mss::ecc::symbol_to_galois<T>(l_symbol, o_galois) , "Failed symbol_to_galois" );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-} // close namespace ecc
-
-} // close namespace mss
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/hw_mark_store.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/hw_mark_store.H
deleted file mode 100644
index 7a206c5bb..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/hw_mark_store.H
+++ /dev/null
@@ -1,507 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/hw_mark_store.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file hw_mark_store.H
-/// @brief Subroutines for the MC hardware mark store registers
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_HW_MARK_STORE_H_
-#define _MSS_HW_MARK_STORE_H_
-
-#include <fapi2.H>
-#include <lib/ecc/ecc_traits.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <lib/shared/mss_const.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace hwms
-{
-
-///
-/// @brief Read Hardware Mark Store (HWMS) register
-/// @tparam R master rank number
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< uint64_t R, fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read_rank( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- static_assert((R < MAX_MRANK_PER_PORT), "Master rank index failed range check");
- FAPI_TRY( mss::getScom(i_target, (TT::HARDWARE_MS0_REG + R), o_data) );
- FAPI_INF("read_rank<%d>: 0x%016lx", R, o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 0 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank0( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<0>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 1 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank1( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<1>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 2 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank2( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<2>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 3 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank3( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<3>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 4 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank4( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<4>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 5 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank5( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<5>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 6 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank6( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<6>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) rank 7 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_rank7( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_rank<7>(i_target, o_data) );
-}
-
-///
-/// @brief Read Hardware Mark Store (HWMS) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_rank the master rank index
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- fapi2::buffer<uint64_t>& o_data )
-{
- switch (i_rank)
- {
- case(0):
- return ( read_rank0(i_target, o_data) );
-
- case(1):
- return ( read_rank1(i_target, o_data) );
-
- case(2):
- return ( read_rank2(i_target, o_data) );
-
- case(3):
- return ( read_rank3(i_target, o_data) );
-
- case(4):
- return ( read_rank4(i_target, o_data) );
-
- case(5):
- return ( read_rank5(i_target, o_data) );
-
- case(6):
- return ( read_rank6(i_target, o_data) );
-
- case(7):
- return ( read_rank7(i_target, o_data) );
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_RANK_PASSED()
- .set_RANK(i_rank)
- .set_TARGET(i_target)
- .set_FUNCTION(HWMS_READ),
- "%s Invalid rank passed to fwms::ecc::hwms::read (%d)",
- mss::c_str(i_target),
- i_rank);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) register
-/// @tparam R master rank number
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< uint64_t R, fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write_rank( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- static_assert((R < MAX_MRANK_PER_PORT), "Master rank index failed range check");
- FAPI_TRY( mss::putScom(i_target, (TT::HARDWARE_MS0_REG + R), i_data) );
- FAPI_INF("write_rank<%d>: 0x%016lx", R, i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 0 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank0( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<0>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 1 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank1( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<1>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 2 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank2( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<2>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 3 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank3( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<3>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 4 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank4( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<4>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 5 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank5( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<5>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 6 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank6( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<6>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) rank 7 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_rank7( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_rank<7>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_rank the master rank index
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const fapi2::buffer<uint64_t>& i_data )
-{
- switch (i_rank)
- {
- case(0):
- return ( write_rank0(i_target, i_data) );
-
- case(1):
- return ( write_rank1(i_target, i_data) );
-
- case(2):
- return ( write_rank2(i_target, i_data) );
-
- case(3):
- return ( write_rank3(i_target, i_data) );
-
- case(4):
- return ( write_rank4(i_target, i_data) );
-
- case(5):
- return ( write_rank5(i_target, i_data) );
-
- case(6):
- return ( write_rank6(i_target, i_data) );
-
- case(7):
- return ( write_rank7(i_target, i_data) );
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_RANK_PASSED()
- .set_RANK(i_rank)
- .set_TARGET(i_target)
- .set_FUNCTION(HWMS_WRITE),
- "%s Invalid rank passed to fwms::ecc::hwms::write(%d)",
- mss::c_str(i_target),
- i_rank);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_chipmark
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note HWMS0_CHIPMARK: Hardware chipmark (Galois field code)
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_chipmark( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::HARDWARE_MS_CHIPMARK, TT::HARDWARE_MS_CHIPMARK_LEN>(i_value);
- FAPI_INF("set_chipmark: 0x%02lx", i_value);
-}
-
-///
-/// @brief get_chipmark
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note HWMS0_CHIPMARK: Hardware chipmark (Galois field code)
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_chipmark( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::HARDWARE_MS_CHIPMARK, TT::HARDWARE_MS_CHIPMARK_LEN>(o_value);
- FAPI_INF("get_chipmark: 0x%02lx", o_value);
-}
-
-///
-/// @brief set_confirmed
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_state mss::YES or mss::NO - desired state
-/// @note HWMS0_CONFIRMED: chipmark confirmed
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_confirmed( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::HARDWARE_MS_CONFIRMED>(i_state);
- FAPI_INF("set_confirmed: 0x%01lx", i_state);
-}
-
-///
-/// @brief get_confirmed
-/// @tparam T fapi2 Target Type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_state mss::YES or mss::NO - representing the state of the field
-/// @note HWMS0_CONFIRMED: chipmark confirmed
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_confirmed( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
-{
- o_state = (i_data.getBit<TT::HARDWARE_MS_CONFIRMED>() == false) ? mss::NO : mss::YES;
- FAPI_INF("get_confirmed: 0x%01lx", o_state);
-}
-
-///
-/// @brief set_exit_1
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_state mss::YES or mss::NO - desired state
-/// @note HWMS0_EXIT_1: When set, bypass-enabled reads using this mark will
-/// @note use exit 1; otherwise exit 0
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_exit_1( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::HARDWARE_MS_EXIT1>(i_state);
- FAPI_INF("set_exit_1: 0x%01lx", i_state);
-}
-
-///
-/// @brief get_exit_1
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_state mss::YES or mss::NO - representing the state of the field
-/// @note HWMS0_EXIT_1: When set, bypass-enabled reads using this mark will
-/// @note use exit 1; otherwise exit 0
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_exit_1( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
-{
- o_state = (i_data.getBit<TT::HARDWARE_MS_EXIT1>() == false) ? mss::NO : mss::YES;
- FAPI_INF("get_exit_1: 0x%01lx", o_state);
-}
-
-} // close namespace hwms
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_aue_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_aue_trap.H
deleted file mode 100644
index c6d4a239a..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_aue_trap.H
+++ /dev/null
@@ -1,130 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_aue_trap.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file mainline_aue_trap.H
-/// @brief Subroutines for the MC mainline aue address trap registers (MBAUER*Q)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MAINLINE_AUE_TRAP_H_
-#define _MSS_MAINLINE_AUE_TRAP_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace mainline_aue_trap
-{
-
-///
-/// @brief Read MBS Mainline AUE Address Trap (MBAUER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_AUE_REGS[l_port]), o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mainline AUE Address Trap (MBAUER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_AUE_REGS[l_port]), i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- io_data.insertFromRight<TT::AUE_ADDR_TRAP, TT::AUE_ADDR_TRAP_LEN>(uint64_t(i_address));
- FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- uint64_t l_addr = 0;
- i_data.extractToRight<TT::AUE_ADDR_TRAP, TT::AUE_ADDR_TRAP_LEN>(l_addr);
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-} // close namespace mainline_aue_trap
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_mpe_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_mpe_trap.H
deleted file mode 100644
index a8ea60c98..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_mpe_trap.H
+++ /dev/null
@@ -1,162 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_mpe_trap.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file mainline_mpe_trap.H
-/// @brief Subroutines for the MC mainline mpe address trap registers (MBNCER*Q)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MAINLINE_MPE_TRAP_H_
-#define _MSS_MAINLINE_MPE_TRAP_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace mainline_mpe_trap
-{
-
-///
-/// @brief Read MBS Mainline MPE Address Trap (MBMPER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_MPE_REGS[l_port]), o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mainline MPE Address Trap (MBMPER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_MPE_REGS[l_port]), i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- io_data.insertFromRight<TT::MPE_ADDR_TRAP, TT::MPE_ADDR_TRAP_LEN>(uint64_t(i_address));
- FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- uint64_t l_addr = 0;
- i_data.extractToRight<TT::MPE_ADDR_TRAP, TT::MPE_ADDR_TRAP_LEN>(l_addr);
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-///
-/// @brief set_mpe_on_rce
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_state mss::YES or mss::NO - desired state
-/// @note MBMPER0Q_PORT_0_MAINLINE_MPE_ON_RCE: Indicates whether if this error
-/// @note came on the retry of a UE, RCD, or AUE as part of an RCE
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_mpe_on_rce( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::MPE_ON_RCE>(i_state);
- FAPI_INF("set_mpe_on_rce: 0x%01lx", i_state);
-}
-
-///
-/// @brief get_mpe_on_rce
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_state mss::YES or mss::NO - representing the state of the field
-/// @note MBMPER0Q_PORT_0_MAINLINE_MPE_ON_RCE: Indicates whether if this error
-/// @note came on the retry of a UE, RCD, or AUE as part of an RCE
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_mpe_on_rce( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
-{
- o_state = (i_data.getBit<TT::MPE_ON_RCE>() == false) ? mss::NO : mss::YES;
- FAPI_INF("get_mpe_on_rce: 0x%01lx", o_state);
-}
-
-} // close namespace mainline_mpe_trap
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H
deleted file mode 100644
index 038ed1e6e..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H
+++ /dev/null
@@ -1,195 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2019 */
-/* [+] 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 */
-
-///
-/// @file mainline_nce_trap.H
-/// @brief Subroutines for the MC mainline nce address trap registers (MBNCER*Q)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MAINLINE_NCE_TRAP_H_
-#define _MSS_MAINLINE_NCE_TRAP_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-#include <generic/memory/lib/utils/pos.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace mainline_nce_trap
-{
-
-///
-/// @brief Read MBS Mainline NCE Address Trap (MBNCER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_NCE_REGS[l_port]), o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mainline NCE Address Trap (MBNCER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_NCE_REGS[l_port]), i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- io_data.insertFromRight<TT::NCE_ADDR_TRAP, TT::NCE_ADDR_TRAP_LEN>(uint64_t(i_address));
- FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- uint64_t l_addr = 0;
- i_data.extractToRight<TT::NCE_ADDR_TRAP, TT::NCE_ADDR_TRAP_LEN>(l_addr);
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-///
-/// @brief set_nce_on_rce
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_state mss::YES or mss::NO - desired state
-/// @note MBNCER0Q_PORT_0_MAINLINE_NCE_ON_RCE: Indicates whether if this NCE came on the
-/// @note retry of a UE, RCD, or AUE as part of an RCE
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_nce_on_rce( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::NCE_ON_RCE>(i_state);
- FAPI_INF("set_nce_on_rce: 0x%01lx", i_state);
-}
-
-///
-/// @brief get_nce_on_rce
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_state mss::YES or mss::NO - representing the state of the field
-/// @note MBNCER0Q_PORT_0_MAINLINE_NCE_ON_RCE: Indicates whether if this NCE came on the
-/// @note retry of a UE, RCD, or AUE as part of an RCE
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_nce_on_rce( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
-{
- o_state = (i_data.getBit<TT::NCE_ON_RCE>() == false) ? mss::NO : mss::YES;
- FAPI_INF("get_nce_on_rce: 0x%01lx", o_state);
-}
-
-///
-/// @brief set_nce_is_tce
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_state mss::YES or mss::NO - desired state
-/// @note MBNCER0Q_PORT_0_MAINLINE_NCE_IS_TCE: Indicates if this NCE is actually
-/// @note a two symbol error (TCE)
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_nce_is_tce( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::NCE_IS_TCE>(i_state);
- FAPI_INF("set_nce_is_tce: 0x%01lx", i_state);
-}
-
-///
-/// @brief get_nce_is_tce
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_state mss::YES or mss::NO - representing the state of the field
-/// @note MBNCER0Q_PORT_0_MAINLINE_NCE_IS_TCE: Indicates if this NCE is actually
-/// @note a two symbol error (TCE)
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_nce_is_tce( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
-{
- o_state = (i_data.getBit<TT::NCE_IS_TCE>() == false) ? mss::NO : mss::YES;
- FAPI_INF("get_nce_is_tce: 0x%01lx", o_state);
-}
-
-} // close namespace mainline_nce_trap
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_rce_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_rce_trap.H
deleted file mode 100644
index 35a0135b3..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_rce_trap.H
+++ /dev/null
@@ -1,130 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_rce_trap.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file mainline_rce_trap.H
-/// @brief Subroutines for the MC mainline rce address trap registers (MBRCER*Q)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MAINLINE_RCE_TRAP_H_
-#define _MSS_MAINLINE_RCE_TRAP_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace mainline_rce_trap
-{
-
-///
-/// @brief Read MBS Mainline RCE Address Trap (MBRCER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_RCE_REGS[l_port]), o_data) );
- FAPI_INF("read: 0x%016lx", o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mainline RCE Address Trap (MBRCER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_RCE_REGS[l_port]), i_data) );
- FAPI_INF("write: 0x%016lx", i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- io_data.insertFromRight<TT::RCE_ADDR_TRAP, TT::RCE_ADDR_TRAP_LEN>(uint64_t(i_address));
- FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- uint64_t l_addr = 0;
- i_data.extractToRight<TT::RCE_ADDR_TRAP, TT::RCE_ADDR_TRAP_LEN>(l_addr);
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-} // close namespace mainline_rce_trap
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_ue_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_ue_trap.H
deleted file mode 100644
index 516f9181e..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_ue_trap.H
+++ /dev/null
@@ -1,130 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_ue_trap.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file mainline_ue_trap.H
-/// @brief Subroutines for the MC mainline ue address trap registers (MBUER*Q)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MAINLINE_UE_TRAP_H_
-#define _MSS_MAINLINE_UE_TRAP_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace mainline_ue_trap
-{
-
-///
-/// @brief Read MBS Mainline UE Address Trap (MBUER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_UE_REGS[l_port]), o_data) );
- FAPI_INF("read: 0x%016lx", o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mainline UE Address Trap (MBUER*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_UE_REGS[l_port]), i_data) );
- FAPI_INF("write: 0x%016lx", i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- io_data.insertFromRight<TT::UE_ADDR_TRAP, TT::UE_ADDR_TRAP_LEN>(uint64_t(i_address));
- FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- uint64_t l_addr = 0;
- i_data.extractToRight<TT::UE_ADDR_TRAP, TT::UE_ADDR_TRAP_LEN>(l_addr);
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-} // close namespace mainline_ue_trap
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/maint_current_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/maint_current_trap.H
deleted file mode 100644
index a06a2ccbe..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/maint_current_trap.H
+++ /dev/null
@@ -1,187 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/maint_current_trap.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file maint_current_trap.H
-/// @brief Subroutines for the MC maint current address trap register (MCBMCATQ)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MAINT_CURRENT_TRAP_H_
-#define _MSS_MAINT_CURRENT_TRAP_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace maint_current_trap
-{
-
-///
-/// @brief Read MBS Mainline MPE Address Trap (MCBMCATQ) register
-/// @param[in] i_target the fapi2 target of the MCA
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-inline fapi2::ReturnCode read( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, MCBIST_MCBMCATQ, o_data) );
- FAPI_INF("read: 0x%016lx", o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mainline MPE Address Trap (MCBMCATQ) register
-/// @param[in] i_target the fapi2 target of the MCA
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-inline fapi2::ReturnCode write( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, MCBIST_MCBMCATQ, i_data) );
- FAPI_INF("write: 0x%016lx", i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
-{
- io_data.insertFromRight<TT::CURRENT_ADDR_TRAP, TT::CURRENT_ADDR_TRAP_LEN>(uint64_t(i_address));
- FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
-}
-
-///
-/// @brief get_address
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_address mcbist::address form of address field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
-{
- uint64_t l_addr = 0;
- i_data.extractToRight<TT::CURRENT_ADDR_TRAP, TT::CURRENT_ADDR_TRAP_LEN>(l_addr);
- o_address = mcbist::address(l_addr);
- FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
-}
-
-///
-/// @brief set_port
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value - desired value
-/// @note MCBMCATQ_CFG_CURRENT_PORT_TRAP: If MCBCFGQ_cfg_current_addr_trap_update_dis = 0, then this
-/// @note field will store port. This field is ONLY valid in maint_addr_mode. Garabage otherwise.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_port( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::CURRENT_PORT, TT::CURRENT_PORT_LEN>(i_value);
- FAPI_INF("set_port: 0x%01lx", i_value);
-}
-
-///
-/// @brief get_port
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value - representing the field value
-/// @note MCBMCATQ_CFG_CURRENT_PORT_TRAP: If MCBCFGQ_cfg_current_addr_trap_update_dis = 0, then this
-/// @note field will store port. This field is ONLY valid in maint_addr_mode. Garabage otherwise.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_port( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::CURRENT_PORT, TT::CURRENT_PORT_LEN>(o_value);
- FAPI_INF("get_port: 0x%01lx", o_value);
-}
-
-///
-/// @brief set_dimm
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value - desired value
-/// @note MCBMCATQ_CFG_CURRENT_DIMM_TRAP: If MCBCFGQ_cfg_current_addr_trap_update_dis = 0, then this
-/// @note field will store dimm select.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_dimm( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.writeBit<TT::CURRENT_DIMM>(i_value);
- FAPI_INF("set_dimm: 0x%01lx", i_value);
-}
-
-///
-/// @brief get_dimm
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value - representing the field value
-/// @note MCBMCATQ_CFG_CURRENT_DIMM_TRAP: If MCBCFGQ_cfg_current_addr_trap_update_dis = 0, then this
-/// @note field will store dimm select.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_dimm( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- o_value = i_data.getBit<TT::CURRENT_DIMM>();
- FAPI_INF("get_dimm: 0x%01lx", o_value);
-}
-
-} // close namespace maint_current_trap
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mark_shadow_reg.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mark_shadow_reg.H
deleted file mode 100644
index 6f413559b..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mark_shadow_reg.H
+++ /dev/null
@@ -1,149 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mark_shadow_reg.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file mark_shadow_reg.H
-/// @brief Subroutines for the MC mark shadow registers (MSR)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MARK_SHADOW_REG_H_
-#define _MSS_MARK_SHADOW_REG_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace mark_shadow_reg
-{
-
-///
-/// @brief Read Mark Shadow register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- FAPI_TRY( mss::getScom(i_target, TT::MARK_SHADOW_REG, o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write Mark Shadow register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- FAPI_TRY( mss::putScom(i_target, TT::MARK_SHADOW_REG, i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_chipmark
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_chipmark( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SHADOW_CHIPMARK, TT::SHADOW_CHIPMARK_LEN>(i_value);
- FAPI_INF("set_chipmark: 0x%016lx", i_value);
-}
-
-///
-/// @brief get_chipmark
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_chipmark( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SHADOW_CHIPMARK, TT::SHADOW_CHIPMARK_LEN>(o_value);
- FAPI_INF("get_chipmark: 0x%016lx", o_value);
-}
-
-///
-/// @brief set_rank
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void set_rank( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SHADOW_RANK, TT::SHADOW_RANK_LEN>(i_value);
- FAPI_INF("set_rank: 0x%016lx", i_value);
-}
-
-///
-/// @brief get_rank
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
-inline void get_rank( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SHADOW_RANK, TT::SHADOW_RANK_LEN>(o_value);
- FAPI_INF("get_rank: 0x%016lx", o_value);
-}
-
-} // close namespace mark_shadow_reg
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/modal_symbol_count.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/modal_symbol_count.H
deleted file mode 100644
index f19185fee..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/modal_symbol_count.H
+++ /dev/null
@@ -1,573 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/modal_symbol_count.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file modal_symbol_count.H
-/// @brief Subroutines for the MC modal symbol count (MBSSYMEC*Q) registers
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MODAL_SYMBOL_COUNT_H_
-#define _MSS_MODAL_SYMBOL_COUNT_H_
-
-#include <fapi2.H>
-#include <lib/ecc/ecc_traits.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <lib/shared/mss_const.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace modal_symbol_count
-{
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) register
-/// @tparam N the register index (0-8)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< uint64_t N, fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read_index( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- static_assert((N < TT::NUM_MBSSYM_REGS), "Modal symbol count reg index failed range check");
- FAPI_TRY( mss::getScom(i_target, (TT::MODAL_SYM_COUNT0_REG + N), o_data) );
- FAPI_INF("read_index<%d>: 0x%016lx", N, o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 0 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index0( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<0>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 1 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index1( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<1>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 2 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index2( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<2>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 3 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index3( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<3>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 4 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index4( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<4>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 5 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index5( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<5>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 6 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index6( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<6>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 7 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index7( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<7>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) 8 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read_index8( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- return ( read_index<8>(i_target, o_data) );
-}
-
-///
-/// @brief Read modal symbol count (MBSSYMEC*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_index the register index
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target,
- const uint64_t i_index,
- fapi2::buffer<uint64_t>& o_data )
-{
- switch (i_index)
- {
- case(0):
- return ( read_index0(i_target, o_data) );
-
- case(1):
- return ( read_index1(i_target, o_data) );
-
- case(2):
- return ( read_index2(i_target, o_data) );
-
- case(3):
- return ( read_index3(i_target, o_data) );
-
- case(4):
- return ( read_index4(i_target, o_data) );
-
- case(5):
- return ( read_index5(i_target, o_data) );
-
- case(6):
- return ( read_index6(i_target, o_data) );
-
- case(7):
- return ( read_index7(i_target, o_data) );
-
- case(8):
- return ( read_index8(i_target, o_data) );
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_INDEX_PASSED()
- .set_INDEX(i_index)
- .set_FUNCTION(SYMBOL_COUNT_READ),
- "%s Invalid index passed to fwms::ecc::modal_symbol_count::read (%d)",
- mss::c_str(i_target),
- i_index);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) register
-/// @tparam N the register index (0-8)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< uint64_t N, fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write_index( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- static_assert((N < TT::NUM_MBSSYM_REGS), "Modal symbol count reg index failed range check");
- FAPI_TRY( mss::putScom(i_target, (TT::MODAL_SYM_COUNT0_REG + N), i_data) );
- FAPI_INF("write_index<%d>: 0x%016lx", N, i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 0 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index0( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<0>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 1 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index1( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<1>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 2 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index2( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<2>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 3 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index3( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<3>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 4 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index4( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<4>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 5 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index5( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<5>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 6 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index6( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<6>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 7 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index7( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<7>(i_target, i_data) );
-}
-
-///
-/// @brief Write modal symbol count (MBSSYMEC*Q) 8 register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write_index8( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- return ( write_index<8>(i_target, i_data) );
-}
-
-///
-/// @brief Write Hardware Mark Store (HWMS) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_index the register index
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target,
- const uint64_t i_index,
- const fapi2::buffer<uint64_t>& i_data )
-{
- switch (i_index)
- {
- case(0):
- return ( write_index0(i_target, i_data) );
-
- case(1):
- return ( write_index1(i_target, i_data) );
-
- case(2):
- return ( write_index2(i_target, i_data) );
-
- case(3):
- return ( write_index3(i_target, i_data) );
-
- case(4):
- return ( write_index4(i_target, i_data) );
-
- case(5):
- return ( write_index5(i_target, i_data) );
-
- case(6):
- return ( write_index6(i_target, i_data) );
-
- case(7):
- return ( write_index7(i_target, i_data) );
-
- case(8):
- return ( write_index8(i_target, i_data) );
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_INDEX_PASSED()
- .set_INDEX(i_index)
- .set_FUNCTION(SYMBOL_COUNT_WRITE),
- "%s Invalid index passed to fwms::ecc::modal_symbol_count::write (%d)",
- mss::c_str(i_target),
- i_index);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_index the counter index
-/// @param[in] i_value the value of the field
-/// @note MBSSYMEC*Q_MODAL_SYMBOL_COUNTER_XX: Functional mode determined by MBSTRQ_Symbol_counter_mode:
-/// @note if 00, 0:7 = Maint NCE counter for Symbol XX if 01, 0:3 = MCBIST error counter for nibble (XX/4)
-/// @note and rank (XX%4)*2 4:7 = MCBIST error counter for nibble (XX/4) and rank ((XX%4)*2)+1 if 10,
-/// @note 0:3 = MCBIST error counter for port XX/18 and nibble XX%18 4:7 = MCBIST error rank map for
-/// @note port XX/18 and nibble XX%18
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_index, const uint64_t i_value )
-{
- static_assert ( TT::MODAL_SYMBOL_COUNTERS_PER_REG <= 8,
- "mss::ecc_count::modal_symbol_count: Modal symbol count field index failed range check" );
- const uint64_t l_field = i_index % TT::MODAL_SYMBOL_COUNTERS_PER_REG;
-
- switch (l_field)
- {
- case 0:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_00, TT::MODAL_SYMBOL_COUNTER_00_LEN>(i_value);
- break;
-
- case 1:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_01, TT::MODAL_SYMBOL_COUNTER_01_LEN>(i_value);
- break;
-
- case 2:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_02, TT::MODAL_SYMBOL_COUNTER_02_LEN>(i_value);
- break;
-
- case 3:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_03, TT::MODAL_SYMBOL_COUNTER_03_LEN>(i_value);
- break;
-
- case 4:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_04, TT::MODAL_SYMBOL_COUNTER_04_LEN>(i_value);
- break;
-
- case 5:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_05, TT::MODAL_SYMBOL_COUNTER_05_LEN>(i_value);
- break;
-
- case 6:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_06, TT::MODAL_SYMBOL_COUNTER_06_LEN>(i_value);
- break;
-
- case 7:
- io_data.insertFromRight<TT::MODAL_SYMBOL_COUNTER_07, TT::MODAL_SYMBOL_COUNTER_07_LEN>(i_value);
- break;
-
- default:
- // Shouldn't happen due to modulo above, but here just in case - JLH
- FAPI_ERR("Modal symbol count field index failed range check");
- fapi2::Assert(false);
- break;
- }
-
- FAPI_INF("set_count(%d): 0x%02lx", l_field, i_value);
-}
-
-///
-/// @brief get_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[in] i_index the counter index
-/// @param[out] o_value the value of the field
-/// @note MBSSYMEC*Q_MODAL_SYMBOL_COUNTER_XX: Functional mode determined by MBSTRQ_Symbol_counter_mode:
-/// @note if 00, 0:7 = Maint NCE counter for Symbol XX if 01, 0:3 = MCBIST error counter for nibble (XX/4)
-/// @note and rank (XX%4)*2 4:7 = MCBIST error counter for nibble (XX/4) and rank ((XX%4)*2)+1 if 10,
-/// @note 0:3 = MCBIST error counter for port XX/18 and nibble XX%18 4:7 = MCBIST error rank map for
-/// @note port XX/18 and nibble XX%18
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_count( const fapi2::buffer<uint64_t>& i_data, const uint64_t i_index, uint64_t& o_value )
-{
- const uint64_t l_field = i_index % TT::MODAL_SYMBOL_COUNTERS_PER_REG;
- static_assert ( TT::MODAL_SYMBOL_COUNTERS_PER_REG <= 8,
- "mss::ecc_count::get_count: Modal symbol count field index failed range check" );
-
- switch (l_field)
- {
- case 0:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_00, TT::MODAL_SYMBOL_COUNTER_00_LEN>(o_value);
- break;
-
- case 1:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_01, TT::MODAL_SYMBOL_COUNTER_01_LEN>(o_value);
- break;
-
- case 2:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_02, TT::MODAL_SYMBOL_COUNTER_02_LEN>(o_value);
- break;
-
- case 3:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_03, TT::MODAL_SYMBOL_COUNTER_03_LEN>(o_value);
- break;
-
- case 4:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_04, TT::MODAL_SYMBOL_COUNTER_04_LEN>(o_value);
- break;
-
- case 5:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_05, TT::MODAL_SYMBOL_COUNTER_05_LEN>(o_value);
- break;
-
- case 6:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_06, TT::MODAL_SYMBOL_COUNTER_06_LEN>(o_value);
- break;
-
- case 7:
- i_data.extractToRight<TT::MODAL_SYMBOL_COUNTER_07, TT::MODAL_SYMBOL_COUNTER_07_LEN>(o_value);
- break;
-
- default:
- // shouldn't happen due to modulo above, but here just in case
- FAPI_ERR("Modal symbol count field index failed range check");
- fapi2::Assert(false);
- break;
- }
-
- FAPI_INF("get_count(%d): 0x%02lx", l_field, o_value);
-}
-
-} // close namespace modal_symbol_count
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mbs_error_vector_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/nimbus_mbs_error_vector_trap.H
index 4ed773988..fe6525231 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mbs_error_vector_trap.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/nimbus_mbs_error_vector_trap.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/mbs_error_vector_trap.H $ */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/nimbus_mbs_error_vector_trap.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -24,22 +24,24 @@
/* IBM_PROLOG_END_TAG */
///
-/// @file mbs_error_vector_trap.H
+/// @file nimbus_mbs_error_vector_trap.H
/// @brief Subroutines for the MC MBS error vector trap registers (MBSEVR*Q)
///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
+// *HWP HWP Owner: Matt Hickman <Matthew.Hickman@ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
-#ifndef _MSS_MBS_ERROR_VECTOR_TRAP_H_
-#define _MSS_MBS_ERROR_VECTOR_TRAP_H_
+#ifndef _NIMBUS_MBS_ERROR_VECTOR_TRAP_H_
+#define _NIMBUS_MBS_ERROR_VECTOR_TRAP_H_
#include <fapi2.H>
#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
+#include <lib/utils/nimbus_find.H>
+#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <generic/memory/lib/ecc/ecc_traits.H>
+#include <generic/memory/lib/ecc/mbs_error_vector_trap.H>
namespace mss
{
@@ -51,54 +53,14 @@ namespace mbs_error_vector_trap
{
///
-/// @brief Read MBS Error Vector Trap (MBSEVR*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::getScom(l_mcbist_target, (TT::ERROR_VECTOR_REGS[l_port]), o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Error Vector Trap (MBSEVR*Q) register
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mc
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- const auto& l_mcbist_target = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);
-
- FAPI_TRY( mss::putScom(l_mcbist_target, (TT::ERROR_VECTOR_REGS[l_port]), i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
/// @brief set_nce_galois
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in, out] io_data the register value
/// @param[in] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void set_nce_galois( const fapi2::Target<T>& i_target,
fapi2::buffer<uint64_t>& io_data,
const uint64_t i_value)
@@ -121,12 +83,12 @@ inline void set_nce_galois( const fapi2::Target<T>& i_target,
///
/// @brief get_nce_galois
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in] i_data the register value
/// @param[out] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void get_nce_galois( const fapi2::Target<T>& i_target,
const fapi2::buffer<uint64_t>& i_data,
uint64_t& o_value)
@@ -149,12 +111,12 @@ inline void get_nce_galois( const fapi2::Target<T>& i_target,
///
/// @brief set_nce_magnitude
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in, out] io_data the register value
/// @param[in] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void set_nce_magnitude( const fapi2::Target<T>& i_target,
fapi2::buffer<uint64_t>& io_data,
const uint64_t i_value)
@@ -177,12 +139,12 @@ inline void set_nce_magnitude( const fapi2::Target<T>& i_target,
///
/// @brief get_nce_magnitude
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in] i_data the register value
/// @param[out] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void get_nce_magnitude( const fapi2::Target<T>& i_target,
const fapi2::buffer<uint64_t>& i_data,
uint64_t& o_value)
@@ -205,12 +167,12 @@ inline void get_nce_magnitude( const fapi2::Target<T>& i_target,
///
/// @brief set_tce_galois
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in, out] io_data the register value
/// @param[in] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void set_tce_galois( const fapi2::Target<T>& i_target,
fapi2::buffer<uint64_t>& io_data,
const uint64_t i_value)
@@ -233,12 +195,12 @@ inline void set_tce_galois( const fapi2::Target<T>& i_target,
///
/// @brief get_tce_galois
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in] i_data the register value
/// @param[out] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void get_tce_galois( const fapi2::Target<T>& i_target,
const fapi2::buffer<uint64_t>& i_data,
uint64_t& o_value)
@@ -261,12 +223,12 @@ inline void get_tce_galois( const fapi2::Target<T>& i_target,
///
/// @brief set_tce_magnitude
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in, out] io_data the register value
/// @param[in] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void set_tce_magnitude( const fapi2::Target<T>& i_target,
fapi2::buffer<uint64_t>& io_data,
const uint64_t i_value)
@@ -289,12 +251,12 @@ inline void set_tce_magnitude( const fapi2::Target<T>& i_target,
///
/// @brief get_tce_magnitude
/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
+/// @tparam TT traits type defaults to eccTraits<mc_type::NIMBUS, T>
/// @param[in] i_target the fapi2 target of the mc
/// @param[in] i_data the register value
/// @param[out] i_value the value of the field
///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
+template< fapi2::TargetType T, typename TT = eccTraits<mc_type::NIMBUS, T> >
inline void get_tce_magnitude( const fapi2::Target<T>& i_target,
const fapi2::buffer<uint64_t>& i_data,
uint64_t& o_value)
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/read_error_count_regs.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/read_error_count_regs.H
deleted file mode 100644
index 834f01b19..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/read_error_count_regs.H
+++ /dev/null
@@ -1,648 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/ecc/read_error_count_regs.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file mainline_ue_trap.H
-/// @brief Subroutines for the MBS Memory Scrub/Read Error Count registers (MBSEC*Q)
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_READ_ERROR_COUNT_REGS_H_
-#define _MSS_READ_ERROR_COUNT_REGS_H_
-
-#include <fapi2.H>
-#include <lib/mcbist/address.H>
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace read_error_count_reg0
-{
-
-///
-/// @brief Read MBS Memory Scrub/Read Error Count Register 0 (MBSEC0Q)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- FAPI_TRY( mss::getScom(i_target, TT::READ_ERROR_COUNT_REG0, o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Memory Scrub/Read Error Count Register 0 (MBSEC0Q)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- FAPI_TRY( mss::putScom(i_target, TT::READ_ERROR_COUNT_REG0, i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_intermittent_ce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_INTERMITTENT_CE_COUNT: Intermittent CE Count This is a 12-bit count of
-/// @note intermittent CE events. Will freeze its value upon incrementing to the max
-/// @note value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_intermittent_ce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::INTERMITTENT_CE_COUNT, TT::INTERMITTENT_CE_COUNT_LEN>(i_value);
- FAPI_INF("set_intermittent_ce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_intermittent_ce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_INTERMITTENT_CE_COUNT: Intermittent CE Count This is a 12-bit count of
-/// @note intermittent CE events. Will freeze its value upon incrementing to the max
-/// @note value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_intermittent_ce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::INTERMITTENT_CE_COUNT, TT::INTERMITTENT_CE_COUNT_LEN>(o_value);
- FAPI_INF("get_intermittent_ce_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_soft_ce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_SOFT_CE_COUNT: Soft CE Count This is a 12-bit count of
-/// @note soft CE events. Will freeze its value upon incrementing to the max
-/// @note value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_soft_ce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SOFT_CE_COUNT, TT::SOFT_CE_COUNT_LEN>(i_value);
- FAPI_INF("set_soft_ce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_soft_ce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_SOFT_CE_COUNT: Soft CE Count This is a 12-bit count of
-/// @note soft CE events. Will freeze its value upon incrementing to the max
-/// @note value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_soft_ce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SOFT_CE_COUNT, TT::SOFT_CE_COUNT_LEN>(o_value);
- FAPI_INF("get_soft_ce_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_hard_ce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_HARD_CE_COUNT: Hard CE Count This is a 12-bit count of
-/// @note hard CE events. Will freeze its value upon incrementing to the max
-/// @note value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_hard_ce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::HARD_CE_COUNT, TT::HARD_CE_COUNT_LEN>(i_value);
- FAPI_INF("set_hard_ce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_hard_ce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_HARD_CE_COUNT: Hard CE Count This is a 12-bit count of
-/// @note hard CE events. Will freeze its value upon incrementing to the max
-/// @note value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_hard_ce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::HARD_CE_COUNT, TT::HARD_CE_COUNT_LEN>(o_value);
- FAPI_INF("get_hard_ce_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_intermittent_mce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_INTERMITTENT_MCE_COUNT: Intermittent MCE Count This is a 12-bit count of
-/// @note intermittent Marked Chip Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_intermittent_mce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::INTERMITTENT_MCE_COUNT, TT::INTERMITTENT_MCE_COUNT_LEN>(i_value);
- FAPI_INF("set_intermittent_mce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_intermittent_mce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_INTERMITTENT_MCE_COUNT: Intermittent MCE Count This is a 12-bit count of
-/// @note intermittent Marked Chip Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_intermittent_mce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::INTERMITTENT_MCE_COUNT, TT::INTERMITTENT_MCE_COUNT_LEN>(o_value);
- FAPI_INF("get_intermittent_mce_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_soft_mce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_SOFT_MCE_COUNT: Soft MCE Count This is a 12-bit count of
-/// @note soft Marked Chip Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_soft_mce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SOFT_MCE_COUNT, TT::SOFT_MCE_COUNT_LEN>(i_value);
- FAPI_INF("set_soft_mce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_soft_mce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_SOFT_MCE_COUNT: Soft MCE Count This is a 12-bit count of
-/// @note soft Marked Chip Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_soft_mce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SOFT_MCE_COUNT, TT::SOFT_MCE_COUNT_LEN>(o_value);
- FAPI_INF("get_soft_mce_count: 0x%03lx", o_value);
-}
-
-} // close namespace read_error_count_reg0
-
-namespace read_error_count_reg1
-{
-
-///
-/// @brief Read MBS Memory Scrub/Read Error Count Register 1 (MBSEC1Q)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- FAPI_TRY( mss::getScom(i_target, TT::READ_ERROR_COUNT_REG1, o_data) );
- FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Memory Scrub/Read Error Count Register 1 (MBSEC1Q)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- FAPI_TRY( mss::putScom(i_target, TT::READ_ERROR_COUNT_REG1, i_data) );
- FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_hard_mce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_HARD_MCE_COUNT: Hard MCE Count This is a 12-bit count of
-/// @note hard Marked Chip Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_hard_mce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::HARD_MCE_COUNT, TT::HARD_MCE_COUNT_LEN>(i_value);
- FAPI_INF("set_hard_mce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_hard_mce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_HARD_MCE_COUNT: Hard MCE Count This is a 12-bit count of
-/// @note hard Marked Chip Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_hard_mce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::HARD_MCE_COUNT, TT::HARD_MCE_COUNT_LEN>(o_value);
- FAPI_INF("get_hard_mce_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_ice_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_ICE_COUNT: ICE (IMPE) Count This is a 12-bit count of
-/// @note Intermittent Marked-Placed Chip Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_ice_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::ICE_COUNT, TT::ICE_COUNT_LEN>(i_value);
- FAPI_INF("set_ice_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_ice_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_ICE_COUNT: ICE (IMPE) Count This is a 12-bit count of
-/// @note Intermittent Marked-Placed Chip Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_ice_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::ICE_COUNT, TT::ICE_COUNT_LEN>(o_value);
- FAPI_INF("get_ice_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_ue_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_UE_COUNT: UE Count This is a 12-bit count of
-/// @note Uncorrectable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_ue_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::UE_COUNT, TT::UE_COUNT_LEN>(i_value);
- FAPI_INF("set_ue_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_ue_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_UE_COUNT: UE Count This is a 12-bit count of
-/// @note Uncorrectable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_ue_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::UE_COUNT, TT::UE_COUNT_LEN>(o_value);
- FAPI_INF("get_ue_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_aue_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_AUE_COUNT: AUE Count This is a 12-bit count of
-/// @note AUE Parity Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_aue_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::AUE_COUNT, TT::AUE_COUNT_LEN>(i_value);
- FAPI_INF("set_aue_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_aue_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_AUE_COUNT: AUE Count This is a 12-bit count of
-/// @note AUE Parity Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_aue_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::AUE_COUNT, TT::AUE_COUNT_LEN>(o_value);
- FAPI_INF("get_aue_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_rce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSEC0Q_RCE_COUNT: RCE Count This is a 12-bit count of
-/// @note Retried Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_rce_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::RCE_COUNT, TT::RCE_COUNT_LEN>(i_value);
- FAPI_INF("set_rce_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_rce_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSEC0Q_RCE_COUNT: RCE Count This is a 12-bit count of
-/// @note Retried Correctable Error events. Will freeze its value upon
-/// @note incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_rce_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::RCE_COUNT, TT::RCE_COUNT_LEN>(o_value);
- FAPI_INF("get_rce_count: 0x%03lx", o_value);
-}
-
-} // close namespace read_error_count_reg1
-
-namespace mark_symbol_count_reg
-{
-
-///
-/// @brief Read MBS Mark Symbol Error Count Register (MBSMSECQ)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @param[out] o_data the value of the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- FAPI_TRY( mss::getScom(i_target, TT::MARK_SYMBOL_COUNT_REG, o_data) );
- FAPI_INF("read: 0x%016lx", o_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Write MBS Mark Symbol Error Count Register (MBSMSECQ)
-/// @tparam T fapi2 Target Type - derived from i_target's type
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @param[in] i_data the value to write to the register
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- FAPI_TRY( mss::putScom(i_target, TT::MARK_SYMBOL_COUNT_REG, i_data) );
- FAPI_INF("write: 0x%016lx", i_data);
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set_symbol0_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL0_COUNT: MCE Symbol 0 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 0 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_symbol0_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SYMBOL0_COUNT, TT::SYMBOL0_COUNT_LEN>(i_value);
- FAPI_INF("set_symbol0_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_symbol0_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL0_COUNT: MCE Symbol 0 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 0 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_symbol0_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SYMBOL0_COUNT, TT::SYMBOL0_COUNT_LEN>(o_value);
- FAPI_INF("get_symbol0_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_symbol1_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL1_COUNT: MCE Symbol 1 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 1 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_symbol1_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SYMBOL1_COUNT, TT::SYMBOL1_COUNT_LEN>(i_value);
- FAPI_INF("set_symbol1_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_symbol1_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL1_COUNT: MCE Symbol 1 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 1 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_symbol1_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SYMBOL1_COUNT, TT::SYMBOL1_COUNT_LEN>(o_value);
- FAPI_INF("get_symbol1_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_symbol2_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL2_COUNT: MCE Symbol 2 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 2 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_symbol2_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SYMBOL2_COUNT, TT::SYMBOL2_COUNT_LEN>(i_value);
- FAPI_INF("set_symbol2_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_symbol2_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL2_COUNT: MCE Symbol 2 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 2 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_symbol2_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SYMBOL2_COUNT, TT::SYMBOL2_COUNT_LEN>(o_value);
- FAPI_INF("get_symbol2_count: 0x%03lx", o_value);
-}
-
-///
-/// @brief set_symbol3_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in, out] io_data the register value
-/// @param[in] i_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL3_COUNT: MCE Symbol 3 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 3 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void set_symbol3_count( fapi2::buffer<uint64_t>& io_data, const uint64_t i_value )
-{
- io_data.insertFromRight<TT::SYMBOL3_COUNT, TT::SYMBOL3_COUNT_LEN>(i_value);
- FAPI_INF("set_symbol3_count: 0x%03lx", i_value);
-}
-
-///
-/// @brief get_symbol3_count
-/// @tparam T fapi2 Target Type defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @param[in] i_data the register value
-/// @param[out] o_value the value of the field
-/// @note MBSMSECQ_MCE_SYMBOL3_COUNT: MCE Symbol 3 Error Count This is a 8-bit count
-/// @note that increments on MCE when Symbol 3 under chip mark takes error. Will freeze
-/// @note its value upon incrementing to the max value until reset.
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = eccTraits<T> >
-inline void get_symbol3_count( const fapi2::buffer<uint64_t>& i_data, uint64_t& o_value )
-{
- i_data.extractToRight<TT::SYMBOL3_COUNT, TT::SYMBOL3_COUNT_LEN>(o_value);
- FAPI_INF("get_symbol3_count: 0x%03lx", o_value);
-}
-
-} // close namespace mark_symbol_count_reg
-
-} // close namespace ecc
-
-} // close namespace mss
-
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C
index 35e1dd62e..61326898d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/memory_size.C
@@ -38,7 +38,7 @@
#include <lib/mss_attribute_accessors.H>
#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/memory_size.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
namespace mss
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_mss_voltage.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_mss_voltage.C
index d895897ca..df3390257 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_mss_voltage.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_mss_voltage.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -42,7 +42,7 @@
// Generic libraries
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/spd/spd_facade.H>
#include <generic/memory/lib/utils/voltage/gen_mss_voltage_traits.H>
#include <generic/memory/lib/utils/voltage/gen_mss_volt.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_pre_data_engine.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_pre_data_engine.C
index 281fe8c56..d8358a8a5 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_pre_data_engine.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/nimbus_pre_data_engine.C
@@ -34,7 +34,7 @@
// *HWP Level: 3
// *HWP Consumed by: CI
-#include <generic/memory/lib/data_engine/pre_data_init.H>
+#include <lib/eff_config/pre_data_init.H>
namespace mss
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/p9n_data_init_traits.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/p9n_data_init_traits.H
new file mode 100644
index 000000000..93d3e43d6
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/p9n_data_init_traits.H
@@ -0,0 +1,473 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/eff_config/p9n_data_init_traits.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
+/* [+] 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 */
+
+///
+/// @file p9n_data_init_traits.H
+/// @brief Trait class definitions for Nimbus pre_data_init
+///
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP FW Owner: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 2
+// *HWP Consumed by: CI
+
+#ifndef _MSS_P9N_PRE_DATA_INIT_TRAITS_H_
+#define _MSS_P9N_PRE_DATA_INIT_TRAITS_H_
+
+#include <fapi2.H>
+#include <generic/memory/lib/data_engine/data_engine_traits_def.H>
+#include <generic/memory/lib/data_engine/data_engine.H>
+#include <lib/mss_attribute_accessors.H>
+
+namespace mss
+{
+
+///
+/// @brief Traits for pre_data_engine
+/// @class preDataInitTraits
+/// @note NIMBUS, DIMM_TYPE specialization
+///
+template<>
+class preDataInitTraits<mss::proc_type::NIMBUS, pre_data_init_fields::DIMM_TYPE>
+{
+ public:
+ using attr_type = fapi2::ATTR_EFF_DIMM_TYPE_Type;
+ static const fapi2::TargetType TARGET_TYPE = fapi2::ATTR_EFF_DIMM_TYPE_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_DIMM_TYPE;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_DIMM_TYPE, i_target, o_setting) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_EFF_DIMM_TYPE, i_target, i_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class preDataInitTraits
+/// @note NIMBUS, DRAM_GEN specialization
+///
+template<>
+class preDataInitTraits<mss::proc_type::NIMBUS, pre_data_init_fields::DRAM_GEN>
+{
+ public:
+ using attr_type = fapi2::ATTR_EFF_DRAM_GEN_Type;
+ static const fapi2::TargetType TARGET_TYPE = fapi2::ATTR_EFF_DRAM_GEN_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_DRAM_GEN;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_DRAM_GEN, i_target, o_setting) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_EFF_DRAM_GEN, i_target, i_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class preDataInitTraits
+/// @note NIMBUS, HYBRID specialization
+///
+template<>
+class preDataInitTraits<mss::proc_type::NIMBUS, pre_data_init_fields::HYBRID>
+{
+ public:
+ using attr_type = fapi2::ATTR_EFF_HYBRID_Type;
+ static const fapi2::TargetType TARGET_TYPE = fapi2::ATTR_EFF_HYBRID_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_HYBRID;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_HYBRID, i_target, o_setting) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_EFF_HYBRID, i_target, i_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class preDataInitTraits
+/// @note NIMBUS, HYBRID_MEDIA specialization
+///
+template<>
+class preDataInitTraits<mss::proc_type::NIMBUS, pre_data_init_fields::HYBRID_MEDIA>
+{
+ public:
+ using attr_type = fapi2::ATTR_EFF_HYBRID_MEMORY_TYPE_Type;
+ static const fapi2::TargetType TARGET_TYPE = fapi2::ATTR_EFF_HYBRID_MEMORY_TYPE_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_HYBRID_MEDIA;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_HYBRID_MEMORY_TYPE, i_target, o_setting) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_EFF_HYBRID_MEMORY_TYPE, i_target, i_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class preDataInitTraits
+/// @note NIMBUS, MRANKS specialization
+///
+template<>
+class preDataInitTraits<mss::proc_type::NIMBUS, pre_data_init_fields::MRANKS>
+{
+ public:
+ using attr_type = fapi2::ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_Type;
+ static const fapi2::TargetType TARGET_TYPE = fapi2::ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_MRANKS;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM, i_target, o_setting) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM, i_target, i_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class preDataInitTraits
+/// @note NIMBUS, DIMM_RANKS_CNFG specialization
+///
+template<>
+struct preDataInitTraits<mss::proc_type::NIMBUS, pre_data_init_fields::DIMM_RANKS_CNFG>
+{
+ using attr_type = fapi2::ATTR_EFF_DIMM_RANKS_CONFIGED_Type;
+ static const fapi2::TargetType TARGET_TYPE = fapi2::ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_DIMM_RANKS_CNFG;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ return FAPI_ATTR_GET(fapi2::ATTR_EFF_DIMM_RANKS_CONFIGED, i_target, o_setting);
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_EFF_DIMM_RANKS_CONFIGED, i_target, i_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class attrEngineTraits
+/// @note AXONE, DIMM_TYPE_METADATA specialization
+///
+template<>
+struct attrEngineTraits<proc_type::NIMBUS, generic_metadata_fields, generic_metadata_fields::DIMM_TYPE_METADATA>
+{
+ using attr_type = fapi2::ATTR_MEM_DIMM_TYPE_METADATA_Type;
+ using attr_integral_type = std::remove_all_extents<attr_type>::type;
+ static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_DIMM_TYPE_METADATA_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_DIMM_TYPE_METADATA;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ return FAPI_ATTR_GET(fapi2::ATTR_MEM_DIMM_TYPE_METADATA, i_target, o_setting);
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_MEM_DIMM_TYPE_METADATA, i_target, i_setting);
+ }
+
+ ///
+ /// @brief Computes setting for attribute
+ /// @param[in] i_spd_data SPD data
+ /// @param[in] i_setting value we want to set attr with
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_value_to_set(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ attr_integral_type& o_setting)
+ {
+ return mss::eff_dimm_type(i_target, o_setting);
+ }
+};
+
+///
+/// @brief Traits associated with DIMM positioning
+/// @class dimmPosTraits - NIMBUS specializattion
+///
+template<>
+class dimmPosTraits<mss::mc_type::NIMBUS>
+{
+ private:
+ using PT = posTraits<fapi2::TARGET_TYPE_DIMM>;
+ using MT = mss::mcTypeTraits<mc_type::NIMBUS>;
+
+ public:
+ // Public interface syntatic sugar
+ using pos_type = PT::pos_type;
+
+ // Proc 0 is DIMM 0-15, proc 2 is 64-79. 64 is the stride between processors
+ static constexpr auto DIMM_STRIDE_PER_PROC = 64;
+ static constexpr auto TOTAL_DIMM = MT::MC_PER_MODULE * MT::MCS_PER_MC * MT::PORTS_PER_MCS * MT::DIMMS_PER_PORT;
+
+ ///
+ /// @brief Return the PROC_CHIP parent of a DIMM
+ /// @param[in] i_target the dimm target
+ /// @return the fapi2 proc target
+ ///
+ static fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> get_proc(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target)
+ {
+ // Using fapi2 rather than mss::find as this is pretty low level stuff.
+ return i_target.getParent<fapi2::TARGET_TYPE_MCA>().getParent<fapi2::TARGET_TYPE_PROC_CHIP>();
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class attrEngineTraits
+/// @note generic_metadata_fields, DRAM_GEN_METADATA specialization
+///
+template<>
+struct attrEngineTraits<proc_type::NIMBUS, generic_metadata_fields, generic_metadata_fields::DRAM_GEN_METADATA>
+{
+ using attr_type = fapi2::ATTR_MEM_DRAM_GEN_METADATA_Type;
+ using attr_integral_type = std::remove_all_extents<attr_type>::type;
+ static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_DRAM_GEN_METADATA_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_DRAM_GEN_METADATA;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ return FAPI_ATTR_GET(fapi2::ATTR_MEM_DRAM_GEN_METADATA, i_target, o_setting);
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_MEM_DRAM_GEN_METADATA, i_target, i_setting);
+ }
+
+ ///
+ /// @brief Computes setting for attribute
+ /// @param[in] i_spd_data SPD data
+ /// @param[in] i_setting value we want to set attr with
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_value_to_set(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ attr_integral_type& o_setting)
+ {
+ return mss::eff_dram_gen(i_target, o_setting);
+ }
+};
+
+///
+/// @brief Traits for pre_data_engine
+/// @class attrEngineTraits
+/// @note generic_metadata_fields, DIMM_POS_METADATA specialization
+///
+template<>
+struct attrEngineTraits<proc_type::NIMBUS, generic_metadata_fields, generic_metadata_fields::DIMM_POS_METADATA>
+{
+ using attr_type = fapi2::ATTR_MEM_DIMM_POS_METADATA_Type;
+ using attr_integral_type = std::remove_all_extents<attr_type>::type;
+ static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_DIMM_POS_METADATA_TargetType;
+ static constexpr generic_ffdc_codes FFDC_CODE = SET_DIMM_POS_METADATA;
+
+ ///
+ /// @brief attribute getter
+ /// @param[in] i_target the MCS target
+ /// @param[out] o_setting array to populate
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& o_setting)
+ {
+ return FAPI_ATTR_GET(fapi2::ATTR_MEM_DIMM_POS_METADATA, i_target, o_setting);
+ }
+
+ ///
+ /// @brief attribute setter
+ /// @param[in] i_target the MCS target
+ /// @param[in] i_setting array to set
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
+ attr_type& i_setting)
+ {
+ return FAPI_ATTR_SET(fapi2::ATTR_MEM_DIMM_POS_METADATA, i_target, i_setting);
+ }
+
+ ///
+ /// @brief Computes setting for attribute
+ /// @param[in] i_spd_data SPD data
+ /// @param[in] i_setting value we want to set attr with
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ static fapi2::ReturnCode get_value_to_set(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ attr_integral_type& o_setting)
+ {
+ using TT = mss::dimmPosTraits<mss::mc_type::NIMBUS>;
+ return gen::dimm_pos<TT>(i_target, o_setting);
+ }
+};
+
+}// mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C
index 5a8f25ab3..75c378da8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C
@@ -34,6 +34,8 @@
// *HWP Consumed by: FSP:HB
#include <fapi2.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/shared/mss_const.H>
#include <vpd_access.H>
#include <mss.H>
#include <algorithm>
@@ -65,7 +67,7 @@ namespace code
/// @return fapi2::FAPI2_RC_SUCCESS if no LRDIMM, otherwise a MSS_PLUG_RULE error code
/// @note This function will commit error logs representing the mixing failure
///
-fapi2::ReturnCode check_lrdimm( const std::vector<dimm::kind>& i_kinds )
+fapi2::ReturnCode check_lrdimm( const std::vector<dimm::kind<>>& i_kinds )
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -100,7 +102,7 @@ fapi_try_exit:
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_xlate_config(const fapi2::Target<TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
if (i_kinds.size() > 1)
{
@@ -149,7 +151,7 @@ fapi_try_exit:
/// @note The DIMM kind should be a DIMM on the MCA
///
fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const dimm::kind& i_kind,
+ const dimm::kind<>& i_kind,
const fapi2::buffer<uint8_t>& i_mrw_supported_list)
{
// Contains a mapping of the DRAM width to the bitmap value to be checked for support
@@ -194,7 +196,7 @@ fapi_try_exit:
/// This function will commit error logs if a DIMM has an unsupported DRAM width
///
fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -220,7 +222,7 @@ fapi_try_exit:
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -249,7 +251,7 @@ fapi_try_exit:
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_hybrid(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
// Make sure we don't get a stale error
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -295,10 +297,11 @@ fapi_try_exit:
fapi2::ReturnCode dimm_slot_is_nv_capable(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
bool& o_is_capable)
{
- const auto l_pos = mss::pos(i_target);
-
+ uint8_t l_pos = 0;
fapi2::buffer<uint64_t> l_plug_rules_bitmap = 0;
+ FAPI_TRY( mss::mrw_nvdimm_slot_position(i_target, l_pos) );
+
FAPI_TRY( mss::mrw_nvdimm_plug_rules(l_plug_rules_bitmap) );
o_is_capable = l_plug_rules_bitmap.getBit(l_pos);
@@ -319,7 +322,7 @@ fapi_try_exit:
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_nvdimm(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
bool l_nvdimm_in_port = false;
@@ -370,7 +373,7 @@ fapi_try_exit:
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_stack_type(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -473,7 +476,7 @@ bool unsupported_rank_helper(const uint64_t i_dimm0_ranks,
/// @note This function will commit error logs representing the mixing failure
///
fapi2::ReturnCode dimm_type_mixing(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds)
+ const std::vector<dimm::kind<>>& i_kinds)
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -609,7 +612,7 @@ fapi_try_exit:
/// @param[in] i_kinds a vector of DIMM kind structs
/// @return fapi2::ReturnCode
///
-fapi2::ReturnCode check_gen( const std::vector<dimm::kind>& i_kinds )
+fapi2::ReturnCode check_gen( const std::vector<dimm::kind<>>& i_kinds )
{
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
@@ -641,7 +644,7 @@ fapi_try_exit:
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_rank_config(const fapi2::Target<TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds,
+ const std::vector<dimm::kind<>>& i_kinds,
const uint64_t i_ranks_override)
{
// We need to keep track of current_err ourselves as the FAPI_ASSERT_NOEXIT macro doesn't.
@@ -687,8 +690,8 @@ fapi2::ReturnCode check_rank_config(const fapi2::Target<TARGET_TYPE_MCA>& i_targ
// (really probably that's the only case it catches but <shhhhh>.)
// I don't think f/w supports std::count ... There aren't many DIMM on this port ...
uint64_t l_rank_count = 0;
- const dimm::kind* l_dimm0_kind = nullptr;
- const dimm::kind* l_dimm1_kind = nullptr;
+ const dimm::kind<>* l_dimm0_kind = nullptr;
+ const dimm::kind<>* l_dimm1_kind = nullptr;
for (const auto& k : i_kinds)
{
@@ -766,7 +769,7 @@ fapi_try_exit:
/// @return fapi2::FAPI2_RC_SUCCESS if okay, otherwise a MSS_PLUG_RULE error code
///
fapi2::ReturnCode check_nvdimm_pairing(const fapi2::Target<fapi2::TARGET_TYPE_MCS> i_target,
- const std::vector<dimm::kind>& l_kinds)
+ const std::vector<dimm::kind<>>& l_kinds)
{
// 3 scenarios where the pairing rule would fail:
// (1). Odd number of NVDIMMs installed
@@ -866,7 +869,7 @@ fapi2::ReturnCode plug_rule::enforce_plug_rules(const fapi2::Target<fapi2::TARGE
// Enforce the NVDIMM pairing rule
{
- const auto l_dimm_kinds = mss::dimm::kind::vector(l_dimms);
+ const auto l_dimm_kinds = mss::dimm::kind<>::vector(l_dimms);
FAPI_TRY( plug_rule::check_nvdimm_pairing(i_target, l_dimm_kinds) );
}
@@ -895,7 +898,7 @@ fapi2::ReturnCode plug_rule::enforce_plug_rules(const fapi2::Target<fapi2::TARGE
// Safe, even though the VPD decoder can get us here before the rest of eff_config has completed.
// We'll only use the master rank information to enforce the rank config rules (which will have been
// decoded and are valid before VPD was asked for.)
- const auto l_dimm_kinds = mss::dimm::kind::vector(l_dimms);
+ const auto l_dimm_kinds = mss::dimm::kind<>::vector(l_dimms);
uint64_t l_ranks_override = 0;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H
index a730fa9a4..24da77869 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H
@@ -38,7 +38,7 @@
#include <fapi2.H>
#include <cstdint>
-#include <lib/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
namespace mss
{
@@ -106,7 +106,7 @@ fapi2::ReturnCode empty_slot_zero(const fapi2::Target<T>& i_target);
/// @return std::pair representing the type and the count.
/// @note the vector of kinds comes back sorted by DIMM type.
///
-std::pair<uint8_t, uint64_t> dimm_type_helper(std::vector<dimm::kind>& io_kinds);
+std::pair<uint8_t, uint64_t> dimm_type_helper(std::vector<dimm::kind<>>& io_kinds);
///
/// @brief Rank violation helper
@@ -142,7 +142,7 @@ inline void rank_violation(const fapi2::Target<T>& i_target, const uint8_t l_dim
/// @note This function will commit error logs representing the mixing failure
///
fapi2::ReturnCode dimm_type_mixing(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
///
/// @brief Enforce rank configs
@@ -155,7 +155,7 @@ fapi2::ReturnCode dimm_type_mixing(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_rank_config(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds,
+ const std::vector<dimm::kind<>>& i_kinds,
const uint64_t i_ranks_override);
///
@@ -167,7 +167,7 @@ fapi2::ReturnCode check_rank_config(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
/// @note The DIMM kind should be a DIMM on the MCA
///
fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const dimm::kind& i_kind,
+ const dimm::kind<>& i_kind,
const fapi2::buffer<uint8_t>& i_mrw_supported_list);
///
@@ -179,7 +179,7 @@ fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target<fapi2::T
/// This function will commit error logs if a DIMM has an unsupported DRAM width
///
fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
///
/// @brief Enforce DRAM width checks
@@ -190,7 +190,7 @@ fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target<fapi2::T
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
///
/// @brief Enforce DRAM stack type checks
@@ -201,7 +201,7 @@ fapi2::ReturnCode check_dram_width(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_stack_type(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
///
/// @brief Enforce hybrid DIMM checks
@@ -212,7 +212,7 @@ fapi2::ReturnCode check_stack_type(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_hybrid(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
///
/// @brief Enforces that NVDIMM are plugged in the proper location
@@ -223,7 +223,7 @@ fapi2::ReturnCode check_hybrid(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_ta
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_nvdimm(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
///
/// @brief Enforce the NVDIMM pairing per MCS
@@ -232,7 +232,7 @@ fapi2::ReturnCode check_nvdimm(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_ta
/// @return fapi2::FAPI2_RC_SUCCESS if okay, otherwise a MSS_PLUG_RULE error code
///
fapi2::ReturnCode check_nvdimm_pairing(const fapi2::Target<fapi2::TARGET_TYPE_MCS> i_target,
- const std::vector<dimm::kind>& l_kinds);
+ const std::vector<dimm::kind<>>& l_kinds);
// Adding in code based plug rules - as supporting code gets added, the following checks can be deleted
namespace code
@@ -244,7 +244,7 @@ namespace code
/// @return fapi2::FAPI2_RC_SUCCESS if no LRDIMM, otherwise a MSS_PLUG_RULE error code
/// @note This function will commit error logs representing the mixing failure
///
-fapi2::ReturnCode check_lrdimm( const std::vector<dimm::kind>& i_kinds );
+fapi2::ReturnCode check_lrdimm( const std::vector<dimm::kind<>>& i_kinds );
///
/// @brief Enforce equivalent rank and row configs
@@ -255,7 +255,7 @@ fapi2::ReturnCode check_lrdimm( const std::vector<dimm::kind>& i_kinds );
/// @note Expects the kind array to represent the DIMM on the port.
///
fapi2::ReturnCode check_xlate_config(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const std::vector<dimm::kind>& i_kinds);
+ const std::vector<dimm::kind<>>& i_kinds);
} // code
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/pre_data_init.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/pre_data_init.H
new file mode 100644
index 000000000..14d25f63b
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/pre_data_init.H
@@ -0,0 +1,438 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/eff_config/pre_data_init.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
+/* [+] 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 */
+
+///
+/// @file pre_data_init.H
+/// @brief Class to set preliminary eff_config attributes
+///
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP FW Owner: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 2
+// *HWP Consumed by: CI
+
+#ifndef _MSS_PRE_DATA_INIT_H_
+#define _MSS_PRE_DATA_INIT_H_
+
+#include <cstring>
+#include <fapi2.H>
+#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <generic/memory/lib/spd/spd_facade.H>
+#include <generic/memory/lib/utils/find.H>
+#include <lib/eff_config/p9n_data_init_traits.H>
+#include <generic/memory/lib/data_engine/data_engine_utils.H>
+
+namespace mss
+{
+// TK - Remove generalizations since this is dubbed Nimbus specific implementation
+
+///
+/// @class DataSetterTraits2D
+/// @brief Traits for setting eff_config data
+/// @tparam P proc_type
+/// @tparam X size of 1st array index
+/// @tparam Y size of 2nd array index
+///
+template < proc_type P, size_t X, size_t Y >
+struct DataSetterTraits2D;
+
+///
+/// @class DataSetterTraits - Nimbus, [PORT][DIMM] array specialization
+/// @brief Traits for setting eff_config data
+///
+template < >
+struct DataSetterTraits2D < proc_type::NIMBUS,
+ mcTypeTraits<mc_type::NIMBUS>::PORTS_PER_MCS,
+ mcTypeTraits<mc_type::NIMBUS>::DIMMS_PER_PORT
+ >
+{
+ static constexpr fapi2::TargetType TARGET = fapi2::TARGET_TYPE_MCA;
+};
+
+///
+/// @brief Helper function to update a 2D array output
+/// @tparam P proc_type
+/// @tparam X size of 1st array index
+/// @tparam Y size of 2nd array index
+/// @tparam T Input/output data type
+/// @tparam TT defaulted to DataSetterTraits2D<P, X, Y>
+/// @param[in] i_target the DIMM target
+/// @param[in] i_setting array to set
+/// @param[in] i_ffdc_code FFDC function code
+/// @param[out] o_data attribute data structure to set
+/// @warning This is Nimbus specific until MCA alias to MEM_PORT
+///
+template < proc_type P,
+ size_t X,
+ size_t Y,
+ typename T,
+ typename TT = DataSetterTraits2D<P, X, Y>
+ >
+fapi2::ReturnCode update_data(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const T i_setting,
+ const generic_ffdc_codes i_ffdc_code,
+ T (&o_data)[X][Y])
+{
+ // Currenlty only valid for a DIMM target, for Nimbus, traits enforces this at compile time
+ // Use case is currently for pre_eff_config which is supported in both Axone and Nimbus
+ const auto l_port_index = mss::index( find_target<TT::TARGET>(i_target) );
+ const auto l_dimm_index = mss::index(i_target);
+
+ FAPI_ASSERT( l_port_index < X,
+ fapi2::MSS_OUT_OF_BOUNDS_INDEXING()
+ .set_INDEX(l_port_index)
+ .set_LIST_SIZE(X)
+ .set_FUNCTION(i_ffdc_code)
+ .set_TARGET(i_target),
+ "Port index (%d) was larger than max (%d) on %s",
+ l_port_index,
+ X,
+ mss::spd::c_str(i_target) );
+
+ FAPI_ASSERT( l_dimm_index < Y,
+ fapi2::MSS_OUT_OF_BOUNDS_INDEXING()
+ .set_INDEX(l_dimm_index)
+ .set_LIST_SIZE(Y)
+ .set_FUNCTION(i_ffdc_code)
+ .set_TARGET(i_target),
+ "DIMM index (%d) was larger than max (%d) on %s",
+ l_dimm_index,
+ Y,
+ mss::spd::c_str(i_target) );
+
+ o_data[l_port_index][l_dimm_index] = i_setting;
+
+ return fapi2::FAPI2_RC_SUCCESS;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Sets attr data fields
+/// @tparam P proc_type
+/// @tparam TT data engine class traits (e.g. preDataInitTraits, etc.)
+/// @tparam T FAPI2 target type
+/// @tparam IT Input data type
+/// @param[in] i_target the FAPI target
+/// @param[in] i_setting value we want to set attr with
+/// @return FAPI2_RC_SUCCESS iff okay
+///
+template< proc_type P,
+ typename TT,
+ fapi2::TargetType T,
+ typename IT >
+inline fapi2::ReturnCode set_field(const fapi2::Target<T>& i_target,
+ const IT i_setting)
+{
+ const auto l_attr_target = mss::find_target<TT::TARGET_TYPE>(i_target);
+ typename TT::attr_type l_attr_list = {};
+ FAPI_TRY( TT::get_attr(l_attr_target, l_attr_list) );
+
+ FAPI_TRY( update_data<P>(i_target, i_setting, TT::FFDC_CODE, l_attr_list) );
+ FAPI_TRY( TT::set_attr(l_attr_target, l_attr_list) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Sets preliminary data fields
+/// @tparam P processor type (e.g. NIMBUS, AXONE, etc.)
+/// @tparam F pre_data_init_fields
+/// @tparam T FAPI2 target type
+/// @tparam IT Input data type
+/// @tparam TT defaulted to preDataInitTraits<T>
+/// @param[in] i_setting value we want to set attr with
+/// @return FAPI2_RC_SUCCESS iff okay
+///
+template< proc_type P,
+ pre_data_init_fields F,
+ fapi2::TargetType T,
+ typename IT,
+ typename TT = preDataInitTraits<P, F>
+ >
+inline fapi2::ReturnCode set_field(const fapi2::Target<T>& i_target,
+ const IT i_setting)
+{
+ FAPI_TRY( (set_field<P, TT>(i_target, i_setting)),
+ "Failed set_field() for %s", spd::c_str(i_target) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Data structure to set pre-effective config data
+/// @class pre_data_engine
+/// @tparam P supported processor type (e.g. Nimbus, Axone, etc.)
+///
+template< proc_type P >
+class pre_data_engine
+{
+ private:
+
+ fapi2::Target<fapi2::TARGET_TYPE_DIMM> iv_dimm;
+ spd::facade iv_spd_data;
+
+ public:
+
+ static const std::vector<std::pair<uint8_t, uint8_t> > NUM_PACKAGE_RANKS_MAP;
+ static const std::vector<std::pair<uint8_t, uint8_t> > BASE_MODULE_TYPE_MAP;
+ static const std::vector<std::pair<uint8_t, uint8_t> > DRAM_GEN_MAP;
+ static const std::vector<std::pair<uint8_t, uint8_t> > HYBRID_MAP;
+ static const std::vector<std::pair<uint8_t, uint8_t> > HYBRID_MEMORY_TYPE_MAP;
+
+ ///
+ /// @brief ctor
+ /// @param[in] i_target the DIMM target
+ /// @param[in] i_spd_data SPD decoder
+ ///
+ pre_data_engine(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const spd::facade& i_spd_data):
+ iv_dimm(i_target),
+ iv_spd_data(i_spd_data)
+ {}
+
+ ///
+ /// @brief default dtor
+ ///
+ ~pre_data_engine() = default;
+
+ ///
+ /// @brief Set ATTR_EFF_DIMM_TYPE
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode set_dimm_type()
+ {
+ uint8_t l_base_module_type = 0;
+ uint8_t l_dimm_type = 0;
+
+ FAPI_TRY(iv_spd_data.base_module(l_base_module_type));
+ FAPI_TRY(lookup_table_check(iv_dimm, BASE_MODULE_TYPE_MAP, SET_ATTR_DIMM_TYPE, l_base_module_type, l_dimm_type));
+ FAPI_TRY( (set_field<P, pre_data_init_fields::DIMM_TYPE>(iv_dimm, l_dimm_type)) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief Set ATTR_EFF_DRAM_GEN
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode set_dram_gen()
+ {
+ uint8_t l_device_type = 0;
+ uint8_t l_dram_gen = 0;
+
+ FAPI_TRY(iv_spd_data.device_type(l_device_type));
+ FAPI_TRY(lookup_table_check(iv_dimm, DRAM_GEN_MAP, SET_ATTR_DRAM_GEN, l_device_type, l_dram_gen));
+
+ FAPI_TRY( (set_field<P, pre_data_init_fields::DRAM_GEN>(iv_dimm, l_dram_gen)) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief Set ATTR_EFF_HYBRID
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode set_hybrid()
+ {
+ uint8_t l_spd_hybrid_type = 0;
+ uint8_t l_hybrid = 0;
+
+ FAPI_TRY(iv_spd_data.hybrid(l_spd_hybrid_type));
+ FAPI_TRY(lookup_table_check(iv_dimm, HYBRID_MAP, SET_ATTR_HYBRID, l_spd_hybrid_type, l_hybrid));
+
+ FAPI_TRY( (set_field<P, pre_data_init_fields::HYBRID>(iv_dimm, l_hybrid)) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief Set ATTR_EFF_HYBRID_MEMORY_TYPE
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode set_hybrid_media()
+ {
+ uint8_t l_hybrid_media = 0;
+ uint8_t l_spd_hybrid_media = 0;
+
+ FAPI_TRY(iv_spd_data.hybrid_media(l_spd_hybrid_media));
+ FAPI_TRY(lookup_table_check(iv_dimm, HYBRID_MAP, SET_ATTR_HYBRID, l_spd_hybrid_media, l_hybrid_media));
+
+ FAPI_TRY( (set_field<P, pre_data_init_fields::HYBRID_MEDIA>(iv_dimm, l_hybrid_media)) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief Set ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode set_master_ranks()
+ {
+ uint8_t l_master_ranks = 0;
+ FAPI_TRY( get_master_ranks(l_master_ranks) );
+
+ FAPI_TRY( (set_field<P, pre_data_init_fields::MRANKS>(iv_dimm, l_master_ranks)) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ ///
+ /// @brief Sets ATTR_EFF_DIMM_RANKS_CONFIGED
+ /// @return FAPI2_RC_SUCCESS iff okay
+ ///
+ fapi2::ReturnCode set_dimm_ranks_configured()
+ {
+ // Set configed ranks. Set the bit representing the master rank configured (0 being left most.) So,
+ // a 4R DIMM would be 0b11110000 (0xF0). This is used by PRD.
+ fapi2::buffer<uint8_t> l_ranks_configed;
+
+ // Make sure the number of master ranks is setup
+ uint8_t l_master_ranks = 0;
+ FAPI_TRY( get_master_ranks(l_master_ranks) );
+
+ FAPI_TRY( l_ranks_configed.setBit(0, l_master_ranks),
+ "%s. Failed to setBit", spd::c_str(iv_dimm) );
+
+ FAPI_TRY( (set_field<P, pre_data_init_fields::DIMM_RANKS_CNFG>(iv_dimm, uint8_t(l_ranks_configed))) );
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+ private:
+
+ ///
+ /// @brief Gets master ranks from SPD
+ /// @param[out] o_output num package ranks per DIMM
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode get_master_ranks(uint8_t& o_output)
+ {
+ // Sets up commonly used member variables
+ uint8_t l_master_ranks_spd = 0;
+ FAPI_TRY(iv_spd_data.num_package_ranks_per_dimm(l_master_ranks_spd),
+ "%s failed to get number of package ranks from SPD", spd::c_str(iv_dimm));
+
+ FAPI_TRY(lookup_table_check(iv_dimm, NUM_PACKAGE_RANKS_MAP, PRE_DATA_ENGINE_CTOR, l_master_ranks_spd,
+ o_output), "%s failed MASTER_RANKS lookup check", spd::c_str(iv_dimm));
+
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+};
+
+///
+/// @brief Sets pre_eff_config attributes
+/// @tparam P processor type
+/// @param[in] i_target the DIMM target
+/// @param[in] i_spd_decoder SPD decoder
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+template <mss::proc_type P>
+inline fapi2::ReturnCode set_pre_init_attrs( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const spd::facade& i_spd_decoder );
+
+///
+/// @brief Sets pre_eff_config attributes - NIMBUS specialization
+/// @param[in] i_target the DIMM target
+/// @param[in] i_spd_decoder SPD decoder
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+template <>
+inline fapi2::ReturnCode set_pre_init_attrs<mss::proc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&
+ i_target,
+ const spd::facade& i_spd_decoder )
+{
+ // TK explicitly forcing this API to only run in Nimbus, need to move pre_data_engine to Nimbus chip path,
+ // using template recursive algorithm moving forward
+ mss::pre_data_engine<mss::proc_type::NIMBUS> l_data_engine(i_target, i_spd_decoder);
+
+ // Set attributes needed before eff_config
+ // DIMM type and DRAM gen are needed for c_str to aid debugging
+ FAPI_TRY(l_data_engine.set_dimm_type(), "Failed to set DIMM type %s", mss::spd::c_str(i_target) );
+ FAPI_TRY(l_data_engine.set_dram_gen(), "Failed to set DRAM gen %s", mss::spd::c_str(i_target) );
+
+ // Hybrid and hybrid media help detect hybrid modules, specifically NVDIMMs for Nimbus
+ FAPI_TRY(l_data_engine.set_hybrid(), "Failed to set Hybrid %s", mss::spd::c_str(i_target) );
+ FAPI_TRY(l_data_engine.set_hybrid_media(), "Failed to set Hybrid Media %s", mss::spd::c_str(i_target) );
+
+ // Number of master ranks needed for VPD decoding
+ FAPI_TRY(l_data_engine.set_master_ranks(), "Failed to set Master ranks %s", mss::spd::c_str(i_target) );
+
+ // and dimm_ranks_configured is a PRD attr...
+ FAPI_TRY(l_data_engine.set_dimm_ranks_configured(), "Failed to set DIMM ranks configured %s",
+ mss::spd::c_str(i_target) );
+
+ // Adding metadata c-str fields derived from attrs set above
+ FAPI_TRY( (mss::gen::attr_engine<proc_type::NIMBUS, mss::generic_metadata_fields>::set(i_target)),
+ "Failed attr_engine<proc_type::NIMBUS, mss::generic_metadata_fields>::set for %s", mss::spd::c_str(i_target) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Sets pre_eff_config attributes
+/// @tparam P processor type
+/// @tparam T fapi2::TargetType
+/// @param[in] i_target the target on which to operate
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+template <mss::proc_type P, fapi2::TargetType T>
+fapi2::ReturnCode set_pre_init_attrs( const fapi2::Target<T>& i_target )
+{
+ for( const auto& d : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target))
+ {
+ std::vector<uint8_t> l_raw_spd;
+ FAPI_TRY(mss::spd::get_raw_data(d, l_raw_spd));
+ {
+ // Gets the SPD facade
+ fapi2::ReturnCode l_rc(fapi2::FAPI2_RC_SUCCESS);
+ mss::spd::facade l_spd_decoder(d, l_raw_spd, l_rc);
+
+ // Checks that the facade was setup correctly
+ FAPI_TRY(l_rc, "Failed to initialize SPD facade for %s", mss::spd::c_str(d));
+
+ // Sets pre-init attributes
+ FAPI_TRY(mss::set_pre_init_attrs<P>(d, l_spd_decoder), "%s failed to set pre init attrs", mss::spd::c_str(d) );
+ }
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+}//mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.C
index ebc203f2e..ebf1650ea 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -31,173 +31,10 @@
#include <fapi2.H>
#include <mss.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/eff_config/timing.H>
namespace mss
{
-enum temp_mode : uint8_t
-{
- NORMAL = 1,
- EXTENDED = 2,
-};
-
-// Proposed DDR4 Full spec update(79-4B)
-// Item No. 1716.78C
-// pg.46
-// Table 24 - tREFI and tRFC parameters (in ps)
-constexpr uint64_t TREFI_BASE = 7800000;
-
-// Proposed DDR4 3DS Addendum
-// Item No. 1727.58A
-// pg. 69 - 71
-// Table 42 - Refresh parameters by logical rank density
-static const std::vector<std::pair<uint8_t, uint64_t> > TRFC_DLR1 =
-{
- // { density in GBs, tRFC4(min) in picoseconds }
- {4, 90000},
- {8, 120000},
- {16, 185000},
-};
-
-// Proposed DDR4 3DS Addendum
-// Item No. 1727.58A
-// pg. 69 - 71
-// Table 42 - Refresh parameters by logical rank density
-static const std::vector<std::pair<uint8_t, uint64_t> > TRFC_DLR2 =
-{
- // { density in GBs, tRFC4(min) in picoseconds }
- {4, 55000},
- {8, 90000},
- {16, 120000},
-};
-
-// Proposed DDR4 3DS Addendum
-// Item No. 1727.58A
-// pg. 69 - 71
-// Table 42 - Refresh parameters by logical rank density
-static const std::vector<std::pair<uint8_t, uint64_t> > TRFC_DLR4 =
-{
- // { density in GBs, tRFC4(min) in picoseconds }
- {4, 40000},
- {8, 55000},
- {16, 90000},
-};
-
-///
-/// @brief Calculates refresh interval time
-/// @param[in] i_mode fine refresh rate mode
-/// @param[in] i_refresh_request_rate refresh rate
-/// @param[out] o_value timing val in ps
-/// @return fapi2::ReturnCode
-///
-fapi2::ReturnCode calc_trefi( const refresh_rate i_mode,
- const uint8_t i_refresh_request_rate,
- uint64_t& o_timing )
-{
- uint64_t l_refresh_request = 0;
- constexpr double TEN_PERCENT_FASTER = 0.90;
-
- switch(i_refresh_request_rate)
- {
- case fapi2::ENUM_ATTR_MSS_MRW_REFRESH_RATE_REQUEST_SINGLE:
- l_refresh_request = TREFI_BASE;
- break;
-
- case fapi2::ENUM_ATTR_MSS_MRW_REFRESH_RATE_REQUEST_DOUBLE:
- // We are truncating but there is no remainder with TREFI_BASE, so we are okay
- l_refresh_request = TREFI_BASE / 2;
- break;
-
- case fapi2::ENUM_ATTR_MSS_MRW_REFRESH_RATE_REQUEST_SINGLE_10_PERCENT_FASTER:
- // We are truncating but there is no remainder with TREFI_BASE, so we are okay
- // 10% faster so 100% - 10% = 90%
- l_refresh_request = TREFI_BASE * TEN_PERCENT_FASTER;
- break;
-
- case fapi2::ENUM_ATTR_MSS_MRW_REFRESH_RATE_REQUEST_DOUBLE_10_PERCENT_FASTER:
- // We are truncating but there is no remainder with TREFI_BASE, so we are okay
- // 10% faster so 100% - 10% = 90%
- l_refresh_request = (TREFI_BASE / 2) * TEN_PERCENT_FASTER;
- break;
-
- default:
- // Will catch incorrect MRW value set
- FAPI_ASSERT(false,
- fapi2::MSS_INVALID_REFRESH_RATE_REQUEST().set_REFRESH_RATE_REQUEST(i_refresh_request_rate),
- "Incorrect refresh request rate received: %d ", i_refresh_request_rate);
- break;
- }
-
- o_timing = (l_refresh_request / i_mode);
-
- FAPI_INF( "tREFI (ps): %d, refresh request (ps): %d, tREFI_base (ps): %d, REF%dX",
- o_timing, l_refresh_request, TREFI_BASE, i_mode );
-
- // FAPI_ASSERT doesn't set current_err as good
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-/// @brief Calculates Minimum Refresh Recovery Delay Time (different logical rank)
-/// @param[in] i_mode fine refresh rate mode
-/// @param[in] i_density SDRAM density
-/// @param[out] o_trfc_in_ps timing val in ps
-/// @return fapi2::FAPI2_RC_SUCCESS iff okay
-///
-fapi2::ReturnCode calc_trfc_dlr(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_refresh_mode,
- const uint8_t i_density,
- uint64_t& o_trfc_in_ps)
-{
- bool l_is_val_found = 0;
-
- // Selects appropriate tRFC based on fine refresh mode
- switch(i_refresh_mode)
- {
- case fapi2::ENUM_ATTR_MSS_MRW_FINE_REFRESH_MODE_NORMAL:
- l_is_val_found = find_value_from_key(TRFC_DLR1, i_density, o_trfc_in_ps);
- break;
-
- case fapi2::ENUM_ATTR_MSS_MRW_FINE_REFRESH_MODE_FIXED_2X:
- case fapi2::ENUM_ATTR_MSS_MRW_FINE_REFRESH_MODE_FLY_2X:
- l_is_val_found = find_value_from_key(TRFC_DLR2, i_density, o_trfc_in_ps);
- break;
-
- case fapi2::ENUM_ATTR_MSS_MRW_FINE_REFRESH_MODE_FIXED_4X:
- case fapi2::ENUM_ATTR_MSS_MRW_FINE_REFRESH_MODE_FLY_4X:
- l_is_val_found = find_value_from_key(TRFC_DLR4, i_density, o_trfc_in_ps);
- break;
-
- default:
- // Fine Refresh Mode will be a platform attribute set by the MRW,
- // which they "shouldn't" mess up as long as use "attribute" enums.
- // if openpower messes this up we can at least catch it
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FINE_REFRESH()
- .set_REFRESH_MODE(i_refresh_mode),
- "Incorrect Fine Refresh Mode received: %d ",
- i_refresh_mode);
- break;
- }// switch
-
- FAPI_ASSERT( l_is_val_found,
- fapi2::MSS_FAILED_TO_FIND_TRFC()
- .set_SDRAM_DENSITY(i_density)
- .set_REFRESH_MODE(i_refresh_mode)
- .set_DIMM_TARGET(i_target),
- "%s: Unable to find tRFC (ps) from map with SDRAM density key %d with %d refresh mode",
- mss::c_str(i_target),
- i_density,
- i_refresh_mode);
-
- // Again, FAPI_ASSERT doesn't set current_err to good, only to bad
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
}// mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.H
index 8b8215b96..e09fa1a17 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/timing.H
@@ -38,106 +38,15 @@
#include <cstdint>
#include <fapi2.H>
#include <lib/mss_attribute_accessors.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <generic/memory/lib/utils/dimm/mss_timing.H>
#include <lib/utils/mss_nimbus_conversions.H>
namespace mss
{
///
-/// @brief Enums for ffdc error callout so we know which function had the error
-///
-enum functions
-{
- TRAS = 0,
- TFAW_HALF_KB_PAGE_HELPER = 1,
- TFAW_ONE_KB_PAGE_HELPER = 2,
- TFAW_TW_KB_PAGE_HELPER = 3,
- TFAW_SLR_X4_HELPER = 4,
- TFAW_SLR_X8_HELPER = 5,
- TRRD_S_SLR = 6,
- TRRD_L_SLR = 7,
- TRRD_L_HALF_AND_1KB_PAGE_HELPER = 8,
- TRRD_S_HALF_AND_1KB_PAGE_HELPER = 9,
- TRRD_S_2KB_PAGE_HELPER = 10,
- TDLLK = 11,
-};
-
-enum refresh_rate : uint8_t
-{
- REF1X = 1, ///< Refresh rate 1X
- REF2X = 2, ///< Refresh rate 2X
- REF4X = 4, ///< Refresh rate 4X
-};
-
-namespace spd
-{
-
-///
-/// @brief Returns clock cycles form picoseconds based on speed bin
-/// Uses SPD rounding algorithm for DDR4
-/// @tparam T the target type from which to get the mt/s
-/// @tparam OT the output type, derrived from the parameters
-/// @param[in] i_target target for the frequency attribute
-/// @param[in] timing_in_ps timing parameter in ps
-/// @return the clock cycles of timing parameter (provided in ps)
-/// @note Uses DDR4 SPD Contents Rounding Algorithm
-/// @note Item 2220.46
-///
-template<fapi2::TargetType T, typename OT>
-inline OT ps_to_nck( const fapi2::Target<T>& i_target, const OT& i_timing_in_ps)
-{
- uint64_t l_freq = 0;
- OT l_tck_in_ps = 0;
- OT l_temp_nck = 0;
-
- FAPI_TRY( mss::freq( find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq) );
-
- // No time if MT/s is 0 (well, infinite really but shut up)
- if (l_freq == 0)
- {
- return 0;
- }
-
- FAPI_TRY( freq_to_ps(l_freq, l_tck_in_ps),
- "Failed freq() accessor" );
- FAPI_TRY( calc_nck(i_timing_in_ps, l_tck_in_ps, spd::INVERSE_DDR4_CORRECTION_FACTOR, l_temp_nck),
- "Failed calc_nck()" );
-
- return l_temp_nck;
-
-fapi_try_exit:
- // We simply can't work if we can't get the frequency or
- // if we get an unsupported value that can't be converted to a valid tCK (clock period)
- // ...so this should be ok
- FAPI_ERR("Can't get MSS_FREQ, obtained an invalid MSS_FREQ (%d), or overflow occurred - stopping", l_freq);
- fapi2::Assert(false);
-
- // Keeps compiler happy
- return 0;
-}
-
-///
-/// @brief Returns clock cycles from nanoseconds
-/// Uses SPD rounding algorithm for DDR4
-/// @tparam T the target type from which to get the mt/s
-/// @tparam OT the output type, derrived from the parameters
-/// @param[in] timing_in_ps timing parameter in ps
-/// @param[out] o_value_nck the end calculation in nck
-/// @return the clock cycles of timing parameter (provided in ps)F
-/// @note Uses DDR4 SPD Contents Rounding Algorithm
-/// @note Item 2220.46
-///
-template<fapi2::TargetType T, typename OT>
-inline OT ns_to_nck( const fapi2::Target<T>& i_target, const OT& i_timing_in_ns)
-{
- return ps_to_nck(i_target, i_timing_in_ns * CONVERT_PS_IN_A_NS);
-}
-
-}// spd
-
-///
/// @brief Returns application clock period (tCK) based on dimm transfer rate
/// @tparam T the fapi2 target
/// @tparam OT output type
@@ -159,30 +68,6 @@ fapi_try_exit:
}
///
-/// @brief Calculates refresh interval time
-/// @param[in] i_mode fine refresh rate mode
-/// @param[in] i_temp_refresh_range temperature refresh range
-/// @param[out] o_value timing val in ps
-/// @return fapi2::ReturnCode
-///
-fapi2::ReturnCode calc_trefi( const refresh_rate i_mode,
- const uint8_t i_temp_refresh_range,
- uint64_t& o_timing );
-
-///
-/// @brief Calculates Minimum Refresh Recovery Delay Time (different logical rank)
-/// @param[in] i_target a target for attributes
-/// @param[in] i_mode fine refresh rate mode
-/// @param[in] i_density SDRAM density
-/// @param[out] o_trfc_in_ps timing val in ps
-/// @return fapi2::FAPI2_RC_SUCCESS iff okay
-///
-fapi2::ReturnCode calc_trfc_dlr( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_refresh_mode,
- const uint8_t i_density,
- uint64_t& o_trfc_in_ps );
-
-///
/// @brief DLL locking time *in clocks*
/// @tparam T the fapi2::TargetType of i_target
/// @tparam OT the type of the output location
@@ -582,602 +467,6 @@ fapi_try_exit:
}
///
-/// @brief tRTP *in ps*
-/// @return constexpr value of RTP = 7500 ps
-///
-constexpr uint64_t trtp()
-{
- // Per JEDEC spec, defaults to 7500 ps for all frequencies.
- // (technically max of 7.5 ns or 4 nclk, which is always 7.5ns for DDR4)
- return 7500;
-}
-
-///
-/// @brief Return the minimum allowable tRAS in picoseconds
-/// @param[in] i_target the fapi2 target
-/// @return value in picoseconds
-///
-inline uint64_t tras(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target)
-{
- uint64_t l_freq = 0;
- uint64_t l_tras = 0;
-
- // Frequency is used to determine tRAS
- FAPI_TRY( freq(mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq) );
-
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- l_tras = 34000;
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- l_tras = 33000;
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- l_tras = 32000;
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TRAS)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- }
-
- return l_tras;
-
-fapi_try_exit:
-
- // We simply can't work if we can't get the frequency or
- // if we get an unsupported value that can't be converted to a valid tCK (clock period)
- // ...so this should be ok
- FAPI_ERR("Can't get MSS_FREQ or obtained an invalid MSS_FREQ (%d) - stopping", l_freq);
- fapi2::Assert(false);
-
- // Keeps compiler happy
- return 0;
-}
-
-///
-/// @brief Helper function to find tFAW based speed (MT/s) for 1/2 KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode tfaw_half_kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability.
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- switch(l_freq)
- {
- // static_cast is needed for template deduction of std::max API
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- o_output = std::max( 16, spd::ns_to_nck(i_target, 17) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- o_output = std::max( 16, spd::ns_to_nck(i_target, 15) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- o_output = std::max( 16, spd::ns_to_nck(i_target, 13) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- o_output = std::max( 16, spd::ns_to_nck(i_target, 12) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TFAW_HALF_KB_PAGE_HELPER)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Helper function to find tFAW based speed (MT/s) for 1KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode tfaw_1kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability (and ease of debug?).
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- o_output = std::max( 20, spd::ns_to_nck(i_target, 23) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- o_output = std::max( 20, spd::ns_to_nck(i_target, 21) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TFAW_ONE_KB_PAGE_HELPER)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- break;
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Helper function to find tFAW based speed (MT/s) for 2KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode tfaw_2kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
-
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability.
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- o_output = std::max( 28, spd::ns_to_nck(i_target, 30) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TFAW_TW_KB_PAGE_HELPER)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- break;
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return the minimum allowable tFAW in nck
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_dram_width the page size
-/// @param[out] o_tFAW timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-//
-template< fapi2::TargetType T >
-fapi2::ReturnCode tfaw( const fapi2::Target<T>& i_target,
- const uint8_t i_dram_width,
- uint64_t& o_tFAW )
-{
- switch(i_dram_width)
- {
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4:
- FAPI_TRY( tfaw_half_kb_page_helper(i_target, o_tFAW) );
- break;
-
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8:
- FAPI_TRY( tfaw_1kb_page_helper(i_target, o_tFAW) );
- break;
-
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X16:
- FAPI_TRY( tfaw_2kb_page_helper(i_target, o_tFAW) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_DRAM_WIDTH()
- .set_DRAM_WIDTH(i_dram_width)
- .set_DIMM_TARGET(i_target),
- "Invalid DRAM width with %d for target %s",
- i_dram_width,
- mss::c_str(i_target));
- break;
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief tFAW_dlr *in nck*
-/// @return 16nck
-/// @note From DDR4 3DS Spec
-/// 12.2 Timing Parameters by Speed Grade
-///
-constexpr uint64_t tfaw_dlr()
-{
- return 16;
-}
-
-///
-/// @brief tRRD_dlr *in nck*
-/// @return 4nck
-/// @note From DDR4 3DS Spec
-/// 12.2 Timing Parameters by Speed Grade
-///
-constexpr uint64_t trrd_dlr()
-{
- return 4;
-}
-
-///
-/// @brief Helper function to find tRRD_L based speed (MT/s) for 1KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode trrd_l_half_and_1kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability (and ease of debug?).
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- // From the spec: Max(4nCK,5.3ns)
- o_output = std::max( 4, spd::ps_to_nck(i_target, 5300) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- // Max(4nCK,4.9ns)
- o_output = std::max( 4, spd::ps_to_nck(i_target, 4900) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TRRD_L_HALF_AND_1KB_PAGE_HELPER)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Helper function to find tRRD_L based speed (MT/s) for 2KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode trrd_l_2kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
-
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability (and ease of debug?).
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- o_output = std::max( 4, spd::ps_to_nck(i_target, 6400) );
- break;
-
- default:
- FAPI_TRY(fapi2::FAPI2_RC_INVALID_PARAMETER, "%s Invalid frequency %lu", mss::c_str(i_target), l_freq);
- break;
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return the minimum allowable tRRD_L in nck
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_dram_width the page size
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode trrd_l( const fapi2::Target<T>& i_target,
- const uint8_t i_dram_width,
- uint64_t& o_tRRD_L )
-{
- switch(i_dram_width)
- {
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4:
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8:
- FAPI_TRY( trrd_l_half_and_1kb_page_helper(i_target, o_tRRD_L), "Error calculating trrd l for half and 1kb page" );
- break;
-
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X16:
- FAPI_TRY( trrd_l_2kb_page_helper(i_target, o_tRRD_L) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_PAGE_SIZE()
- .set_DRAM_WIDTH(i_dram_width)
- .set_DIMM_TARGET(i_target),
- "%s Recieved an invalid page size: %lu",
- mss::c_str(i_target),
- i_dram_width);
- break;
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Helper function to find tRRD_S based speed (MT/s) for 1KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode trrd_s_half_and_1kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability (and ease of debug?).
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- o_output = std::max( 4, spd::ps_to_nck(i_target, 4200) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- o_output = std::max( 4, spd::ps_to_nck(i_target, 3700) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- o_output = std::max( 4, spd::ps_to_nck(i_target, 3300) );
- break;
-
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- o_output = std::max( 4, spd::ps_to_nck(i_target, 3000) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TRRD_S_HALF_AND_1KB_PAGE_HELPER)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Helper function to find tRRD_S based speed (MT/s) for 2KB page
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[out] o_output timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-static fapi2::ReturnCode trrd_s_2kb_page_helper(const fapi2::Target<T>& i_target,
- uint64_t& o_output)
-{
- // Values derived from DDR4 Spec (79-4A)
- // 13.3 Timing Parameters by Speed Grade
- // Table 132. Pg 240
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- uint64_t l_freq = 0;
- FAPI_TRY( freq(find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq),
- "Failed to invoke freq accessor" );
-
- // It could have been more "efficient" to hand-calculate the answer and
- // use compile time constants to return the answer. To avoid magic
- // numbers and to align (more closely) with the DDR4 JEDEC spec,
- // we let the std library do the work for us for maintainability (and ease of debug?).
- // Could have used compile-time constants to denote the numbers below
- // but they are "random" and vary.
- switch(l_freq)
- {
- case fapi2::ENUM_ATTR_MSS_FREQ_MT1866:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2133:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2400:
- case fapi2::ENUM_ATTR_MSS_FREQ_MT2666:
- o_output = std::max( 4, spd::ps_to_nck(i_target, 5300) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_FREQ_PASSED_IN()
- .set_FREQ(l_freq)
- .set_FUNCTION(TRRD_S_2KB_PAGE_HELPER)
- .set_DIMM_TARGET(i_target),
- "%s Invalid frequency %lu",
- mss::c_str(i_target),
- l_freq);
- break;
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return the minimum allowable tRRD_S in nck
-/// @tparam T the fapi2::TargetType of a type from which we can get MT/s
-/// @param[in] i_target the fapi2 target
-/// @param[in] i_dram_width the page size
-/// @param[out] o_tRRD_S timing in clocks (nck)
-/// @return FAPI2_RC_SUCCESS iff okay
-/// @note this is only for non-3DS DIMM
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode trrd_s( const fapi2::Target<T>& i_target,
- const uint8_t i_dram_width,
- uint64_t& o_tRRD_S )
-{
- switch(i_dram_width)
- {
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4:
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8:
- FAPI_TRY( trrd_s_half_and_1kb_page_helper(i_target, o_tRRD_S), "Error calculating trrd_s for half and 1kb page" );
- break;
-
- case fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X16:
- FAPI_TRY( trrd_s_2kb_page_helper(i_target, o_tRRD_S) );
- break;
-
- default:
- FAPI_ASSERT( false,
- fapi2::MSS_INVALID_PAGE_SIZE()
- .set_DRAM_WIDTH(i_dram_width)
- .set_DIMM_TARGET(i_target),
- "%s Recieved an invalid page size: %lu",
- mss::c_str(i_target),
- i_dram_width);
- break;
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
/// @brief VREF DQ Enter time *in clocks*
/// @tparam T the fapi2::TargetType of i_target
/// @param[in] i_target a target for attributes
@@ -1215,25 +504,5 @@ constexpr uint64_t tccd_s()
return 4;
}
-namespace lrdimm
-{
-
-///
-/// @brief Return the VREF to VREF change time long
-/// @tparam fapi2::TargetType T - type of the target on which to operate
-/// @param[in] i_target the fapi2 target
-/// @return value in clocks
-/// @note VREF time change long is used for changing by more than one VREF tick
-///
-template< fapi2::TargetType T >
-inline uint64_t vref_time_long(const fapi2::Target<T>& i_target)
-{
- // Taken from the LRDIMM spec
- constexpr uint64_t VREF_TIME_LONG_NS = 500;
- return mss::spd::ns_to_nck(i_target, VREF_TIME_LONG_NS);
-}
-
-} // ns lrdimm
-
} // mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C
index de7b6003b..224dfc050 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C
@@ -38,12 +38,12 @@
#include <p9_mc_scom_addresses_fld.H>
#include <p9_perv_scom_addresses.H>
#include <p9_perv_scom_addresses_fld.H>
-#include <generic/memory/lib/utils/find_magic.H>
+#include <lib/utils/find_magic.H>
#include <generic/memory/lib/utils/scom.H>
#include <lib/fir/fir.H>
#include <lib/fir/check.H>
#include <generic/memory/lib/utils/assert_noexit.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.C
deleted file mode 100644
index f4ab6727c..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.C
+++ /dev/null
@@ -1,175 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2019 */
-/* [+] 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 */
-
-///
-/// @file memdiags_fir.C
-/// @brief Subroutines for memdiags/prd FIR
-///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP HWP Backup: Marc Gollub <gollub@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#include <lib/shared/nimbus_defaults.H>
-#include <fapi2.H>
-#include <p9_mc_scom_addresses.H>
-#include <p9_mc_scom_addresses_fld.H>
-
-#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/fir/fir.H>
-#include <lib/fir/memdiags_fir.H>
-#include <lib/mc/port.H>
-#include <lib/workarounds/mcbist_workarounds.H>
-
-using fapi2::TARGET_TYPE_MCBIST;
-using fapi2::TARGET_TYPE_MCA;
-
-namespace mss
-{
-
-namespace unmask
-{
-
-///
-/// @brief Unmask and setup actions for memdiags related FIR
-/// @param[in] i_target the fapi2::Target MCBIST
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
-///
-template<>
-fapi2::ReturnCode after_memdiags( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
-{
- fapi2::ReturnCode l_rc;
- fapi2::buffer<uint64_t> dsm0_buffer;
- fapi2::buffer<uint64_t> l_mnfg_buffer;
- uint64_t rd_tag_delay = 0;
- uint64_t wr_done_delay = 0;
- fapi2::buffer<uint64_t> l_aue_buffer;
- fapi2::ATTR_CHIP_EC_FEATURE_HW414700_Type l_checkstop_flag;
- constexpr uint64_t MNFG_THRESHOLDS_ATTR = 63;
-
- // Broadcast mode workaround for UEs causing out of sync
- FAPI_TRY(mss::workarounds::mcbist::broadcast_out_of_sync(i_target, mss::ON));
-
- for (const auto& p : mss::find_targets<TARGET_TYPE_MCA>(i_target))
- {
- fir::reg<MCA_FIR> l_ecc64_fir_reg(p, l_rc);
- FAPI_TRY(l_rc, "unable to create fir::reg for %d", MCA_FIR);
-
- fir::reg<MCA_MBACALFIRQ> l_cal_fir_reg(p, l_rc);
- FAPI_TRY(l_rc, "unable to create fir::reg for %d", MCA_MBACALFIRQ);
-
- // Read out the wr_done and rd_tag delays and find min
- // and set the RCD Protect Time to this value
- FAPI_TRY (mss::read_dsm0q_register(p, dsm0_buffer) );
- mss::get_wrdone_delay(dsm0_buffer, wr_done_delay);
- mss::get_rdtag_delay(dsm0_buffer, rd_tag_delay);
- const auto rcd_protect_time = std::min(wr_done_delay, rd_tag_delay);
- FAPI_TRY (mss::change_rcd_protect_time(p, rcd_protect_time) );
-
- l_ecc64_fir_reg.checkstop<MCA_FIR_MAINLINE_AUE>()
- .recoverable_error<MCA_FIR_MAINLINE_UE>()
- .checkstop<MCA_FIR_MAINLINE_IAUE>()
- .recoverable_error<MCA_FIR_MAINLINE_IUE>();
-
- l_cal_fir_reg.recoverable_error<MCA_MBACALFIRQ_PORT_FAIL>();
-
- // If ATTR_CHIP_EC_FEATURE_HW414700 is enabled set checkstops
- auto l_chip_target = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
- FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_HW414700, l_chip_target, l_checkstop_flag) );
-
- // If the system is running DD2 chips override some recoverable firs with checkstop
- // Due to a known hardware defect with DD2 certain errors are not handled properly
- // As a result, these firs are marked as checkstop for DD2 to avoid any mishandling
- if (l_checkstop_flag)
- {
- l_ecc64_fir_reg.checkstop<MCA_FIR_MAINLINE_UE>()
- .checkstop<MCA_FIR_MAINLINE_RCD>();
- l_cal_fir_reg.checkstop<MCA_MBACALFIRQ_PORT_FAIL>();
- }
-
- // If MNFG FLAG Threshhold is enabled skip IUE unflagging
- FAPI_TRY ( mss::mnfg_flags(l_mnfg_buffer) );
-
- if ( !(l_mnfg_buffer.getBit<MNFG_THRESHOLDS_ATTR>()) )
- {
- l_ecc64_fir_reg.recoverable_error<MCA_FIR_MAINTENANCE_IUE>();
- }
-
- FAPI_TRY(l_ecc64_fir_reg.write(), "unable to write fir::reg %d", MCA_FIR);
- FAPI_TRY(l_cal_fir_reg.write(), "unable to write fir::reg %d", MCA_MBACALFIRQ);
-
- // Change Maint AUE and IAUE to checkstop without unmasking
- // Normal setup modifies masked bits in addition to setting checkstop
- // This causes issues if error has occured, manually scoming to avoid this
- FAPI_TRY( mss::getScom(p, MCA_ACTION1, l_aue_buffer) );
- l_aue_buffer.clearBit<MCA_FIR_MAINTENANCE_AUE>();
- l_aue_buffer.clearBit<MCA_FIR_MAINTENANCE_IAUE>();
- FAPI_TRY( mss::putScom(p, MCA_ACTION1, l_aue_buffer) );
-
- // Note: We also want to include the following setup RCD recovery and port fail
- FAPI_TRY( mss::change_port_fail_disable(p, mss::LOW) );
- FAPI_TRY( mss::change_rcd_recovery_disable(p, mss::LOW) );
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Unmask and setup actions for scrub related FIR
-/// @param[in] i_target the fapi2::Target MCBIST
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
-///
-template<>
-fapi2::ReturnCode after_background_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
-{
- for (const auto& p : mss::find_targets<TARGET_TYPE_MCA>(i_target))
- {
- fapi2::ReturnCode l_rc;
- fir::reg<MCA_FIR> l_ecc64_fir_reg(p, l_rc);
- FAPI_TRY(l_rc, "unable to create fir::reg for %d", MCA_FIR);
-
- l_ecc64_fir_reg.recoverable_error<MCA_FIR_MAINLINE_MPE_RANK_0_TO_7,
- MCA_FIR_MAINLINE_MPE_RANK_0_TO_7_LEN>()
- .recoverable_error<MCA_FIR_MAINLINE_NCE>()
- .recoverable_error<MCA_FIR_MAINLINE_TCE>()
- .recoverable_error<MCA_FIR_MAINLINE_IMPE>()
- .recoverable_error<MCA_FIR_MAINTENANCE_IMPE>();
-
- FAPI_TRY(l_ecc64_fir_reg.write(), "unable to write fir::reg %d", MCA_FIR);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-}
-}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.H b/src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.H
deleted file mode 100644
index c3a8e6c8c..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.H
+++ /dev/null
@@ -1,68 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/fir/memdiags_fir.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file memdiags_fir.H
-/// @brief Subroutines for memdiags/prd FIR
-///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP HWP Backup: Marc Gollub <gollub@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MEMDIAGS_FIR_H_
-#define _MSS_MEMDIAGS_FIR_H_
-
-#include <fapi2.H>
-#include <lib/fir/fir.H>
-
-namespace mss
-{
-
-namespace unmask
-{
-
-///
-/// @brief Unmask and setup actions for memdiags related FIR
-/// @tparam T the fapi2::TargetType which hold the FIR bits
-/// @param[in] i_target the fapi2::Target
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode after_memdiags( const fapi2::Target<T>& i_target );
-
-///
-/// @brief Unmask and setup actions for scrub related FIR
-/// @tparam T the fapi2::TargetType which hold the FIR bits
-/// @param[in] i_target the fapi2::Target
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode after_background_scrub( const fapi2::Target<T>& i_target );
-
-}
-}
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C
index 3d28935f8..744e7412f 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C
@@ -37,9 +37,11 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
-#include <generic/memory/lib/utils/find_magic.H>
+#include <lib/utils/find_magic.H>
#include <generic/memory/lib/utils/scom.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/fir/fir.H>
+#include <lib/mc/port.H>
#include <lib/fir/unmask.H>
#include <lib/workarounds/mcbist_workarounds.H>
@@ -80,8 +82,6 @@ fapi2::ReturnCode after_draminit_mc<mss::mc_type::NIMBUS>( const fapi2::Target<T
// Broadcast mode workaround for UEs causing out of sync
FAPI_TRY(mss::workarounds::mcbist::broadcast_out_of_sync(i_target, mss::OFF));
- FAPI_TRY(mss::workarounds::mcbist::wat_debug_attention(i_target));
-
for (const auto& p : mss::find_targets<TARGET_TYPE_MCA>(i_target))
{
fir::reg<MCA_FIR> l_mca_fir_reg(p, l_rc);
@@ -252,5 +252,125 @@ fapi_try_exit:
}
+
+///
+/// @brief Unmask and setup actions for memdiags related FIR
+/// @param[in] i_target the fapi2::Target MCBIST
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_memdiags<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
+{
+ fapi2::ReturnCode l_rc1, l_rc2;
+ fapi2::buffer<uint64_t> dsm0_buffer;
+ fapi2::buffer<uint64_t> l_mnfg_buffer;
+ uint64_t rd_tag_delay = 0;
+ uint64_t wr_done_delay = 0;
+ fapi2::buffer<uint64_t> l_aue_buffer;
+ fapi2::ATTR_CHIP_EC_FEATURE_HW414700_Type l_checkstop_flag;
+ constexpr uint64_t MNFG_THRESHOLDS_ATTR = 63;
+
+ // Broadcast mode workaround for UEs causing out of sync
+ FAPI_TRY(mss::workarounds::mcbist::broadcast_out_of_sync(i_target, mss::ON));
+
+ for (const auto& p : mss::find_targets<TARGET_TYPE_MCA>(i_target))
+ {
+ fir::reg<MCA_FIR> l_ecc64_fir_reg(p, l_rc1);
+ fir::reg<MCA_MBACALFIRQ> l_cal_fir_reg(p, l_rc2);
+ uint64_t rcd_protect_time = 0;
+ const auto l_chip_target = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
+
+ FAPI_TRY(l_rc1, "unable to create fir::reg for %d", MCA_FIR);
+ FAPI_TRY(l_rc2, "unable to create fir::reg for %d", MCA_MBACALFIRQ);
+
+ // Read out the wr_done and rd_tag delays and find min
+ // and set the RCD Protect Time to this value
+ FAPI_TRY (mss::read_dsm0q_register(p, dsm0_buffer) );
+ mss::get_wrdone_delay(dsm0_buffer, wr_done_delay);
+ mss::get_rdtag_delay(dsm0_buffer, rd_tag_delay);
+ rcd_protect_time = std::min(wr_done_delay, rd_tag_delay);
+ FAPI_TRY (mss::change_rcd_protect_time(p, rcd_protect_time) );
+
+ l_ecc64_fir_reg.checkstop<MCA_FIR_MAINLINE_AUE>()
+ .recoverable_error<MCA_FIR_MAINLINE_UE>()
+ .checkstop<MCA_FIR_MAINLINE_IAUE>()
+ .recoverable_error<MCA_FIR_MAINLINE_IUE>();
+
+ l_cal_fir_reg.recoverable_error<MCA_MBACALFIRQ_PORT_FAIL>();
+
+ // If ATTR_CHIP_EC_FEATURE_HW414700 is enabled set checkstops
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_HW414700, l_chip_target, l_checkstop_flag) );
+
+ // If the system is running DD2 chips override some recoverable firs with checkstop
+ // Due to a known hardware defect with DD2 certain errors are not handled properly
+ // As a result, these firs are marked as checkstop for DD2 to avoid any mishandling
+ if (l_checkstop_flag)
+ {
+ l_ecc64_fir_reg.checkstop<MCA_FIR_MAINLINE_UE>()
+ .checkstop<MCA_FIR_MAINLINE_RCD>();
+ l_cal_fir_reg.checkstop<MCA_MBACALFIRQ_PORT_FAIL>();
+ }
+
+ // If MNFG FLAG Threshhold is enabled skip IUE unflagging
+ FAPI_TRY ( mss::mnfg_flags(l_mnfg_buffer) );
+
+ if ( !(l_mnfg_buffer.getBit<MNFG_THRESHOLDS_ATTR>()) )
+ {
+ l_ecc64_fir_reg.recoverable_error<MCA_FIR_MAINTENANCE_IUE>();
+ }
+
+ FAPI_TRY(l_ecc64_fir_reg.write(), "unable to write fir::reg %d", MCA_FIR);
+ FAPI_TRY(l_cal_fir_reg.write(), "unable to write fir::reg %d", MCA_MBACALFIRQ);
+
+ // Change Maint AUE and IAUE to checkstop without unmasking
+ // Normal setup modifies masked bits in addition to setting checkstop
+ // This causes issues if error has occured, manually scoming to avoid this
+ FAPI_TRY( mss::getScom(p, MCA_ACTION1, l_aue_buffer) );
+ l_aue_buffer.clearBit<MCA_FIR_MAINTENANCE_AUE>();
+ l_aue_buffer.clearBit<MCA_FIR_MAINTENANCE_IAUE>();
+ FAPI_TRY( mss::putScom(p, MCA_ACTION1, l_aue_buffer) );
+
+ // Note: We also want to include the following setup RCD recovery and port fail
+ FAPI_TRY( mss::change_port_fail_disable(p, mss::LOW) );
+ FAPI_TRY( mss::change_rcd_recovery_disable(p, mss::LOW) );
+ }
+
+ return fapi2::FAPI2_RC_SUCCESS;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Unmask and setup actions for scrub related FIR
+/// @param[in] i_target the fapi2::Target MCBIST
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_background_scrub<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>&
+ i_target )
+{
+ for (const auto& p : mss::find_targets<TARGET_TYPE_MCA>(i_target))
+ {
+ fapi2::ReturnCode l_rc;
+ fir::reg<MCA_FIR> l_ecc64_fir_reg(p, l_rc);
+ FAPI_TRY(l_rc, "unable to create fir::reg 0x%016lx for %s", MCA_FIR, mss::c_str(p));
+
+ l_ecc64_fir_reg.recoverable_error<MCA_FIR_MAINLINE_MPE_RANK_0_TO_7,
+ MCA_FIR_MAINLINE_MPE_RANK_0_TO_7_LEN>()
+ .recoverable_error<MCA_FIR_MAINLINE_NCE>()
+ .recoverable_error<MCA_FIR_MAINLINE_TCE>()
+ .recoverable_error<MCA_FIR_MAINLINE_IMPE>()
+ .recoverable_error<MCA_FIR_MAINTENANCE_IMPE>();
+
+ FAPI_TRY(l_ecc64_fir_reg.write(), "unable to write fir::reg 0x%016lx for %s", MCA_FIR, mss::c_str(p));
+ }
+
+ return fapi2::FAPI2_RC_SUCCESS;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
}
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.H b/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.H
index 7a4d271bc..a6ae3863f 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -45,7 +45,57 @@ namespace mss
namespace unmask
{
+///
+/// @brief Unmask and setup actions performed after draminit_mc
+/// @param[in] i_target the fapi2::Target of the MCBIST
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_draminit_mc<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target );
+
+///
+/// @brief Unmask and setup actions performed after draminit_training
+/// @param[in] i_target the fapi2::Target of the MCBIST
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_draminit_training<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>&
+ i_target );
+///
+/// @brief Unmask and setup actions performed after mss_scominit
+/// (yeah, it's clearing bits - it's ok)
+/// @param[in] i_target the fapi2::Target of the MCBIST
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_scominit<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target );
+
+///
+/// @brief Unmask and setup actions performed after mss_ddr_phy_reset
+/// @param[in] i_target the fapi2::Target of the MCBIST
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_phy_reset<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target );
+
+
+///
+/// @brief Unmask and setup actions for memdiags related FIR
+/// @param[in] i_target the fapi2::Target
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_memdiags<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target );
+
+///
+/// @brief Unmask and setup actions for scrub related FIR
+/// @param[in] i_target the fapi2::Target
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
+///
+template<>
+fapi2::ReturnCode after_background_scrub<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>&
+ i_target );
}
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/freq/nimbus_freq_traits.H b/src/import/chips/p9/procedures/hwp/memory/lib/freq/nimbus_freq_traits.H
index 4818eeeb1..9ef0fc6a3 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/freq/nimbus_freq_traits.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/freq/nimbus_freq_traits.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2019 */
+/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -57,6 +57,7 @@ class frequency_traits<mss::proc_type::NIMBUS>
//////////////////////////////////////////////////////////////
static constexpr fapi2::TargetType PORT_TARGET_TYPE = fapi2::TARGET_TYPE_MCA;
static constexpr fapi2::TargetType FREQ_TARGET_TYPE = fapi2::TARGET_TYPE_MCBIST;
+ static constexpr fapi2::TargetType FREQ_DOMAIN_TARGET_TYPE = fapi2::TARGET_TYPE_MCBIST;
static constexpr fapi2::TargetType VPD_TARGET_TYPE = fapi2::TARGET_TYPE_MCS;
//////////////////////////////////////////////////////////////
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.C b/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.C
index 8c9b1ccc5..277847f73 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.C
@@ -46,7 +46,7 @@
// Generic libraries
#include <generic/memory/lib/utils/assert_noexit.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/spd/spd_facade.H>
#include <generic/memory/lib/spd/spd_utils.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.C
index c56b1ff90..a37418f13 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.C
@@ -34,9 +34,11 @@
// *HWP Consumed by: FSP:HB
#include <fapi2.H>
-#include <lib/utils/dump_regs.H>
+
+#include <lib/shared/nimbus_defaults.H>
+#include <generic/memory/lib/utils/dump_regs.H>
#include <lib/mc/mc.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_MCS;
@@ -88,8 +90,7 @@ fapi2::ReturnCode set_pwr_cntrl_reg(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
uint8_t l_pwr_cntrl = 0;
fapi2::buffer<uint64_t> l_data;
- FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_POWER_CONTROL_REQUESTED, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
- l_pwr_cntrl), "Error in set_pwr_cntrl_reg");
+ FAPI_TRY(mrw_power_control_requested(l_pwr_cntrl), "Error in set_pwr_cntrl_reg");
FAPI_TRY(read_mbarpc0(i_target, l_data));
l_data.insertFromRight<TT::CFG_MIN_MAX_DOMAINS, TT::CFG_MIN_MAX_DOMAINS_LEN>(MAXALL_MINALL);
@@ -138,8 +139,7 @@ fapi2::ReturnCode set_str_reg(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_tar
uint8_t l_str_enable = 0;
fapi2::buffer<uint64_t> l_data;
- FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_POWER_CONTROL_REQUESTED, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
- l_str_enable), "Error in set_pwr_cntrl_reg");
+ FAPI_TRY(mrw_power_control_requested(l_str_enable), "Error in set_pwr_cntrl_reg");
FAPI_TRY(read_mbastr0(i_target, l_data));
//Write bit if STR should be enabled
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H
index fdef40a8d..b589c0479 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/mc.H
@@ -41,7 +41,7 @@
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
#include <lib/mss_attribute_accessors.H>
-#include <lib/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/scom.H>
@@ -123,6 +123,7 @@ class mcTraits<fapi2::TARGET_TYPE_MCA>
EMERGENCY_M = MCA_MBA_FARB4Q_EMERGENCY_M,
EMERGENCY_M_LEN = MCA_MBA_FARB4Q_EMERGENCY_M_LEN,
CFG_STR_ENABLE = MCA_MBASTR0Q_CFG_STR_ENABLE,
+ CFG_STR_STATE = MCA_MBA_FARB6Q_CFG_STR_STATE,
MIN_DOMAIN_REDUCTION_ENABLE = MCA_MBARPC0Q_CFG_MIN_DOMAIN_REDUCTION_ENABLE,
MIN_MAX_DOMAINS_ENABLE = MCA_MBARPC0Q_CFG_MIN_MAX_DOMAINS_ENABLE,
@@ -189,6 +190,43 @@ enum
namespace mc
{
+///
+/// @brief Reads the contents of the FARB6Q
+/// @tparam T fapi2 Target Type - derived
+/// @tparam TT traits type defaults to mcTraits<T>
+/// @param[in] i_target the target on which to operate
+/// @param[out] o_data the register data
+/// @return fapi2::fapi2_rc_success if ok
+///
+template< fapi2::TargetType T, typename TT = mcTraits<T> >
+inline fapi2::ReturnCode read_farb6q( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
+{
+ o_data = 0;
+
+ FAPI_TRY( mss::getScom(i_target, TT::FARB6Q, o_data ), "%s failed to read FARB6Q regiser", mss::c_str(i_target));
+ FAPI_DBG("%s FARB6Q has data 0x%016lx", mss::c_str(i_target), o_data);
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Writes the contents of the FARB6Q
+/// @tparam T fapi2 Target Type - derived
+/// @tparam TT traits type defaults to mcTraits<T>
+/// @param[in] i_target the target on which to operate
+/// @param[in] i_data the register data
+/// @return fapi2::fapi2_rc_success if ok
+///
+template< fapi2::TargetType T, typename TT = mcTraits<T> >
+inline fapi2::ReturnCode write_farb6q( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
+{
+ FAPI_TRY( mss::putScom(i_target, TT::FARB6Q, i_data ), "%s failed to write FARB6Q regiser", mss::c_str(i_target));
+ FAPI_DBG("%s FARB6Q has data 0x%016lx", mss::c_str(i_target), i_data);
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
///
/// @brief Reads the contents of the MBARPC0
@@ -407,6 +445,20 @@ inline void get_enter_self_time_refresh_time( const fapi2::buffer<uint64_t>& i_d
}
///
+/// @brief Gets the port self time refresh state
+/// @tparam T fapi2 Target Type - defaults to TARGET_TYPE_MCA
+/// @tparam TT traits type defaults to mcTraits<T>
+/// @param[in] i_data the value of the register
+/// @param[out] o_state the current STR state of the given port
+///
+template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = mcTraits<T> >
+inline void get_self_time_refresh_state( const fapi2::buffer<uint64_t>& i_data, mss::states& o_state )
+{
+ o_state = i_data.getBit<TT::CFG_STR_STATE>() ? mss::states::ON : mss::states::OFF;
+ FAPI_DBG("get_self_time_refresh_state to %d", o_state);
+}
+
+///
/// @brief set the PWR CNTRL register
/// @param[in] i_target the mca target
/// @return fapi2::fapi2_rc_success if ok
@@ -485,7 +537,7 @@ fapi2::ReturnCode calculate_perf2(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i
/// @param[out] fapi2::buffer<uint64_t> o_xlate2 - xlt register 2's value
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind>& i_dimm_kinds,
+fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind<>>& i_dimm_kinds,
fapi2::buffer<uint64_t>& o_xlate0,
fapi2::buffer<uint64_t>& o_xlate1,
fapi2::buffer<uint64_t>& o_xlate2 );
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C
index 62d36ae0b..84ae50e3c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C
@@ -35,6 +35,7 @@
#include <fapi2.H>
+#include <lib/shared/nimbus_defaults.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
@@ -42,8 +43,7 @@
#include <lib/shared/mss_const.H>
#include <lib/mc/mc.H>
#include <generic/memory/lib/utils/scom.H>
-#include <lib/dimm/kind.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/pos.H>
using fapi2::TARGET_TYPE_MCA;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C
index 9ca4fae85..fc3f7b568 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2019 */
+/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,8 +38,9 @@
#include <lib/mc/port.H>
#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/scom.H>
-#include <lib/ecc/ecc.H>
+#include <generic/memory/lib/ecc/ecc.H>
#include <lib/workarounds/mca_workarounds.H>
+#include <lib/ecc/nimbus_mbs_error_vector_trap.H>
namespace mss
{
@@ -306,207 +307,18 @@ fapi_try_exit:
}
///
-/// @brief Convert a bitmap from the BAD_DQ_BITMAP attribute to a vector of bad DQ indexes
-/// @param[in] i_bad_bits an 8-bit bitmap of bad bits
-/// @param[in] i_nibble which nibble of the bitmap to convert
-/// @return std::vector of DQ bits marked as bad in the bitmap
-///
-std::vector<uint64_t> bad_bit_helper(const uint8_t i_bad_bits, const size_t i_nibble)
-{
- std::vector<uint64_t> l_output;
- fapi2::buffer<uint8_t> l_bit_buffer(i_bad_bits);
-
- const size_t l_start = (i_nibble == 0) ? 0 : BITS_PER_NIBBLE;
-
- for (size_t l_offset = 0; l_offset < BITS_PER_NIBBLE; ++l_offset)
- {
- if (l_bit_buffer.getBit(l_start + l_offset))
- {
- l_output.push_back(l_start + l_offset);
- }
- }
-
- return l_output;
-}
-
-///
-/// @brief Place a symbol mark in a Firmware Mark Store register
-/// @param[in] i_target the DIMM target
-/// @param[in] i_rank the rank
-/// @param[in] i_dq the bad DQ bit
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template<>
-fapi2::ReturnCode place_symbol_mark(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq)
-{
- const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
- const auto l_dimm_idx = mss::index(i_target);
- const auto l_rank_idx = mss::index(i_rank);
-
- uint8_t l_galois = 0;
- mss::mcbist::address l_addr;
-
- // For symbol marks, we set the appropriate Firmware Mark Store reg, with the symbol's
- // Galois code, mark_type=SYMBOL, mark_region=MRANK, and the address of the DIMM+MRANK
- // TODO RTC:165133 Remove static_cast once Galois API is updated to accept uint64_t input
- FAPI_TRY( mss::ecc::dq_to_galois(static_cast<uint8_t>(i_dq), l_galois) );
-
- l_addr.set_dimm(l_dimm_idx).set_master_rank(l_rank_idx);
-
- FAPI_INF("%s Setting firmware symbol mark on rank:%d dq:%d galois:0x%02x",
- mss::c_str(i_target), i_rank, i_dq, l_galois);
- FAPI_TRY( mss::ecc::set_fwms(l_mca, i_rank, l_galois, mss::ecc::fwms::mark_type::SYMBOL,
- mss::ecc::fwms::mark_region::MRANK, l_addr) );
-
- // Apply workaround for HW474117 if we place a symbol mark
- FAPI_TRY( mss::workarounds::disable_bypass(l_mca) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Place a chip mark in a Hardware Mark Store register
-/// @param[in] i_target the DIMM target
-/// @param[in] i_rank the rank
-/// @param[in] i_dq one of the bad DQ bits in the bad nibble
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template<>
-fapi2::ReturnCode place_chip_mark(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq)
-{
- const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
-
- uint8_t l_galois = 0;
- uint8_t l_symbol = 0;
-
- // For chip marks, we set the appropriate Hardware Mark Store reg, with the Galois code
- // of the first (smallest) symbol in the bad nibble, and both confirmed and exit1 bits set
- FAPI_TRY( mss::ecc::dq_to_symbol(static_cast<uint8_t>(i_dq), l_symbol) );
-
- // Round down to the nearest "nibble" to get the correct symbol, then get the Galois code for it
- l_symbol = (l_symbol / BITS_PER_NIBBLE) * BITS_PER_NIBBLE;
- FAPI_TRY( mss::ecc::symbol_to_galois(l_symbol, l_galois) );
-
- FAPI_INF("%s Setting hardware (chip) mark on rank:%d galois:0x%02x", mss::c_str(i_target), i_rank, l_galois);
- FAPI_TRY( mss::ecc::set_hwms(l_mca, i_rank, l_galois) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Restore symbol and chip marks according to BAD_DQ_BITMAP attribute, helper function for unit testing
-/// Specialization for TARGET_TYPE_DIMM
-/// @param[in] i_target the DIMM target
-/// @param[in] i_bad_bits the bad bits values from the VPD, for the specified DIMM
-/// @param[out] o_repairs_applied 8-bit mask, where a bit set means a rank had repairs applied (bit0-7 = rank0-7)
-/// @param[out] o_repairs_exceeded 2-bit mask, where a bit set means a DIMM had more bad bits than could be repaired (bit0-1 = DIMM0-1)
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template<>
-fapi2::ReturnCode restore_repairs_helper<fapi2::TARGET_TYPE_DIMM, BAD_BITS_RANKS, BAD_DQ_BYTE_COUNT>(
- const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const uint8_t i_bad_bits[BAD_BITS_RANKS][BAD_DQ_BYTE_COUNT],
- fapi2::buffer<uint8_t>& o_repairs_applied,
- fapi2::buffer<uint8_t>& o_repairs_exceeded)
-{
- FAPI_INF("%s Restore repair marks from bad DQ data", mss::c_str(i_target));
-
- std::vector<uint64_t> l_ranks;
- const auto l_dimm_idx = mss::index(i_target);
-
- FAPI_TRY( mss::rank::ranks(i_target, l_ranks) );
-
- // loop through ranks
- for (const auto l_rank : l_ranks)
- {
- const auto l_rank_idx = mss::index(l_rank);
-
- repair_state_machine<fapi2::TARGET_TYPE_DIMM> l_machine;
-
- // loop through bytes
- for (uint64_t l_byte = 0; l_byte < (MAX_DQ_NIBBLES / NIBBLES_PER_BYTE); ++l_byte)
- {
- for (size_t l_nibble = 0; l_nibble < NIBBLES_PER_BYTE; ++l_nibble)
- {
- const auto l_bad_dq_vector = bad_bit_helper(i_bad_bits[l_rank_idx][l_byte], l_nibble);
- FAPI_DBG("Total bad bits on DIMM:%d rank:%d nibble%d: %d",
- l_dimm_idx, l_rank, (l_byte * NIBBLES_PER_BYTE) + l_nibble, l_bad_dq_vector.size());
-
- // apply repairs and update repair machine state
- // if there are no bad bits (l_bad_dq_vector.size() == 0) no action is necessary
- if (l_bad_dq_vector.size() == 1)
- {
- // l_bad_dq_vector is per byte, so multiply up to get the bad dq's index
- const uint64_t l_dq = l_bad_dq_vector[0] + (l_byte * BITS_PER_BYTE);
- FAPI_TRY( l_machine.one_bad_dq(i_target, l_rank, l_dq, o_repairs_applied, o_repairs_exceeded) );
- }
- else if (l_bad_dq_vector.size() > 1)
- {
- // l_bad_dq_vector is per byte, so multiply up to get the bad dq's index
- const uint64_t l_dq = l_bad_dq_vector[0] + (l_byte * BITS_PER_BYTE);
- FAPI_TRY( l_machine.multiple_bad_dq(i_target, l_rank, l_dq, o_repairs_applied, o_repairs_exceeded) );
- }
-
- // if repairs have been exceeded, we're done
- if (o_repairs_exceeded.getBit(l_dimm_idx))
- {
- FAPI_INF("Repairs exceeded on DIMM %s", mss::c_str(i_target));
- return fapi2::FAPI2_RC_SUCCESS;
- }
- } // end loop through nibbles
- } // end loop through bytes
- } // end loop through ranks
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Restore symbol and chip marks according to BAD_DQ_BITMAP attribute
-/// Specialization for TARGET_TYPE_MCA
-/// @param[in] i_target A target representing a port
-/// @param[out] o_repairs_applied 8-bit mask, where a bit set means a rank had repairs applied (bit0-7 = rank0-7)
-/// @param[out] o_repairs_exceeded 2-bit mask, where a bit set means a DIMM had more bad bits than could be repaired (bit0-1 = DIMM0-1)
+/// @brief Set up memory controller specific settings for ECC registers (at the end of draminit_mc)
+/// @param[in] i_target the target
+/// @param[in,out] io_data contents of RECR register
/// @return FAPI2_RC_SUCCESS if and only if ok
+/// @note mc_type::NIMBUS specialization
///
template<>
-fapi2::ReturnCode restore_repairs( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- fapi2::buffer<uint8_t>& o_repairs_applied,
- fapi2::buffer<uint8_t>& o_repairs_exceeded)
+fapi2::ReturnCode ecc_reg_settings_draminit_mc<mss::mc_type::NIMBUS>(
+ const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ fapi2::buffer<uint64_t>& io_data )
{
- uint8_t l_bad_bits[BAD_BITS_RANKS][BAD_DQ_BYTE_COUNT] = {};
-
- o_repairs_applied = 0;
- o_repairs_exceeded = 0;
-
- for (const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target))
- {
- FAPI_TRY( mss::bad_dq_bitmap(l_dimm, &(l_bad_bits[0][0])) );
-
- FAPI_TRY( (restore_repairs_helper<fapi2::TARGET_TYPE_DIMM, BAD_BITS_RANKS, BAD_DQ_BYTE_COUNT>(
- l_dimm, l_bad_bits, o_repairs_applied, o_repairs_exceeded)) );
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Set a new state in the repair state machine
-/// @tparam T, the fapi2 target type of the DIMM
-/// @param[in,out] io_machine the repair state machine
-/// @param[in] i_state shared pointer to the new state to set
-///
-template< fapi2::TargetType T >
-void repair_state<T>::set_state(repair_state_machine<T>& io_machine, std::shared_ptr<repair_state<T>> i_state)
-{
- io_machine.update_state(i_state);
+ return fapi2::FAPI2_RC_SUCCESS;
}
///
@@ -802,48 +614,4 @@ fapi2::ReturnCode chip_and_symbol_mark<fapi2::TARGET_TYPE_DIMM>::multiple_bad_dq
return fapi2::FAPI2_RC_SUCCESS;
}
-///
-/// @brief Perform a repair for a single bad DQ bit in a nibble
-/// @tparam T, the fapi2 target type of the DIMM
-/// @param[in] i_target the DIMM target
-/// @param[in] i_rank the rank
-/// @param[in] i_dq the DQ bit index
-/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
-/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode repair_state_machine<T>::one_bad_dq(const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded)
-{
- FAPI_TRY( iv_repair_state->one_bad_dq(*this, i_target, i_rank, i_dq, io_repairs_applied, io_repairs_exceeded) );
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Perform a repair for multiple bad DQ bits in a nibble
-/// @tparam T, the fapi2 target type of the DIMM
-/// @param[in] i_target the DIMM target
-/// @param[in] i_rank the rank
-/// @param[in] i_dq one of the bad DQ bit indexes
-/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
-/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode repair_state_machine<T>::multiple_bad_dq(const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded)
-{
- FAPI_TRY( iv_repair_state->multiple_bad_dq(*this, i_target, i_rank, i_dq, io_repairs_applied, io_repairs_exceeded) );
-fapi_try_exit:
- return fapi2::current_err;
-}
-
} // ns mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H
index 33131ad4f..f11f9aafa 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2019 */
+/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -40,12 +40,12 @@
#include <lib/mss_attribute_accessors.H>
#include <lib/shared/mss_const.H>
+#include <lib/utils/mss_nimbus_conversions.H>
#include <generic/memory/lib/utils/scom.H>
#include <generic/memory/lib/utils/c_str.H>
#include <generic/memory/lib/utils/mc/gen_mss_port.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
-#include <lib/utils/mss_nimbus_conversions.H>
#include <lib/dimm/rank.H>
#include <lib/mcbist/address.H>
@@ -75,9 +75,14 @@ template<>
class portTraits<mss::mc_type::NIMBUS>
{
public:
+
+ // PORT_TYPE
+ static constexpr enum fapi2::TargetType PORT_TYPE = fapi2::TARGET_TYPE_MCA;
+
static constexpr uint64_t FARB0Q_REG = MCA_MBA_FARB0Q;
static constexpr uint64_t FARB1Q_REG = MCA_MBA_FARB1Q;
static constexpr uint64_t FARB5Q_REG = MCA_MBA_FARB5Q;
+ static constexpr uint64_t FARB6Q_REG = MCA_MBA_FARB6Q;
static constexpr uint64_t REFRESH_REG = MCA_MBAREF0Q;
static constexpr uint64_t ECC_REG = MCA_RECR;
static constexpr uint64_t CAL0Q_REG = MCA_MBA_CAL0Q;
@@ -134,6 +139,10 @@ class portTraits<mss::mc_type::NIMBUS>
PORT_FAIL_DISABLE = MCA_MBA_FARB0Q_CFG_PORT_FAIL_DISABLE,
OE_ALWAYS_ON = MCA_MBA_FARB0Q_CFG_OE_ALWAYS_ON,
RCD_RECOVERY_DISABLE = MCA_MBA_FARB0Q_CFG_DISABLE_RCD_RECOVERY,
+ BW_WINDOW_SIZE = MCA_MBA_FARB0Q_CFG_BW_WINDOW_SIZE,
+ BW_WINDOW_SIZE_LEN = MCA_MBA_FARB0Q_CFG_BW_WINDOW_SIZE_LEN,
+ BW_SNAPSHOT = MCA_MBA_FARB6Q_CFG_BW_SNAPSHOT,
+ BW_SNAPSHOT_LEN = MCA_MBA_FARB6Q_CFG_BW_SNAPSHOT_LEN,
CAL0Q_CAL_INTERVAL_TMR0_ENABLE = MCA_MBA_CAL0Q_CFG_CAL_INTERVAL_TMR0_ENABLE,
CAL0Q_TIME_BASE_TMR0 = MCA_MBA_CAL0Q_CFG_TIME_BASE_TMR0,
@@ -247,9 +256,9 @@ class portTraits<mss::mc_type::NIMBUS>
RECR_ENABLE_UE_NOISE_WINDOW = MCA_RECR_MBSECCQ_ENABLE_UE_NOISE_WINDOW,
RECR_TCE_CORRECTION = MCA_RECR_MBSECCQ_ENABLE_TCE_CORRECTION,
RECR_READ_POINTER_DLY = MCA_RECR_MBSECCQ_READ_POINTER_DELAY,
+ RECR_READ_POINTER_DLY_LEN = MCA_RECR_MBSECCQ_READ_POINTER_DELAY_LEN,
RECR_MBSECCQ_DATA_INVERSION = MCA_RECR_MBSECCQ_DATA_INVERSION,
RECR_MBSECCQ_DATA_INVERSION_LEN = MCA_RECR_MBSECCQ_DATA_INVERSION_LEN,
- RECR_READ_POINTER_DLY_LEN = MCA_RECR_MBSECCQ_READ_POINTER_DELAY_LEN,
DSM0Q_RDTAG_DLY = MCA_MBA_DSM0Q_CFG_RDTAG_DLY,
DSM0Q_RDTAG_DLY_LEN = MCA_MBA_DSM0Q_CFG_RDTAG_DLY_LEN,
DSM0Q_WRDONE_DLY = MCA_MBA_DSM0Q_CFG_WRDONE_DLY,
@@ -681,7 +690,7 @@ fapi2::ReturnCode configure_cid_parity( const fapi2::Target<T>& i_target)
l_state = mss::states::OFF_N;
}
- FAPI_DBG( "Change RDTAG_DLY to %d for %s", l_state, mss::c_str(i_target) );
+ FAPI_DBG( "Change CID_PARITY to %d for %s", l_state, mss::c_str(i_target) );
FAPI_TRY( read_farb1q_register(i_target, l_data) );
set_cid_parity<T>(l_state, l_data);
@@ -814,6 +823,23 @@ template<>
fapi2::ReturnCode enable_periodic_cal( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target );
+///
+/// @brief Change the state of the force_str bit - mc_type::NIMBUS specialization
+/// @tparam MC the memory controller type
+/// @param[in] i_target the target
+/// @param[in] i_state the state
+/// @return FAPI2_RC_SUCCESS if and only if ok
+/// @note This bit doesn't exist on Nimbus, so this is a no-op
+///
+template<>
+inline fapi2::ReturnCode change_force_str<DEFAULT_MC_TYPE>(
+ const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ const states i_state )
+{
+ return fapi2::FAPI2_RC_SUCCESS;
+}
+
+
//
// We expect to come in to draminit with the following setup:
// 1. ENABLE_RESET_N (FARB5Q(6)) 0
@@ -956,558 +982,21 @@ fapi_try_exit:
return fapi2::current_err;
}
+/// @brief Get the attributes for the reorder queue setting
+/// @param[in] const ref to the mc target
+/// @param[out] uint8_t& reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Contains the settings for write/read reorder
+/// queue
///
-/// @brief Configures the write reorder queue for MCBIST operations
-/// @param[in] i_target the target to effect
-/// @param[in] i_state to set the bit too
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-inline fapi2::ReturnCode configure_wrq(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, const mss::states i_state)
-{
- typedef portTraits<mss::mc_type::NIMBUS> TT;
-
- fapi2::buffer<uint64_t> l_data;
-
- // Gets the reg
- FAPI_TRY(mss::getScom(i_target, TT::WRQ_REG, l_data), "%s failed to getScom from MCA_MBA_WRQ0Q", mss::c_str(i_target));
-
- // Sets the bit
- l_data.writeBit<TT::WRQ_FIFO_MODE>(i_state == mss::states::ON);
-
- // Sets the regs
- FAPI_TRY(mss::putScom(i_target, TT::WRQ_REG, l_data), "%s failed to putScom to MCA_MBA_WRQ0Q", mss::c_str(i_target));
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-
-///
-/// @brief Configures the write reorder queue bit
-/// @param[in] i_target the target to effect
-/// @param[in] i_state to set the bit too
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-inline fapi2::ReturnCode configure_wrq(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- const mss::states i_state)
-{
- // Loops through all MCA targets, hitting all the registers
- for( const auto& l_mca : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target) )
- {
- FAPI_TRY(configure_wrq(l_mca, i_state));
- }
-
- // In case we don't have any MCA's
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Configures the read reorder queue for MCBIST operations
-/// @param[in] i_target the target to effect
-/// @param[in] i_state to set the bit too
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-inline fapi2::ReturnCode configure_rrq(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, const mss::states i_state)
-{
- typedef portTraits<mss::mc_type::NIMBUS> TT;
-
- fapi2::buffer<uint64_t> l_data;
-
- // Gets the reg
- FAPI_TRY(mss::getScom(i_target, TT::RRQ_REG, l_data), "%s failed to getScom from MCA_MBA_RRQ0Q", mss::c_str(i_target));
-
- // Sets the bit
- l_data.writeBit<TT::RRQ_FIFO_MODE>(i_state == mss::states::ON);
-
- // Sets the regs
- FAPI_TRY(mss::putScom(i_target, TT::RRQ_REG, l_data), "%s failed to putScom to MCA_MBA_RRQ0Q", mss::c_str(i_target));
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Configures the read reorder queue bit
-/// @param[in] i_target the target to effect
-/// @param[in] i_state to set the bit too
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-inline fapi2::ReturnCode configure_rrq(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- const mss::states i_state)
-{
- // Loops through all MCA targets, hitting all the registers
- for( const auto& l_mca : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target) )
- {
- FAPI_TRY(configure_rrq(l_mca, i_state));
- }
-
- // In case we don't have any MCA's
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Resets the write/read reorder queue values - needs to be called after MCBIST execution
-/// @tparam T, the fapi2 target type of the target
-/// @param[in] i_target the target to effect
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T>
-fapi2::ReturnCode reset_reorder_queue_settings(const fapi2::Target<T>& i_target)
+template< >
+inline fapi2::ReturnCode reorder_queue_setting<mss::mc_type::NIMBUS>(const
+ fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ uint8_t& o_value)
{
- uint8_t l_reorder_queue = 0;
- FAPI_TRY(reorder_queue_setting(i_target, l_reorder_queue));
-
- // Changes the reorder queue settings
- {
- // Two settings are FIFO and REORDER. FIFO is a 1 in the registers, while reorder is a 0 state
- const mss::states l_state = ((l_reorder_queue == fapi2::ENUM_ATTR_MSS_REORDER_QUEUE_SETTING_FIFO) ?
- mss::states::ON : mss::states::OFF);
- FAPI_TRY(configure_rrq(i_target, l_state), "%s failed to reset read reorder queue settings", mss::c_str(i_target));
- FAPI_TRY(configure_wrq(i_target, l_state), "%s failed to reset read reorder queue settings", mss::c_str(i_target));
- }
-
-
-fapi_try_exit:
- return fapi2::current_err;
+ return mss::reorder_queue_setting(i_target, o_value);
}
-///
-/// @brief Convert a bitmap from the BAD_DQ_BITMAP attribute to a vector of bad DQ indexes
-/// @param[in] i_bad_bits an 8-bit bitmap of bad bits
-/// @param[in] i_nibble which nibble of the bitmap to convert
-/// @return std::vector of DQ bits marked as bad in the bitmap
-///
-std::vector<uint64_t> bad_bit_helper(const uint8_t i_bad_bits, const size_t i_nibble);
-
-///
-/// @brief Place a symbol mark in a Firmware Mark Store register
-/// @tparam T, the fapi2 target type of the DIMM (derived)
-/// @param[in] i_target the DIMM target
-/// @param[in] i_rank the rank
-/// @param[in] i_dq the bad DQ bit
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode place_symbol_mark(const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq);
-
-///
-/// @brief Place a chip mark in a Hardware Mark Store register
-/// @tparam T, the fapi2 target type of the DIMM (derived)
-/// @param[in] i_target the DIMM target
-/// @param[in] i_rank the rank
-/// @param[in] i_dq one of the bad DQ bits in the bad nibble
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode place_chip_mark(const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq);
-
-// Forward declaration for use in repair_state classes
-template< fapi2::TargetType T >
-class repair_state_machine;
-
-///
-/// @class mss::repair_state
-/// @brief A class for keeping track of bad bit repair states in a repair_state_machine
-/// @tparam T, the fapi2 target type of the DIMM
-/// @note this is a base class
-///
-template< fapi2::TargetType T >
-class repair_state
-{
- public:
- /// @brief default contructor
- repair_state() = default;
- /// @brief default destructor
- virtual ~repair_state() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- virtual fapi2::ReturnCode one_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) = 0;
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- virtual fapi2::ReturnCode multiple_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) = 0;
-
- protected:
- ///
- /// @brief Set a new state in the repair state machine
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_state pointer to the new state to set
- ///
- void set_state(repair_state_machine<T>& io_machine, std::shared_ptr<repair_state<T>> i_state);
-};
-
-///
-/// @class mss::no_fails
-/// @brief repair_state class for no fails (no marks applied)
-/// @tparam T, the fapi2 target type of the DIMM
-///
-template< fapi2::TargetType T >
-class no_fails : public repair_state<T>
-{
- public:
- /// @brief default contructor
- no_fails() = default;
- /// @brief default destructor
- ~no_fails() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode one_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode multiple_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-};
-
-///
-/// @class mss::symbol_mark_only
-/// @brief repair_state class for when only a symbol mark has been used
-/// @tparam T, the fapi2 target type of the DIMM
-///
-template< fapi2::TargetType T >
-class symbol_mark_only : public repair_state<T>
-{
- public:
- /// @brief default contructor
- symbol_mark_only() = default;
- /// @brief default destructor
- ~symbol_mark_only() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode one_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode multiple_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-};
-
-///
-/// @class mss::symbol_mark_plus_unrepaired_dq
-/// @brief repair_state class for when only a symbol mark has been used, and one DQ bit remains unrepaired
-/// @tparam T, the fapi2 target type of the DIMM
-///
-template< fapi2::TargetType T >
-class symbol_mark_plus_unrepaired_dq : public repair_state<T>
-{
- public:
- /// @brief default contructor
- symbol_mark_plus_unrepaired_dq() = default;
- /// @brief default destructor
- ~symbol_mark_plus_unrepaired_dq() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode one_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode multiple_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-};
-
-///
-/// @class mss::chip_mark_only
-/// @brief repair_state class for when only a chip mark has been used
-/// @tparam T, the fapi2 target type of the DIMM
-///
-template< fapi2::TargetType T >
-class chip_mark_only : public repair_state<T>
-{
- public:
- /// @brief default contructor
- chip_mark_only() = default;
- /// @brief default destructor
- ~chip_mark_only() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode one_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode multiple_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-};
-
-///
-/// @class mss::chip_mark_only
-/// @brief repair_state class for when both a chip mark and a symbol mark have been used
-/// @tparam T, the fapi2 target type of the DIMM
-///
-template< fapi2::TargetType T >
-class chip_and_symbol_mark : public repair_state<T>
-{
- public:
- /// @brief default contructor
- chip_and_symbol_mark() = default;
- /// @brief default destructor
- ~chip_and_symbol_mark() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode one_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in,out] io_machine the repair state machine
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode multiple_bad_dq(repair_state_machine<T>& io_machine,
- const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded) override;
-};
-
-///
-/// @class mss::repair_state_machine
-/// @brief state machine class used in restore_repairs_helper
-/// @tparam T, the fapi2 target type of the DIMM
-///
-template< fapi2::TargetType T >
-class repair_state_machine
-{
- public:
- /// @brief constructor
- repair_state_machine()
- : iv_repair_state(std::make_shared<no_fails<T>>()) {}
-
- /// @brief default destructor
- ~repair_state_machine() = default;
-
- ///
- /// @brief Perform a repair for a single bad DQ bit in a nibble
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq the DQ bit index
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode one_bad_dq(const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded);
-
- ///
- /// @brief Perform a repair for multiple bad DQ bits in a nibble
- /// @param[in] i_target the DIMM target
- /// @param[in] i_rank the rank
- /// @param[in] i_dq one of the bad DQ bit indexes
- /// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
- /// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
- /// @return FAPI2_RC_SUCCESS if and only if ok
- ///
- fapi2::ReturnCode multiple_bad_dq(const fapi2::Target<T>& i_target,
- const uint64_t i_rank,
- const uint64_t i_dq,
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded);
-
- ///
- /// @brief Update the state of the state machine
- /// @param[in] i_state shared pointer to the new state
- ///
- void update_state(std::shared_ptr<repair_state<T>> i_state)
- {
- iv_repair_state = i_state;
- }
-
- private:
- std::shared_ptr<repair_state<T>> iv_repair_state;
-};
-
-// TODO RTC: 157753 tparam R can be pulled from an MCA trait once we have it
-///
-/// @brief Restore symbol and chip marks according to BAD_DQ_BITMAP attribute, helper function for unit testing
-/// @tparam T, the fapi2 target type of the DIMM (derived)
-/// @tparam R the maximum rank per DIMM
-/// @tparam B the number of bytes per rank in the bad_dq_bitmap attribute
-/// @param[in] i_target A target representing a DIMM
-/// @param[in] i_bad_bits the bad bits values from the VPD, for the specified DIMM
-/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
-/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template< fapi2::TargetType T, uint64_t R, uint64_t B >
-fapi2::ReturnCode restore_repairs_helper( const fapi2::Target<T>& i_target,
- const uint8_t i_bad_bits[R][B],
- fapi2::buffer<uint8_t>& io_repairs_applied,
- fapi2::buffer<uint8_t>& io_repairs_exceeded);
-
-///
-/// @brief Restore symbol and chip marks according to BAD_DQ_BITMAP attribute
-/// @tparam T, the fapi2 target type of the port (derived)
-/// @param[in] i_target A target representing a port
-/// @param[out] o_repairs_applied bit mask, where a bit set means a rank had repairs applied (bit0 = rank0, etc)
-/// @param[out] o_repairs_exceeded bit mask, where a bit set means a DIMM had more bad bits than could be repaired (bit0 = DIMM0 etc)
-/// @return FAPI2_RC_SUCCESS if and only if ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode restore_repairs( const fapi2::Target<T>& i_target,
- fapi2::buffer<uint8_t>& o_repairs_applied,
- fapi2::buffer<uint8_t>& o_repairs_exceeded);
-
}// mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C
index 31ac6eade..cc13cd96c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C
@@ -35,6 +35,7 @@
#include <fapi2.H>
+#include <lib/shared/nimbus_defaults.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
@@ -43,8 +44,8 @@
#include <lib/mc/mc.H>
#include <lib/mc/xlate.H>
#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/dimm/kind.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/dimm/nimbus_kind.H>
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_DIMM;
@@ -59,7 +60,7 @@ static const std::vector<xlate_setup> xlate_map =
{
// 1R 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -72,7 +73,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -85,7 +86,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -98,7 +99,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -111,7 +112,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -124,7 +125,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -137,7 +138,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -150,7 +151,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -163,7 +164,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -176,7 +177,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -189,7 +190,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -202,7 +203,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -215,7 +216,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -228,7 +229,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -241,7 +242,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -254,7 +255,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -267,7 +268,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -280,7 +281,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -299,7 +300,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 2H 3DS 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -312,7 +313,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 2H 3DS 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -325,7 +326,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 2H 3DS 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -338,7 +339,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 2H 3DS 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -351,7 +352,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 2H 3DS 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -364,7 +365,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 2H 3DS 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -377,7 +378,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4H 3DS 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -390,7 +391,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4H 3DS 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -403,7 +404,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4H 3DS 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -416,7 +417,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4H 3DS 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -429,7 +430,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4H 3DS 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -442,7 +443,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 4H 3DS 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -455,7 +456,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8H 3DS 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -468,7 +469,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8H 3DS 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -481,7 +482,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8H 3DS 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -494,7 +495,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8H 3DS 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -507,7 +508,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8H 3DS 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -520,7 +521,7 @@ static const std::vector<xlate_setup> xlate_map =
// 1R 8H 3DS 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_1R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -533,7 +534,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -546,7 +547,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -559,7 +560,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -572,7 +573,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -585,7 +586,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -598,7 +599,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -611,7 +612,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -624,7 +625,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -637,7 +638,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -650,7 +651,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -663,7 +664,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -676,7 +677,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -689,7 +690,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8H 3DS 4Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_16R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -702,7 +703,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8H 3DS 4Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_16R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -715,7 +716,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8H 3DS 8Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_16R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -728,7 +729,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8H 3DS 8Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_16R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -741,7 +742,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8H 3DS 16Gbx8 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_16R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8,
@@ -754,7 +755,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8H 3DS 16Gbx4 DDR4 RDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_16R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -773,7 +774,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 8Gbx4 32GB DDR4 LRDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -786,7 +787,7 @@ static const std::vector<xlate_setup> xlate_map =
// 4R 8Gbx4 64GB DDR4 LRDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -803,7 +804,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 8Gbx4 64GB DDR4 LRDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_4G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -816,7 +817,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 8Gbx4 64GB DDR4 LRDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_8G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -829,7 +830,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 2H 3DS 16Gbx4 128GB DDR4 LRDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_4R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -842,7 +843,7 @@ static const std::vector<xlate_setup> xlate_map =
// 2R 4H 3DS 16Gbx4 256GB DDR4 LRDIMM
{
- dimm::kind(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
+ dimm::kind<>(fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_2R,
fapi2::ENUM_ATTR_EFF_NUM_RANKS_PER_DIMM_8R,
fapi2::ENUM_ATTR_EFF_DRAM_DENSITY_16G,
fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4,
@@ -867,7 +868,7 @@ static bool all_slots_1R_helper(const fapi2::Target<TARGET_TYPE_DIMM>& i_target)
const auto& l_mca = mss::find_target<TARGET_TYPE_MCA>(i_target);
const auto& l_dimms = mss::find_targets<TARGET_TYPE_DIMM>(l_mca);
- const std::vector<dimm::kind> l_dimm_kinds = dimm::kind::vector(l_dimms);
+ const std::vector<dimm::kind<>> l_dimm_kinds = dimm::kind<>::vector(l_dimms);
bool l_all_slots_1R = false;
// If we only have 1 DIMM, we don't have two slots with 1R DIMM. If we need to check, iterate
@@ -993,7 +994,7 @@ fapi_try_exit:
/// @note Called for 2R4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1038,7 +1039,7 @@ fapi_try_exit:
/// @note Called for 2R 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1075,7 +1076,7 @@ fapi_try_exit:
/// @note Called for 2R 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1112,7 +1113,7 @@ fapi_try_exit:
/// @note Called for 2R 2H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1142,7 +1143,7 @@ fapi_try_exit:
/// @note Called for 2R 2H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1175,7 +1176,7 @@ fapi_try_exit:
/// @note Called for 2R 2H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1208,7 +1209,7 @@ fapi_try_exit:
/// @note Called for 2R 4H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1238,7 +1239,7 @@ fapi_try_exit:
/// @note Called for 2R 4H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1271,7 +1272,7 @@ fapi_try_exit:
/// @note Called for 2R 4H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1304,7 +1305,7 @@ fapi_try_exit:
/// @note Called for 2R 8H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1341,7 +1342,7 @@ fapi_try_exit:
/// @note Called for 2R 8H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1374,7 +1375,7 @@ fapi_try_exit:
/// @note Called for 2R 8H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1408,7 +1409,7 @@ fapi_try_exit:
/// @note Called for 1R 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1510,7 +1511,7 @@ fapi_try_exit:
/// @note Called for 1R 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1547,7 +1548,7 @@ fapi_try_exit:
/// @note Called for 1R 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1584,7 +1585,7 @@ fapi_try_exit:
/// @note Called for 1R 2H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1615,7 +1616,7 @@ fapi_try_exit:
/// @note Called for 1R 2H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1648,7 +1649,7 @@ fapi_try_exit:
/// @note Called for 1R 2H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1681,7 +1682,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1718,7 +1719,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1751,7 +1752,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1784,7 +1785,7 @@ fapi_try_exit:
/// @note Called for 1R 8H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1819,7 +1820,7 @@ fapi_try_exit:
/// @note Called for 1R 8H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1852,7 +1853,7 @@ fapi_try_exit:
/// @note Called for 1R 8H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1885,7 +1886,7 @@ fapi_try_exit:
/// @note Called for 4R 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1920,7 +1921,7 @@ fapi_try_exit:
/// @note Called for 4R 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1953,7 +1954,7 @@ fapi_try_exit:
/// @note Called for 4R 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1983,7 +1984,7 @@ fapi_try_exit:
/// @param[out] fapi2::buffer<uint64_t> io_xlate2 - xlt register 2's value
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind>& io_dimm_kinds,
+fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind<>>& io_dimm_kinds,
fapi2::buffer<uint64_t>& io_xlate0,
fapi2::buffer<uint64_t>& io_xlate1,
fapi2::buffer<uint64_t>& io_xlate2 )
@@ -1999,7 +2000,8 @@ fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind>& io_dimm_kinds
// However, we need to set that DIMM's D bit in the location of the largest DIMM's D-bit map (I know that's
// hard to grok - set the D bit in the smallest DIMM but in the location mapped for the largest.) So we
// keep track of the largest DIMM so when we set it up, we make sure to set the D-bit in the other.
- std::sort(io_dimm_kinds.begin(), io_dimm_kinds.end(), [](const dimm::kind & a, const dimm::kind & b) -> bool
+ std::sort(io_dimm_kinds.begin(), io_dimm_kinds.end(), [](const dimm::kind<>& a,
+ const dimm::kind<>& b) -> bool
{
return a.iv_size > b.iv_size;
});
@@ -2106,7 +2108,7 @@ fapi2::ReturnCode setup_xlate_map(const fapi2::Target<TARGET_TYPE_MCA>& i_target
const auto l_dimms = mss::find_targets<TARGET_TYPE_DIMM>(i_target);
// We need to keep around specifications of both DIMM as we set the D bit based on the sizes of the DIMM
- std::vector<dimm::kind> l_dimm_kinds = dimm::kind::vector(l_dimms);
+ std::vector<dimm::kind<>> l_dimm_kinds = dimm::kind<>::vector(l_dimms);
FAPI_INF("Setting up xlate registers for MCA%d (%d)", mss::pos(i_target), mss::index(i_target));
@@ -2131,7 +2133,7 @@ fapi_try_exit:
/// @note Called for 1R 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2156,7 +2158,7 @@ fapi_try_exit:
/// @note Called for 1R 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2181,7 +2183,7 @@ fapi_try_exit:
/// @note Called for 1R 2H 3DS 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2206,7 +2208,7 @@ fapi_try_exit:
/// @note Called for 1R 2H 3DS 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2231,7 +2233,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 3DS 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2256,7 +2258,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 3DS 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2281,7 +2283,7 @@ fapi_try_exit:
/// @note Called for 1R 8H 3DS 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2306,7 +2308,7 @@ fapi_try_exit:
/// @note Called for 1R 8H 3DS 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2331,7 +2333,7 @@ fapi_try_exit:
/// @note Called for 2R 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2356,7 +2358,7 @@ fapi_try_exit:
/// @note Called for 2R16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2381,7 +2383,7 @@ fapi_try_exit:
/// @note Called for 2R 2H 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2406,7 +2408,7 @@ fapi_try_exit:
/// @note Called for 2R 2H 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2431,7 +2433,7 @@ fapi_try_exit:
/// @note Called for 2R 4H 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2456,7 +2458,7 @@ fapi_try_exit:
/// @note Called for 2R 4H 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2481,7 +2483,7 @@ fapi_try_exit:
/// @note Called for 2R 8H 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2506,7 +2508,7 @@ fapi_try_exit:
/// @note Called for 2R 8H 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2531,7 +2533,7 @@ fapi_try_exit:
/// @note Called for 4R 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2556,7 +2558,7 @@ fapi_try_exit:
/// @note Called for 4R 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2581,7 +2583,7 @@ fapi_try_exit:
/// @note Called for 1R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2609,7 +2611,7 @@ fapi_try_exit:
/// @note Called for 1R 2H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2640,7 +2642,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2671,7 +2673,7 @@ fapi_try_exit:
/// @note Called for 1R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2702,7 +2704,7 @@ fapi_try_exit:
/// @note Called for 2R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2733,7 +2735,7 @@ fapi_try_exit:
/// @note Called for 2R 2H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2764,7 +2766,7 @@ fapi_try_exit:
/// @note Called for 2R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2795,7 +2797,7 @@ fapi_try_exit:
/// @note Called for 2R 8H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -2826,7 +2828,7 @@ fapi_try_exit:
/// @note Called for 4R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H
index 9a168c0b5..5b7db7076 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -44,7 +44,7 @@
#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/scom.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <lib/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
namespace mss
{
@@ -495,8 +495,8 @@ struct xlate_setup
/// @param[in] i_kind a DIMM kind structure representing the ... err... kind of DIMM
/// @param[in] i_func a function pointer to a function which does the configuring
///
- xlate_setup( const dimm::kind i_kind,
- fapi2::ReturnCode (*i_func)( const dimm::kind&, const uint64_t, const bool,
+ xlate_setup( const dimm::kind<> i_kind,
+ fapi2::ReturnCode (*i_func)( const dimm::kind<>&, const uint64_t, const bool,
fapi2::buffer<uint64_t>&, fapi2::buffer<uint64_t>&, fapi2::buffer<uint64_t>& ) ):
iv_kind(i_kind),
iv_func(i_func)
@@ -504,10 +504,10 @@ struct xlate_setup
}
// Keep around the kind of DIMM this nugget represents
- dimm::kind iv_kind;
+ dimm::kind<> iv_kind;
// The function to call to setup the translation registers to setup for our DIMM kind.
- fapi2::ReturnCode (*iv_func)( const dimm::kind&, const uint64_t, const bool,
+ fapi2::ReturnCode (*iv_func)( const dimm::kind<>&, const uint64_t, const bool,
fapi2::buffer<uint64_t>&, fapi2::buffer<uint64_t>&, fapi2::buffer<uint64_t>& );
};
@@ -522,7 +522,7 @@ struct xlate_setup
/// @note Called for 2R4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -540,7 +540,7 @@ fapi2::ReturnCode xlate_dimm_2R2T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -558,7 +558,7 @@ fapi2::ReturnCode xlate_dimm_2R2T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -576,7 +576,7 @@ fapi2::ReturnCode xlate_dimm_2R2T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 2H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -594,7 +594,7 @@ fapi2::ReturnCode xlate_dimm_2R4T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 2H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -612,7 +612,7 @@ fapi2::ReturnCode xlate_dimm_2R4T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 2H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -630,7 +630,7 @@ fapi2::ReturnCode xlate_dimm_2R4T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 4H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -648,7 +648,7 @@ fapi2::ReturnCode xlate_dimm_2R8T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 4H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -666,7 +666,7 @@ fapi2::ReturnCode xlate_dimm_2R8T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 4H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -684,7 +684,7 @@ fapi2::ReturnCode xlate_dimm_2R8T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 8H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -702,7 +702,7 @@ fapi2::ReturnCode xlate_dimm_2R16T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 8H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -719,7 +719,7 @@ fapi2::ReturnCode xlate_dimm_2R16T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 2R 8H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -737,7 +737,7 @@ fapi2::ReturnCode xlate_dimm_2R16T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -754,7 +754,7 @@ fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -772,7 +772,7 @@ fapi2::ReturnCode xlate_dimm_1R1T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -790,7 +790,7 @@ fapi2::ReturnCode xlate_dimm_1R1T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 2H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -808,7 +808,7 @@ fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 2H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -826,7 +826,7 @@ fapi2::ReturnCode xlate_dimm_1R2T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 2H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -844,7 +844,7 @@ fapi2::ReturnCode xlate_dimm_1R2T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 4H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -862,7 +862,7 @@ fapi2::ReturnCode xlate_dimm_1R4T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 4H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -880,7 +880,7 @@ fapi2::ReturnCode xlate_dimm_1R4T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 4H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -898,7 +898,7 @@ fapi2::ReturnCode xlate_dimm_1R4T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 8H 3DS 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -915,7 +915,7 @@ fapi2::ReturnCode xlate_dimm_1R8T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 8H 3DS 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -933,7 +933,7 @@ fapi2::ReturnCode xlate_dimm_1R8T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 8H 3DS 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -951,7 +951,7 @@ fapi2::ReturnCode xlate_dimm_1R8T16Gbx4( const dimm::kind& i_kind,
/// @note Called for 4R 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -968,7 +968,7 @@ fapi2::ReturnCode xlate_dimm_4R4T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 4R 8Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T8Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T8Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -985,7 +985,7 @@ fapi2::ReturnCode xlate_dimm_4R4T8Gbx4( const dimm::kind& i_kind,
/// @note Called for 4R 16Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T16Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T16Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1000,7 +1000,7 @@ fapi2::ReturnCode xlate_dimm_4R4T16Gbx4( const dimm::kind& i_kind,
/// @param[out] fapi2::buffer<uint64_t> o_xlate2 - xlt register 2's value
/// @return FAPI2_RC_SUCCESS iff ok
///
-fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind>& i_dimm_kinds,
+fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind<>>& i_dimm_kinds,
fapi2::buffer<uint64_t>& o_xlate0,
fapi2::buffer<uint64_t>& io_xlate1,
fapi2::buffer<uint64_t>& io_xlate2 );
@@ -1016,7 +1016,7 @@ fapi2::ReturnCode setup_xlate_map_helper( std::vector<dimm::kind>& i_dimm_kinds,
/// @note Called for 1R4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1034,7 +1034,7 @@ fapi2::ReturnCode xlate_dimm_1R1T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 2 total ranks 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1052,7 +1052,7 @@ fapi2::ReturnCode xlate_dimm_1R2T4Gbx4( const dimm::kind& i_kind,
/// @note Called for 1R 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1070,7 +1070,7 @@ fapi2::ReturnCode xlate_dimm_1R1T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1088,7 +1088,7 @@ fapi2::ReturnCode xlate_dimm_1R1T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 2H 3DS 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1106,7 +1106,7 @@ fapi2::ReturnCode xlate_dimm_1R2T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 2H 3DS 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1124,7 +1124,7 @@ fapi2::ReturnCode xlate_dimm_1R2T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 4H 3DS 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1142,7 +1142,7 @@ fapi2::ReturnCode xlate_dimm_1R4T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 4H 3DS 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1160,7 +1160,7 @@ fapi2::ReturnCode xlate_dimm_1R4T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 8H 3DS 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1177,7 +1177,7 @@ fapi2::ReturnCode xlate_dimm_1R8T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 8H 3DS 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1195,7 +1195,7 @@ fapi2::ReturnCode xlate_dimm_1R8T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1213,7 +1213,7 @@ fapi2::ReturnCode xlate_dimm_2R2T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1231,7 +1231,7 @@ fapi2::ReturnCode xlate_dimm_2R2T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 2H 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1249,7 +1249,7 @@ fapi2::ReturnCode xlate_dimm_2R4T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 2H 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1267,7 +1267,7 @@ fapi2::ReturnCode xlate_dimm_2R4T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 4H 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1285,7 +1285,7 @@ fapi2::ReturnCode xlate_dimm_2R8T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 4H 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1303,7 +1303,7 @@ fapi2::ReturnCode xlate_dimm_2R8T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 8H 8Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1321,7 +1321,7 @@ fapi2::ReturnCode xlate_dimm_2R16T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 8H 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1339,7 +1339,7 @@ fapi2::ReturnCode xlate_dimm_2R16T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 4R 4Gbx4 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T8Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T8Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1357,7 +1357,7 @@ fapi2::ReturnCode xlate_dimm_4R4T8Gbx8( const dimm::kind& i_kind,
/// @note Called for 4R 16Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T16Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T16Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1375,7 +1375,7 @@ fapi2::ReturnCode xlate_dimm_4R4T16Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R1T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R1T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1393,7 +1393,7 @@ fapi2::ReturnCode xlate_dimm_1R1T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 2H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R2T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R2T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1411,7 +1411,7 @@ fapi2::ReturnCode xlate_dimm_1R2T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1429,7 +1429,7 @@ fapi2::ReturnCode xlate_dimm_1R4T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 1R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_1R8T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_1R8T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1447,7 +1447,7 @@ fapi2::ReturnCode xlate_dimm_1R8T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1465,7 +1465,7 @@ fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1483,7 +1483,7 @@ fapi2::ReturnCode xlate_dimm_2R2T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 2H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1501,7 +1501,7 @@ fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 2H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1519,7 +1519,7 @@ fapi2::ReturnCode xlate_dimm_2R4T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1537,7 +1537,7 @@ fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 4H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1555,7 +1555,7 @@ fapi2::ReturnCode xlate_dimm_2R8T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 2R 8H 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_2R16T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_2R16T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
@@ -1573,7 +1573,7 @@ fapi2::ReturnCode xlate_dimm_2R16T4Gbx8( const dimm::kind& i_kind,
/// @note Called for 4R 4Gbx8 DDR4 RDIMM
/// @return FAPI2_RC_SUCCESS iff okay
///
-fapi2::ReturnCode xlate_dimm_4R4T4Gbx8( const dimm::kind& i_kind,
+fapi2::ReturnCode xlate_dimm_4R4T4Gbx8( const dimm::kind<>& i_kind,
const uint64_t i_offset,
const bool i_largest,
fapi2::buffer<uint64_t>& io_xlate0,
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/address.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/address.H
index 3a7a4ee2c..fcfd9a3e4 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/address.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/address.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,489 +38,13 @@
#include <fapi2.H>
#include <utility>
-#include <lib/ecc/ecc_traits.H>
-
-namespace mss
-{
-
-namespace ecc
-{
-
-namespace fwms
-{
-
-///
-/// @class address
-/// @brief Converts Firmware Mark Store ADDRESS field into mcbist::address
-/// @tparam T fapi2 Target Type defaults to fapi2::TARGET_TYPE_MCA
-/// @tparam TT traits type defaults to eccTraits<T>
-/// @note template argument defaults are in forward declaration in lib/mcbist/address.H
-/// @note 12 = dimm
-/// @note 13:14 = mrank
-/// @note 15:17 = srank
-/// @note 18:19 = bank group
-/// @note 20:22 = bank
-///
-// See declaration below
-template< fapi2::TargetType T, typename TT = eccTraits<T> >
-class address;
-
-} // close namespace fwms
-} // close namespace ecc
-
-namespace mcbist
-{
-
-///
-/// @class address
-/// @brief Represents a physical address in memory
-/// @note
-/// 0:1 port select
-/// 2 dimm select
-/// 3:4 mrank(0 to 1)
-/// 5:7 srank(0 to 2)
-/// 8:25 row(0 to 17)
-/// 26:32 col(3 to 9)
-/// 33:35 bank(0 to 2)
-/// 36:37 bank_group(0 to 1)
-///
-class address
-{
- private:
- // How far over we shift to align the address in either the register or a buffer
- enum { MAGIC_PAD = 26 };
-
- public:
-
- // first is the start bit of the field, second is the length
- typedef std::pair<uint64_t, uint64_t> field;
-
- constexpr static field PORT = {0, 2};
- constexpr static field DIMM = {2, 1};
- constexpr static field MRANK = {3, 2};
- constexpr static field SRANK = {5, 3};
- constexpr static field ROW = {8, 18};
- constexpr static field COL = {26, 7};
- constexpr static field BANK = {33, 3};
- constexpr static field BANK_GROUP = {36, 2};
- constexpr static field LAST_VALID = BANK_GROUP;
-
- address() = default;
-
- static constexpr uint64_t LARGEST_ADDRESS = ~0 >> MAGIC_PAD;
-
- // Used when accessing an integral value containing a port and DIMM combination
- static constexpr uint64_t DIMM_BIT = 63;
- static constexpr uint64_t PORT_START = 61;
- static constexpr uint64_t PORT_LEN = 2;
-
- ///
- /// @brief Construct an address from a uint64_t (scom'ed value)
- /// @param[in] i_value representing an address; say from a trap register
- ///
- /// @note This assumes input has the same bit layout as this address
- /// structure, and this is presently not the case for the trap registers (3/16).
- /// These are presently unused, however. There is an open defect against the
- /// design team to correct this.
- /// @warn Assumes right-aligned value; bit 63 is shifted to represent the Bank Group
- address( const uint64_t i_value ):
- iv_address(i_value << MAGIC_PAD)
- {
- }
-
- ///
- /// @brief Construct an address from an ecc::fwms::address
- /// @tparam T fapi2 Target Type
- /// @param[in] i_address representing an address field from a firmware mark store register
- ///
- template< fapi2::TargetType T >
- address( const ecc::fwms::address<T>& i_address )
- {
- fapi2::buffer<uint64_t> l_value = uint64_t(i_address);
- uint64_t l_temp = 0;
- l_value.extractToRight<ecc::fwms::address<T>::DIMM.first, ecc::fwms::address<T>::DIMM.second>(l_temp);
- this->set_field<DIMM>(l_temp);
- l_value.extractToRight<ecc::fwms::address<T>::MRANK.first, ecc::fwms::address<T>::MRANK.second>(l_temp);
- this->set_field<MRANK>(l_temp);
- l_value.extractToRight<ecc::fwms::address<T>::SRANK.first, ecc::fwms::address<T>::SRANK.second>(l_temp);
- this->set_field<SRANK>(l_temp);
- l_value.extractToRight<ecc::fwms::address<T>::BANK_GROUP.first, ecc::fwms::address<T>::BANK_GROUP.second>(l_temp);
- this->set_field<BANK_GROUP>(l_temp);
- l_value.extractToRight<ecc::fwms::address<T>::BANK.first, ecc::fwms::address<T>::BANK.second>(l_temp);
- this->set_field<BANK>(l_temp);
- }
-
- ///
- /// @brief Conversion operator to uint64_t
- /// @warn Right-aligns the address
- ///
- inline operator uint64_t() const
- {
- return iv_address >> MAGIC_PAD;
- }
-
- ///
- /// @brief Set a field for an address
- /// @tparam F the field to set
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- template< const field& F >
- inline address& set_field( const uint64_t i_value )
- {
- iv_address.insertFromRight<F.first, F.second>(i_value);
- return *this;
- }
-
- ///
- /// @brief Get a field from an address
- /// @tparam F the field to get
- /// @return right-aligned uint64_t representing the value
- ///
- template< const field& F >
- inline uint64_t get_field() const
- {
- uint64_t l_value = 0;
- iv_address.extractToRight<F.first, F.second>(l_value);
- return l_value;
- }
-
- ///
- /// @brief Get a range of addresses.
- /// @tparam[in] F the left-most valid field. So, if the address was for master rank,
- /// the left-most valid field would be MRANK
- /// @param[out] o_end representing an address to end at
- /// @note this pointer is the start address
- ///
- template< const field& F >
- inline void get_range( address& o_end ) const
- {
- constexpr uint64_t START = F.first + F.second;
- constexpr uint64_t LEN = (LAST_VALID.first + LAST_VALID.second) - START;
-
- // All we need to do is fill in the bits to the right of the last valid field
- o_end.iv_address = iv_address;
- o_end.iv_address.setBit<START, LEN>();
- }
-
-
- ///
- /// @brief Get an end address for sim mode
- /// @param[out] o_end representing an address to end at
- /// @note this pointer is the start address
- ///
- inline void get_sim_end_address( address& o_end ) const
- {
- // This magic number represents a range of addresses which cover all
- // cache lines the training algorithms touch. By effecting 0 - this end
- // address you'll effect everything which has bad ECC in the sim.
- constexpr uint64_t l_magic_sim_number = 0b1000000;
-
- get_range<COL>(o_end);
- o_end.set_column(l_magic_sim_number);
- return;
- }
-
- ///
- /// @brief Get a range of addresses given a master rank
- /// @param[in] i_start representing an address to start from
- /// @param[out] o_end representing an address to end at
- ///
- inline static void get_mrank_range( const address& i_start, address& o_end )
- {
- i_start.get_range<MRANK>(o_end);
- }
-
- ///
- /// @brief Get a range of addresses given a master rank
- /// @param[in] i_port representing the port for the starting address
- /// @param[in] i_dimm representing the dimm for the starting address
- /// @param[in] i_mrank representing the master rank for the starting address
- /// @param[out] o_start representing an address to start from
- /// @param[out] o_end representing an address to end at
- ///
- inline static void get_mrank_range( const uint64_t i_port, const uint64_t i_dimm, const uint64_t i_mrank,
- address& o_start, address& o_end )
- {
- o_start.set_port(i_port).set_dimm(i_dimm).set_master_rank(i_mrank);
- get_mrank_range(o_start, o_end);
- }
-
- ///
- /// @brief Get a range of addresses given a slave rank
- /// @param[in] i_start representing an address to start from
- /// @param[out] o_end representing an address to end at
- ///
- inline static void get_srank_range( const address& i_start, address& o_end )
- {
- i_start.get_range<SRANK>(o_end);
- }
-
- ///
- /// @brief Get a range of addresses given a slave rank
- /// @param[in] i_port representing the port for the starting address
- /// @param[in] i_dimm representing the dimm for the starting address
- /// @param[in] i_mrank representing the master rank for the starting address
- /// @param[in] i_srank representing the slave rank for the starting address
- /// @param[out] o_start representing an address to start from
- /// @param[out] o_end representing an address to end at
- ///
- inline static void get_srank_range( const uint64_t i_port, const uint64_t i_dimm,
- const uint64_t i_mrank, const uint64_t i_srank,
- address& o_start, address& o_end )
- {
- o_start.set_port(i_port).set_dimm(i_dimm).set_master_rank(i_mrank).set_slave_rank(i_srank);
- get_srank_range(o_start, o_end);
- }
-
- ///
- /// @brief Set the port value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- inline address& set_port( const uint64_t i_value )
- {
- return set_field<PORT>(i_value);
- }
-
- ///
- /// @brief Get the port value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_port() const
- {
- return get_field<PORT>();
- }
-
- ///
- /// @brief Set the DIMM value for an address
- /// @param[in] i_value the value to set
- /// @note 0 is the DIMM[0] != 0 is DIMM[1]
- /// @return address& for method chaining
- ///
- inline address& set_dimm( const uint64_t i_value )
- {
- return set_field<DIMM>(i_value);
- }
-
- ///
- /// @brief Get the DIMM value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_dimm() const
- {
- return get_field<DIMM>();
- }
-
- ///
- /// @brief Set the port and DIMM value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- /// @note Useful for indexing all ports/DIMM on a controller
- ///
- inline address& set_port_dimm( const fapi2::buffer<uint64_t> i_value )
- {
- uint64_t l_read_port = 0;
-
- i_value.extractToRight<PORT_START, PORT_LEN>(l_read_port);
- return set_dimm(i_value.getBit<DIMM_BIT>()).set_port(l_read_port);
- }
-
- ///
- /// @brief Get the port and DIMM value for an address
- /// @return right-aligned uint64_t representing the value
- /// @note Useful for indexing all ports/DIMM on a controller
- ///
- inline uint64_t get_port_dimm() const
- {
- fapi2::buffer<uint64_t> l_value;
-
- l_value.insertFromRight<PORT_START, PORT_LEN>(get_port());
- l_value.writeBit<DIMM_BIT>(get_dimm());
-
- return l_value;
- }
-
- ///
- /// @brief Set the master rank value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- inline address& set_master_rank( const uint64_t i_value )
- {
- return set_field<MRANK>(i_value);
- }
-
- ///
- /// @brief Get the master rank value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_master_rank() const
- {
- return get_field<MRANK>();
- }
-
-
- ///
- /// @brief Set the slave rank value for an address
- /// @param[in] i_value the value to set
- ///
- inline void set_slave_rank( const uint64_t i_value )
- {
- set_field<SRANK>(i_value);
- }
-
- ///
- /// @brief Get the slave rank value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_slave_rank() const
- {
- return get_field<SRANK>();
- }
-
-
- ///
- /// @brief Set the row value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- inline address& set_row( const uint64_t i_value )
- {
- return set_field<ROW>(i_value);
- }
-
- ///
- /// @brief Get the row value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_row() const
- {
- return get_field<ROW>();
- }
-
-
- ///
- /// @brief Set the column value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- inline address& set_column( const uint64_t i_value )
- {
- return set_field<COL>(i_value);
- }
-
- ///
- /// @brief Get the column value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_column() const
- {
- return get_field<COL>();
- }
-
-
- ///
- /// @brief Set the bank value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- inline address& set_bank( const uint64_t i_value )
- {
- return set_field<BANK>(i_value);
- }
-
- ///
- /// @brief Get the bank value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_bank() const
- {
- return get_field<BANK>();
- }
-
- ///
- /// @brief Set the bank group value for an address
- /// @param[in] i_value the value to set
- /// @return address& for method chaining
- ///
- inline address& set_bank_group( const uint64_t i_value )
- {
- return set_field<BANK_GROUP>(i_value);
- }
-
- ///
- /// @brief Get the bank group value for an address
- /// @return right-aligned uint64_t representing the value
- ///
- inline uint64_t get_bank_group() const
- {
- return get_field<BANK_GROUP>();
- }
-
- private:
- // We use a fapi2 buffer as it has static compile-time support
- fapi2::buffer<uint64_t> iv_address;
-};
-
-} // close namespace mcbist
-
-// Documented above in its declaration.
-template< fapi2::TargetType T, typename TT >
-class ecc::fwms::address
-{
- public:
- // first is the start bit of the field, second is the length
- typedef std::pair<uint64_t, uint64_t> field;
-
- constexpr static field DIMM = {TT::FIRMWARE_MS_ADDRESS, 1};
- constexpr static field MRANK = {TT::FIRMWARE_MS_ADDRESS + 1, 2};
- constexpr static field SRANK = {TT::FIRMWARE_MS_ADDRESS + 3, 3};
- constexpr static field BANK_GROUP = {TT::FIRMWARE_MS_ADDRESS + 6, 2};
- constexpr static field BANK = {TT::FIRMWARE_MS_ADDRESS + 8, 3};
- constexpr static field LAST_VALID = BANK;
-
- address() = default;
-
- ///
- /// @brief Construct an address from a uint64_t (scom'ed value)
- /// @param[in] i_value representing raw value from FWMS register
- ///
- address( const uint64_t& i_value ):
- iv_value(i_value)
- {
- }
-
- ///
- /// @brief Construct an address from an mcbist::address
- /// @param[in] i_mcbist_address mcbist formatted address
- /// @note Construction of mcbist::address from ecc::fwms::address
- /// @note located in mcbist::address class
- ///
- address( const mcbist::address& i_mcbist_address )
- {
- iv_value.insertFromRight<DIMM.first, DIMM.second>(i_mcbist_address.get_field<mcbist::address::DIMM>());
- iv_value.insertFromRight<MRANK.first, MRANK.second>(i_mcbist_address.get_field<mcbist::address::MRANK>());
- iv_value.insertFromRight<SRANK.first, SRANK.second>(i_mcbist_address.get_field<mcbist::address::SRANK>());
- iv_value.insertFromRight<BANK_GROUP.first, BANK_GROUP.second>
- (i_mcbist_address.get_field<mcbist::address::BANK_GROUP>());
- iv_value.insertFromRight<BANK.first, BANK.second>(i_mcbist_address.get_field<mcbist::address::BANK>());
- }
-
- ///
- /// @brief Conversion operator to uint64_t
- ///
- inline operator uint64_t() const
- {
- uint64_t l_temp = 0;
- iv_value.extract<TT::FIRMWARE_MS_ADDRESS, TT::FIRMWARE_MS_ADDRESS_LEN, TT::FIRMWARE_MS_ADDRESS>(l_temp);
- return l_temp;
- }
-
- private:
- fapi2::buffer<uint64_t> iv_value;
-};
-
-} // close namespace mss
+#include <lib/shared/mss_const.H>
+#include <lib/ecc/ecc_traits_nimbus.H>
+#include <lib/mcbist/mcbist_traits.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_ecc_trap_address.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_fwms_address.H>
+
+// This file is still necessary to put traits and generic code together
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C
index f5ef0e24c..f002b31e9 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C
@@ -35,8 +35,8 @@
#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
+#include <lib/mss_attribute_accessors.H>
#include <lib/mcbist/mcbist.H>
-#include <lib/utils/dump_regs.H>
#include <lib/workarounds/mcbist_workarounds.H>
#include <generic/memory/lib/utils/pos.H>
@@ -47,7 +47,22 @@ using fapi2::TARGET_TYPE_MCS;
namespace mss
{
-const std::pair<uint64_t, uint64_t> mcbistTraits<fapi2::TARGET_TYPE_MCBIST>::address_pairs[] =
+///
+/// @brief Gets the attribute for freq
+/// @param[in] const ref to the target
+/// @param[out] uint64_t& reference to store the value
+/// @note Generated by gen_accessors.pl generate_mc_port_params
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Frequency of this memory channel in MT/s (Mega Transfers per second)
+///
+template<>
+fapi2::ReturnCode freq<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCBIST>(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>&
+ i_target, uint64_t& o_value)
+{
+ return mss::freq(i_target, o_value);
+}
+
+const std::pair<uint64_t, uint64_t> mcbistTraits<>::address_pairs[] =
{
{ START_ADDRESS_0, END_ADDRESS_0 },
{ START_ADDRESS_1, END_ADDRESS_1 },
@@ -55,7 +70,7 @@ const std::pair<uint64_t, uint64_t> mcbistTraits<fapi2::TARGET_TYPE_MCBIST>::add
{ START_ADDRESS_3, END_ADDRESS_3 },
};
-const std::vector< mss::mcbist::op_type > mcbistTraits<fapi2::TARGET_TYPE_MCBIST>::FIFO_MODE_REQUIRED_OP_TYPES =
+const std::vector< mss::mcbist::op_type > mcbistTraits<>::FIFO_MODE_REQUIRED_OP_TYPES =
{
mss::mcbist::op_type::WRITE ,
mss::mcbist::op_type::READ ,
@@ -67,463 +82,63 @@ const std::vector< mss::mcbist::op_type > mcbistTraits<fapi2::TARGET_TYPE_MCBIST
mss::mcbist::op_type::READ_READ_WRITE ,
};
-namespace mcbist
-{
-
-///
-/// @brief Load MCBIST maint pattern given a pattern
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_pattern an mcbist::patterns
-/// @param[in] i_invert whether to invert the pattern or not
-/// @note this overload disappears when we have real patterns.
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< >
-fapi2::ReturnCode load_maint_pattern( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const pattern& i_pattern,
- const bool i_invert )
+// These valus are pulled out of the MCBIST specification
+// The index is the fixed width - the value is the LFSR_MASK value to be used
+const std::vector< uint64_t > mcbistTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCBIST>::LFSR_MASK_VALUES =
{
- // Init the fapi2 return code
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- // Array access control
- fapi2::buffer<uint64_t> l_aacr;
- // Array access data
- fapi2::buffer<uint64_t> l_aadr;
-
- // first we must setup the access control register
- // Setup the array address
- // enable the auto increment bit
- // set ecc mode bit on
- l_aacr
- .writeBit<MCA_WREITE_AACR_BUFFER>(mss::states::OFF)
- .insertFromRight<MCA_WREITE_AACR_ADDRESS, MCA_WREITE_AACR_ADDRESS_LEN>(mss::mcbist::rmw_address::DW0)
- .writeBit<MCA_WREITE_AACR_AUTOINC>(mss::states::ON)
- .writeBit<MCA_WREITE_AACR_ECCGEN>(mss::states::ON);
-
- // This loop will be run twice to write the pattern twice. Once per 64B write.
- // When MCBIST maint mode is in 64B mode it will only use the first 64B when in 128B mode
- // MCBIST maint will use all 128B (it will perform two consecutive writes)
- const auto l_ports = mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target);
- // Init the port map
-
- for (const auto& p : l_ports)
- {
- l_aacr.insertFromRight<MCA_WREITE_AACR_ADDRESS, MCA_WREITE_AACR_ADDRESS_LEN>(mss::mcbist::rmw_address::DW0);
-
- for (auto l_num_reads = 0; l_num_reads < 2; ++l_num_reads)
- {
- FAPI_INF("Setting the array access control register.");
- FAPI_TRY( mss::putScom(p, MCA_WREITE_AACR, l_aacr) );
-
- for (const auto& l_cache_line : i_pattern)
- {
- fapi2::buffer<uint64_t> l_value_first = i_invert ? ~l_cache_line.first : l_cache_line.first;
- fapi2::buffer<uint64_t> l_value_second = i_invert ? ~l_cache_line.second : l_cache_line.second;
- FAPI_INF("Loading cache line pattern 0x%016lx 0x%016lx", l_value_first, l_value_second);
- FAPI_TRY( mss::putScom(p, MCA_AADR, l_value_first) );
-
- // In order for the data to actually be written into the RMW buffer, we must issue a putscom to the MCA_AAER register
- // This register is used for the ECC, we will just write all zero to this register. The ECC will be auto generated
- // when the aacr MCA_WREITE_AACR_ECCGEN bit is set
- FAPI_TRY( mss::putScom(p, MCA_AAER, 0) );
-
- // No need to increment the address because the logic does it automatically when MCA_WREITE_AACR_AUTOINC is set
- FAPI_TRY( mss::putScom(p, MCA_AADR, l_value_second) );
-
- // In order for the data to actually be written into the RMW buffer, we must issue a putscom to the MCA_AAER register
- // This register is used for the ECC, we will just write all zero to this register. The ECC will be auto generated
- // when the aacr MCA_WREITE_AACR_ECCGEN bit is set
- FAPI_TRY( mss::putScom(p, MCA_AAER, 0) );
- }
-
- l_aacr.insertFromRight<MCA_WREITE_AACR_ADDRESS, MCA_WREITE_AACR_ADDRESS_LEN>(mss::mcbist::rmw_address::DW8);
- }
- }
-
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST data compare mask registers
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< >
-fapi2::ReturnCode load_data_compare_mask( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const mcbist::program<TARGET_TYPE_MCBIST>& i_program )
-{
- typedef mcbistTraits<TARGET_TYPE_MCBIST> TT;
-
- // Init the fapi2 return code
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- // Load the MCBCM Data compare masks
-
- const auto l_ports = mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target);
- FAPI_INF("Loading the MCBIST data compare mask registers!");
-
- for (const auto& p : l_ports)
- {
- FAPI_TRY( mss::putScom(p, TT::COMPARE_MASK, i_program.iv_compare_mask) );
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-
-}
-
-///
-/// @brief Load MCBIST 24b random data seeds given a pattern index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_random24_data_seed mcbist::random24_data_seed
-/// @param[in] i_random24_map mcbist::random24_seed_map
-/// @param[in] i_invert whether to invert the pattern or not
-/// @note this overload disappears when we have real patterns.
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< >
-fapi2::ReturnCode load_random24b_seeds( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const random24_data_seed& i_random24_data_seed,
- const random24_seed_map& i_random24_map,
- const bool i_invert )
-{
- // Init the fapi2 return code
- fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
-
- const uint64_t l_random_addr0 = MCBIST_MCBRDS0Q;
- const uint64_t l_random_addr1 = MCBIST_MCBRDS1Q;
- uint64_t l_index = 0;
- uint64_t l_map_index = 0;
- uint64_t l_map_offset = 0;
-
- fapi2::buffer<uint64_t> l_mcbrsd0q;
- fapi2::buffer<uint64_t> l_mcbrsd1q;
-
-
- // We are going to loop through the random seeds and load them into the random seed registers
- // Because the 24b random data seeds share the same registers as the 24b random data byte LFSR maps
- // we will load those as well
-
- for (const auto& l_seed : i_random24_data_seed)
- {
- FAPI_INF("Loading 24b random seed index %ld ", l_index);
- fapi2::buffer<uint64_t> l_value = i_invert ? ~l_seed : l_seed;
-
- // Print an informational message to indicate if a random seed is 0
- // TK Do we want an error here? 0 may be used on purpose to hold a byte at all 0 on purpose
- if ( l_value == 0 )
- {
- FAPI_INF("Warning: Random 24b data seed is set to 0 for seed index %d", l_index);
- }
-
- // If we are processing the first 24b random data seed we will add it to the fapi buffer
- // we won't load it yet because the second 24b seed will be loaded into the same register
- if ( l_index == 0 )
- {
- l_mcbrsd0q.insertFromRight<MCBIST_MCBRDS0Q_DGEN_RNDD_SEED0, MCBIST_MCBRDS0Q_DGEN_RNDD_SEED0_LEN>(l_value);
- }
- // The second 24b random data seed is loaded into the same register as the first seed
- // therefore we will add the second seed tothe fapi buffer and then issue the putscom
- else if (l_index == 1 )
- {
- l_mcbrsd0q.insertFromRight<MCBIST_MCBRDS0Q_DGEN_RNDD_SEED1, MCBIST_MCBRDS0Q_DGEN_RNDD_SEED1_LEN>(l_value);
- FAPI_INF("Loading 24b random seeds 0 and 1 0x%016lx ", l_mcbrsd0q);
- FAPI_TRY( mss::putScom(i_target, l_random_addr0, l_mcbrsd0q) );
- }
- // The third 24b random data seed occupies the same register as the random data byte maps. Therefore we first
- // add the third random 24b data seed to the register and then loop through all of the byte mappings a total of
- // 9. ach of the byte mappings associates a byte of the random data to a byte in the 24b random data LFSRs
- // Each byte map is offset by 4 bits in the register.
- else
- {
- l_mcbrsd1q.insertFromRight<MCBIST_MCBRDS1Q_DGEN_RNDD_SEED2, MCBIST_MCBRDS1Q_DGEN_RNDD_SEED2_LEN>(l_value);
-
- for (const auto& l_map : i_random24_map)
- {
- l_map_offset = MCBIST_MCBRDS1Q_DGEN_RNDD_DATA_MAPPING + (l_map_index * RANDOM24_SEED_MAP_FIELD_LEN);
- l_mcbrsd1q.insertFromRight(l_map, l_map_offset, RANDOM24_SEED_MAP_FIELD_LEN);
- FAPI_INF("Loading 24b random seed map index %ld ", l_map_index);
- FAPI_ASSERT( l_map_index < mss::mcbist::MAX_NUM_RANDOM24_MAPS,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(l_map_index),
- "Attempting to load a 24b random data seed map which does not exist %d", l_map_index );
- ++l_map_index;
- }
-
- FAPI_TRY( mss::putScom(i_target, l_random_addr1, l_mcbrsd1q) );
- }
-
- FAPI_ASSERT( l_index < MAX_NUM_RANDOM24_SEEDS,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(l_index),
- "Attempting to load a 24b random data seed which does not exist %d", l_index );
- ++l_index;
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load a set of MCBIST subtests in to the MCBIST registers
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] the target to effect
-/// @param[in] the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note assumes the MCBIST engine has been configured.
-///
-template<>
-fapi2::ReturnCode load_mcbmr( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const mcbist::program<TARGET_TYPE_MCBIST>& i_program )
-{
-
- // Leave if there are no subtests.
- if (0 == i_program.iv_subtests.size())
- {
- FAPI_INF("no subtests, nothing to do");
- return fapi2::current_err;
- }
-
- // List of the 8 MCBIST registers - each holds 4 subtests.
- static const std::vector< uint64_t > l_memory_registers =
- {
- MCBIST_MCBMR0Q, MCBIST_MCBMR1Q, MCBIST_MCBMR2Q, MCBIST_MCBMR3Q,
- MCBIST_MCBMR4Q, MCBIST_MCBMR5Q, MCBIST_MCBMR6Q, MCBIST_MCBMR7Q,
- };
-
- std::vector< uint64_t > l_memory_register_buffers =
- {
- 0, 0, 0, 0, 0, 0, 0, 0,
- };
-
- static const size_t SUBTEST_PER_REG = 4;
- static const size_t SUBTEST_PER_PROGRAM = 32;
-
- static const auto BITS_IN_SUBTEST = sizeof(mcbist::subtest_t<TARGET_TYPE_MCBIST>().iv_mcbmr) * 8;
- static const auto LEFT_SHIFT = (sizeof(uint64_t) * 8) - BITS_IN_SUBTEST;
-
- ssize_t l_bin = -1;
- size_t l_register_shift = 0;
-
- // We'll shift this in to position to indicate which subtest is the last
- static const uint64_t l_done_bit( 0x8000000000000000 >> MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DONE );
-
- // TK: For now limit MCBIST programs to 32 subtests.
- const auto l_program_size = i_program.iv_subtests.size();
- FAPI_ASSERT( l_program_size <= SUBTEST_PER_PROGRAM,
- fapi2::MSS_MCBIST_PROGRAM_TOO_BIG().set_PROGRAM_LENGTH(l_program_size),
- "mcbist program of length %d exceeds arbitrary maximum of %d", l_program_size, SUBTEST_PER_PROGRAM );
-
- // Distribute the program over the 8 MCBIST subtest registers
- // We need the index, so increment thru i_program.iv_subtests.size()
- for (size_t l_index = 0; l_index < l_program_size; ++l_index)
- {
- l_bin = (l_index % SUBTEST_PER_REG) == 0 ? l_bin + 1 : l_bin;
- l_register_shift = (l_index % SUBTEST_PER_REG) * BITS_IN_SUBTEST;
-
- l_memory_register_buffers[l_bin] |=
- (uint64_t(i_program.iv_subtests[l_index].iv_mcbmr) << LEFT_SHIFT) >> l_register_shift;
-
- FAPI_DBG("putting subtest %d (0x%x) in MCBMR%dQ shifted %d 0x%016llx",
- l_index, i_program.iv_subtests[l_index].iv_mcbmr, l_bin,
- l_register_shift, l_memory_register_buffers[l_bin]);
- }
-
- // l_bin and l_register_shift are the values for the last subtest we'll tell the MCBIST about.
- // We need to set that subtest's done-bit so the MCBIST knows it's the end of the line
- l_memory_register_buffers[l_bin] |= l_done_bit >> l_register_shift;
- FAPI_DBG("setting MCBMR%dQ subtest %llu as the last subtest 0x%016llx",
- l_bin, l_register_shift, l_memory_register_buffers[l_bin]);
-
- // ... and slam the values in to the registers.
- // Could just decrement l_bin, but that scoms the subtests in backwards and is confusing
- for (auto l_index = 0; l_index <= l_bin; ++l_index)
- {
- FAPI_TRY( mss::putScom(i_target, l_memory_registers[l_index], l_memory_register_buffers[l_index]) );
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Poll the mcbist engine and check for errors
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program, the mcbist program which is executing
-/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode poll( const fapi2::Target<T>& i_target, const program<T>& i_program )
-{
- fapi2::buffer<uint64_t> l_status;
-
- static const uint64_t l_done = fapi2::buffer<uint64_t>().setBit<TT::MCBIST_DONE>();
- static const uint64_t l_fail = fapi2::buffer<uint64_t>().setBit<TT::MCBIST_FAIL>();
- static const uint64_t l_in_progress = fapi2::buffer<uint64_t>().setBit<TT::MCBIST_IN_PROGRESS>();
-
- // A small vector of addresses to poll during the polling loop
- const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes =
- {
- {i_target, "mcbist current address", MCBIST_MCBMCATQ},
- };
-
- mss::poll(i_target, TT::STATQ_REG, i_program.iv_poll,
- [&l_status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
- {
- FAPI_DBG("mcbist statq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<TT::MCBIST_IN_PROGRESS>() != 1;
- },
- l_probes);
-
- // Check to see if we're still in progress - meaning we timed out.
- FAPI_ASSERT((l_status & l_in_progress) != l_in_progress,
- fapi2::MSS_MCBIST_TIMEOUT().set_MCBIST_TARGET(i_target),
- "MCBIST timed out %s", mss::c_str(i_target));
-
- // The control register has a bit for done-and-happy and a bit for done-and-unhappy
- if ( ((l_status & l_done) == l_done) || ((l_status & l_fail) == l_fail) )
- {
- FAPI_INF("MCBIST completed, processing errors");
-
- // We're done. It doesn't mean that there were no errors.
- FAPI_TRY( i_program.process_errors(i_target) );
-
- // If we're here there were no errors, but lets report if the fail bit was set anyway.
- FAPI_ASSERT( (l_status & l_fail) != l_fail,
- fapi2::MSS_MCBIST_UNKNOWN_FAILURE()
- .set_MCBIST_TARGET(i_target)
- .set_STATUS_REGISTER(l_status),
- "%s MCBIST reported a fail, but process_errors didn't find it 0x%016llx",
- mss::c_str(i_target), l_status );
-
- // And if we're here all is good with the world.
- return fapi2::current_err;
- }
-
- FAPI_ASSERT(false,
- fapi2::MSS_MCBIST_DATA_FAIL()
- .set_MCBIST_TARGET(i_target)
- .set_STATUS_REGISTER(l_status),
- "%s MCBIST executed but we got corrupted data in the control register 0x%016llx",
- mss::c_str(i_target), l_status );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
+ 0x000000031,
+ 0x00000001F,
+ 0x001000000,
+ 0x100000000,
+ 0x004000003,
+ 0x000080000,
+ 0x040000018,
+ 0x008000000,
+ 0x010006000,
+ 0x004000000,
+ 0x001000000,
+ 0x003200000,
+ 0x001880000,
+ 0x000200000,
+ 0x000610000,
+ 0x000100000,
+ 0x000040000,
+ 0x000010000,
+ 0x000023000,
+ 0x000002000,
+ 0x000000400,
+ 0x000002000,
+ 0x000005008,
+ 0x000002000,
+ 0x000001088,
+ 0x000000B00,
+ 0x0000004A0,
+ 0x000000100,
+ 0x000000040,
+ 0x000000010,
+ 0x000000038,
+ 0x000000008,
+ 0x000000010,
+ 0x000000004,
+ 0x000000004,
+ 0x000000002,
+ 0x000000001,
+};
-///
-/// @brief Execute the mcbist program
-/// @param[in] i_target the target to effect
-/// @param[in] i_program, the mcbist program to execute
-/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
-///
-template<>
-fapi2::ReturnCode execute( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const program<TARGET_TYPE_MCBIST>& i_program )
+namespace mcbist
{
- typedef mcbistTraits<TARGET_TYPE_MCBIST> TT;
-
- fapi2::buffer<uint64_t> l_status;
- bool l_poll_result = false;
- poll_parameters l_poll_parameters;
-
- // Before we go off into the bushes, lets see if there are any instructions in the
- // program. If not, we can save everyone the hassle
- FAPI_ASSERT(0 != i_program.iv_subtests.size(),
- fapi2::MSS_MEMDIAGS_NO_MCBIST_SUBTESTS().set_MCBIST_TARGET(i_target),
- "Attempt to run an MCBIST program with no subtests on %s", mss::c_str(i_target));
-
- // Implement any mcbist work-arounds.
- // I'm going to do the unthinkable here - and cast away the const of the mcbist program input.
- // The work arounds need to change this, and so it needs to not be const. However, I don't want
- // to risk general const-correctness by changing the input parameter to non-const. So, I use
- // const_cast<> (ducks out of the way of the flying adjectives.) These are work-arounds ...
- FAPI_TRY( workarounds::mcbist::end_of_rank(i_target, const_cast<program<TARGET_TYPE_MCBIST>&>(i_program)) );
-
- FAPI_TRY( clear_errors(i_target) );
-
- // Configures the write/read FIFO bit
- FAPI_TRY( load_fifo_mode( i_target, i_program) );
-
- // Slam the address generator config
- FAPI_TRY( load_addr_gen(i_target, i_program) );
-
- // Slam the parameters in to the mcbist parameter register
- FAPI_TRY( load_mcbparm(i_target, i_program) );
-
- // Slam the configured address maps down
- FAPI_TRY( load_mcbamr( i_target, i_program) );
-
- // Slam the config register down
- FAPI_TRY( load_config( i_target, i_program) );
-
- // Slam the control register down
- FAPI_TRY( load_control( i_target, i_program) );
-
- // Load the patterns and any associated bits for random, etc
- FAPI_TRY( load_data_config( i_target, i_program) );
-
- // Load the thresholds
- FAPI_TRY( load_thresholds( i_target, i_program) );
-
- // Slam the subtests in to the mcbist registers
- // Always do this last so the action file triggers see the other bits set
- FAPI_TRY( load_mcbmr(i_target, i_program) );
-
- // Start the engine, and then poll for completion
- FAPI_TRY(start_stop(i_target, mss::START));
-
- // Verify that the in-progress bit has been set, so we know we started
- // Don't use the program's poll as it could be a very long time. Use the default poll.
- l_poll_result = mss::poll(i_target, TT::STATQ_REG, l_poll_parameters,
- [&l_status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
- {
- FAPI_DBG("looking for mcbist start, mcbist statq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- // We're done polling when either we see we're in progress or we see we're done.
- return (l_status.getBit<TT::MCBIST_IN_PROGRESS>() == true) || (l_status.getBit<TT::MCBIST_DONE>() == true);
- });
-
- // So we've either run/are running or we timed out waiting for the start.
- FAPI_ASSERT( l_poll_result == true,
- fapi2::MSS_MEMDIAGS_MCBIST_FAILED_TO_START().set_MCBIST_TARGET(i_target),
- "The MCBIST engine failed to start its program" );
-
- // If the user asked for async mode, we can leave. Otherwise, poll and check for errors
- if (!i_program.iv_async)
- {
- return mcbist::poll(i_target, i_program);
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
///
/// @brief Get a list of ports involved in the program
-/// Specialization for program<fapi2::TARGET_TYPE_MCBIST>
+/// Specialization for program<>
/// @param[in] i_target the target for this program
/// @return vector of port targets
///
template<>
-template<>
std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCA>>
- program<fapi2::TARGET_TYPE_MCBIST>::get_port_list<fapi2::TARGET_TYPE_MCA>( const
- fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target ) const
+ program<>::get_port_list( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target ) const
{
- typedef mss::mcbistTraits<TARGET_TYPE_MCBIST> TT;
+ using TT = mss::mcbistTraits<>;
std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCA>> l_list;
@@ -542,81 +157,6 @@ std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCA>>
return l_list;
}
-///
-/// @brief Read entries from MCBIST Read Modify Write (RMW) array
-/// Specialization for fapi2::TARGET_TYPE_MCA
-/// @param[in] i_target the target to effect
-/// @param[in] i_start_addr the array address to read first
-/// @param[in] i_num_entries the number of array entries to read
-/// @param[in] i_roll_over_for_compare_mode set to true if only using first
-/// NUM_COMPARE_INFO_ENTRIES of array, so array address rolls over at correct value
-/// @param[out] o_data vector of output data
-/// @param[out] o_ecc_data vector of ecc data
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note The number of entries in the array depends on i_roll_over_for_compare_mode parameter:
-/// (NUM_COMPARE_LOG_ENTRIES for false, NUM_COMPARE_INFO_ENTRIES for true) but user may read more than
-/// that since reads work in a circular buffer fashion
-///
-template<>
-fapi2::ReturnCode read_rmw_array(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
- const uint64_t i_start_addr,
- const uint64_t i_num_entries,
- const bool i_roll_over_for_compare_mode,
- std::vector< fapi2::buffer<uint64_t> >& o_data,
- std::vector< fapi2::buffer<uint64_t> >& o_ecc_data)
-{
- typedef mcbistTraits<fapi2::TARGET_TYPE_MCA> TT;
-
- fapi2::buffer<uint64_t> l_control_value;
- fapi2::buffer<uint64_t> l_data;
- uint64_t l_array_addr = i_start_addr;
-
- // Clear out any stale values from output vectors
- o_data.clear();
- o_ecc_data.clear();
-
- // Set the control register for the RMW array
- l_control_value.writeBit<TT::RMW_WRT_BUFFER_SEL>(TT::SELECT_RMW_BUFFER)
- // set start address
- .insertFromRight<TT::RMW_WRT_ADDRESS, TT::RMW_WRT_ADDRESS_LEN>(l_array_addr)
- // enable the auto increment bit
- .setBit<TT::RMW_WRT_AUTOINC>()
- // set ecc mode bit off
- .clearBit<TT::RMW_WRT_ECCGEN>();
-
- FAPI_INF("Setting the RMW array access control register.");
- FAPI_TRY( mss::putScom(i_target, TT::RMW_WRT_BUF_CTL_REG, l_control_value) );
-
- for (uint8_t l_index = 0; l_index < i_num_entries; ++l_index)
- {
- // Read info out of RMW array and put into output vector
- // Note that since we enabled AUTOINC above, reading ECC_REG will increment
- // the array pointer so the next DATA_REG read will read the next array entry
- FAPI_TRY( mss::getScom(i_target, TT::RMW_WRT_BUF_DATA_REG, l_data) );
-
- FAPI_INF("RMW data index %d is: %016lx", l_array_addr, l_data);
- o_data.push_back(l_data);
-
- // Need to read ecc register to increment array index
- FAPI_TRY( mss::getScom(i_target, TT::RMW_WRT_BUF_ECC_REG, l_data) );
- o_ecc_data.push_back(l_data);
- ++l_array_addr;
-
- // Need to manually roll over address if we go beyond NUM_COMPARE_INFO_ENTRIES
- // Since actual array is bigger than what is used for compare mode
- if (i_roll_over_for_compare_mode &&
- (l_array_addr >= TT::NUM_COMPARE_INFO_ENTRIES))
- {
- FAPI_INF("Rolling over the RMW array access control register address from %d to %d.", (i_start_addr + l_index), 0);
- l_control_value.clearBit<TT::RMW_WRT_ADDRESS, TT::RMW_WRT_ADDRESS_LEN>();
- FAPI_TRY( mss::putScom(i_target, TT::RMW_WRT_BUF_CTL_REG, l_control_value) );
- l_array_addr = 0;
- }
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
///
/// @brief Read entries from MCBIST Read Buffer (RB) array
@@ -635,7 +175,7 @@ fapi2::ReturnCode read_rb_array(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_t
std::vector< fapi2::buffer<uint64_t> >& o_data,
std::vector< fapi2::buffer<uint64_t> >& o_ecc_data)
{
- typedef mcbistTraits<fapi2::TARGET_TYPE_MCS> TT;
+ using TT = mcbistTraits<DEFAULT_MC_TYPE, fapi2::TARGET_TYPE_MCS>;
fapi2::buffer<uint64_t> l_control_value;
fapi2::buffer<uint64_t> l_data;
@@ -687,7 +227,7 @@ fapi_try_exit:
/// @param[in] i_targets the vector of targets to analyze - specialization for MCA target type
/// @return l_capable - yes iff these vector of targets are broadcast capable
///
-template< >
+template<>
const mss::states is_broadcast_capable(const std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCA>>& i_targets)
{
// If we don't have MCA's exit out
@@ -810,7 +350,7 @@ const mss::states is_broadcast_capable(const fapi2::Target<fapi2::TARGET_TYPE_MC
// 2) Check that all of the DIMM kinds are equal - if they are, then we can do broadcast mode
const auto l_dimms = mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target);
- const auto l_dimm_kinds = mss::dimm::kind::vector(l_dimms);
+ const auto l_dimm_kinds = mss::dimm::kind<>::vector(l_dimms);
const auto l_dimm_kind_check = is_broadcast_capable(l_dimm_kinds);
// 3) if both 1/2 are true, then broadcastable, otherwise false
@@ -832,7 +372,7 @@ fapi_try_exit:
/// @param[in] i_target the target to effect
/// @return l_capable - yes iff these vector of targets are broadcast capable
///
-const mss::states is_broadcast_capable(const std::vector<mss::dimm::kind>& i_kinds)
+const mss::states is_broadcast_capable(const std::vector<mss::dimm::kind<>>& i_kinds)
{
// If we don't have any DIMM kinds exit out
if(i_kinds.size() == 0)
@@ -848,7 +388,7 @@ const mss::states is_broadcast_capable(const std::vector<mss::dimm::kind>& i_kin
// Now, find if we have any kinds that differ from our first kind
// Note: starts on the next DIMM kind due to the fact that something always equals itself
const auto l_kind_it = std::find_if(i_kinds.begin() + 1,
- i_kinds.end(), [&l_expected_kind]( const mss::dimm::kind & i_rhs) -> bool
+ i_kinds.end(), [&l_expected_kind]( const mss::dimm::kind<>& i_rhs) -> bool
{
// If they're different, we found a DIMM that is differs
return (l_expected_kind != i_rhs);
@@ -911,7 +451,7 @@ fapi_try_exit:
///
template< >
fapi2::ReturnCode enable_broadcast_mode(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- mcbist::program<fapi2::TARGET_TYPE_MCBIST>& io_program)
+ mcbist::program<>& io_program)
{
// constexpr's for beautification
constexpr bool ENABLE = true;
@@ -934,6 +474,52 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief Configures broadcast mode, if it is needed
+/// @param[in] i_target the target to effect
+/// @param[in,out] io_program the mcbist::program
+/// @return FAPI2_RC_SUCCSS iff ok
+///
+template<>
+fapi2::ReturnCode configure_broadcast_mode(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ mcbist::program<>& io_program)
+{
+ // If we're not capable to do broadcast mode on this target, exit out
+ const auto l_broadcast_capable = is_broadcast_capable(i_target);
+
+ if(l_broadcast_capable == mss::states::NO)
+ {
+ FAPI_INF("%s is not broadcast capable, skipping enablement of broadcast mode", mss::c_str(i_target));
+ return fapi2::FAPI2_RC_SUCCESS;
+ }
+
+ // Enable broadcast mode
+ FAPI_INF("%s is broadcast capable, enabling broadcast mode", mss::c_str(i_target));
+ return enable_broadcast_mode(i_target, io_program);
+}
+
+///
+/// @brief Clear the errors helper. Chip can specialise this
+/// function to put any necessary workaround in it.
+/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
+///
+template< >
+fapi2::ReturnCode clear_error_helper( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const program<>& i_program )
+{
+ // Implement any mcbist work-arounds.
+ // I'm going to do the unthinkable here - and cast away the const of the mcbist program input.
+ // The work arounds need to change this, and so it needs to not be const. However, I don't want
+ // to risk general const-correctness by changing the input parameter to non-const. So, I use
+ // const_cast<> (ducks out of the way of the flying adjectives.) These are work-arounds ...
+ FAPI_TRY( workarounds::mcbist::end_of_rank(i_target, const_cast<program<>&>(i_program)) );
+
+ FAPI_TRY( clear_errors(i_target) );
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
} // namespace MCBIST
// Note: outside of the mcbist namespace
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H
index bba494154..f708a8869 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2019 */
+/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -42,3156 +42,27 @@
#include <p9_mc_scom_addresses_fld.H>
#include <lib/shared/mss_const.H>
-#include <generic/memory/lib/utils/find.H>
-#include <generic/memory/lib/utils/poll.H>
-#include <generic/memory/lib/utils/memory_size.H>
+#include <lib/ecc/ecc_traits_nimbus.H>
+#include <lib/mc/port.H>
#include <lib/utils/mss_nimbus_conversions.H>
#include <lib/utils/bit_count.H>
-#include <lib/utils/num.H>
-#include <lib/mcbist/patterns.H>
-#include <lib/mcbist/settings.H>
-#include <lib/mc/port.H>
-#include <lib/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
+#include <lib/mcbist/mcbist_traits.H>
+#include <lib/workarounds/mcbist_workarounds.H>
+#include <generic/memory/lib/utils/num.H>
+#include <generic/memory/lib/utils/poll.H>
+#include <generic/memory/lib/utils/memory_size.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_settings.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist.H>
+#include <generic/memory/lib/utils/dump_regs.H>
namespace mss
{
-
-// I have a dream that the MCBIST engine code can be shared among controllers. So, I drive the
-// engine from a set of traits. This might be folly. Allow me to dream. BRS
-
-///
-/// @class mcbistTraits
-/// @brief a collection of traits associated with the MCBIST engine or hardware
-///
-template< fapi2::TargetType T >
-class mcbistTraits;
-
-///
-/// @class mcbistTraits
-/// @brief a collection of traits associated with the Centaur MCBIST engine or hardware
-///
-template<>
-class mcbistTraits<fapi2::TARGET_TYPE_MEMBUF_CHIP>
-{
-};
-
-///
-/// @class mcbistTraits
-/// @brief a collection of traits associated with the Nimbus MCBIST engine or hardware
-///
-template<>
-class mcbistTraits<fapi2::TARGET_TYPE_MCBIST>
-{
- public:
- /// MCBIST "memory registers" - config for subtests.
- static constexpr uint64_t MCBMR0_REG = MCBIST_MCBMR0Q;
- static constexpr uint64_t CFGQ_REG = MCBIST_MCBCFGQ;
- static constexpr uint64_t CNTLQ_REG = MCBIST_MCB_CNTLQ;
- static constexpr uint64_t STATQ_REG = MCBIST_MCB_CNTLSTATQ;
- static constexpr uint64_t MCBSTATQ_REG = MCBIST_MCBSTATQ;
- static constexpr uint64_t MCBPARMQ_REG = MCBIST_MCBPARMQ;
- static constexpr uint64_t MCBAGRAQ_REG = MCBIST_MCBAGRAQ;
- static constexpr uint64_t SRERR0_REG = MCBIST_MBSEC0Q;
- static constexpr uint64_t SRERR1_REG = MCBIST_MBSEC1Q;
- static constexpr uint64_t THRESHOLD_REG = MCBIST_MBSTRQ;
- static constexpr uint64_t FIRQ_REG = MCBIST_MCBISTFIRQ;
- static constexpr uint64_t LAST_ADDR_REG = MCBIST_MCBMCATQ;
-
- static constexpr uint64_t MCBAMR0A0Q_REG = MCBIST_MCBAMR0A0Q;
- static constexpr uint64_t MCBAMR1A0Q_REG = MCBIST_MCBAMR1A0Q;
- static constexpr uint64_t MCBAMR2A0Q_REG = MCBIST_MCBAMR2A0Q;
- static constexpr uint64_t MCBAMR3A0Q_REG = MCBIST_MCBAMR3A0Q;
-
- // MCBIST FIR registers
- static constexpr uint64_t MCBFIRMASK_REG = MCBIST_MCBISTFIRMASK;
- static constexpr uint64_t MCBFIRQ_REG = MCBIST_MCBISTFIRQ;
-
- // All of the pattern registers are calculated off of this base
- static constexpr uint64_t PATTERN0_REG = MCBIST_MCBFD0Q;
-
- static constexpr uint64_t DATA_ROTATE_CNFG_REG = MCBIST_MCBDRCRQ;
- static constexpr uint64_t DATA_ROTATE_SEED_REG = MCBIST_MCBDRSRQ;
-
- static constexpr uint64_t START_ADDRESS_0 = MCBIST_MCBSA0Q;
- static constexpr uint64_t START_ADDRESS_1 = MCBIST_MCBSA1Q;
- static constexpr uint64_t START_ADDRESS_2 = MCBIST_MCBSA2Q;
- static constexpr uint64_t START_ADDRESS_3 = MCBIST_MCBSA3Q;
-
- static constexpr uint64_t END_ADDRESS_0 = MCBIST_MCBEA0Q;
- static constexpr uint64_t END_ADDRESS_1 = MCBIST_MCBEA1Q;
- static constexpr uint64_t END_ADDRESS_2 = MCBIST_MCBEA2Q;
- static constexpr uint64_t END_ADDRESS_3 = MCBIST_MCBEA3Q;
-
- static constexpr uint64_t RANDOM_DATA_SEED0 = MCBIST_MCBRDS0Q;
- static constexpr uint64_t RANDOM_DATA_SEED1 = MCBIST_MCBRDS1Q;
-
-
- // MCBIST Compare Masks, used to setup the ECC traps
- // TK there is one reg per port, does writing to this one write to all?
- static constexpr uint64_t COMPARE_MASK = MCA_MCBCM;
-
- static constexpr uint64_t PATTERN_COUNT = 4;
-
- // Sometimes we want to access the start/end address registers based off
- // of an index, like master rank. This allows us to do that.
- static const std::pair<uint64_t, uint64_t> address_pairs[];
-
- // Subtest types that need to be run in FIFO mode
- static const std::vector< mss::mcbist::op_type > FIFO_MODE_REQUIRED_OP_TYPES;
-
- enum
- {
- // Subtest control bits. These are the same in all '16 bit subtest' field
- COMPL_1ST_CMD = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_1ST_CMD,
- COMPL_2ND_CMD = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_2ND_CMD,
- COMPL_3RD_CMD = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_3RD_CMD,
- ADDR_REV_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_REV_MODE,
- ADDR_RAND_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_RAND_MODE,
-
- // Goto subtests use the compl_1st - rand_mode to define the subtest to jump to
- GOTO_SUBTEST = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_1ST_CMD,
- GOTO_SUBTEST_LEN = 5,
-
- ECC_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ECC_MODE,
- DATA_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DATA_MODE,
- DATA_MODE_LEN = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DATA_MODE_LEN,
- ADDR_SEL = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_SEL,
- ADDR_SEL_LEN = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_SEL_LEN,
- OP_TYPE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_OP_TYPE,
- OP_TYPE_LEN = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_OP_TYPE_LEN,
- DONE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DONE,
-
- SYNC_EN = MCBIST_MCBCFGQ_BROADCAST_SYNC_EN,
- SYNC_WAIT = MCBIST_MCBCFGQ_BROADCAST_SYNC_WAIT,
- SYNC_WAIT_LEN = MCBIST_MCBCFGQ_BROADCAST_SYNC_WAIT_LEN,
-
- PORT_SEL = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL,
- PORT_SEL_LEN = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL_LEN,
-
- MCBIST_START = MCBIST_MCB_CNTLQ_START,
- MCBIST_STOP = MCBIST_MCB_CNTLQ_STOP,
- MCBIST_RESUME = MCBIST_MCB_CNTLQ_RESUME_FROM_PAUSE,
- MCBIST_RESET_ERRORS = MCBIST_MCB_CNTLQ_RESET_ERROR_LOGS,
-
- MCBIST_IN_PROGRESS = MCBIST_MCB_CNTLSTATQ_IP,
- MCBIST_DONE = MCBIST_MCB_CNTLSTATQ_DONE,
- MCBIST_FAIL = MCBIST_MCB_CNTLSTATQ_FAIL,
-
- MIN_CMD_GAP = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP,
- MIN_CMD_GAP_LEN = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP_LEN,
- MIN_GAP_TIMEBASE = MCBIST_MCBPARMQ_CFG_MIN_GAP_TIMEBASE,
- MIN_CMD_GAP_BLIND_STEER = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP_BLIND_STEER,
- MIN_CMD_GAP_BLIND_STEER_LEN = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP_BLIND_STEER_LEN,
- MIN_GAP_TIMEBASE_BLIND_STEER = MCBIST_MCBPARMQ_CFG_MIN_GAP_TIMEBASE_BLIND_STEER,
- RANDCMD_WGT = MCBIST_MCBPARMQ_CFG_RANDCMD_WGT,
- RANDCMD_WGT_LEN = MCBIST_MCBPARMQ_CFG_RANDCMD_WGT_LEN,
- CLOCK_MONITOR_EN = MCBIST_MCBPARMQ_CFG_CLOCK_MONITOR_EN,
- EN_RANDCMD_GAP = MCBIST_MCBPARMQ_CFG_EN_RANDCMD_GAP,
- RANDGAP_WGT = MCBIST_MCBPARMQ_CFG_RANDGAP_WGT,
- RANDGAP_WGT_LEN = MCBIST_MCBPARMQ_CFG_RANDGAP_WGT_LEN,
- BC4_EN = MCBIST_MCBPARMQ_CFG_BC4_EN,
-
- FIXED_WIDTH = MCBIST_MCBAGRAQ_CFG_FIXED_WIDTH,
- FIXED_WIDTH_LEN = MCBIST_MCBAGRAQ_CFG_FIXED_WIDTH_LEN,
- ADDR_COUNTER_MODE = MCBIST_MCBAGRAQ_CFG_ADDR_COUNTER_MODE,
- ADDR_COUNTER_MODE_LEN = MCBIST_MCBAGRAQ_CFG_ADDR_COUNTER_MODE_LEN,
- MAINT_ADDR_MODE_EN = MCBIST_MCBAGRAQ_CFG_MAINT_ADDR_MODE_EN,
- MAINT_BROADCAST_MODE_EN = MCBIST_MCBAGRAQ_CFG_MAINT_BROADCAST_MODE_EN,
- MAINT_DETECT_SRANK_BOUNDARIES = MCBIST_MCBAGRAQ_CFG_MAINT_DETECT_SRANK_BOUNDARIES,
-
- CFG_CMD_TIMEOUT_MODE = MCBIST_MCBCFGQ_CFG_CMD_TIMEOUT_MODE,
- CFG_CMD_TIMEOUT_MODE_LEN = MCBIST_MCBCFGQ_CFG_CMD_TIMEOUT_MODE_LEN,
- RESET_KEEPER = MCBIST_MCBCFGQ_RESET_KEEPER,
- CFG_CURRENT_ADDR_TRAP_UPDATE_DIS = MCBIST_MCBCFGQ_CFG_CURRENT_ADDR_TRAP_UPDATE_DIS,
- CFG_CCS_RETRY_DIS = MCBIST_MCBCFGQ_CFG_CCS_RETRY_DIS,
- CFG_RESET_CNTS_START_OF_RANK = MCBIST_MCBCFGQ_CFG_RESET_CNTS_START_OF_RANK,
- CFG_LOG_COUNTS_IN_TRACE = MCBIST_MCBCFGQ_CFG_LOG_COUNTS_IN_TRACE,
- SKIP_INVALID_ADDR_DIMM_DIS = MCBIST_MCBCFGQ_SKIP_INVALID_ADDR_DIMM_DIS,
- REFRESH_ONLY_SUBTEST_EN = MCBIST_MCBCFGQ_REFRESH_ONLY_SUBTEST_EN,
- REFRESH_ONLY_SUBTEST_TIMEBASE_SEL = MCBIST_MCBCFGQ_REFRESH_ONLY_SUBTEST_TIMEBASE_SEL,
- REFRESH_ONLY_SUBTEST_TIMEBASE_SEL_LEN = MCBIST_MCBCFGQ_REFRESH_ONLY_SUBTEST_TIMEBASE_SEL_LEN,
- RAND_ADDR_ALL_ADDR_MODE_EN = MCBIST_MCBCFGQ_RAND_ADDR_ALL_ADDR_MODE_EN,
- MCBIST_CFG_REF_WAIT_TIME = MCBIST_MCBCFGQ_MCBIST_CFG_REF_WAIT_TIME,
- MCBIST_CFG_REF_WAIT_TIME_LEN = MCBIST_MCBCFGQ_MCBIST_CFG_REF_WAIT_TIME_LEN,
- CFG_MCB_LEN64 = MCBIST_MCBCFGQ_CFG_MCB_LEN64,
- CFG_PAUSE_ON_ERROR_MODE = MCBIST_MCBCFGQ_CFG_PAUSE_ON_ERROR_MODE,
- CFG_PAUSE_ON_ERROR_MODE_LEN = MCBIST_MCBCFGQ_CFG_PAUSE_ON_ERROR_MODE_LEN,
- MCBIST_CFG_PAUSE_AFTER_CCS_SUBTEST = MCBIST_MCBCFGQ_MCBIST_CFG_PAUSE_AFTER_CCS_SUBTEST,
- MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR = MCBIST_MCBCFGQ_MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR,
- MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST = MCBIST_MCBCFGQ_MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST,
- CFG_ENABLE_SPEC_ATTN = MCBIST_MCBCFGQ_CFG_ENABLE_SPEC_ATTN,
- CFG_ENABLE_HOST_ATTN = MCBIST_MCBCFGQ_CFG_ENABLE_HOST_ATTN,
- MCBIST_CFG_PAUSE_AFTER_RANK = MCBIST_MCBCFGQ_CFG_MCBIST_CFG_FORCE_PAUSE_AFTER_RANK,
-
- LOGGED_ERROR_ON_PORT_INDICATOR = MCBIST_MCBSTATQ_MCBIST_LOGGED_ERROR_ON_PORT_INDICATOR,
- LOGGED_ERROR_ON_PORT_INDICATOR_LEN = MCBIST_MCBSTATQ_MCBIST_LOGGED_ERROR_ON_PORT_INDICATOR_LEN,
- SUBTEST_NUM_INDICATOR = MCBIST_MCBSTATQ_MCBIST_SUBTEST_NUM_INDICATOR,
- SUBTEST_NUM_INDICATOR_LEN = MCBIST_MCBSTATQ_MCBIST_SUBTEST_NUM_INDICATOR_LEN,
-
- UE_COUNT = MCBIST_MBSEC1Q_UE_COUNT,
- UE_COUNT_LEN = MCBIST_MBSEC1Q_UE_COUNT_LEN,
-
- CFG_AMAP_DIMM_SELECT = MCBIST_MCBAMR0A0Q_CFG_AMAP_DIMM_SELECT,
- CFG_AMAP_DIMM_SELECT_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_DIMM_SELECT_LEN,
- CFG_AMAP_MRANK0 = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK0,
- CFG_AMAP_MRANK0_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK0_LEN,
- CFG_AMAP_MRANK1 = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK1,
- CFG_AMAP_MRANK1_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK1_LEN,
- CFG_AMAP_SRANK0 = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK0,
- CFG_AMAP_SRANK0_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK0_LEN,
- CFG_AMAP_SRANK1 = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK1,
- CFG_AMAP_SRANK1_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK1_LEN,
- CFG_AMAP_SRANK2 = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK2,
- CFG_AMAP_SRANK2_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK2_LEN,
- CFG_AMAP_BANK2 = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK2,
- CFG_AMAP_BANK2_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK2_LEN ,
- CFG_AMAP_BANK1 = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK1,
- CFG_AMAP_BANK1_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK1_LEN ,
- CFG_AMAP_BANK0 = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK0,
- CFG_AMAP_BANK0_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK0_LEN ,
-
- CFG_AMAP_BANK_GROUP1 = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP1,
- CFG_AMAP_BANK_GROUP1_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP1_LEN ,
- CFG_AMAP_BANK_GROUP0 = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP0,
- CFG_AMAP_BANK_GROUP0_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP0_LEN ,
- CFG_AMAP_ROW17 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW17,
- CFG_AMAP_ROW17_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW17_LEN,
- CFG_AMAP_ROW16 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW16,
- CFG_AMAP_ROW16_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW16_LEN,
- CFG_AMAP_ROW15 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW15,
- CFG_AMAP_ROW15_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW15_LEN,
- CFG_AMAP_ROW14 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW14,
- CFG_AMAP_ROW14_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW14_LEN,
- CFG_AMAP_ROW13 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW13,
- CFG_AMAP_ROW13_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW13_LEN,
- CFG_AMAP_ROW12 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW12,
- CFG_AMAP_ROW12_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW12_LEN,
- CFG_AMAP_ROW11 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW11,
- CFG_AMAP_ROW11_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW11_LEN,
- CFG_AMAP_ROW10 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW10,
- CFG_AMAP_ROW10_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW10_LEN,
-
- CFG_AMAP_ROW9 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW9,
- CFG_AMAP_ROW9_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW9_LEN,
- CFG_AMAP_ROW8 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW8,
- CFG_AMAP_ROW8_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW8_LEN,
- CFG_AMAP_ROW7 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW7,
- CFG_AMAP_ROW7_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW7_LEN,
- CFG_AMAP_ROW6 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW6,
- CFG_AMAP_ROW6_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW6_LEN,
- CFG_AMAP_ROW5 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW5,
- CFG_AMAP_ROW5_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW5_LEN,
- CFG_AMAP_ROW4 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW4,
- CFG_AMAP_ROW4_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW4_LEN,
- CFG_AMAP_ROW3 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW3,
- CFG_AMAP_ROW3_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW3_LEN,
- CFG_AMAP_ROW2 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW2,
- CFG_AMAP_ROW2_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW2_LEN,
- CFG_AMAP_ROW1 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW1,
- CFG_AMAP_ROW1_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW1_LEN,
- CFG_AMAP_ROW0 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW0,
- CFG_AMAP_ROW0_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW0_LEN,
-
- CFG_AMAP_COL9 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL9,
- CFG_AMAP_COL9_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL9_LEN,
- CFG_AMAP_COL8 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL8,
- CFG_AMAP_COL8_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL8_LEN,
- CFG_AMAP_COL7 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL7,
- CFG_AMAP_COL7_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL7_LEN,
- CFG_AMAP_COL6 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL6,
- CFG_AMAP_COL6_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL6_LEN,
- CFG_AMAP_COL5 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL5,
- CFG_AMAP_COL5_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL5_LEN,
- CFG_AMAP_COL4 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL4,
- CFG_AMAP_COL4_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL4_LEN,
- CFG_AMAP_COL3 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL3,
- CFG_AMAP_COL3_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL3_LEN,
- CFG_AMAP_COL2 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL2,
- CFG_AMAP_COL2_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL2_LEN,
-
- CFG_DATA_ROT_SEED1 = MCBIST_MCBDRSRQ_CFG_DATA_ROT_SEED,
- CFG_DATA_ROT_SEED1_LEN = MCBIST_MCBDRSRQ_CFG_DATA_ROT_SEED_LEN,
- CFG_DATA_ROT = MCBIST_MCBDRCRQ_CFG_DATA_ROT,
- CFG_DATA_ROT_LEN = MCBIST_MCBDRCRQ_CFG_DATA_ROT_LEN,
- CFG_DATA_ROT_SEED2 = MCBIST_MCBDRCRQ_CFG_DATA_ROT_SEED,
- CFG_DATA_ROT_SEED2_LEN = MCBIST_MCBDRCRQ_CFG_DATA_ROT_SEED_LEN,
- CFG_DATA_SEED_MODE = MCBIST_MCBDRCRQ_CFG_DATA_SEED_MODE,
- CFG_DATA_SEED_MODE_LEN = MCBIST_MCBDRCRQ_CFG_DATA_SEED_MODE_LEN,
-
- CFG_TRAP_CE_ENABLE = MCA_MCBCM_MCBIST_TRAP_CE_ENABLE,
- CFG_TRAP_UE_ENABLE = MCA_MCBCM_MCBIST_TRAP_UE_ENABLE,
- CFG_TRAP_MPE_ENABLE = MCA_MCBCM_MCBIST_TRAP_MPE_ENABLE,
-
- CFG_DGEN_RNDD_SEED0 = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED0,
- CFG_DGEN_RNDD_SEED0_LEN = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED0_LEN,
- CFG_DGEN_RNDD_SEED1 = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED1,
- CFG_DGEN_RNDD_SEED1_LEN = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED1_LEN,
- CFG_DGEN_RNDD_SEED2 = MCBIST_MCBRDS1Q_DGEN_RNDD_SEED2,
- CFG_DGEN_RNDD_SEED2_LEN = MCBIST_MCBRDS1Q_DGEN_RNDD_SEED2_LEN,
- CFG_DGEN_RNDD_DATA_MAPPING = MCBIST_MCBRDS1Q_DGEN_RNDD_DATA_MAPPING,
- CFG_DGEN_RNDD_DATA_MAPPING_LEN = MCBIST_MCBRDS1Q_DGEN_RNDD_DATA_MAPPING_LEN,
-
- // Bit mapping for MCBIST error log control data (address+ in Nimbus doc)
- ERROR_LOG_SUBTEST = 0,
- ERROR_LOG_SUBTEST_LEN = 5,
- ERROR_LOG_SUBCMD = 5,
- ERROR_LOG_SUBCMD_LEN = 2,
- ERROR_LOG_ADDR_DIMM = 7,
- ERROR_LOG_ADDR_MRANK = 8,
- ERROR_LOG_ADDR_MRANK_LEN = 2,
- ERROR_LOG_ADDR_SRANK = 10,
- ERROR_LOG_ADDR_SRANK_LEN = 3,
- ERROR_LOG_ADDR_BANK_GROUP = 13,
- ERROR_LOG_ADDR_BANK_GROUP_LEN = 2,
- ERROR_LOG_ADDR_BANK = 15,
- ERROR_LOG_ADDR_BANK_LEN = 3,
- ERROR_LOG_ADDR_ROW = 18,
- ERROR_LOG_ADDR_ROW_LEN = 18,
- ERROR_LOG_ADDR_COLUMN = 36,
- ERROR_LOG_ADDR_COLUMN_LEN = 8,
- ERROR_LOG_BEAT = 44,
- ERROR_LOG_BEAT_LEN = 2,
- ERROR_LOG_TYPE = 46,
- ERROR_LOG_TYPE_LEN = 2,
-
- //MCBIST FIR mask
- MCB_PROGRAM_COMPLETE = MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE,
- MCB_WAT_DEBUG_ATTN = MCBIST_MCBISTFIRQ_WAT_DEBUG_ATTN,
- MCB_PROGRAM_COMPLETE_MASK = MCB_PROGRAM_COMPLETE,
- MCB_WAT_DEBUG_ATTN_MASK = MCB_WAT_DEBUG_ATTN,
- };
-
-};
-
-///
-/// @class mcbistTraits
-/// @brief a collection of traits associated with the Nimbus MCA
-///
-template<>
-class mcbistTraits<fapi2::TARGET_TYPE_MCA>
-{
- public:
- // MCBIST error log related registers
- static constexpr uint64_t ERROR_LOG_PTR_REG = MCA_ELPR;
- static constexpr uint64_t RMW_WRT_BUF_CTL_REG = MCA_WREITE_AACR;
- static constexpr uint64_t RMW_WRT_BUF_DATA_REG = MCA_AADR;
- static constexpr uint64_t RMW_WRT_BUF_ECC_REG = MCA_AAER;
-
- enum
- {
- // Register field constants
- ERROR_LOG_PTR = MCA_ELPR_LOG_POINTER,
- ERROR_LOG_PTR_LEN = MCA_ELPR_LOG_POINTER_LEN,
- ERROR_LOG_FULL = MCA_ELPR_LOG_FULL,
- RMW_WRT_BUFFER_SEL = MCA_WREITE_AACR_BUFFER,
- RMW_WRT_ADDRESS = MCA_WREITE_AACR_ADDRESS,
- RMW_WRT_ADDRESS_LEN = MCA_WREITE_AACR_ADDRESS_LEN,
- RMW_WRT_AUTOINC = MCA_WREITE_AACR_AUTOINC,
- RMW_WRT_ECCGEN = MCA_WREITE_AACR_ECCGEN,
-
- // Constants used for field settings
- SELECT_RMW_BUFFER = 0,
- SELECT_WRT_BUFFER = 1,
-
- // Other constants
- NUM_COMPARE_LOG_ENTRIES = 64,
- // In compare mode, there is one "info" entry per 4 data (log) entries
- // so compare mode only uses 16 info entries total in the rmw array
- NUM_COMPARE_DATA_PER_INFO_LOG = 4,
- NUM_COMPARE_INFO_ENTRIES = 16,
- };
-
-};
-
-///
-/// @class mcbistTraits
-/// @brief a collection of traits associated with the Nimbus MCS
-///
-template<>
-class mcbistTraits<fapi2::TARGET_TYPE_MCS>
-{
- public:
- // MCBIST error log related registers
- static constexpr uint64_t RD_BUF_CTL_REG = MCS_PORT02_AACR;
- static constexpr uint64_t RD_BUF_DATA_REG = MCS_PORT02_AADR;
- static constexpr uint64_t RD_BUF_ECC_REG = MCS_PORT02_AAER;
-
- enum
- {
- // Register field constants
- RB_BUFFER_SEL = MCS_PORT02_AACR_BUFFER,
- RB_ADDRESS = MCS_PORT02_AACR_ADDRESS,
- RB_ADDRESS_LEN = MCS_PORT02_AACR_ADDRESS_LEN,
- RB_AUTOINC = MCS_PORT02_AACR_AUTOINC,
-
- // Other constants
- NUM_COMPARE_LOG_ENTRIES = 64,
- };
-
-};
-
-///
-/// @brief Return the estimated time an MCBIST subtest will take to complete
-/// Useful for initial polling delays, probably isn't accurate for much else
-/// as it doesn't take refresh in to account (which will necessarily slow down
-/// the program.)
-/// @param[in] i_target the target from which to gather memory frequency
-/// @param[in] i_bytes number of *bytes* in the address range
-/// @param[in] i_64B_per mss::YES if the command is 64B, mss::NO if it's 128B. Defaults to mss::YES
-/// @return the initial polling delay for this program in ns
-///
-template< fapi2::TargetType T >
-inline uint64_t calculate_initial_delay(const fapi2::Target<T>& i_target,
- const uint64_t i_bytes,
- const bool i_64B_per = mss::YES)
-{
- // TODO RTC: 164104 Update MCBIST delay calculator. As we learn more about what
- // the lab really needs, we can probably make this function better.
- const uint64_t l_bytes_per_cmd = (i_64B_per == mss::YES) ? 64 : 128;
-
- // Best case is a command takes 4 cycles. Given the number of commands and address space size
- // we can get some idea of how long to wait before we start polling.
- return cycles_to_ns(i_target, (i_bytes / l_bytes_per_cmd) * mss::CYCLES_PER_CMD);
-}
-
namespace mcbist
{
-///
-/// @class subtest_t
-/// @brief encapsulation of an MCBIST subtest.
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-class subtest_t
-{
- public:
- subtest_t( const uint16_t i_data = 0 ):
- iv_mcbmr(i_data)
- {}
-
- ///
- /// @brief Checks if the op type requires FIFO mode to be on
- /// @return bool fifo_mode_requried - true if FIFO mode is required to be forced on
- ///
- inline bool fifo_mode_required() const
- {
- // Gets the op type for this subtest
- uint64_t l_value_to_find = 0;
- iv_mcbmr.extractToRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(l_value_to_find);
-
- // Finds if this op type is in the vector that stores the OP types that require FIFO mode to be run
- const auto l_op_type_it = std::find(TT::FIFO_MODE_REQUIRED_OP_TYPES.begin(), TT::FIFO_MODE_REQUIRED_OP_TYPES.end(),
- l_value_to_find);
-
- // If the op type is required (aka was found), it will be less than end
- // std::find returns the ending iterator if it was not found, so this will return false in that case
- return l_op_type_it != TT::FIFO_MODE_REQUIRED_OP_TYPES.end();
- }
-
- ///
- /// @brief Convert to a 16 bit int
- /// @return the subtest as a 16 bit integer, useful for testing
- ///
- inline operator uint16_t()
- {
- return uint16_t(iv_mcbmr);
- }
-
- ///
- /// @brief Complement the data for the first subcommand
- /// @param[in] i_state the desired state (mss::ON or mss::OFF)
- ///
- inline void change_compliment_1st_cmd( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::COMPL_1ST_CMD>(i_state);
- return;
- }
-
- ///
- /// @brief Complement the data for the second subcommand
- /// @param[in] i_state the desired state (mss::ON or mss::OFF)
- /// @return void
- ///
- inline void change_compliment_2nd_cmd( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::COMPL_2ND_CMD>(i_state);
- return;
- }
-
- ///
- /// @brief Complement the data for the third subcommand
- /// @param[in] i_state the desired state (mss::ON or mss::OFF)
- /// @return void
- ///
- inline void change_compliment_3rd_cmd( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::COMPL_3RD_CMD>(i_state);
- return;
- }
-
- ///
- /// @brief Enable a specific port for this test - maint address mode
- /// @param[in] i_port the port desired to be enabled - int 0, 1, 2, 3
- /// @note The port number is relative to the MCBIST
- /// @return void
- ///
- inline void enable_port( const uint64_t i_port )
- {
- constexpr uint64_t l_len = (TT::COMPL_2ND_CMD - TT::COMPL_1ST_CMD) + 1;
- iv_mcbmr.template insertFromRight<TT::COMPL_1ST_CMD, l_len>(i_port);
- return;
- }
-
- ///
- /// @brief Enable a specific dimm for this test - maint address mode
- /// @param[in] i_dimm the dimm desired to be enabled - int 0, 1
- /// @return void
- ///
- inline void enable_dimm( const uint64_t i_dimm )
- {
- iv_mcbmr.template writeBit<TT::COMPL_3RD_CMD>(i_dimm);
- return;
- }
-
- ///
- /// @brief Get the port from this subtest
- /// @note The port number is relative to the MCBIST
- /// @return the port of the subtest
- ///
- inline uint64_t get_port() const
- {
- uint64_t l_port = 0;
- constexpr uint64_t l_len = (TT::COMPL_2ND_CMD - TT::COMPL_1ST_CMD) + 1;
- iv_mcbmr.template extractToRight<TT::COMPL_1ST_CMD, l_len>(l_port);
- return l_port;
- }
-
- ///
- /// @brief Get the DIMM from this subtest
- /// @return the DIMM this subtest has been configured for
- ///
- inline uint64_t get_dimm() const
- {
- return iv_mcbmr.template getBit<TT::COMPL_3RD_CMD>() ? 1 : 0;
- }
-
- ///
- /// @brief Add the subtest to go to
- /// @param[in] the subtest to jump to
- /// @return void
- ///
- inline void change_goto_subtest( const uint64_t i_jmp_to )
- {
- iv_mcbmr.template insertFromRight<TT::GOTO_SUBTEST, TT::GOTO_SUBTEST_LEN>(i_jmp_to);
- FAPI_INF("changing subtest to jump to %d (0x%02x)", i_jmp_to, iv_mcbmr);
- return;
- }
-
- ///
- /// @brief Generate addresses in reverse order
- /// @param[in] i_state the desired state of the function; mss:ON, mss::OFF
- /// @return void
- ///
- inline void change_addr_rev_mode( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::ADDR_REV_MODE>(i_state);
- return;
- }
-
- ///
- /// @brief Generate addresses in random order
- /// @param[in] i_state the desired state of the function; mss:ON, mss::OFF
- /// @return void
- ///
- inline void change_addr_rand_mode( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::ADDR_RAND_MODE>(i_state);
- return;
- }
-
- ///
- /// @brief Generate and check data with ECC
- /// @param[in] i_state the desired state of the function; mss:ON, mss::OFF
- /// @return void
- ///
- inline void change_ecc_mode( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::ECC_MODE>(i_state);
- return;
- }
-
- ///
- /// @brief Set the 'done after this test' bit
- /// @param[in] i_state the desired state of the function; mss:ON, mss::OFF
- /// @return void
- ///
- inline void change_done( const mss::states i_state )
- {
- iv_mcbmr.template writeBit<TT::DONE>(i_state);
- return;
- }
-
- ///
- /// @brief Set the data mode for this subtest
- /// @param[in] i_mode the desired mcbist::data_mode
- /// @return void
- ///
- inline void change_data_mode( const data_mode i_mode )
- {
- iv_mcbmr.template insertFromRight<TT::DATA_MODE, TT::DATA_MODE_LEN>(i_mode);
- return;
- }
-
- ///
- /// @brief Set the operation type for this subtest
- /// @param[in] i_mode the desired mcbist::op_type
- /// @return void
- ///
- inline void change_op_type( const op_type i_type )
- {
- iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(i_type);
- return;
- }
-
- ///
- /// @brief Configure which address registers to use for this subtest
- /// @param[in] i_index 0 = MCBSA0Q, 1 = MCBSA1Q, ...
- /// @note wraps to 0-3 no matter what value you pass in.
- /// @return void
- ///
- inline void change_addr_sel( const uint16_t i_index )
- {
- // Roll the index around - tidy support for an index which is out of range.
- constexpr uint16_t MAX_ADDRESS_START_END_REGISTERS = 3 + 1;
- iv_mcbmr.template insertFromRight<TT::ADDR_SEL, TT::ADDR_SEL_LEN>(i_index % MAX_ADDRESS_START_END_REGISTERS);
- FAPI_INF("changed address select to index %d (0x%x)", i_index, iv_mcbmr);
- return;
- }
-
- //
- // @brief operator== for mcbist subtests
- // @param[in] i_rhs the right hand side of the compare
- // @return bool, true iff i_rhs == this
- inline bool operator==(const subtest_t<T>& i_rhs) const
- {
- return i_rhs.iv_mcbmr == iv_mcbmr;
- }
-
- /// The mcbist 'memory register' for this subtest.
- // Note that it is only 16 bits.
- // Each 64b memory register contains multiple 16 bit subtest definitions.
- // As we create a vector of subtests, we'll drop them in to their appropriate
- // MCBMR register before executing.
- fapi2::buffer<uint16_t> iv_mcbmr;
-};
-
-///
-/// @brief Return a write subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> write_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 0000 - we want subtest type to be a Write (W)
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::WRITE);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 12 = 1 - ecc
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- // 14:15 = 0 address select config registers 0
-
- return l_subtest;
-}
-
-
-///
-/// @brief Return an alter subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> alter_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 1011 - we want subtest type to be a Alter
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::ALTER);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return an display subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> display_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 1100 - we want subtest type to be a Display
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::DISPLAY);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return an scrub subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> scrub_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 1001 - we want subtest type to be a Scrub
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::SCRUB_RRWR);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return a steer subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> steer_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 1010 - we want subtest type to be a Steer
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::STEER_RW);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return a read subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> read_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 0001 - we want subtest type to be a Read (R)
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::READ);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return a read write subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> read_write_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 0010 - we want subtest type to be a Read Write (RW)
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::READ_WRITE);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return a read write read subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> read_write_read_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 0100 - we want subtest type to be a Read Write Read (RWR) 7
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::READ_WRITE_READ);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return a random subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> random_subtest()
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 0110 - we want subtest type to be a Random Seq, a randomly chosen read or write
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::RAND_SEQ);
-
- // - Not a special subtest, so no other configs associated
- // 4 = 0 - we don't want to complement data for our Writes
- // 5:6 = 00 - don't know whether we complement 2nd and 3rd subcommand, caller to fix
- // 7 = 0 - forward address generation
- // 8 = 0 - non random address generation
- // - Don't need to set up anything for LFSRs
- // 9:11 = 000 - Fixed data mode
-
- // 14:15 = 0 address select config registers 0
-
- // By default we want to turn on ECC. Caller can turn it off.
- l_subtest.change_ecc_mode(mss::ON);
-
- return l_subtest;
-}
-
-///
-/// @brief Return a goto subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] the subtest we should go to
-/// @return mss::mcbist::subtest_t
-/// @note Turns on ECC mode for the returned subtest - caller can turn it off
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> goto_subtest( const uint64_t i_jump_to )
-{
- // Starts life full of 0's
- subtest_t<T> l_subtest;
-
- // 0:3 = 0111 - we want subtest type to be a Goto
- l_subtest.iv_mcbmr.template insertFromRight<TT::OP_TYPE, TT::OP_TYPE_LEN>(op_type::GOTO_SUBTEST_N);
-
- // Plug in the subtest the user passed in
- l_subtest.change_goto_subtest(i_jump_to);
- return l_subtest;
-}
-
-///
-/// @brief Return an init subtest - configured simply
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @return mss::mcbist::subtest_t
-/// @note Configures for start/end address select bit as address config register 0
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline subtest_t<T> init_subtest()
-{
- return write_subtest<T>();
-}
-
-///
-/// @brief A class representing a series of MCBIST subtests, and the
-/// MCBIST engine parameters associated with running the subtests
-/// @tparam T fapi2::TargetType representing the fapi2 target which
-/// contains the MCBIST engine (e.g., fapi2::TARGET_TYPE_MCBIST)
-/// @tparam TT, the mssTraits associtated with T
-/// @note MCBIST Memory Parameter Register defaults to
-/// - issue commands as fast as possible
-/// - even weighting of read/write if random addressing
-/// - disable clock monitoring
-/// - random command gap is disabled
-/// - BC4 disabled
-/// - no selected ports
-/// @note Address Generation Config Register defaults to
-/// - 0 fixed slots
-/// - All address counter modes on (so addr configs are start + len)
-/// - maint address mode enabled
-/// - maint broadcast mode disabled
-/// - maint slave rank boundary detect disabled
-/// @note Config register defaults to
-/// - BROADCAST_SYNC_EN disabled
-/// - BROADCAST_SYNC_WAIT 0
-/// - TIMEOUT_MODE - wait 524288 cycles until timeout is called
-/// - RESET_KEEPER - 0
-/// - CURRENT_ADDR_TRAP_UPDATE_DIS - 0
-/// - CCS_RETRY_DIS - 0
-/// - RESET_CNTS_START_OF_RANK - 0
-/// - LOG_COUNTS_IN_TRACE - 0
-/// - SKIP_INVALID_ADDR_DIMM_DIS - 0
-/// - REFRESH_ONLY_SUBTEST_EN - 0
-/// - REFRESH_ONLY_SUBTEST_TIMEBASE_SEL(0:1) - 0
-/// - RAND_ADDR_ALL_ADDR_MODE_EN - 0
-/// - REF_WAIT_TIME(0:13) - 0
-/// - MCB_LEN64 - 1
-/// - PAUSE_ON_ERROR_MODE(0:1) - don't pause on error
-/// - PAUSE_AFTER_CCS_SUBTEST - don't puase after CCS subtest
-/// - FORCE_PAUSE_AFTER_ADDR - don't pause after current address
-/// - FORCE_PAUSE_AFTER_SUBTEST - no pause after subtest
-/// - ENABLE_SPEC_ATTN - disabled
-/// - ENABLE_HOST_ATTN - enabled
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-class program
-{
- public:
- // Setup our poll parameters so the MCBIST executer can see
- // whether to use the delays in the instruction stream or not
- program():
- iv_parameters(0),
- iv_addr_gen(0),
- iv_test_type(CENSHMOO), // Used as default in Centaur
- iv_addr_map0(0),
- iv_addr_map1(0),
- iv_addr_map2(0),
- iv_addr_map3(0),
- iv_data_rotate_cnfg(0),
- iv_data_rotate_seed(0),
- iv_config(0),
- iv_control(0),
- iv_async(false),
- iv_pattern(PATTERN_0),
- iv_random24_data_seed(RANDOM24_SEEDS_0),
- iv_random24_seed_map(RANDOM24_SEED_MAP_0),
- iv_compare_mask(0)
- {
- // Enable the maintenance mode addressing
- change_maint_address_mode(mss::ON);
-
- // Enable 64B lengths by default. Commands which need 128B (scrub, steer, alter, display)
- // can change this to 128B (mss::OFF).
- change_len64(mss::ON);
-
- // Turn off counting mode for all address configs
- iv_addr_gen.insertFromRight<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(0b0000);
-
- // By default if there's an error, we stop after the errored address
- iv_config.insertFromRight<TT::CFG_PAUSE_ON_ERROR_MODE,
- TT::CFG_PAUSE_ON_ERROR_MODE_LEN>(end_boundary::STOP_AFTER_ADDRESS);
-
- // All mcbist attentions are host attentions, special attention bit is already clear
- iv_config.setBit<TT::CFG_ENABLE_HOST_ATTN>();
-
- }
-
- ///
- /// @brief Change the DIMM select in the address mapping
- /// @param[in] i_bitmap DIMM select bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_dimm_select_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_DIMM_SELECT, TT::CFG_AMAP_DIMM_SELECT_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the MRANK0 address mapping when not in 5D mode
- /// @param[in] i_bitmap MRANK0 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_mrank0_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_MRANK0, TT::CFG_AMAP_MRANK0_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the MRANK0 address mapping when in 5D mode
- /// @param[in] i_bitmap MRANK0 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_mrank0_bit_5d( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_SRANK0, TT::CFG_AMAP_SRANK0_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the MRANK1 address mapping when not in 5D mode
- /// @param[in] i_bitmap MRANK1 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_mrank1_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_MRANK1, TT::CFG_AMAP_MRANK1_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the MRANK1 address mapping when in 5D mode
- /// @param[in] i_bitmap MRANK1 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_mrank1_bit_5d( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_SRANK1, TT::CFG_AMAP_SRANK1_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the MRANK2 address mapping when in 5D mode
- /// @param[in] i_bitmap MRANK2 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_mrank2_bit_5d( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_SRANK2, TT::CFG_AMAP_SRANK2_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the SRANK0 address mapping when in 5D mode
- /// @param[in] i_bitmap SRANK0 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_srank0_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_SRANK0, TT::CFG_AMAP_SRANK0_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the SRANK1 address mapping
- /// @param[in] i_bitmap SRANK1 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_srank1_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_SRANK1, TT::CFG_AMAP_SRANK1_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the SRANK2 address mapping
- /// @param[in] i_bitmap SRANK2 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_srank2_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_SRANK2, TT::CFG_AMAP_SRANK2_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the BANK2 address mapping
- /// @param[in] i_bitmap BANK2 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_bank2_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_BANK2, TT::CFG_AMAP_BANK2_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the BANK1 address mapping
- /// @param[in] i_bitmap BANK1 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_bank1_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_BANK1, TT::CFG_AMAP_BANK1_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the BANK0 address mapping
- /// @param[in] i_bitmap BANK0 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_bank0_bit( const uint64_t i_bitmap )
- {
- iv_addr_map0.insertFromRight<TT::CFG_AMAP_BANK0, TT::CFG_AMAP_BANK0_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the BANK_GROUP1 address mapping
- /// @param[in] i_bitmap BANK_GROUP1 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_bank_group1_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_BANK_GROUP1, TT::CFG_AMAP_BANK_GROUP1_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the BANK_GROUP0 address mapping
- /// @param[in] i_bitmap BANK_GROUP0 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_bank_group0_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_BANK_GROUP0, TT::CFG_AMAP_BANK_GROUP0_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW17 address mapping
- /// @param[in] i_bitmap ROW17 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row17_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW17, TT::CFG_AMAP_ROW17_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW16 address mapping
- /// @param[in] i_bitmap ROW16 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row16_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW16, TT::CFG_AMAP_ROW16_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW15 address mapping
- /// @param[in] i_bitmap ROW15 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row15_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW15, TT::CFG_AMAP_ROW15_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW14 address mapping
- /// @param[in] i_bitmap ROW14 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row14_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW14, TT::CFG_AMAP_ROW14_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW13 address mapping
- /// @param[in] i_bitmap ROW13 bit map in the address counter
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_row13_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW13, TT::CFG_AMAP_ROW13_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW12 address mapping
- /// @param[in] i_bitmap ROW12 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row12_bit( const uint64_t i_bitmap )
- {
- // CFG_AMAP_ROW12 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW12 ,
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW12, TT::CFG_AMAP_ROW12_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW11 address mapping
- /// @param[in] i_bitmap ROW11 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row11_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW11, TT::CFG_AMAP_ROW11_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW10 address mapping
- /// @param[in] i_bitmap ROW10 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row10_bit( const uint64_t i_bitmap )
- {
- iv_addr_map1.insertFromRight<TT::CFG_AMAP_ROW10, TT::CFG_AMAP_ROW10_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW9 address mapping
- /// @param[in] i_bitmap ROW9 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row9_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW9, TT::CFG_AMAP_ROW9_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW8 address mapping
- /// @param[in] i_bitmap ROW8 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row8_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW8, TT::CFG_AMAP_ROW8_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW7 address mapping
- /// @param[in] i_bitmap ROW7 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row7_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW7, TT::CFG_AMAP_ROW7_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW6 address mapping
- /// @param[in] i_bitmap ROW6 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row6_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW6, TT::CFG_AMAP_ROW6_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW5 address mapping
- /// @param[in] i_bitmap ROW5 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row5_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW5, TT::CFG_AMAP_ROW5_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW4 address mapping
- /// @param[in] i_bitmap ROW4 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row4_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW4, TT::CFG_AMAP_ROW4_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW3 address mapping
- /// @param[in] i_bitmap ROW3 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row3_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW3, TT::CFG_AMAP_ROW3_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW2 address mapping
- /// @param[in] i_bitmap ROW2 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row2_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW2, TT::CFG_AMAP_ROW2_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW1 address mapping
- /// @param[in] i_bitmap ROW1 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row1_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW1, TT::CFG_AMAP_ROW1_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the ROW0 address mapping
- /// @param[in] i_bitmap ROW0 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_row0_bit( const uint64_t i_bitmap )
- {
- iv_addr_map2.insertFromRight<TT::CFG_AMAP_ROW0, TT::CFG_AMAP_ROW0_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the COL9 address mapping
- /// @param[in] i_bitmap COL9 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col9_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL9, TT::CFG_AMAP_COL9_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the COL8 address mapping
- /// @param[in] i_bitmap COL8 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col8_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL8, TT::CFG_AMAP_COL8_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the COL7 address mapping
- /// @param[in] i_bitmap COL7 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col7_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL7, TT::CFG_AMAP_COL7_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the COL6 address mapping
- /// @param[in] i_bitmap COL6 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col6_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL6, TT::CFG_AMAP_COL6_LEN>(i_bitmap);
- return;
- }
-
- /// @brief Change the COL5 address mapping
- /// @param[in] i_bitmap COL5 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col5_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL5, TT::CFG_AMAP_COL5_LEN>(i_bitmap);
- return;
- }
-
- /// @brief Change the COL4 address mapping
- /// @param[in] i_bitmap COL4 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col4_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL4, TT::CFG_AMAP_COL4_LEN>(i_bitmap);
- return;
- }
-
- /// @brief Change the COL3 address mapping
- /// @param[in] i_bitmap COL3 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col3_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL3, TT::CFG_AMAP_COL3_LEN>(i_bitmap);
- return;
- }
-
- /// @brief Change the COL2 address mapping
- /// @param[in] i_bitmap COL2 bit map in the address counter
- /// @note Assumes data is right-aligned
- ///
- inline void change_col2_bit( const uint64_t i_bitmap )
- {
- iv_addr_map3.insertFromRight<TT::CFG_AMAP_COL2, TT::CFG_AMAP_COL2_LEN>(i_bitmap);
- return;
- }
-
- ///
- /// @brief Change the mcbist 64/128 byte control
- /// @param[in] i_state mss::ON if you want 64B, mss::OFF if you want 128B
- /// @return void
- ///
- inline void change_len64( const mss::states i_state )
- {
- iv_config.writeBit<TT::CFG_MCB_LEN64>(i_state);
- return;
- }
-
- ///
- /// @brief Change the random address all address mode
- /// @param[in] i_state mss::ON if you random addressing all addresses, mss::OFF if you don't
- /// @return void
- ///
- inline void random_address_all( const mss::states i_state )
- {
- iv_config.writeBit<TT::RAND_ADDR_ALL_ADDR_MODE_EN>(i_state);
- return;
- }
-
- ///
- /// @brief Change the broadcast sync enable bit
- /// @param[in] i_state mss::ON to enable the sync pulse, mss::OFF to disable
- /// @return void
- ///
- inline void broadcast_sync_enable( const mss::states i_state )
- {
- iv_config.writeBit<TT::SYNC_EN>(i_state);
- return;
- }
-
- ///
- /// @brief Change the broadcast mode sync timbase count
- /// @param[in] i_broadcast_timebase
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_broadcast_timebase( mss::mcbist::broadcast_timebase i_broadcast_timebase )
- {
- iv_config.insertFromRight<TT::SYNC_WAIT, TT::SYNC_WAIT_LEN>(i_broadcast_timebase);
- return;
- }
-
- ///
- /// @brief Change the mcbist thresholds
- /// @param[in] i_thresholds the new thresholds/stop conditions
- /// @return void
- ///
- inline void change_thresholds( const stop_conditions& i_thresholds )
- {
- iv_thresholds = i_thresholds;
- return;
- }
-
- ///
- /// @brief Change the data rotate value
- /// @param[in] i_data_rotate
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_data_rotate( mss::mcbist::data_rotate_mode i_data_rotate )
- {
- iv_data_rotate_cnfg.insertFromRight<TT::CFG_DATA_ROT, TT::CFG_DATA_ROT_LEN>(i_data_rotate);
- return;
- }
-
- ///
- /// @brief Get the data rotate value
- /// @note Assumes data is right aligned
- /// @return the data rotate value config
- ///
- inline uint64_t get_data_rotate()
- {
- uint64_t l_data_rotate = 0;
- iv_data_rotate_cnfg.extractToRight<TT::CFG_DATA_ROT, TT::CFG_DATA_ROT_LEN>(l_data_rotate);
- return l_data_rotate;
- }
-
- ///
- /// @brief Change the data seed mode value
- /// @param[in] i_data_seed_mode
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_data_seed_mode( const mss::mcbist::data_seed_mode i_data_seed_mode )
- {
- iv_data_rotate_cnfg.insertFromRight<TT::CFG_DATA_SEED_MODE, TT::CFG_DATA_SEED_MODE_LEN>(i_data_seed_mode);
- return;
- }
-
- ///
- /// @brief Get the data seed mode value
- /// @note Assumes data is right aligned
- /// @return the data seed mode value
- ///
- inline uint64_t get_data_seed_mode()
- {
- uint64_t l_data_seed_mode = 0;
- iv_data_rotate_cnfg.extractToRight<TT::CFG_DATA_SEED_MODE, TT::CFG_DATA_SEED_MODE_LEN>(l_data_seed_mode);
- return l_data_seed_mode;
- }
-
- ///
- /// @brief Change the data rotate seed for data bits 0:63
- /// @param[in] i_width
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_data_rotate_seed1( const uint64_t i_data_rotate_seed1 )
- {
- iv_data_rotate_seed.insertFromRight<TT::CFG_DATA_ROT_SEED1, TT::CFG_DATA_ROT_SEED1_LEN>(i_data_rotate_seed1);
- return;
- }
-
- ///
- /// @brief Get the data rotate seed for data bits 0:63
- /// @note Assumes data is right aligned
- /// @return the data rotate seed for data bits 0:63
- ///
- inline uint64_t get_data_rotate_seed1()
- {
- uint64_t l_data_rotate_seed1 = 0;
- iv_data_rotate_seed.extractToRight<TT::CFG_DATA_ROT_SEED1, TT::CFG_DATA_ROT_SEED1_LEN>(l_data_rotate_seed1);
- return l_data_rotate_seed1;
- }
-
- ///
- /// @brief Change the data rotate seed for data bits 64:79
- /// @param[in] i_width
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_data_rotate_seed2( const uint64_t i_data_rotate_seed2 )
- {
- iv_data_rotate_cnfg.insertFromRight<TT::CFG_DATA_ROT_SEED2, TT::CFG_DATA_ROT_SEED2_LEN>(i_data_rotate_seed2);
- return;
- }
-
- ///
- /// @brief Get the data rotate seed for data bits 64:79
- /// @note Assumes data is right aligned
- /// @return the data rotate seed for data bits 64:79
- ///
- inline uint64_t get_data_rotate_seed2()
- {
- uint64_t l_data_rotate_seed2 = 0;
- iv_data_rotate_cnfg.extractToRight<TT::CFG_DATA_ROT_SEED2, TT::CFG_DATA_ROT_SEED2_LEN>(l_data_rotate_seed2);
- return l_data_rotate_seed2;
- }
-
- ///
- /// @brief Change the compare mask CE trap enable
- /// @param[in] i_state mss::ON to enable the trap, mss::OFF to disable the trap
- /// @return void
- ///
- inline void change_ce_trap_enable( const mss::states i_state )
- {
- iv_compare_mask.writeBit<TT::CFG_TRAP_CE_ENABLE>(i_state);
- return;
- }
-
- ///
- /// @brief Change the compare mask UE trap enable
- /// @param[in] i_state mss::ON to enable the trap, mss::OFF to disable the trap
- /// @return void
- ///
- inline void change_ue_trap_enable( const mss::states i_state )
- {
- iv_compare_mask.writeBit<TT::CFG_TRAP_UE_ENABLE>(i_state);
- return;
- }
-
- ///
- /// @brief Change the compare mask MPE trap enable
- /// @param[in] i_state mss::ON to enable the trap, mss::OFF to disable the trap
- /// @return void
- ///
- inline void change_mpe_trap_enable( const mss::states i_state )
- {
- iv_compare_mask.writeBit<TT::CFG_TRAP_MPE_ENABLE>(i_state);
- return;
- }
-
- ///
- /// @brief Change the forced pause state
- /// @param[in] i_end the end_boundary to pause at
- /// @return void
- ///
- inline void change_forced_pause( const end_boundary& i_end )
- {
- if (i_end == end_boundary::DONT_CHANGE)
- {
- return;
- }
-
- // Clear all the forced pause bits so we don't stack pauses
- iv_config.clearBit<TT::MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR>();
- iv_config.clearBit<TT::MCBIST_CFG_PAUSE_AFTER_RANK>();
- iv_config.clearBit<TT::MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST>();
- iv_addr_gen.clearBit<TT::MAINT_DETECT_SRANK_BOUNDARIES>();
-
- switch (i_end)
- {
- case end_boundary::STOP_AFTER_ADDRESS:
- iv_config.setBit<TT::MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR>();
- break;
-
- case end_boundary::STOP_AFTER_SLAVE_RANK:
- iv_config.setBit<TT::MCBIST_CFG_PAUSE_AFTER_RANK>();
- iv_addr_gen.setBit<TT::MAINT_DETECT_SRANK_BOUNDARIES>();
- break;
-
- case end_boundary::STOP_AFTER_MASTER_RANK:
- iv_config.setBit<TT::MCBIST_CFG_PAUSE_AFTER_RANK>();
- iv_addr_gen.clearBit<TT::MAINT_DETECT_SRANK_BOUNDARIES>();
- break;
-
- case end_boundary::STOP_AFTER_SUBTEST:
- iv_config.setBit<TT::MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST>();
- break;
-
- // None is all set, we cleared the bits above
- case end_boundary::NONE:
- break;
-
- // Default is a no forced pause (as we cleared all the bits)
- default:
- FAPI_INF("no forced pause state - end state %d unknown", i_end);
- break;
- };
-
- return;
- }
-
- ///
- /// @brief Calculate minimum command gap for BG_SCRUB
- /// @param[in] i_target the target behind which the memory sits
- /// @param[in] i_freq the DRAM frequency
- /// @param[in] i_size the sum of all DIMM sizes
- /// @param[out] o_min_cmd_gap the setting for MCBPARMQ_CFG_MIN_CMD_GAP
- /// @param[out] o_timebase the setting for MCBPARMQ_CFG_MIN_GAP_TIMEBASE
- ///
- inline void calculate_min_cmd_gap( const fapi2::Target<T>& i_target,
- const uint64_t i_freq,
- const uint64_t i_size,
- uint64_t& o_min_cmd_gap,
- mss::states& o_timebase )
- {
- constexpr uint64_t l_seconds = SEC_IN_HOUR * BG_SCRUB_IN_HOURS;
- constexpr uint64_t MIN_CMD_GAP = 0x001;
-
- // Sanity check our inputs, just assert if bad since they come directly from eff_config
- // this will prevent us from any divide by zero problems
- if ((i_freq == 0) || (i_size == 0))
- {
- FAPI_ERR("received zero memory freq or size in calculate_min_cmd_gap");
- fapi2::Assert(false);
- }
-
- // MIN CMD GAP = TOTAL CYCLES / TOTAL ADDRESSES
- // TOTAL CYCLES = 12 hours x 60 min/hr x 60 sec/min x [DRAM freq] cycles/sec x
- // 1/2 (MEM logic runs half DRAM freq)
- const uint64_t l_mem_cycles_per_sec = (i_freq * T_PER_MT) / 2;
- const uint64_t l_total_cycles = l_seconds * l_mem_cycles_per_sec;
-
- // TOTAL ADDRESSES = sum over all dimms of ( [DIMM CAPACITY]/128B )
- const uint64_t l_total_addresses = i_size * BYTES_PER_GB / 128;
-
- const auto l_min_cmd_gap = l_total_cycles / l_total_addresses;
-
- // If we're greater than the timebase, set the multiplier and divide down to get the gap setting
- if (CMD_TIMEBASE < l_min_cmd_gap)
- {
- o_min_cmd_gap = l_min_cmd_gap / CMD_TIMEBASE;
- o_timebase = mss::ON;
- return;
- }
-
- // If we're greater than the max gap setting, get as close to 12 hours as we can instead of just truncating
- if (l_min_cmd_gap > MAX_CMD_GAP)
- {
- // work backwards to calculate what the total scrub time would be with the highest cmd gap with no multiplier...
- const uint64_t l_scrub_time_fff = (l_total_addresses * MAX_CMD_GAP) / l_mem_cycles_per_sec;
- // and with the lowest cmd gap with the multiplier
- const uint64_t l_scrub_time_001 = (l_total_addresses * CMD_TIMEBASE) / l_mem_cycles_per_sec;
-
- if ((l_seconds - l_scrub_time_fff) > (l_scrub_time_001 - l_seconds))
- {
- FAPI_INF("%s gap is greater than the field will allow. Setting to: %03x", mss::c_str(i_target), MIN_CMD_GAP);
- o_min_cmd_gap = MIN_CMD_GAP;
- o_timebase = mss::ON;
- }
- else
- {
- FAPI_INF("%s gap is greater than the field will allow. Setting to: %03x", mss::c_str(i_target), MAX_CMD_GAP);
- o_min_cmd_gap = MAX_CMD_GAP;
- o_timebase = mss::OFF;
- }
-
- return;
- }
-
- // Else, we're good to just set the calculated gap value directly
- o_min_cmd_gap = l_min_cmd_gap;
- o_timebase = mss::OFF;
- }
-
- ///
- /// @brief Change MCBIST Speed
- /// @param[in] i_target the target behind which the memory sits
- /// @param[in] i_speed the speed eunmeration
- /// @return FAPI2_RC_SUCCSS iff ok
- ///
- inline fapi2::ReturnCode change_speed( const fapi2::Target<T>& i_target, const speed i_speed )
- {
- switch (i_speed)
- {
- case speed::LUDICROUS:
- change_min_cmd_gap(0);
- change_min_gap_timebase(mss::OFF);
- return fapi2::FAPI2_RC_SUCCESS;
- break;
-
- case speed::BG_SCRUB:
- {
- uint64_t l_freq = 0;
- uint64_t l_size = 0;
- uint64_t l_min_cmd_gap = 0;
- mss::states l_timebase = mss::OFF;
-
- constexpr uint64_t l_seconds = SEC_IN_HOUR * BG_SCRUB_IN_HOURS;
-
- FAPI_TRY( mss::freq(i_target, l_freq) );
- FAPI_TRY( mss::eff_memory_size<mss::mc_type::NIMBUS>(i_target, l_size) );
-
- calculate_min_cmd_gap(i_target, l_freq, l_size, l_min_cmd_gap, l_timebase);
-
- FAPI_INF("%s setting bg scrub speed: %dMT/s, memory: %dGB, duration: %ds, gap: %d",
- mss::c_str(i_target), l_freq, l_size, l_seconds, l_min_cmd_gap);
-
- change_min_cmd_gap(l_min_cmd_gap);
- change_min_gap_timebase(l_timebase);
-
- return fapi2::FAPI2_RC_SUCCESS;
- }
- break;
-
- // Otherwise it's SAME_SPEED or something else in which case we do nothing
- default:
- break;
- };
-
- fapi_try_exit:
- return fapi2::current_err;
- }
-
- ///
- /// @brief Get a list of ports involved in the program
- /// @tparam P fapi2 target type of port
- /// @param[in] i_target the target for this program
- /// @return vector of port targets
- ///
- template< fapi2::TargetType P >
- std::vector<fapi2::Target<P>> get_port_list( const fapi2::Target<T>& i_target ) const;
-
- ///
- /// @brief Change MCBIST Stop-on-error conditions (end boundaries)
- /// @param[in] i_end the end boundary
- /// @note By default the MCBIST is programmed to always stop after an errored address. This API
- /// allows the caller to force a stop at a boundary or to force no stopping on errors
- ///
- inline void change_end_boundary( const end_boundary i_end )
- {
- // Which bit in the end boundary which siginifies this is a slave rank detect situation
- constexpr uint64_t SLAVE_RANK_INDICATED_BIT = 61;
-
- // If there's no change, just get outta here
- if (i_end == DONT_CHANGE)
- {
- return;
- }
-
- // The values of the enum were crafted so that we can simply insertFromRight into the register.
- // We take note of whether to set the slave or master rank indicator and set that as well.
- // The hardware has to have a 1 or a 0 - so there is no choice for the rank detection. So it
- // doesn't matter that we're processing other end boundaries here - they'll just look like we
- // asked for a master rank detect.
- iv_config.insertFromRight<TT::CFG_PAUSE_ON_ERROR_MODE, TT::CFG_PAUSE_ON_ERROR_MODE_LEN>(i_end);
-
- uint64_t l_detect_slave = fapi2::buffer<uint64_t>(i_end).getBit<SLAVE_RANK_INDICATED_BIT>();
- iv_addr_gen.writeBit<TT::MAINT_DETECT_SRANK_BOUNDARIES>( l_detect_slave );
- FAPI_INF("load MCBIST end boundaries 0x%016lx detect slave? %s",
- i_end, (l_detect_slave == 1 ? "yes" : "no") );
- }
-
- ///
- /// @brief Change the mcbist min command gap
- /// @param[in] i_gap minimum number of cycles between commands when cfg_en_randcmd_gap is a 0 (disabled)
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_min_cmd_gap( const uint64_t i_gap )
- {
- iv_parameters.insertFromRight<TT::MIN_CMD_GAP, TT::MIN_CMD_GAP_LEN>(i_gap);
- return;
- }
-
- ///
- /// @brief Change the mcbist gap timebase
- /// @param[in] i_tb When set to mss::ON and cfg_en_randcmd_gap is a 0, then the number of minimum
- /// cycles between commands will be cfg_min_cmd_gap multiplied by 2^13.
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_min_gap_timebase( const bool i_tb )
- {
- iv_parameters.writeBit<TT::MIN_GAP_TIMEBASE>(i_tb);
- return;
- }
-
- ///
- /// @brief Change the mcbist min command gap blind steer
- /// @param[in] i_gap min gap between commands when doing steering
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_min_cmd_gap_blind_steer( const uint64_t i_gap )
- {
- iv_parameters.insertFromRight<TT::MIN_CMD_GAP_BLIND_STEER, TT::MIN_CMD_GAP_BLIND_STEER_LEN>(i_gap);
- return;
- }
-
- ///
- /// @brief Change the mcbist gap timebase for blind steer
- /// @param[in] i_program the program in question
- /// @param[in] i_tb When set to mss::ON and cfg_en_randcmd_gap is a 0, then the number of minimum
- /// cycles between commands will be cfg_min_cmd_gap multiplied by 2^13.
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_min_gap_timebase_blind_steer( const bool i_tb )
- {
- iv_parameters.writeBit<TT::MIN_GAP_TIMEBASE_BLIND_STEER>(i_tb);
- return;
- }
-
- ///
- /// @brief Change the weights for random mcbist reads, writes
- /// @param[in] i_weight
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_randcmd_wgt( const uint64_t i_weight )
- {
- iv_parameters.insertFromRight<TT::RANDCMD_WGT, TT::RANDCMD_WGT_LEN>(i_weight);
- return;
- }
-
- ///
- /// @brief Change the weights for random mcbist command gaps
- /// @param[in] i_program the program in question
- /// @param[in] i_weight
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_randgap_wgt( const uint64_t i_weight )
- {
- iv_parameters.insertFromRight<TT::RANDGAP_WGT, TT::RANDGAP_WGT_LEN>(i_weight);
- return;
- }
-
- ///
- /// @brief Enable or disable mcbist clock monitoring
- /// @param[in] i_monitor mss::ON to monitor
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_clock_monitor_en( const bool i_monitor )
- {
- iv_parameters.writeBit<TT::CLOCK_MONITOR_EN>(i_monitor);
- return;
- }
-
- ///
- /// @brief Enable or disable mcbist random command gaps
- /// @param[in] i_rndgap mss::ON to enable
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_en_randcmd_gap( const bool i_rndgap )
- {
- iv_parameters.writeBit<TT::EN_RANDCMD_GAP>(i_rndgap);
- return;
- }
-
- ///
- /// @brief Enable or disable mcbist BC4 support
- /// @param[in] i_bc4 mss::ON to enable
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_bc4_en( const bool i_bc4 )
- {
- iv_parameters.writeBit<TT::BC4_EN>(i_bc4);
- return;
- }
-
- ///
- /// @brief Change fixed width address generator config
- /// @param[in] i_width
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_fixed_width( const uint64_t i_width )
- {
- iv_addr_gen.insertFromRight<TT::FIXED_WIDTH, TT::FIXED_WIDTH_LEN>(i_width);
- return;
- }
-
- ///
- /// @brief Get the fixed width address config
- /// @note Assumes data is right aligned
- /// @return the fixed width address config
- ///
- inline uint64_t get_fixed_width()
- {
- uint64_t l_fixed_width = 0;
- iv_addr_gen.extractToRight<TT::FIXED_WIDTH, TT::FIXED_WIDTH_LEN>(l_fixed_width);
- return l_fixed_width;
- }
-
- ///
- /// @brief Enable or disable address counting mode for address config 0
- /// @param[in] i_mode mss::ON to enable
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_address_counter_mode0( const bool i_mode )
- {
- fapi2::buffer<uint64_t> l_value;
- iv_addr_gen.extract<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- l_value.writeBit<0>(i_mode);
- iv_addr_gen.insert<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- return;
- }
-
- ///
- /// @brief Enable or disable address counting mode for address config 1
- /// @param[in] i_mode mss::ON to enable
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_address_counter_mode1( const bool i_mode )
- {
- fapi2::buffer<uint64_t> l_value;
- iv_addr_gen.extract<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- l_value.writeBit<1>(i_mode);
- iv_addr_gen.insert<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- return;
- }
-
- ///
- /// @brief Enable or disable address counting mode for address config 2
- /// @param[in] i_mode mss::ON to enable
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_address_counter_mode2( const bool i_mode )
- {
- fapi2::buffer<uint64_t> l_value;
- iv_addr_gen.extract<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- l_value.writeBit<2>(i_mode);
- iv_addr_gen.insert<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- return;
- }
-
- ///
- /// @brief Enable or disable address counting mode for address config 3
- /// @param[in] i_program, the program in question
- /// @param[in] i_mode mss::ON to enable
- /// @note Assumes data is right-aligned
- /// @return void
- ///
- inline void change_address_counter_mode3( const bool i_mode )
- {
- fapi2::buffer<uint64_t> l_value;
- iv_addr_gen.extract<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- l_value.writeBit<3>(i_mode);
- iv_addr_gen.insert<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(l_value);
- return;
- }
-
-
- ///
- /// @brief Enable or disable maint address mode
- /// @param[in] i_mode mss::ON to enable
- /// @warn Address counter modes must be 0 for this to work.
- /// @note When enabled subtest complement bits become 3-bit port-dimm selector field
- /// (Note: when turning this off, make sure you clear or reprogram complement bits)
- /// @return void
- ///
- inline void change_maint_address_mode( const bool i_mode )
- {
- iv_addr_gen.writeBit<TT::MAINT_ADDR_MODE_EN>(i_mode);
- return;
- }
-
- ///
- /// @brief Enable or disable broadcast mode
- /// @param[in] i_program the program in question
- /// @param[in] i_mode mss::ON to enable
- /// @warn Maint address mode must be enabled for this to work
- /// @return void
- ///
- inline void change_maint_broadcast_mode( const bool i_mode )
- {
- iv_addr_gen.writeBit<TT::MAINT_BROADCAST_MODE_EN>(i_mode);
- return;
- }
-
-
- ///
- /// @brief Enable or disable slave rank boundary detect
- /// @param[in] i_program the program in question
- /// @param[in] i_mode mss::ON to enable
- /// @return void
- ///
- inline void change_srank_boundaries( const bool i_mode )
- {
- iv_addr_gen.writeBit<TT::MAINT_DETECT_SRANK_BOUNDARIES>(i_mode);
- return;
- }
-
- ///
- /// @brief Enable or disable async mode
- /// @param[in] i_program the program in question
- /// @param[in] i_mode mss::ON to enable, programs will run async
- /// @return void
- ///
- inline void change_async( const bool i_mode )
- {
- iv_async = i_mode;
- return;
- }
-
- ///
- /// @brief Select the port(s) to be used by the MCBIST
- /// @param[in] i_ports uint64_t representing the ports. Multiple bits set imply broadcast
- /// i_ports is a right-aligned uint64_t, of which only the right-most 4 bits are used. The register
- /// field is defined such that the left-most bit in the field represents port 0, the right most
- /// bit in the field represents port 3. So, to run on port 0, i_ports should be 0b1000. 0b0001
- /// (or 0x1) is port 3 - not port 0
- /// @return void
- ///
- inline void select_ports( const uint64_t i_ports )
- {
- iv_control.insertFromRight<TT::PORT_SEL, TT::PORT_SEL_LEN>(i_ports);
- FAPI_INF("mcbist select ports: iv_control 0x%016lx (ports: 0x%x)", iv_control, i_ports);
- return;
- }
-
- ///
- /// @brief Process mcbist errors
- /// @tparam MCBIST target type
- /// @tparam T fapi2::TargetType representing the fapi2 target which
- /// contains the MCBIST engine (e.g., fapi2::TARGET_TYPE_MCBIST)
- /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
- /// This shouldn't be called in firmware? Check with PRD
- ///
- inline fapi2::ReturnCode process_errors( const fapi2::Target<T> i_target ) const
- {
- // Until reading the error array is documented, comparison errors 'just' result in
- // a flag indicating there was a problem on port.
- {
- fapi2::buffer<uint64_t> l_data;
- uint64_t l_port = 0;
- uint64_t l_subtest = 0;
- FAPI_TRY( mss::getScom(i_target, TT::MCBSTATQ_REG, l_data), "%s Failed getScom", mss::c_str(i_target) );
- l_data.extractToRight<TT::LOGGED_ERROR_ON_PORT_INDICATOR, TT::LOGGED_ERROR_ON_PORT_INDICATOR_LEN>(l_port);
- l_data.extractToRight<TT::SUBTEST_NUM_INDICATOR, TT::SUBTEST_NUM_INDICATOR_LEN>(l_subtest);
-
- FAPI_ASSERT( l_port == 0,
- fapi2::MSS_MEMDIAGS_COMPARE_ERROR_IN_LAST_PATTERN()
- .set_MCBIST_TARGET(i_target)
- .set_PORT(mss::first_bit_set(l_port))
- .set_SUBTEST(l_subtest),
- "%s MCBIST error on port %d subtest %d", mss::c_str(i_target), mss::first_bit_set(l_port), l_subtest );
- }
-
- // Check for UE errors
- {
- fapi2::buffer<uint64_t> l_read0;
- fapi2::buffer<uint64_t> l_read1;
-
- FAPI_TRY( mss::getScom(i_target, TT::SRERR0_REG, l_read0), "%s Failed getScom", mss::c_str(i_target) );
- FAPI_TRY( mss::getScom(i_target, TT::SRERR1_REG, l_read1), "%s Failed getScom", mss::c_str(i_target) );
-
- FAPI_ASSERT( ((l_read0 == 0) && (l_read1 == 0)),
- fapi2::MSS_MEMDIAGS_ERROR_IN_LAST_PATTERN()
- .set_MCBIST_TARGET(i_target)
- .set_STATUS0(l_read0)
- .set_STATUS1(l_read1),
- "%s MCBIST scrub/read error reg0: 0x%016lx reg1: 0x%016lx", mss::c_str(i_target), l_read0, l_read1 );
- }
-
- FAPI_INF("%s Execution success - no errors seen from MCBIST program", mss::c_str(i_target));
-
- fapi_try_exit:
- return fapi2::current_err;
- }
-
- ///
- /// @brief Store off the pattern index. We'll use this to write the patterns when we load the program
- /// @param[in] i_index an index such as mss::mcbist::PATTERN_0
- /// @return fapi2::ReturnCode checks for bad pattern index
- /// @warning if you give a pattern index which does not exist your pattern will not change.
- /// @note patterns default to PATTERN_0
- ///
- inline fapi2::ReturnCode change_pattern( const uint64_t i_pattern )
- {
- FAPI_INF("change MCBIST pattern index %d", i_pattern);
-
- // Sanity check the pattern since they're just numbers.
- FAPI_ASSERT( i_pattern <= mcbist::NO_PATTERN,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(i_pattern),
- "Attempting to change a pattern which does not exist %d", i_pattern );
-
- iv_pattern = i_pattern;
-
- return fapi2::FAPI2_RC_SUCCESS;
-
- fapi_try_exit:
- return fapi2::current_err;
- }
-
- ///
- /// @brief Store off the random 24b data seed index. We'll use this to write the 24b random data seeds when we load the program
- /// @param[in] i_index an index such as mss::mcbist::RANDOM24_SEEDS_0
- /// @return fapi2::ReturnCode checks for bad pattern index
- /// @warning if you give a pattern index which does not exist your pattern will not change.
- /// @note patterns default to PATTERN_0
- ///
- inline fapi2::ReturnCode change_random_24b_seeds( const uint64_t i_random24_seed )
- {
- FAPI_INF("change MCBIST 24b random data seeds index %d", i_random24_seed );
-
- // TK Want a new RC for random 24
- // Sanity check the pattern since they're just numbers.
- FAPI_ASSERT( i_random24_seed <= mcbist::NO_RANDOM24_SEEDS,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(i_random24_seed),
- "Attempting to change to a 24b random data seed which does not exist %d", i_random24_seed );
-
- iv_random24_data_seed = i_random24_seed;
-
- return fapi2::FAPI2_RC_SUCCESS;
-
- fapi_try_exit:
- return fapi2::current_err;
- }
-
- ///
- /// @brief Store off the random 24b data seed mapping index. We'll use this to write the 24b random data seed mappings when we load the program
- /// @param[in] i_index an index such as mss::mcbist::RANDOM24_SEEDS_0
- /// @return fapi2::ReturnCode checks for bad pattern index
- /// @warning if you give a pattern index which does not exist your pattern will not change.
- /// @note patterns default to PATTERN_0
- ///
- inline fapi2::ReturnCode change_random_24b_maps( const uint64_t i_random24_map )
- {
- FAPI_INF("change MCBIST 24b random data seed mappings index %d", i_random24_map );
-
- // TK Want a new RC for random 24
- // Sanity check the pattern since they're just numbers.
- FAPI_ASSERT( i_random24_map <= mcbist::NO_RANDOM24_SEED_MAP,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(i_random24_map),
- "Attempting to change to a random seed map which does not exist %d", i_random24_map );
-
- iv_random24_seed_map = i_random24_map;
-
- return fapi2::FAPI2_RC_SUCCESS;
-
- fapi_try_exit:
- return fapi2::current_err;
- }
-
- ///
- /// @brief checks if two programs are equal
- /// @param[in] i_rhs program to compare
- /// @return bool true if equal
- ///
- inline bool operator==( const program<T>& i_rhs ) const
- {
- //checks the vector first, to save time if they're not equal (no sense in checking everything else)
- if(iv_subtests != i_rhs.iv_subtests)
- {
- return false;
- }
-
- //checks everything else
- bool l_equal = iv_parameters == i_rhs.iv_parameters;
- l_equal &= iv_addr_gen == i_rhs.iv_addr_gen;
- l_equal &= iv_test_type == i_rhs.iv_test_type;
- l_equal &= iv_poll == i_rhs.iv_poll;
- l_equal &= iv_addr_map0 == i_rhs.iv_addr_map0;
- l_equal &= iv_addr_map1 == i_rhs.iv_addr_map1;
- l_equal &= iv_addr_map2 == i_rhs.iv_addr_map2;
- l_equal &= iv_addr_map3 == i_rhs.iv_addr_map3;
- l_equal &= iv_config == i_rhs.iv_config;
- l_equal &= iv_control == i_rhs.iv_control;
- l_equal &= iv_async == i_rhs.iv_async;
- l_equal &= iv_pattern == i_rhs.iv_pattern;
- l_equal &= iv_thresholds == i_rhs.iv_thresholds;
- l_equal &= iv_data_rotate_cnfg == i_rhs.iv_data_rotate_cnfg;
- l_equal &= iv_data_rotate_seed == i_rhs.iv_data_rotate_seed;
- l_equal &= iv_random24_data_seed == i_rhs.iv_random24_data_seed;
- l_equal &= iv_random24_seed_map == i_rhs.iv_random24_seed_map;
- l_equal &= iv_data_rotate_cnfg == i_rhs.iv_data_rotate_cnfg;
- l_equal &= iv_data_rotate_seed == i_rhs.iv_data_rotate_seed;
- l_equal &= iv_compare_mask == i_rhs.iv_compare_mask;
-
- //returns result
- return l_equal;
- }
-
- // Vector of subtests. Note the MCBIST subtests are spread across
- // 8 registers - 4 subtests fit in one 64b register
- // (16 bits/test, 4 x 16 == 64, 4x8 = 32 subtests)
- // We keep a vector of 16 bit subtests here, and we program the
- // MCBIST engine (i.e., spread the subtests over the 8 registers)
- // when we're told to execute the program.
- std::vector< subtest_t<T> > iv_subtests;
-
- // Place to hold the value of the MCBIST Memory Parameter Register. We'll scom
- // it when we execute the program.
- fapi2::buffer<uint64_t> iv_parameters;
-
- // Place to hold the value of the MCBIST Address Generation Config. We'll scom
- // it when we execute the program.
- fapi2::buffer<uint64_t> iv_addr_gen;
-
- test_type iv_test_type;
-
- poll_parameters iv_poll;
-
- // Address Map Registers
- // We might want to refactor to a vector ... BRS
- // uint64_t iv_addr_map0;
- // uint64_t iv_addr_map1;
- // uint64_t iv_addr_map2;
- // uint64_t iv_addr_map3;
- //Perhaps this isn't the right approach, we can discuss and change if needed, leaving the above comments for now
- fapi2::buffer<uint64_t> iv_addr_map0;
- fapi2::buffer<uint64_t> iv_addr_map1;
- fapi2::buffer<uint64_t> iv_addr_map2;
- fapi2::buffer<uint64_t> iv_addr_map3;
-
- // Data Rotate Seed and Config Registers
- fapi2::buffer<uint64_t> iv_data_rotate_cnfg;
- fapi2::buffer<uint64_t> iv_data_rotate_seed;
-
- // Config register
- fapi2::buffer<uint64_t> iv_config;
-
- // Control register
- fapi2::buffer<uint64_t> iv_control;
-
- // True iff we want to run in asynchronous mode
- bool iv_async;
-
- // The pattern for the pattern generator
- uint64_t iv_pattern;
-
- // The pattern for the random 24b seeds
- uint64_t iv_random24_data_seed;
-
- // The pattern for the random 24b data seed mapping
- uint64_t iv_random24_seed_map;
-
- // The pattern for the pattern generator
- fapi2::buffer<uint64_t> iv_compare_mask;
-
- // The error stop conditions, thresholds for the program
- stop_conditions iv_thresholds;
-};
-
-///
-/// @brief Load the mcbist config register
-/// @tparam T fapi2::TargetType of the MCBIST engine
-/// @tparam TT the mssTraits associtated with T
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_config( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- FAPI_INF("loading MCBIST Config 0x%016lx", i_program.iv_config);
-
- // Copy the program's config settings - we want to modify them if we're in sim.
- fapi2::buffer<uint64_t> l_config = i_program.iv_config;
-
- // If we're running in Cronus, there is no interrupt so any attention bits will
- // hang something somewhere. Make sure there's nothing in this config which can
- // turn on attention bits unless we're running in hostboot
-#ifndef __HOSTBOOT_MODULE
- l_config.template clearBit<TT::CFG_ENABLE_HOST_ATTN>();
- l_config.template clearBit<TT::CFG_ENABLE_SPEC_ATTN>();
-#endif
-
- FAPI_TRY( mss::putScom(i_target, TT::CFGQ_REG, l_config) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-
-///
-/// @brief Load the mcbist control register
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_control( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- FAPI_INF("loading MCBIST Control 0x%016lx", i_program.iv_control);
- return mss::putScom(i_target, TT::CNTLQ_REG, i_program.iv_control);
-}
-
-
-///
-/// @brief Load the address generator config
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_addr_gen( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- FAPI_INF("loading MCBIST Address Generation 0x%016lx", i_program.iv_addr_gen);
- return mss::putScom(i_target, TT::MCBAGRAQ_REG, i_program.iv_addr_gen);
-}
-
-///
-/// @brief Configure address range based on index
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start 64b right-aligned address
-/// @param[in] i_end 64b right-aligned address
-/// @param[in] i_index which start/end pair to effect
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note Only the right-most 37 bits of the start/end are used.
-/// @warn if address counting mode is enabled in the MCBIST program, these bits are start, len
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode config_address_range( const fapi2::Target<T>& i_target, const uint64_t i_start,
- const uint64_t i_end, const uint64_t i_index )
-{
- FAPI_INF("config MCBIST address range %d start: 0x%016lx (0x%016lx), end/len 0x%016lx (0x%016lx)",
- i_index, i_start, (i_start << 26), i_end, (i_end << 26));
- FAPI_TRY( mss::putScom(i_target, TT::address_pairs[i_index].first, i_start << 26) );
- FAPI_TRY( mss::putScom(i_target, TT::address_pairs[i_index].second, i_end << 26) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Configure address range 0
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start 64b right-aligned address
-/// @param[in] i_end 64b right-aligned address
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note Only the right-most 37 bits of the start/end are used.
-/// @warn if address counting mode is enabled in the MCBIST program, these bits are start, len
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode config_address_range0( const fapi2::Target<T>& i_target, const uint64_t i_start,
- const uint64_t i_end )
-{
- return config_address_range(i_target, i_start, i_end, 0);
-}
-
-
-///
-/// @brief Configure address range 1
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start 64b right-aligned address
-/// @param[in] i_end 64b right-aligned address
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note Only the right-most 37 bits of the start/end are used.
-/// @warn if address counting mode is enabled in the MCBIST program, these bits are start, len
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode config_address_range1( const fapi2::Target<T>& i_target, const uint64_t i_start,
- const uint64_t i_end )
-{
- return config_address_range(i_target, i_start, i_end, 1);
-}
-
-
-///
-/// @brief Configure address range 2
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start 64b right-aligned address
-/// @param[in] i_end 64b right-aligned address
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note Only the right-most 37 bits of the start/end are used.
-/// @warn if address counting mode is enabled in the MCBIST program, these bits are start, len
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode config_address_range2( const fapi2::Target<T>& i_target, const uint64_t i_start,
- const uint64_t i_end )
-{
- return config_address_range(i_target, i_start, i_end, 2);
-}
-
-
-///
-/// @brief Configure address range 3
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start 64b right-aligned address
-/// @param[in] i_end 64b right-aligned address
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note Only the right-most 37 bits of the start/end are used.
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode config_address_range3( const fapi2::Target<T>& i_target, const uint64_t i_start,
- const uint64_t i_end )
-{
- return config_address_range(i_target, i_start, i_end, 3);
-}
-
-///
-/// @brief Start or stop the MCBIST engine
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start_stop bool START for starting, STOP otherwise
-/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode start_stop( const fapi2::Target<T>& i_target, bool i_start_stop )
-{
- // This is the same as the CCS start_stop ... perhaps we need one template for all
- // 'engine' control functions? BRS
- fapi2::buffer<uint64_t> l_buf;
- FAPI_TRY(mss::getScom(i_target, TT::CNTLQ_REG, l_buf));
-
- FAPI_TRY( mss::putScom(i_target, TT::CNTLQ_REG,
- i_start_stop ? l_buf.setBit<TT::MCBIST_START>() : l_buf.setBit<TT::MCBIST_STOP>()) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Resume the MCBIST engine
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode resume( const fapi2::Target<T>& i_target )
-{
- fapi2::buffer<uint64_t> l_buf;
-
- FAPI_TRY( mss::getScom(i_target, TT::CNTLQ_REG, l_buf) );
- FAPI_TRY( mss::putScom(i_target, TT::CNTLQ_REG, l_buf.setBit<TT::MCBIST_RESUME>()) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Reset the MCBIST error logs
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode reset_errors( const fapi2::Target<T>& i_target )
-{
- fapi2::buffer<uint64_t> l_buf;
-
- FAPI_TRY( mss::getScom(i_target, TT::CNTLQ_REG, l_buf) );
- FAPI_TRY( mss::putScom(i_target, TT::CNTLQ_REG, l_buf.setBit<TT::MCBIST_RESET_ERRORS>()) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Return whether or not the MCBIST engine has an operation in progress
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the target to effect
-/// @param[out] i_in_progress - false if no operation is in progress
-/// @return FAPI2_RC_SUCCESS if getScom succeeded
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode in_progress( const fapi2::Target<T>& i_target, bool o_in_progress )
-{
- fapi2::buffer<uint64_t> l_buf;
-
- FAPI_TRY(mss::getScom(i_target, TT::STATQ_REG, l_buf));
- o_in_progress = l_buf.getBit<TT::MCBIST_IN_PROGRESS>();
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Execute the mcbist program
-/// @tparam T the fapi2::TargetType - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist program to execute
-/// @return fapi2::ReturnCode, FAPI2_RC_SUCCESS iff OK
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode execute( const fapi2::Target<T>& i_target, const program<T>& i_program );
-
-///
-/// @brief Load a set of MCBIST subtests in to the MCBIST registers
-/// @tparam T the fapi2::TargetType - derived
-/// @tparam TT the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode load_mcbmr( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program );
-
-
-///
-/// @brief Load a set of MCBIST address map registers
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] the target to effect
-/// @param[in] the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode load_mcbamr( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- // Vector? Can decide when we fully understand the methods to twiddle the maps themselves. BRS
- FAPI_INF("load MCBIST address map register 0: 0x%016lx", i_program.iv_addr_map0);
- FAPI_TRY( mss::putScom(i_target, TT::MCBAMR0A0Q_REG, i_program.iv_addr_map0) );
-
- FAPI_INF("load MCBIST address map register 1: 0x%016lx", i_program.iv_addr_map1);
- FAPI_TRY( mss::putScom(i_target, TT::MCBAMR1A0Q_REG, i_program.iv_addr_map1) );
-
- FAPI_INF("load MCBIST address map register 2: 0x%016lx", i_program.iv_addr_map2);
- FAPI_TRY( mss::putScom(i_target, TT::MCBAMR2A0Q_REG, i_program.iv_addr_map2) );
-
- FAPI_INF("load MCBIST address map register 3: 0x%016lx", i_program.iv_addr_map3);
- FAPI_TRY( mss::putScom(i_target, TT::MCBAMR3A0Q_REG, i_program.iv_addr_map3) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-
-///
-/// @brief Load MCBIST Memory Parameter Register
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] the target to effect
-/// @param[in] the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_mcbparm( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- FAPI_INF("load MCBIST parameter register: 0x%016lx", i_program.iv_parameters);
- return mss::putScom(i_target, TT::MCBPARMQ_REG, i_program.iv_parameters);
-}
-
-///
-/// @brief Clear mcbist errors
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target fapi2::Target<T> of the MCBIST
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode clear_errors( const fapi2::Target<T> i_target )
-{
- // TK: Clear the more detailed errors checked above
- FAPI_INF("Clear MCBIST error state");
- FAPI_TRY( mss::putScom(i_target, TT::MCBSTATQ_REG, 0) );
- FAPI_TRY( mss::putScom(i_target, TT::SRERR0_REG, 0) );
- FAPI_TRY( mss::putScom(i_target, TT::SRERR1_REG, 0) );
- FAPI_TRY( mss::putScom(i_target, TT::FIRQ_REG, 0) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST pattern given a pattern
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_pattern an mcbist::patterns
-/// @param[in] i_invert whether to invert the pattern or not
-/// @note this overload disappears when we have real patterns.
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_pattern( const fapi2::Target<T>& i_target, const pattern& i_pattern, const bool i_invert )
-{
- uint64_t l_address = TT::PATTERN0_REG;
-
- // TODO RTC:155561 Add random pattern support.
-
- // TK: algorithm for patterns which include ECC bits in them
- // Loop over the cache lines in the pattern. We write one half of the cache line
- // to the even register and half to the odd.
- for (const auto& l_cache_line : i_pattern)
- {
- fapi2::buffer<uint64_t> l_value_first = i_invert ? ~l_cache_line.first : l_cache_line.first;
- fapi2::buffer<uint64_t> l_value_second = i_invert ? ~l_cache_line.second : l_cache_line.second;
- FAPI_INF("Loading cache line pattern 0x%016lx 0x%016lx", l_value_first, l_value_second);
- FAPI_TRY( mss::putScom(i_target, l_address, l_value_first) );
- FAPI_TRY( mss::putScom(i_target, ++l_address, l_value_second) );
- ++l_address;
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST pattern given an index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_index the pattern index
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_pattern( const fapi2::Target<T>& i_target, uint64_t i_pattern )
-{
- if (NO_PATTERN != i_pattern)
- {
- bool l_invert = false;
-
- // Sanity check the pattern since they're just numbers.
- // Belt-and-suspenders FAPI_ASSERT as the sim-only uses this API directly.
- FAPI_ASSERT( i_pattern <= mcbist::LAST_PATTERN,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(i_pattern),
- "Attempting to load a pattern which does not exist %d", i_pattern );
-
- // The indexes are split in to even and odd where the odd indexes don't really exist.
- // They're just indicating that we want to grab the even index and invert it. So calculate
- // the proper vector index and acknowledge the inversion if necessary.
- if (mss::is_odd(i_pattern))
- {
- l_invert = true;
- i_pattern -= 1;
- }
-
- return load_pattern(i_target, patterns[i_pattern / 2], l_invert);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST pattern given an index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_pattern( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- return load_pattern(i_target, i_program.iv_pattern);
-}
-
-///
-/// @brief Load MCBIST maint pattern given a pattern
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_pattern an mcbist::patterns
-/// @param[in] i_invert whether to invert the pattern or not
-/// @note this overload disappears when we have real patterns.
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode load_maint_pattern( const fapi2::Target<T>& i_target, const pattern& i_pattern, const bool i_invert );
-
-
-///
-/// @brief Load MCBIST maint pattern given an index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_index the pattern index
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_maint_pattern( const fapi2::Target<T>& i_target, uint64_t i_pattern )
-{
- if (NO_PATTERN != i_pattern)
- {
- bool l_invert = false;
-
- // Sanity check the pattern since they're just numbers.
- // Belt-and-suspenders FAPI_ASSERT as the sim-only uses this API directly.
- FAPI_ASSERT( i_pattern <= mcbist::LAST_PATTERN,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(i_pattern),
- "Attempting to load a pattern which does not exist %d", i_pattern );
-
- // The indexes are split in to even and odd where the odd indexes don't really exist.
- // They're just indicating that we want to grab the even index and invert it. So calculate
- // the proper vector index and acknowledge the inversion if necessary.
- if ((i_pattern % 2) != 0)
- {
- l_invert = true;
- i_pattern -= 1;
- }
-
- return load_maint_pattern(i_target, patterns[i_pattern / 2], l_invert);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST Maint mode pattern given an index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_maint_pattern( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- return load_maint_pattern(i_target, i_program.iv_pattern);
-}
-
-
-///
-/// @brief Load MCBIST 24b random data seeds given a pattern index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_random24_data_seed mcbist::random24_data_seed
-/// @param[in] i_random24_map mcbist::random24_seed_map
-/// @param[in] i_invert whether to invert the pattern or not
-/// @note this overload disappears when we have real patterns.
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode load_random24b_seeds( const fapi2::Target<T>& i_target,
- const random24_data_seed& i_random24_data_seed,
- const random24_seed_map& i_random24_map,
- const bool i_invert );
-
-///
-/// @brief Load MCBIST 24b Random data seeds given a pattern index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_data_seed the 24b random data seed index
-/// @param[in] i_seed_map the 24b random data map index
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_random24b_seeds( const fapi2::Target<T>& i_target, uint64_t i_data_seed,
- uint64_t i_seed_map )
-{
- if ((NO_RANDOM24_SEEDS != i_data_seed) && (NO_RANDOM24_SEED_MAP != i_seed_map))
- {
- bool l_invert = false;
-
- // TK Want a new RC for random 24
- // Sanity check the pattern since they're just numbers.
- // Belt-and-suspenders FAPI_ASSERT as the sim-only uses this API directly.
- FAPI_ASSERT( i_data_seed <= mcbist::LAST_RANDOM24_SEEDS,
- fapi2::MSS_MEMDIAGS_INVALID_PATTERN_INDEX().set_INDEX(i_data_seed),
- "Attempting to load a 24b random data seed set which does not exist %d", i_data_seed );
-
- // The indexes are split in to even and odd where the odd indexes don't really exist.
- // They're just indicating that we want to grab the even index and invert it. So calculate
- // the proper vector index and acknowledge the inversion if necessary.
- if ((i_data_seed % 2) != 0)
- {
- l_invert = true;
- i_data_seed -= 1;
- }
-
- return load_random24b_seeds(i_target, random24_data_seeds[i_data_seed / 2], random24_seed_maps[i_seed_map], l_invert);
- }
-
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST 24b Random data seeds given a program conatining a pattern index
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_random24b_seeds( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- return load_random24b_seeds(i_target, i_program.iv_random24_data_seed, i_program.iv_random24_seed_map);
-}
-
-///
-/// @brief Loads the FIFO value if needed
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_fifo_mode( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
-
- // Checks if FIFO mode is required by checking all subtests
- const auto l_subtest_it = std::find_if(i_program.iv_subtests.begin(),
- i_program.iv_subtests.end(), []( const mss::mcbist::subtest_t<T>& i_rhs) -> bool
- {
- return i_rhs.fifo_mode_required();
- });
-
- // if the FIFO load is not needed (no subtest requiring it was found), just exit out
- if(l_subtest_it == i_program.iv_subtests.end())
- {
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- // Turns on FIFO mode
- constexpr mss::states FIFO_ON = mss::states::ON;
-
- FAPI_TRY(mss::configure_wrq(i_target, FIFO_ON));
- FAPI_TRY(mss::configure_rrq(i_target, FIFO_ON));
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Load MCBIST data patterns and configuration
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_data_config( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- uint64_t l_data_rotate_cnfg_addr = TT::DATA_ROTATE_CNFG_REG;
- uint64_t l_data_rotate_seed_addr = TT::DATA_ROTATE_SEED_REG;
-
- // First load the data pattern registers
- FAPI_INF("Loading the data pattern seeds!");
- FAPI_TRY( mss::mcbist::load_pattern(i_target, i_program.iv_pattern) );
-
- // Load the 24b random data pattern seeds registers
- FAPI_INF("Loading the 24b Random data pattern seeds!");
- FAPI_TRY( mss::mcbist::load_random24b_seeds(i_target, i_program.iv_random24_data_seed,
- i_program.iv_random24_seed_map) );
-
- // Load the maint data pattern into the Maint entry in the RMW buffer
- // TK Might want to only load the RMW buffer if maint commands are present in the program
- // The load takes 33 Putscoms to load 16 64B registers, might slow down mcbist programs that
- // don't need the RMW buffer maint entry loaded
- FAPI_INF("Loading the maint data pattern into the RMW buffer!");
- FAPI_TRY( mss::mcbist::load_maint_pattern(i_target, i_program.iv_pattern) );
-
- FAPI_INF("Loading the data rotate config and seeds!");
- FAPI_TRY( mss::putScom(i_target, l_data_rotate_cnfg_addr, i_program.iv_data_rotate_cnfg) );
- FAPI_TRY( mss::putScom(i_target, l_data_rotate_seed_addr, i_program.iv_data_rotate_seed) );
-
-fapi_try_exit:
- return fapi2::current_err;
-
-}
-
-///
-/// @brief Load MCBIST data compare mask registers
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the mcbist::program
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode load_data_compare_mask( const fapi2::Target<T>& i_target,
- const mcbist::program<T>& i_program );
-
-///
-/// @brief Load MCBIST Thresholds
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_thresholds the thresholds
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_thresholds( const fapi2::Target<T>& i_target, const uint64_t i_thresholds )
-{
- FAPI_INF("load MCBIST threshold register: 0x%016lx", i_thresholds );
- return mss::putScom(i_target, TT::THRESHOLD_REG, i_thresholds);
-}
-
-///
-/// @brief Load MCBIST Threshold Register
-/// @tparam T, the fapi2::TargetType - derived
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_program the program containing the thresholds
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode load_thresholds( const fapi2::Target<T>& i_target, const mcbist::program<T>& i_program )
-{
- return load_thresholds(i_target, i_program.iv_thresholds);
-}
-
-///
-/// @brief Read entries from MCBIST Read Modify Write (RMW) array
-/// @tparam T, the fapi2::TargetType
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start_addr the array address to read first
-/// @param[in] i_num_entries the number of array entries to read
-/// @param[in] i_roll_over_for_compare_mode set to true if only using first
-/// NUM_COMPARE_INFO_ENTRIES of array, so array address rolls over at correct value
-/// @param[out] o_data vector of output data
-/// @param[out] o_ecc_data vector of ecc data
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note The number of entries in the array depends on i_roll_over_for_compare_mode parameter:
-/// (NUM_COMPARE_LOG_ENTRIES for false, NUM_COMPARE_INFO_ENTRIES for true) but user may read more than
-/// that since reads work in a circular buffer fashion
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode read_rmw_array(const fapi2::Target<T>& i_target,
- const uint64_t i_start_addr,
- const uint64_t i_num_entries,
- const bool i_roll_over_for_compare_mode,
- std::vector< fapi2::buffer<uint64_t> >& o_data,
- std::vector< fapi2::buffer<uint64_t> >& o_ecc_data);
-
-///
-/// @brief Read entries from MCBIST Read Modify Write (RMW) array
-/// Overload for the case where o_ecc_data is not needed
-/// @tparam T, the fapi2::TargetType
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start_addr the array address to read first
-/// @param[in] i_num_entries the number of array entries to read
-/// @param[in] i_roll_over_for_compare_mode set to true if only using first
-/// NUM_COMPARE_INFO_ENTRIES of array, so array address rolls over at correct value
-/// @param[out] o_data vector of output data
-/// @return FAPI2_RC_SUCCSS iff ok
-/// @note The number of entries in the array depends on i_roll_over_for_compare_mode parameter:
-/// (NUM_COMPARE_LOG_ENTRIES for false, NUM_COMPARE_INFO_ENTRIES for true) but user may read more than
-/// that since reads work in a circular buffer fashion
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode read_rmw_array(const fapi2::Target<T>& i_target,
- const uint64_t i_start_addr,
- const uint64_t i_num_entries,
- const bool i_roll_over_for_compare_mode,
- std::vector< fapi2::buffer<uint64_t> >& o_data)
-{
- std::vector< fapi2::buffer<uint64_t> > l_temp;
- return read_rmw_array(i_target, i_start_addr, i_num_entries, i_roll_over_for_compare_mode, o_data, l_temp);
-}
-
-///
-/// @brief Read entries from MCBIST Read Buffer (RB) array
-/// @tparam T, the fapi2::TargetType
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start_addr the array address to read first
-/// @param[in] i_num_entries the number of array entries to read
-/// @param[out] o_data vector of output data
-/// @param[out] o_ecc_data vector of ecc data
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode read_rb_array(const fapi2::Target<T>& i_target,
- const uint64_t i_start_addr,
- const uint64_t i_num_entries,
- std::vector< fapi2::buffer<uint64_t> >& o_data,
- std::vector< fapi2::buffer<uint64_t> >& o_ecc_data);
-
-///
-/// @brief Read entries from MCBIST Read Buffer (RB) array
-/// Overload for the case where o_ecc_data is not needed
-/// @tparam T, the fapi2::TargetType
-/// @tparam TT, the mcbistTraits associated with T - derived
-/// @param[in] i_target the target to effect
-/// @param[in] i_start_addr the array address to read first
-/// @param[in] i_num_entries the number of array entries to read
-/// @param[out] o_data vector of output data
-/// @return FAPI2_RC_SUCCSS iff ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-fapi2::ReturnCode read_rb_array(const fapi2::Target<T>& i_target,
- const uint64_t i_start_addr,
- const uint64_t i_num_entries,
- std::vector< fapi2::buffer<uint64_t> >& o_data)
-{
- std::vector< fapi2::buffer<uint64_t> > l_temp;
- return read_rb_array(i_target, i_start_addr, i_num_entries, o_data, l_temp);
-}
-
-///
+////
/// @brief Checks if broadcast mode is capable of being enabled on this target
/// @param[in] i_target the target to effect
/// @param[in] i_bc_force attribute's value to force off broadcast mode
@@ -3206,20 +77,23 @@ const mss::states is_broadcast_capable_helper(const fapi2::Target<fapi2::TARGET_
///
/// @brief Checks if broadcast mode is capable of being enabled on this target
+/// @tparam MC the mc type of the T
/// @tparam T, the fapi2::TargetType
/// @param[in] i_target the target to effect
/// @return o_capable - yes iff these vector of targets are broadcast capable
///
-template< fapi2::TargetType T >
+template< mss::mc_type MC = DEFAULT_MC_TYPE, fapi2::TargetType T >
const mss::states is_broadcast_capable(const fapi2::Target<T>& i_target);
+
///
/// @brief Checks if broadcast mode is capable of being enabled on this vector of targets
+/// @tparam MC the mc type of the T
/// @tparam T, the fapi2::TargetType
/// @param[in] i_targets the vector of targets to analyze
/// @return o_capable - yes iff these vector of targets are broadcast capable
///
-template< fapi2::TargetType T >
+template< mss::mc_type MC = DEFAULT_MC_TYPE, fapi2::TargetType T >
const mss::states is_broadcast_capable(const std::vector<fapi2::Target<T>>& i_targets);
///
@@ -3227,191 +101,55 @@ const mss::states is_broadcast_capable(const std::vector<fapi2::Target<T>>& i_ta
/// @param[in] i_target the target to effect
/// @return o_capable - yes iff these vector of targets are broadcast capable
///
-const mss::states is_broadcast_capable(const std::vector<mss::dimm::kind>& i_kinds);
+const mss::states is_broadcast_capable(const std::vector<mss::dimm::kind<>>& i_kinds);
+
///
/// @brief Configures all of the ports for broadcast mode
+/// @tparam MC the mc type of the T
/// @tparam T, the fapi2::TargetType
/// @param[in] i_target the target to effect
/// @param[out] o_port_select - the configuration of the selected ports
/// @return FAPI2_RC_SUCCSS iff ok
///
-template< fapi2::TargetType T >
+template< mss::mc_type MC = DEFAULT_MC_TYPE, fapi2::TargetType T >
fapi2::ReturnCode setup_broadcast_port_select(const fapi2::Target<T>& i_target, uint64_t& o_port_select);
///
/// @brief Enables broadcast mode
+/// @tparam MC the mc type of the T
/// @tparam T, the fapi2::TargetType
/// @param[in] i_target the target to effect
/// @param[in,out] io_program the mcbist::program
/// @return FAPI2_RC_SUCCSS iff ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode enable_broadcast_mode(const fapi2::Target<T>& i_target, mcbist::program<T>& io_program);
+template< mss::mc_type MC = DEFAULT_MC_TYPE, fapi2::TargetType T >
+fapi2::ReturnCode enable_broadcast_mode(const fapi2::Target<T>& i_target, mcbist::program<>& io_program);
///
-/// @brief Configures broadcast mode, if it is needed
-/// @tparam T, the fapi2::TargetType
+/// @brief Load MCBIST ECC (and?) spare data pattern given a pattern - explorer specialization
/// @param[in] i_target the target to effect
-/// @param[in,out] io_program the mcbist::program
+/// @param[in] i_pattern an mcbist::patterns
+/// @param[in] i_invert whether to invert the pattern or not
+/// @note this overload disappears when we have real patterns.
/// @return FAPI2_RC_SUCCSS iff ok
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode configure_broadcast_mode(const fapi2::Target<T>& i_target, mcbist::program<T>& io_program)
-{
- // If we're not capable to do broadcast mode on this target, exit out
- const auto l_broadcast_capable = is_broadcast_capable(i_target);
-
- if(l_broadcast_capable == mss::states::NO)
- {
- FAPI_INF("%s is not broadcast capable, skipping enablement of broadcast mode", mss::c_str(i_target));
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- // Enable broadcast mode
- FAPI_INF("%s is broadcast capable, enabling broadcast mode", mss::c_str(i_target));
- return enable_broadcast_mode(i_target, io_program);
-}
-
-} // mcbist namespace
-
-///
-/// @brief Reads the contents of the MCBISTFIRMASK
-/// @tparam T fapi2 Target Type - derived
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in] i_target the target on which to operate
-/// @param[out] o_data the register data
-/// @return fapi2::fapi2_rc_success if ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode read_mcbfirmask( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
+template< >
+inline fapi2::ReturnCode load_eccspare_pattern<mss::mc_type::NIMBUS>(
+ const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const pattern& i_pattern,
+ const bool i_invert )
{
- o_data = 0;
+ // First up assemble the pattern
+ const auto l_pattern = generate_eccspare_pattern(i_pattern, i_invert);
- FAPI_TRY( mss::getScom(i_target, TT::MCBFIRMASK_REG, o_data ), "%s failed to read MCBISTFIRMASK regiser",
- mss::c_str(i_target));
- FAPI_DBG("%s MCBISTFIRMASK has data 0x%016lx", mss::c_str(i_target), o_data);
+ FAPI_TRY(fapi2::putScom(i_target, MCBIST_MCBFDQ, l_pattern));
fapi_try_exit:
return fapi2::current_err;
}
+} // namespace MCBIST
-///
-/// @brief Writes the contents of the MCBISTFIRMASK
-/// @tparam T fapi2 Target Type - derived
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in] i_target the target on which to operate
-/// @param[in] i_data the register data
-/// @return fapi2::fapi2_rc_success if ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode write_mcbfirmask( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- FAPI_TRY( mss::putScom(i_target, TT::MCBFIRMASK_REG, i_data ), "%s failed to write MCBISTFIRMASK regiser",
- mss::c_str(i_target));
- FAPI_DBG("%s MCBISTFIRMASK has data 0x%016lx", mss::c_str(i_target), i_data);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Reads the contents of the MCBISTFIRQ
-/// @tparam T fapi2 Target Type - derived
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in] i_target the target on which to operate
-/// @param[out] o_data the register data
-/// @return fapi2::fapi2_rc_success if ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode read_mcbfirq( const fapi2::Target<T>& i_target, fapi2::buffer<uint64_t>& o_data )
-{
- o_data = 0;
-
- FAPI_TRY( mss::getScom(i_target, TT::MCBFIRQ_REG, o_data ), "%s failed to read MCBISTFIRQ regiser",
- mss::c_str(i_target));
- FAPI_DBG("%s MCBISTFIRQ has data 0x%016lx", mss::c_str(i_target), o_data);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Writes the contents of the MCBISTFIRQ
-/// @tparam T fapi2 Target Type - derived
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in] i_target the target on which to operate
-/// @param[in] i_data the register data
-/// @return fapi2::fapi2_rc_success if ok
-///
-template< fapi2::TargetType T, typename TT = mcbistTraits<T> >
-inline fapi2::ReturnCode write_mcbfirq( const fapi2::Target<T>& i_target, const fapi2::buffer<uint64_t>& i_data )
-{
- FAPI_TRY( mss::putScom(i_target, TT::MCBFIRQ_REG, i_data ), "%s failed to write MCBISTFIRQ regiser",
- mss::c_str(i_target));
- FAPI_DBG("%s MCBISTFIRQ has data 0x%016lx", mss::c_str(i_target), i_data);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Sets the mask for program complete
-/// @tparam T fapi2 Target Type - defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in,out] io_data the value of the register
-/// @param[in] i_state the state to write into the enable
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = mcbistTraits<T> >
-inline void set_mcbist_program_complete_mask( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::MCB_PROGRAM_COMPLETE_MASK>(i_state == mss::states::ON);
- FAPI_DBG("set_mcbist_program_complete_mask to %d 0x%016lx", i_state, io_data);
-}
-
-///
-/// @brief Sets the mask for WAT debug ATTN
-/// @tparam T fapi2 Target Type - defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in,out] io_data the value of the register
-/// @param[in] i_state the state to write into the enable
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = mcbistTraits<T> >
-inline void set_mcbist_wat_debug_attn_mask( fapi2::buffer<uint64_t>& io_data, const mss::states i_state )
-{
- io_data.writeBit<TT::MCB_WAT_DEBUG_ATTN_MASK>(i_state == mss::states::ON);
- FAPI_DBG("set_mcbist_wat_debug_attn_mask to %d 0x%016lx", i_state, io_data);
-}
-
-///
-/// @brief Clears the program complete and WAT debug ATTN
-/// @tparam T fapi2 Target Type - defaults to TARGET_TYPE_MCBIST
-/// @tparam TT traits type defaults to mcbistTraits<T>
-/// @param[in,out] io_data the value of the register
-/// @param[in] i_state the state to write into the enable
-///
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = mcbistTraits<T> >
-inline void clear_mcbist_program_complete( fapi2::buffer<uint64_t>& io_data )
-{
- io_data.writeBit<TT::MCB_PROGRAM_COMPLETE>(mss::states::OFF);
- io_data.writeBit<TT::MCB_WAT_DEBUG_ATTN>(mss::states::OFF);
- FAPI_DBG("clear_mcbist_program_complete to %d 0x%016lx", mss::states::OFF, io_data);
-}
-
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = mcbistTraits<T> >
-inline void get_mcbist_program_complete_mask( const fapi2::buffer<uint64_t> i_data, mss::states& o_state )
-{
- o_state = i_data.getBit<TT::MCB_PROGRAM_COMPLETE>() ? mss::states::HIGH : mss::states::LOW;
- FAPI_DBG("get_mcbist_program_complete_mask %d", o_state);
-}
-
-template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCBIST, typename TT = mcbistTraits<T> >
-inline void get_mcbist_wat_debug_attn_mask( const fapi2::buffer<uint64_t> i_data, mss::states& o_state )
-{
- o_state = i_data.getBit<TT::MCB_WAT_DEBUG_ATTN>() ? mss::states::HIGH : mss::states::LOW;
- FAPI_DBG("mcbist_wat_debug_attn_mask %d", o_state);
-}
-
-} // mss namespace
+} // namespace mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist_traits.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist_traits.H
index 6936f7aff..7d9d3ab2c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist_traits.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist_traits.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2019 */
+/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -22,3 +22,645 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
+///
+/// @file mcbist_traits.H
+/// @brief Run and manage the MCBIST engine
+///
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#ifndef _MSS_MCBIST_TRAITS_H_
+#define _MSS_MCBIST_TRAITS_H_
+
+#include <fapi2.H>
+
+#include <lib/shared/mss_const.H>
+#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_traits.H>
+#include <p9_mc_scom_addresses.H>
+#include <p9_mc_scom_addresses_fld.H>
+
+namespace mss
+{
+
+///
+/// @class mcbistMCTraits
+/// @brief A MC to MC_TARGET_TYPE mapping
+///
+template<>
+class mcbistMCTraits<mss::mc_type::NIMBUS>
+{
+ public:
+ static constexpr fapi2::TargetType MC_TARGET_TYPE = fapi2::TARGET_TYPE_MCBIST;
+ static constexpr fapi2::TargetType FWMS_ADDR_TARGET_TYPE = fapi2::TARGET_TYPE_MCA;
+
+ ///
+ /// @brief Returns an error for memdiags compare error in last pattern
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_COMPARE_ERROR_IN_LAST_PATTERN memdiags_compare_error_in_last_pattern()
+ {
+ return fapi2::MSS_MEMDIAGS_COMPARE_ERROR_IN_LAST_PATTERN();
+ }
+
+ ///
+ /// @brief Returns an error for memdiags error in last pattern
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_ERROR_IN_LAST_PATTERN memdiags_error_in_last_pattern()
+ {
+ return fapi2::MSS_MEMDIAGS_ERROR_IN_LAST_PATTERN();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags failed to start
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_MCBIST_FAILED_TO_START memdiags_failed_to_start()
+ {
+ return fapi2::MSS_MEMDIAGS_MCBIST_FAILED_TO_START();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags failed to stop
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_MCBIST_FAILED_TO_STOP memdiags_failed_to_stop()
+ {
+ return fapi2::MSS_MEMDIAGS_MCBIST_FAILED_TO_STOP();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags has a non-functional port
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_PORT_NOT_FUNCTIONAL memdiags_port_not_functional()
+ {
+ return fapi2::MSS_MEMDIAGS_PORT_NOT_FUNCTIONAL();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags super fast init failed to init
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_SUPERFAST_INIT_FAILED_TO_INIT memdiags_sf_init_failed_init()
+ {
+ return fapi2::MSS_MEMDIAGS_SUPERFAST_INIT_FAILED_TO_INIT();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags super fast read failed to init
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_SUPERFAST_READ_FAILED_TO_INIT memdiags_sf_read_failed_init()
+ {
+ return fapi2::MSS_MEMDIAGS_SUPERFAST_READ_FAILED_TO_INIT();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags continuous scrub failed to init
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_CONTINUOUS_SCRUB_FAILED_TO_INIT memdiags_continuous_scrub_failed_init()
+ {
+ return fapi2::MSS_MEMDIAGS_CONTINUOUS_SCRUB_FAILED_TO_INIT();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags targeted scrub failed to init
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_TARGETED_SCRUB_FAILED_TO_INIT memdiags_targeted_scrub_failed_init()
+ {
+ return fapi2::MSS_MEMDIAGS_TARGETED_SCRUB_FAILED_TO_INIT();
+ }
+
+ ///
+ /// @brief Returns an error if memdiags is already at a boundary
+ /// @return memdiags error
+ ///
+ static fapi2::MSS_MEMDIAGS_ALREADY_AT_BOUNDARY memdiags_already_at_boundary()
+ {
+ return fapi2::MSS_MEMDIAGS_ALREADY_AT_BOUNDARY();
+ }
+
+ ///
+ /// @brief Returns an error if MCBIST timesout
+ /// @return MCBIST error
+ ///
+ static fapi2::MSS_MCBIST_TIMEOUT mcbist_timeout()
+ {
+ return fapi2::MSS_MCBIST_TIMEOUT();
+ }
+
+ ///
+ /// @brief Returns an error if MCBIST has an unknown failure
+ /// @return MCBIST error
+ ///
+ static fapi2::MSS_MCBIST_UNKNOWN_FAILURE mcbist_unknown_failure()
+ {
+ return fapi2::MSS_MCBIST_UNKNOWN_FAILURE();
+ }
+
+ ///
+ /// @brief Returns an error if MCBIST has a data miscompare
+ /// @return MCBIST error
+ ///
+ static fapi2::MSS_MCBIST_DATA_FAIL mcbist_data_fail()
+ {
+ return fapi2::MSS_MCBIST_DATA_FAIL();
+ }
+};
+
+///
+/// @class mcbistTraits
+/// @brief a collection of traits associated with the Nimbus MCBIST engine or hardware
+///
+template<>
+class mcbistTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCBIST>
+{
+ public:
+
+ // PORT_TYPE used in continuous_scrub_operation
+ static constexpr enum fapi2::TargetType PORT_TYPE = fapi2::TARGET_TYPE_MCA;
+
+ // ATTN support
+ static constexpr mss::states CFG_ENABLE_ATTN_SUPPORT = mss::states::YES;
+ static constexpr mss::states BROADCAST_CAPABLE = mss::states::YES;
+
+ // Multi-ports, dimms
+ static constexpr mss::states MULTI_PORTS = mss::states::YES;
+
+ // Subtest
+ static constexpr size_t SUBTEST_PER_REG = 4;
+ static constexpr size_t SUBTEST_PER_PROGRAM = 32;
+ static constexpr size_t BITS_IN_SUBTEST = 16; // 2 Bytes
+ static constexpr size_t LEFT_SHIFT = (sizeof(uint64_t) * 8) - BITS_IN_SUBTEST;
+
+ // LARGEST_ADDRESS
+ static constexpr uint64_t LARGEST_ADDRESS = ~0 >> mss::mcbist::address::MAGIC_PAD;
+
+ // Length of expected patterns
+ static constexpr uint64_t EXPECTED_PATTERN_SIZE = 4;
+
+ // Size
+ static constexpr size_t PORTS_PER_MCBIST = mss::PORTS_PER_MCBIST;
+ static constexpr size_t MAX_DIMM_PER_PORT = mss::MAX_DIMM_PER_PORT;
+ static constexpr size_t MAX_PRIMARY_RANKS_PER_PORT = mss::MAX_PRIMARY_RANKS_PER_PORT;
+ static constexpr size_t MAX_DQ_BITS = 72;
+ static constexpr size_t MAX_DQ_NIBBLES = MAX_DQ_BITS /
+ BITS_PER_NIBBLE; ///< For ISDIMMs are 18 DQ nibbles for DQ 72 bits
+ static constexpr size_t MAX_DRAMS_X8 = MAX_DQ_BITS / BITS_PER_BYTE; ///< For x8's there are 9 DRAM for 72 bits
+ static constexpr size_t MAX_DRAMS_X4 = MAX_DQ_BITS / BITS_PER_NIBBLE; ///< For x4's there are 18 DRAM for 72 bits
+
+ /// MCBIST "memory registers" - config for subtests.
+ static constexpr uint64_t MCBMR0_REG = MCBIST_MCBMR0Q;
+ static constexpr uint64_t MCBMR1_REG = MCBIST_MCBMR1Q;
+ static constexpr uint64_t MCBMR2_REG = MCBIST_MCBMR2Q;
+ static constexpr uint64_t MCBMR3_REG = MCBIST_MCBMR3Q;
+ static constexpr uint64_t MCBMR4_REG = MCBIST_MCBMR4Q;
+ static constexpr uint64_t MCBMR5_REG = MCBIST_MCBMR5Q;
+ static constexpr uint64_t MCBMR6_REG = MCBIST_MCBMR6Q;
+ static constexpr uint64_t MCBMR7_REG = MCBIST_MCBMR7Q;
+ static constexpr uint64_t CFGQ_REG = MCBIST_MCBCFGQ;
+ static constexpr uint64_t CNTLQ_REG = MCBIST_MCB_CNTLQ;
+ static constexpr uint64_t STATQ_REG = MCBIST_MCB_CNTLSTATQ;
+ static constexpr uint64_t MCBSTATQ_REG = MCBIST_MCBSTATQ;
+ static constexpr uint64_t MCBPARMQ_REG = MCBIST_MCBPARMQ;
+ static constexpr uint64_t MCBAGRAQ_REG = MCBIST_MCBAGRAQ;
+ static constexpr uint64_t SRERR0_REG = MCBIST_MBSEC0Q;
+ static constexpr uint64_t SRERR1_REG = MCBIST_MBSEC1Q;
+ static constexpr uint64_t THRESHOLD_REG = MCBIST_MBSTRQ;
+ static constexpr uint64_t FIRQ_REG = MCBIST_MCBISTFIRQ;
+ static constexpr uint64_t LAST_ADDR_REG = MCBIST_MCBMCATQ;
+
+ static constexpr uint64_t MCBAMR0A0Q_REG = MCBIST_MCBAMR0A0Q;
+ static constexpr uint64_t MCBAMR1A0Q_REG = MCBIST_MCBAMR1A0Q;
+ static constexpr uint64_t MCBAMR2A0Q_REG = MCBIST_MCBAMR2A0Q;
+ static constexpr uint64_t MCBAMR3A0Q_REG = MCBIST_MCBAMR3A0Q;
+ static constexpr uint64_t LFSR_REG = MCBIST_MCBLFSRA0Q;
+ static const std::vector<uint64_t> LFSR_MASK_VALUES;
+
+ // MCBIST FIR registers
+ static constexpr uint64_t MCBFIRMASK_REG = MCBIST_MCBISTFIRMASK;
+ static constexpr uint64_t MCBFIRQ_REG = MCBIST_MCBISTFIRQ;
+
+ // All of the pattern registers are calculated off of this base
+ static constexpr uint64_t PATTERN0_REG = MCBIST_MCBFD0Q;
+ static constexpr uint64_t PATTERN1_REG = MCBIST_MCBFD1Q;
+ static constexpr uint64_t PATTERN2_REG = MCBIST_MCBFD2Q;
+ static constexpr uint64_t PATTERN3_REG = MCBIST_MCBFD3Q;
+ static constexpr uint64_t PATTERN4_REG = MCBIST_MCBFD4Q;
+ static constexpr uint64_t PATTERN5_REG = MCBIST_MCBFD5Q;
+ static constexpr uint64_t PATTERN6_REG = MCBIST_MCBFD6Q;
+ static constexpr uint64_t PATTERN7_REG = MCBIST_MCBFD7Q;
+
+ static constexpr uint64_t DATA_ROTATE_CNFG_REG = MCBIST_MCBDRCRQ;
+ static constexpr uint64_t DATA_ROTATE_SEED_REG = MCBIST_MCBDRSRQ;
+
+ static constexpr uint16_t MAX_ADDRESS_START_END_REGISTERS = 4;
+ static constexpr uint64_t START_ADDRESS_0 = MCBIST_MCBSA0Q;
+ static constexpr uint64_t START_ADDRESS_1 = MCBIST_MCBSA1Q;
+ static constexpr uint64_t START_ADDRESS_2 = MCBIST_MCBSA2Q;
+ static constexpr uint64_t START_ADDRESS_3 = MCBIST_MCBSA3Q;
+
+ static constexpr uint64_t END_ADDRESS_0 = MCBIST_MCBEA0Q;
+ static constexpr uint64_t END_ADDRESS_1 = MCBIST_MCBEA1Q;
+ static constexpr uint64_t END_ADDRESS_2 = MCBIST_MCBEA2Q;
+ static constexpr uint64_t END_ADDRESS_3 = MCBIST_MCBEA3Q;
+
+ static constexpr uint64_t RANDOM_DATA_SEED0 = MCBIST_MCBRDS0Q;
+ static constexpr uint64_t RANDOM_DATA_SEED1 = MCBIST_MCBRDS1Q;
+
+
+ static constexpr uint64_t MBSTRQ_CFG_PAUSE_ON_MPE = MCBIST_MBSTRQ_CFG_PAUSE_ON_MPE;
+
+
+ // MCBIST Compare Masks, used to setup the ECC traps
+ // TK there is one reg per port, does writing to this one write to all?
+ static constexpr uint64_t COMPARE_MASK = MCA_MCBCM;
+
+ static constexpr uint64_t PATTERN_COUNT = 4;
+
+ // Sometimes we want to access the start/end address registers based off
+ // of an index, like master rank. This allows us to do that.
+ static const std::pair<uint64_t, uint64_t> address_pairs[];
+ static constexpr uint64_t ADDRESS_PAIRS = 4;
+
+ // Subtest types that need to be run in FIFO mode
+ static const std::vector< mss::mcbist::op_type > FIFO_MODE_REQUIRED_OP_TYPES;
+
+ // Which bit in the end boundary which siginifies this is a slave rank detect situation
+ static constexpr uint64_t SLAVE_RANK_INDICATED_BIT = 61;
+
+ enum
+ {
+ // The start/end address config registers have common lengths and bits, just including 1 below
+ MCB_ADDR_CONFIG = MCBIST_MCBEA0Q_CFG_END_ADDR_0,
+ MCB_ADDR_CONFIG_LEN = MCBIST_MCBEA0Q_CFG_END_ADDR_0_LEN,
+
+ // Subtest control bits. These are the same in all '16 bit subtest' field
+ COMPL_1ST_CMD = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_1ST_CMD,
+ COMPL_2ND_CMD = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_2ND_CMD,
+ COMPL_3RD_CMD = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_3RD_CMD,
+ ADDR_REV_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_REV_MODE,
+ ADDR_RAND_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_RAND_MODE,
+
+ // Goto subtests use the compl_1st - rand_mode to define the subtest to jump to
+ GOTO_SUBTEST = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_COMPL_1ST_CMD,
+ GOTO_SUBTEST_LEN = 5,
+
+ ECC_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ECC_MODE,
+ DATA_MODE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DATA_MODE,
+ DATA_MODE_LEN = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DATA_MODE_LEN,
+ ADDR_SEL = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_SEL,
+ ADDR_SEL_LEN = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_ADDR_SEL_LEN,
+ OP_TYPE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_OP_TYPE,
+ OP_TYPE_LEN = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_OP_TYPE_LEN,
+ DONE = MCBIST_MCBMR0Q_MCBIST_CFG_TEST00_DONE,
+
+ SYNC_EN = MCBIST_MCBCFGQ_BROADCAST_SYNC_EN,
+ SYNC_WAIT = MCBIST_MCBCFGQ_BROADCAST_SYNC_WAIT,
+ SYNC_WAIT_LEN = MCBIST_MCBCFGQ_BROADCAST_SYNC_WAIT_LEN,
+
+ PORT_SEL = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL,
+ PORT_SEL_LEN = MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL_LEN,
+
+ MCBIST_START = MCBIST_MCB_CNTLQ_START,
+ MCBIST_STOP = MCBIST_MCB_CNTLQ_STOP,
+ MCBIST_RESUME = MCBIST_MCB_CNTLQ_RESUME_FROM_PAUSE,
+ MCBIST_RESET_ERRORS = MCBIST_MCB_CNTLQ_RESET_ERROR_LOGS,
+
+ MCBIST_IN_PROGRESS = MCBIST_MCB_CNTLSTATQ_IP,
+ MCBIST_DONE = MCBIST_MCB_CNTLSTATQ_DONE,
+ MCBIST_FAIL = MCBIST_MCB_CNTLSTATQ_FAIL,
+
+ MIN_CMD_GAP = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP,
+ MIN_CMD_GAP_LEN = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP_LEN,
+ MIN_GAP_TIMEBASE = MCBIST_MCBPARMQ_CFG_MIN_GAP_TIMEBASE,
+ MIN_CMD_GAP_BLIND_STEER = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP_BLIND_STEER,
+ MIN_CMD_GAP_BLIND_STEER_LEN = MCBIST_MCBPARMQ_CFG_MIN_CMD_GAP_BLIND_STEER_LEN,
+ MIN_GAP_TIMEBASE_BLIND_STEER = MCBIST_MCBPARMQ_CFG_MIN_GAP_TIMEBASE_BLIND_STEER,
+ RANDCMD_WGT = MCBIST_MCBPARMQ_CFG_RANDCMD_WGT,
+ RANDCMD_WGT_LEN = MCBIST_MCBPARMQ_CFG_RANDCMD_WGT_LEN,
+ CLOCK_MONITOR_EN = MCBIST_MCBPARMQ_CFG_CLOCK_MONITOR_EN,
+ EN_RANDCMD_GAP = MCBIST_MCBPARMQ_CFG_EN_RANDCMD_GAP,
+ RANDGAP_WGT = MCBIST_MCBPARMQ_CFG_RANDGAP_WGT,
+ RANDGAP_WGT_LEN = MCBIST_MCBPARMQ_CFG_RANDGAP_WGT_LEN,
+ BC4_EN = MCBIST_MCBPARMQ_CFG_BC4_EN,
+
+ FIXED_WIDTH = MCBIST_MCBAGRAQ_CFG_FIXED_WIDTH,
+ FIXED_WIDTH_LEN = MCBIST_MCBAGRAQ_CFG_FIXED_WIDTH_LEN,
+ ADDR_COUNTER_MODE = MCBIST_MCBAGRAQ_CFG_ADDR_COUNTER_MODE,
+ ADDR_COUNTER_MODE_LEN = MCBIST_MCBAGRAQ_CFG_ADDR_COUNTER_MODE_LEN,
+ MAINT_ADDR_MODE_EN = MCBIST_MCBAGRAQ_CFG_MAINT_ADDR_MODE_EN,
+ MAINT_BROADCAST_MODE_EN = MCBIST_MCBAGRAQ_CFG_MAINT_BROADCAST_MODE_EN,
+ MAINT_DETECT_SRANK_BOUNDARIES = MCBIST_MCBAGRAQ_CFG_MAINT_DETECT_SRANK_BOUNDARIES,
+
+ CFG_CMD_TIMEOUT_MODE = MCBIST_MCBCFGQ_CFG_CMD_TIMEOUT_MODE,
+ CFG_CMD_TIMEOUT_MODE_LEN = MCBIST_MCBCFGQ_CFG_CMD_TIMEOUT_MODE_LEN,
+ RESET_KEEPER = MCBIST_MCBCFGQ_RESET_KEEPER,
+ CFG_CURRENT_ADDR_TRAP_UPDATE_DIS = MCBIST_MCBCFGQ_CFG_CURRENT_ADDR_TRAP_UPDATE_DIS,
+ CFG_CCS_RETRY_DIS = MCBIST_MCBCFGQ_CFG_CCS_RETRY_DIS,
+ CFG_RESET_CNTS_START_OF_RANK = MCBIST_MCBCFGQ_CFG_RESET_CNTS_START_OF_RANK,
+ CFG_LOG_COUNTS_IN_TRACE = MCBIST_MCBCFGQ_CFG_LOG_COUNTS_IN_TRACE,
+ SKIP_INVALID_ADDR_DIMM_DIS = MCBIST_MCBCFGQ_SKIP_INVALID_ADDR_DIMM_DIS,
+ REFRESH_ONLY_SUBTEST_EN = MCBIST_MCBCFGQ_REFRESH_ONLY_SUBTEST_EN,
+ REFRESH_ONLY_SUBTEST_TIMEBASE_SEL = MCBIST_MCBCFGQ_REFRESH_ONLY_SUBTEST_TIMEBASE_SEL,
+ REFRESH_ONLY_SUBTEST_TIMEBASE_SEL_LEN = MCBIST_MCBCFGQ_REFRESH_ONLY_SUBTEST_TIMEBASE_SEL_LEN,
+ RAND_ADDR_ALL_ADDR_MODE_EN = MCBIST_MCBCFGQ_RAND_ADDR_ALL_ADDR_MODE_EN,
+ MCBIST_CFG_REF_WAIT_TIME = MCBIST_MCBCFGQ_MCBIST_CFG_REF_WAIT_TIME,
+ MCBIST_CFG_REF_WAIT_TIME_LEN = MCBIST_MCBCFGQ_MCBIST_CFG_REF_WAIT_TIME_LEN,
+ CFG_MCB_LEN64 = MCBIST_MCBCFGQ_CFG_MCB_LEN64,
+ CFG_PAUSE_ON_ERROR_MODE = MCBIST_MCBCFGQ_CFG_PAUSE_ON_ERROR_MODE,
+ CFG_PAUSE_ON_ERROR_MODE_LEN = MCBIST_MCBCFGQ_CFG_PAUSE_ON_ERROR_MODE_LEN,
+ MCBIST_CFG_PAUSE_AFTER_CCS_SUBTEST = MCBIST_MCBCFGQ_MCBIST_CFG_PAUSE_AFTER_CCS_SUBTEST,
+ MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR = MCBIST_MCBCFGQ_MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR,
+ MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST = MCBIST_MCBCFGQ_MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST,
+ CFG_ENABLE_SPEC_ATTN = MCBIST_MCBCFGQ_CFG_ENABLE_SPEC_ATTN,
+ CFG_ENABLE_HOST_ATTN = MCBIST_MCBCFGQ_CFG_ENABLE_HOST_ATTN,
+ MCBIST_CFG_PAUSE_AFTER_RANK = MCBIST_MCBCFGQ_CFG_MCBIST_CFG_FORCE_PAUSE_AFTER_RANK,
+
+ LOGGED_ERROR_ON_PORT_INDICATOR = MCBIST_MCBSTATQ_MCBIST_LOGGED_ERROR_ON_PORT_INDICATOR,
+ LOGGED_ERROR_ON_PORT_INDICATOR_LEN = MCBIST_MCBSTATQ_MCBIST_LOGGED_ERROR_ON_PORT_INDICATOR_LEN,
+ SUBTEST_NUM_INDICATOR = MCBIST_MCBSTATQ_MCBIST_SUBTEST_NUM_INDICATOR,
+ SUBTEST_NUM_INDICATOR_LEN = MCBIST_MCBSTATQ_MCBIST_SUBTEST_NUM_INDICATOR_LEN,
+
+ UE_COUNT = MCBIST_MBSEC1Q_UE_COUNT,
+ UE_COUNT_LEN = MCBIST_MBSEC1Q_UE_COUNT_LEN,
+
+ MBSTRQ_CFG_MAINT_RCE_WITH_CE = MCBIST_MBSTRQ_CFG_MAINT_RCE_WITH_CE,
+
+ CFG_AMAP_DIMM_SELECT = MCBIST_MCBAMR0A0Q_CFG_AMAP_DIMM_SELECT,
+ CFG_AMAP_DIMM_SELECT_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_DIMM_SELECT_LEN,
+ CFG_AMAP_MRANK0 = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK0,
+ CFG_AMAP_MRANK0_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK0_LEN,
+ CFG_AMAP_MRANK1 = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK1,
+ CFG_AMAP_MRANK1_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_MRANK1_LEN,
+ CFG_AMAP_SRANK0 = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK0,
+ CFG_AMAP_SRANK0_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK0_LEN,
+ CFG_AMAP_SRANK1 = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK1,
+ CFG_AMAP_SRANK1_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK1_LEN,
+ CFG_AMAP_SRANK2 = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK2,
+ CFG_AMAP_SRANK2_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_SRANK2_LEN,
+ CFG_AMAP_BANK2 = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK2,
+ CFG_AMAP_BANK2_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK2_LEN ,
+ CFG_AMAP_BANK1 = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK1,
+ CFG_AMAP_BANK1_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK1_LEN ,
+ CFG_AMAP_BANK0 = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK0,
+ CFG_AMAP_BANK0_LEN = MCBIST_MCBAMR0A0Q_CFG_AMAP_BANK0_LEN ,
+
+ CFG_AMAP_BANK_GROUP1 = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP1,
+ CFG_AMAP_BANK_GROUP1_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP1_LEN ,
+ CFG_AMAP_BANK_GROUP0 = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP0,
+ CFG_AMAP_BANK_GROUP0_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_BANK_GROUP0_LEN ,
+ CFG_AMAP_ROW17 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW17,
+ CFG_AMAP_ROW17_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW17_LEN,
+ CFG_AMAP_ROW16 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW16,
+ CFG_AMAP_ROW16_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW16_LEN,
+ CFG_AMAP_ROW15 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW15,
+ CFG_AMAP_ROW15_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW15_LEN,
+ CFG_AMAP_ROW14 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW14,
+ CFG_AMAP_ROW14_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW14_LEN,
+ CFG_AMAP_ROW13 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW13,
+ CFG_AMAP_ROW13_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW13_LEN,
+ CFG_AMAP_ROW12 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW12,
+ CFG_AMAP_ROW12_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW12_LEN,
+ CFG_AMAP_ROW11 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW11,
+ CFG_AMAP_ROW11_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW11_LEN,
+ CFG_AMAP_ROW10 = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW10,
+ CFG_AMAP_ROW10_LEN = MCBIST_MCBAMR1A0Q_CFG_AMAP_ROW10_LEN,
+
+ CFG_AMAP_ROW9 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW9,
+ CFG_AMAP_ROW9_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW9_LEN,
+ CFG_AMAP_ROW8 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW8,
+ CFG_AMAP_ROW8_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW8_LEN,
+ CFG_AMAP_ROW7 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW7,
+ CFG_AMAP_ROW7_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW7_LEN,
+ CFG_AMAP_ROW6 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW6,
+ CFG_AMAP_ROW6_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW6_LEN,
+ CFG_AMAP_ROW5 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW5,
+ CFG_AMAP_ROW5_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW5_LEN,
+ CFG_AMAP_ROW4 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW4,
+ CFG_AMAP_ROW4_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW4_LEN,
+ CFG_AMAP_ROW3 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW3,
+ CFG_AMAP_ROW3_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW3_LEN,
+ CFG_AMAP_ROW2 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW2,
+ CFG_AMAP_ROW2_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW2_LEN,
+ CFG_AMAP_ROW1 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW1,
+ CFG_AMAP_ROW1_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW1_LEN,
+ CFG_AMAP_ROW0 = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW0,
+ CFG_AMAP_ROW0_LEN = MCBIST_MCBAMR2A0Q_CFG_AMAP_ROW0_LEN,
+
+ CFG_AMAP_COL9 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL9,
+ CFG_AMAP_COL9_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL9_LEN,
+ CFG_AMAP_COL8 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL8,
+ CFG_AMAP_COL8_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL8_LEN,
+ CFG_AMAP_COL7 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL7,
+ CFG_AMAP_COL7_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL7_LEN,
+ CFG_AMAP_COL6 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL6,
+ CFG_AMAP_COL6_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL6_LEN,
+ CFG_AMAP_COL5 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL5,
+ CFG_AMAP_COL5_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL5_LEN,
+ CFG_AMAP_COL4 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL4,
+ CFG_AMAP_COL4_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL4_LEN,
+ CFG_AMAP_COL3 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL3,
+ CFG_AMAP_COL3_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL3_LEN,
+ CFG_AMAP_COL2 = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL2,
+ CFG_AMAP_COL2_LEN = MCBIST_MCBAMR3A0Q_CFG_AMAP_COL2_LEN,
+
+ LFSR_MASK = MCBIST_MCBLFSRA0Q_CFG_LFSR_MASK_A0,
+ LFSR_MASK_LEN = MCBIST_MCBLFSRA0Q_CFG_LFSR_MASK_A0_LEN,
+
+ CFG_DATA_ROT_SEED1 = MCBIST_MCBDRSRQ_CFG_DATA_ROT_SEED,
+ CFG_DATA_ROT_SEED1_LEN = MCBIST_MCBDRSRQ_CFG_DATA_ROT_SEED_LEN,
+ CFG_DATA_ROT = MCBIST_MCBDRCRQ_CFG_DATA_ROT,
+ CFG_DATA_ROT_LEN = MCBIST_MCBDRCRQ_CFG_DATA_ROT_LEN,
+ CFG_DATA_ROT_SEED2 = MCBIST_MCBDRCRQ_CFG_DATA_ROT_SEED,
+ CFG_DATA_ROT_SEED2_LEN = MCBIST_MCBDRCRQ_CFG_DATA_ROT_SEED_LEN,
+ CFG_DATA_SEED_MODE = MCBIST_MCBDRCRQ_CFG_DATA_SEED_MODE,
+ CFG_DATA_SEED_MODE_LEN = MCBIST_MCBDRCRQ_CFG_DATA_SEED_MODE_LEN,
+
+ CFG_TRAP_CE_ENABLE = MCA_MCBCM_MCBIST_TRAP_CE_ENABLE,
+ CFG_TRAP_UE_ENABLE = MCA_MCBCM_MCBIST_TRAP_UE_ENABLE,
+ CFG_TRAP_MPE_ENABLE = MCA_MCBCM_MCBIST_TRAP_MPE_ENABLE,
+
+ CFG_DGEN_RNDD_SEED0 = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED0,
+ CFG_DGEN_RNDD_SEED0_LEN = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED0_LEN,
+ CFG_DGEN_RNDD_SEED1 = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED1,
+ CFG_DGEN_RNDD_SEED1_LEN = MCBIST_MCBRDS0Q_DGEN_RNDD_SEED1_LEN,
+ CFG_DGEN_RNDD_SEED2 = MCBIST_MCBRDS1Q_DGEN_RNDD_SEED2,
+ CFG_DGEN_RNDD_SEED2_LEN = MCBIST_MCBRDS1Q_DGEN_RNDD_SEED2_LEN,
+ CFG_DGEN_RNDD_DATA_MAPPING = MCBIST_MCBRDS1Q_DGEN_RNDD_DATA_MAPPING,
+ CFG_DGEN_RNDD_DATA_MAPPING_LEN = MCBIST_MCBRDS1Q_DGEN_RNDD_DATA_MAPPING_LEN,
+
+ // THRESHOLD control bits
+ MBSTRQ_CFG_THRESH_MAG_NCE_INT = MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_INT,
+ MBSTRQ_CFG_THRESH_MAG_NCE_INT_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_INT_LEN,
+ MBSTRQ_CFG_THRESH_MAG_NCE_SOFT = MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_SOFT,
+ MBSTRQ_CFG_THRESH_MAG_NCE_SOFT_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_SOFT_LEN,
+ MBSTRQ_CFG_THRESH_MAG_NCE_HARD = MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_HARD,
+ MBSTRQ_CFG_THRESH_MAG_NCE_HARD_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_HARD_LEN,
+ MBSTRQ_CFG_THRESH_MAG_RCE = MCBIST_MBSTRQ_CFG_THRESH_MAG_RCE,
+ MBSTRQ_CFG_THRESH_MAG_RCE_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_RCE_LEN,
+ MBSTRQ_CFG_THRESH_MAG_ICE = MCBIST_MBSTRQ_CFG_THRESH_MAG_ICE,
+ MBSTRQ_CFG_THRESH_MAG_ICE_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_ICE_LEN,
+ MBSTRQ_CFG_THRESH_MAG_MCE_INT = MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_INT,
+ MBSTRQ_CFG_THRESH_MAG_MCE_INT_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_INT_LEN,
+ MBSTRQ_CFG_THRESH_MAG_MCE_SOFT = MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_SOFT,
+ MBSTRQ_CFG_THRESH_MAG_MCE_SOFT_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_SOFT_LEN,
+ MBSTRQ_CFG_THRESH_MAG_MCE_HARD = MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_HARD,
+ MBSTRQ_CFG_THRESH_MAG_MCE_HARD_LEN = MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_HARD_LEN,
+ MBSTRQ_CFG_PAUSE_ON_SCE = MCBIST_MBSTRQ_CFG_PAUSE_ON_SCE,
+ MBSTRQ_CFG_PAUSE_ON_MCE = MCBIST_MBSTRQ_CFG_PAUSE_ON_MCE,
+ MBSTRQ_CFG_PAUSE_ON_UE = MCBIST_MBSTRQ_CFG_PAUSE_ON_UE,
+ MBSTRQ_CFG_PAUSE_ON_SUE = MCBIST_MBSTRQ_CFG_PAUSE_ON_SUE,
+ MBSTRQ_CFG_PAUSE_ON_AUE = MCBIST_MBSTRQ_CFG_PAUSE_ON_AUE,
+ MBSTRQ_CFG_PAUSE_ON_RCD = MCBIST_MBSTRQ_CFG_PAUSE_ON_RCD,
+ MBSTRQ_CFG_SYMBOL_COUNTER_MODE = MCBIST_MBSTRQ_CFG_SYMBOL_COUNTER_MODE,
+ MBSTRQ_CFG_SYMBOL_COUNTER_MODE_LEN = MCBIST_MBSTRQ_CFG_SYMBOL_COUNTER_MODE_LEN,
+ MBSTRQ_CFG_NCE_SOFT_SYMBOL_COUNT_ENABLE = MCBIST_MBSTRQ_CFG_NCE_SOFT_SYMBOL_COUNT_ENABLE,
+ MBSTRQ_CFG_NCE_INTER_SYMBOL_COUNT_ENABLE = MCBIST_MBSTRQ_CFG_NCE_INTER_SYMBOL_COUNT_ENABLE,
+ MBSTRQ_CFG_NCE_HARD_SYMBOL_COUNT_ENABLE = MCBIST_MBSTRQ_CFG_NCE_HARD_SYMBOL_COUNT_ENABLE,
+ MBSTRQ_CFG_PAUSE_MCB_ERROR = MCBIST_MBSTRQ_CFG_PAUSE_MCB_ERROR,
+ MBSTRQ_CFG_PAUSE_MCB_LOG_FULL = MCBIST_MBSTRQ_CFG_PAUSE_MCB_LOG_FULL,
+ MBSTRQ_CFG_MCE_SOFT_SYMBOL_COUNT_ENABLE = MCBIST_MBSTRQ_CFG_MCE_SOFT_SYMBOL_COUNT_ENABLE,
+ MBSTRQ_CFG_MCE_INTER_SYMBOL_COUNT_ENABLE = MCBIST_MBSTRQ_CFG_MCE_INTER_SYMBOL_COUNT_ENABLE,
+ MBSTRQ_CFG_MCE_HARD_SYMBOL_COUNT_ENABLE = MCBIST_MBSTRQ_CFG_MCE_HARD_SYMBOL_COUNT_ENABLE,
+
+ // Bit mapping for MCBIST error log control data (address+ in Nimbus doc)
+ ERROR_LOG_SUBTEST = 0,
+ ERROR_LOG_SUBTEST_LEN = 5,
+ ERROR_LOG_SUBCMD = 5,
+ ERROR_LOG_SUBCMD_LEN = 2,
+ ERROR_LOG_ADDR_DIMM = 7,
+ ERROR_LOG_ADDR_MRANK = 8,
+ ERROR_LOG_ADDR_MRANK_LEN = 2,
+ ERROR_LOG_ADDR_SRANK = 10,
+ ERROR_LOG_ADDR_SRANK_LEN = 3,
+ ERROR_LOG_ADDR_BANK_GROUP = 13,
+ ERROR_LOG_ADDR_BANK_GROUP_LEN = 2,
+ ERROR_LOG_ADDR_BANK = 15,
+ ERROR_LOG_ADDR_BANK_LEN = 3,
+ ERROR_LOG_ADDR_ROW = 18,
+ ERROR_LOG_ADDR_ROW_LEN = 18,
+ ERROR_LOG_ADDR_COLUMN = 36,
+ ERROR_LOG_ADDR_COLUMN_LEN = 8,
+ ERROR_LOG_BEAT = 44,
+ ERROR_LOG_BEAT_LEN = 2,
+ ERROR_LOG_TYPE = 46,
+ ERROR_LOG_TYPE_LEN = 2,
+
+ //MCBIST FIR mask
+ MCB_PROGRAM_COMPLETE = MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE,
+ MCB_WAT_DEBUG_ATTN = MCBIST_MCBISTFIRQ_WAT_DEBUG_ATTN,
+ MCB_PROGRAM_COMPLETE_MASK = MCB_PROGRAM_COMPLETE,
+ MCB_WAT_DEBUG_ATTN_MASK = MCB_WAT_DEBUG_ATTN,
+ MCB_DATA_ERROR = MCBIST_MCBISTFIRQ_MCBIST_DATA_ERROR,
+
+ //XLT address valid offset
+ XLT0_SLOT1_D_VALID = MCS_PORT13_MCP0XLT0_SLOT1_VALID,
+ XLT0_SLOT0_M1_VALID = MCS_PORT13_MCP0XLT0_SLOT0_M1_VALID,
+ XLT0_SLOT0_M0_VALID = MCS_PORT13_MCP0XLT0_SLOT0_M0_VALID,
+ XLT0_SLOT0_S2_VALID = MCS_PORT13_MCP0XLT0_SLOT0_S2_VALID,
+ XLT0_SLOT0_S1_VALID = MCS_PORT13_MCP0XLT0_SLOT0_S1_VALID,
+ XLT0_SLOT0_S0_VALID = MCS_PORT13_MCP0XLT0_SLOT0_S0_VALID,
+ XLT0_SLOT0_ROW17_VALID = MCS_PORT02_MCP0XLT0_SLOT0_ROW17_VALID,
+ XLT0_SLOT0_ROW16_VALID = MCS_PORT02_MCP0XLT0_SLOT0_ROW16_VALID,
+ XLT0_SLOT0_ROW15_VALID = MCS_PORT02_MCP0XLT0_SLOT0_ROW15_VALID,
+
+ };
+
+
+};
+
+
+///
+/// @class mcbistTraits
+/// @brief a collection of traits associated with the Nimbus MCA
+///
+template<>
+class mcbistTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCA>
+{
+ public:
+ // MCBIST error log related registers
+ static constexpr uint64_t ERROR_LOG_PTR_REG = MCA_ELPR;
+ static constexpr uint64_t RMW_WRT_BUF_CTL_REG = MCA_WREITE_AACR;
+ static constexpr uint64_t RMW_WRT_BUF_DATA_REG = MCA_AADR;
+ static constexpr uint64_t RMW_WRT_BUF_ECC_REG = MCA_AAER;
+
+ // XLT registers
+ static constexpr uint64_t XLTATE0 = MCA_MBA_MCP0XLT0;
+ static constexpr uint64_t XLTATE1 = MCA_MBA_MCP0XLT1;
+ static constexpr uint64_t XLTATE2 = MCA_MBA_MCP0XLT2;
+
+ // Maintenance data location within the array
+ static constexpr uint64_t MAINT_DATA_INDEX_START = 0b111110000;
+ static constexpr uint64_t MAINT_DATA_INDEX_END = 0b111111000;
+
+ enum
+ {
+ // Register field constants
+ ERROR_LOG_PTR = MCA_ELPR_LOG_POINTER,
+ ERROR_LOG_PTR_LEN = MCA_ELPR_LOG_POINTER_LEN,
+ ERROR_LOG_FULL = MCA_ELPR_LOG_FULL,
+ RMW_WRT_BUFFER_SEL = MCA_WREITE_AACR_BUFFER,
+ RMW_WRT_ADDRESS = MCA_WREITE_AACR_ADDRESS,
+ RMW_WRT_ADDRESS_LEN = MCA_WREITE_AACR_ADDRESS_LEN,
+ RMW_WRT_AUTOINC = MCA_WREITE_AACR_AUTOINC,
+ RMW_WRT_ECCGEN = MCA_WREITE_AACR_ECCGEN,
+
+ XLTATE_SLOT0_VALID = MCS_PORT02_MCP0XLT0_SLOT0_VALID,
+ XLTATE_SLOT1_VALID = MCS_PORT02_MCP0XLT0_SLOT1_VALID,
+
+ // Constants used for field settings
+ SELECT_RMW_BUFFER = 0,
+ SELECT_WRT_BUFFER = 1,
+
+ // Other constants
+ NUM_COMPARE_LOG_ENTRIES = 64,
+ // In compare mode, there is one "info" entry per 4 data (log) entries
+ // so compare mode only uses 16 info entries total in the rmw array
+ NUM_COMPARE_DATA_PER_INFO_LOG = 4,
+ NUM_COMPARE_INFO_ENTRIES = 16,
+ };
+
+};
+
+
+///
+/// @class mcbistTraits
+/// @brief a collection of traits associated with the Nimbus MCS
+///
+template<>
+class mcbistTraits<mss::mc_type::NIMBUS, fapi2::TARGET_TYPE_MCS>
+{
+ public:
+ // MCBIST error log related registers
+ static constexpr uint64_t RD_BUF_CTL_REG = MCS_PORT02_AACR;
+ static constexpr uint64_t RD_BUF_DATA_REG = MCS_PORT02_AADR;
+ static constexpr uint64_t RD_BUF_ECC_REG = MCS_PORT02_AAER;
+
+ enum
+ {
+ // Register field constants
+ RB_BUFFER_SEL = MCS_PORT02_AACR_BUFFER,
+ RB_ADDRESS = MCS_PORT02_AACR_ADDRESS,
+ RB_ADDRESS_LEN = MCS_PORT02_AACR_ADDRESS_LEN,
+ RB_AUTOINC = MCS_PORT02_AACR_AUTOINC,
+
+ // Other constants
+ NUM_COMPARE_LOG_ENTRIES = 64,
+ };
+
+};
+
+
+} // namespace mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C
index b235637b5..1d4a4940c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2019 */
+/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,26 +33,16 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
-#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
+#include <lib/shared/nimbus_defaults.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
-#include <generic/memory/lib/utils/find_magic.H>
#include <lib/mcbist/memdiags.H>
#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/address.H>
-#include <lib/mcbist/settings.H>
-#include <lib/mcbist/sim.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/utils/poll.H>
-using fapi2::TARGET_TYPE_MCBIST;
-using fapi2::TARGET_TYPE_MCA;
-using fapi2::TARGET_TYPE_DIMM;
-using fapi2::TARGET_TYPE_SYSTEM;
-using fapi2::FAPI2_RC_SUCCESS;
-using fapi2::FAPI2_RC_INVALID_PARAMETER;
namespace mss
{
@@ -61,153 +51,28 @@ namespace memdiags
{
///
-/// @brief Stop the current command
-/// @param[in] i_target the target
+/// @brief Set up memory controller specific settings for pre-maint mode read
+/// @param[in] i_target the memory controller target
/// @return FAPI2_RC_SUCCESS iff ok
+/// @note mc_type::NIMBUS specialization
///
template<>
-fapi2::ReturnCode stop( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
-{
- // Too long, make shorter
- using TT = mss::mcbistTraits<TARGET_TYPE_MCBIST>;
-
- // Poll parameters are defined as TK so that we wait a nice time for operations
- // For now use the defaults
- mss::poll_parameters l_poll_parameters;
- fapi2::buffer<uint64_t> l_status;
- fapi2::buffer<uint64_t> l_last_address;
- bool l_poll_result = false;
-
- FAPI_INF("Stopping any mcbist operations which are in progress for %s", mss::c_str(i_target));
-
- // TODO RTC:153951 Add masking of FIR when stopping
- FAPI_TRY( mss::mcbist::start_stop(i_target, mss::STOP) );
-
- // Poll waiting for the engine to stop
- l_poll_result = mss::poll(i_target, TT::STATQ_REG, l_poll_parameters,
- [&l_status](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
- {
- FAPI_DBG("looking for mcbist not in-progress, mcbist statq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- // We're done polling when either we see we're in progress or we see we're done.
- return l_status.getBit<TT::MCBIST_IN_PROGRESS>() == false;
- });
-
- // Pass or fail output the current address. This is useful for debugging when we can get it.
- // It's in the register FFDC for memdiags so we don't need it below
- FAPI_TRY( mss::getScom(i_target, TT::LAST_ADDR_REG, l_last_address) );
- FAPI_INF("MCBIST last address (during stop): 0x%016lx for %s",
- l_last_address, mss::c_str(i_target));
-
- // So we've either stopped or we timed out
- FAPI_ASSERT( l_poll_result == true,
- fapi2::MSS_MEMDIAGS_MCBIST_FAILED_TO_STOP()
- .set_MCBIST_TARGET(i_target)
- .set_POLL_COUNT(l_poll_parameters.iv_poll_count),
- "%s The MCBIST engine failed to stop its program",
- mss::c_str(i_target) );
-
-fapi_try_exit:
- return fapi2::current_err;
-
-}
-
-///
-/// @brief memdiags init helper
-/// Initializes common sections. Broken out rather than the base class ctor to enable checking return codes
-/// in subclassed constructors more easily.
-/// @return FAPI2_RC_SUCCESS iff everything ok
-///
-template<>
-fapi2::ReturnCode operation<TARGET_TYPE_MCBIST>::base_init()
+fapi2::ReturnCode pre_maint_read_settings<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>&
+ i_target )
{
- FAPI_INF("memdiags base init for %s", mss::c_str(iv_target));
-
- // Check the state of the MCBIST engine to make sure its OK that we proceed.
- // Force stop the engine (per spec, as opposed to waiting our turn)
- FAPI_TRY( memdiags::stop(iv_target) );
-
- // Zero out cmd timebase - mcbist::program constructor does that for us.
- // Load pattern
- FAPI_TRY( iv_program.change_pattern(iv_const.iv_pattern) );
-
- // Load end boundaries
- iv_program.change_end_boundary(iv_const.iv_end_boundary);
-
- // Load thresholds
- iv_program.change_thresholds(iv_const.iv_stop);
-
- // Setup the requested speed
- FAPI_TRY( iv_program.change_speed(iv_target, iv_const.iv_speed) );
-
- // Enable maint addressing mode - enabled by default in the mcbist::program ctor
-
- // Apparently the MCBIST engine needs the ports selected even though the ports are specified
- // in the subtest. We can just select them all, and it adjusts when it executes the subtest
- iv_program.select_ports(0b1111);
-
- // Kick it off, don't wait for a result
- iv_program.change_async(mss::ON);
-
-fapi_try_exit:
- return fapi2::current_err;
+ return fapi2::FAPI2_RC_SUCCESS;
}
///
-/// @brief Single port initializer
-/// Initializes common sections. Broken out rather than the base class ctor to enable checking return codes
-/// in subclassed constructors more easily.
-/// @return FAPI2_RC_SUCCESS iff everything ok
+/// @brief Set up memory controller specific settings for pre-scrub
+/// @param[in] i_target the memory controller target
+/// @return FAPI2_RC_SUCCESS iff ok
+/// @note mc_type::NIMBUS specialization
///
template<>
-fapi2::ReturnCode operation<TARGET_TYPE_MCBIST>::single_port_init()
+fapi2::ReturnCode pre_scrub_settings<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
{
- FAPI_INF("single port init for %s", mss::c_str(iv_target));
-
- const uint64_t l_relative_port_number = iv_const.iv_start_address.get_port();
- const uint64_t l_dimm_number = iv_const.iv_start_address.get_dimm();
-
- // Make sure the specificed port is functional
- FAPI_ASSERT( mss::is_functional<TARGET_TYPE_MCA>(iv_target, l_relative_port_number),
- fapi2::MSS_MEMDIAGS_PORT_NOT_FUNCTIONAL()
- .set_RELATIVE_PORT_POSITION(l_relative_port_number)
- .set_ADDRESS( uint64_t(iv_const.iv_start_address) )
- .set_MCBIST_TARGET(iv_target),
- "Port with relative postion %d is not functional for %s",
- l_relative_port_number, mss::c_str(iv_target));
-
- // No broadcast mode for this one
- // Push on a read subtest
- {
- mss::mcbist::subtest_t<TARGET_TYPE_MCBIST> l_subtest = iv_subtest;
-
- l_subtest.enable_port(l_relative_port_number);
- l_subtest.enable_dimm(l_dimm_number);
- iv_program.iv_subtests.push_back(l_subtest);
- FAPI_INF("%s adding subtest 0x%04x for port %d, DIMM %d",
- mss::c_str(iv_target), l_subtest, l_relative_port_number, l_dimm_number);
- }
-
- // The address should have the port and DIMM noted in it. All we need to do is calculate the
- // remainder of the address
- if (iv_sim)
- {
- iv_const.iv_start_address.get_sim_end_address(iv_const.iv_end_address);
- }
- else if (iv_const.iv_end_address == mss::mcbist::address::LARGEST_ADDRESS)
- {
- // Only the DIMM range as we don't want to cross ports.
- iv_const.iv_start_address.get_range<mss::mcbist::address::DIMM>(iv_const.iv_end_address);
- }
-
- // Configure the address range
- FAPI_TRY( mss::mcbist::config_address_range0(iv_target, iv_const.iv_start_address, iv_const.iv_end_address) );
-
- // Initialize the common sections
- FAPI_TRY( base_init() );
-
-fapi_try_exit:
- return fapi2::current_err;
+ return fapi2::FAPI2_RC_SUCCESS;
}
///
@@ -215,10 +80,12 @@ fapi_try_exit:
/// @return FAPI2_RC_SUCCESS iff ok
///
template<>
-fapi2::ReturnCode operation<TARGET_TYPE_MCBIST>::multi_port_addr()
+fapi2::ReturnCode operation<DEFAULT_MC_TYPE>::multi_port_addr()
{
+ using TT = mcbistTraits<>;
+
mss::mcbist::address l_end_of_start_port;
- mss::mcbist::address l_end_of_complete_port(mss::mcbist::address::LARGEST_ADDRESS);
+ mss::mcbist::address l_end_of_complete_port(TT::LARGEST_ADDRESS);
mss::mcbist::address l_start_of_end_port;
// The last address in the start port is the start address thru the "DIMM range" (all addresses left on this DIMM)
@@ -255,8 +122,8 @@ fapi_try_exit:
/// @param[in] i_dimms a vector of DIMM targets
///
template<>
-void operation<TARGET_TYPE_MCBIST>::configure_multiport_subtests(const
- std::vector<fapi2::Target<fapi2::TARGET_TYPE_DIMM>>& i_dimms)
+void operation<DEFAULT_MC_TYPE>::configure_multiport_subtests(
+ const std::vector<fapi2::Target<fapi2::TARGET_TYPE_DIMM>>& i_dimms)
{
// Constexpr's to beautify the code
constexpr uint64_t FIRST_ADDRESS = 0;
@@ -424,37 +291,21 @@ fapi_try_exit:
}
///
-/// @brief memdiags multi-port init helper
+/// @brief memdiags multi-port init
/// Initializes common sections. Broken out rather than the base class ctor to enable checking return codes
/// in subclassed constructors more easily.
/// @return FAPI2_RC_SUCCESS iff everything ok
///
template<>
-fapi2::ReturnCode operation<TARGET_TYPE_MCBIST>::multi_port_init()
+fapi2::ReturnCode operation<DEFAULT_MC_TYPE>::multi_port_init_internal()
{
- FAPI_INF("multi-port init for %s", mss::c_str(iv_target));
-
- const auto l_mcas = mss::find_targets<fapi2::TARGET_TYPE_MCA>(iv_target);
+ FAPI_INF("multi-port init internal for %s", mss::c_str(iv_target));
- // Make sure we have ports, if we don't then exit out
- if(l_mcas.size() == 0)
- {
- // Cronus can have no ports under an MCBIST, FW deconfigures by association
- FAPI_INF("%s has no attached MCAs skipping setup", mss::c_str(iv_target));
- return fapi2::FAPI2_RC_SUCCESS;
- }
// Let's assume we are going to send out all subtest unless we are in broadcast mode,
// where we only send up to 2 subtests under an MCA ( 1 for each DIMM) which is why no const
auto l_dimms = mss::find_targets<fapi2::TARGET_TYPE_DIMM>(iv_target);
- if( l_dimms.size() == 0)
- {
- // Cronus can have no DIMMS under an MCBIST, FW deconfigures by association
- FAPI_INF("%s has no attached DIMMs skipping setup", mss::c_str(iv_target));
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
// Get the port/DIMM information for the addresses. This is an integral value which allows us to index
// all the DIMM across a controller.
const uint64_t l_portdimm_start_address = iv_const.iv_start_address.get_port_dimm();
@@ -478,7 +329,7 @@ fapi2::ReturnCode operation<TARGET_TYPE_MCBIST>::multi_port_init()
"Start address %d larger than end address %d for %s",
l_portdimm_start_address, l_portdimm_end_address, mss::c_str(iv_target));
- // Determine which ports are functional and whether we can broadcast to them
+// Determine which ports are functional and whether we can broadcast to them
// If we're in broadcast mode, PRD sends DIMM 0/1 of the first functional and configured port,
// and we then run all ports in parallel (ports set in subtest config)
if( mss::mcbist::is_broadcast_capable(iv_target) == mss::YES )
@@ -532,407 +383,7 @@ fapi_try_exit:
return fapi2::current_err;
}
-///
-/// @brief memdiags::continuous_scrub_operation constructor
-/// @param[in] i_target the target of the mcbist engine
-/// @param[in] i_const the contraints of the operation
-/// @param[out] o_rc the fapi2::ReturnCode of the intialization process
-///
-template<>
-continuous_scrub_operation<TARGET_TYPE_MCBIST>::continuous_scrub_operation(
- const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const constraints i_const,
- fapi2::ReturnCode& o_rc ):
- operation<TARGET_TYPE_MCBIST>(i_target, mss::mcbist::scrub_subtest<TARGET_TYPE_MCBIST>(), i_const)
-{
- mss::mcbist::address l_generic_start_address;
- mss::mcbist::address l_generic_end_address;
-
- FAPI_INF("setting up for continuous scrub for %s", mss::c_str(i_target));
-
- // Scrub operations run 128B
- iv_program.change_len64(mss::OFF);
-
- // We build a little program here which allows us to restart the loop in the event of a pause.
- // So we need to craft some of the address ranges and some of the subtests by hand.
-
- // Setup address config 0 to cover all the addresses for a port/dimm.
- // We leverage the MCBIST's ability to skip invalid addresses, and just setup
- // If we're running in the simulator, we want to only touch the addresses which training touched
- // *INDENT-OFF*
- iv_sim ?
- l_generic_start_address.get_sim_end_address(l_generic_end_address) :
- l_generic_start_address.get_range<mss::mcbist::address::DIMM>(l_generic_end_address);
- // *INDENT-ON*
-
- FAPI_TRY( mss::mcbist::config_address_range0(i_target, l_generic_start_address, l_generic_end_address) );
-
- // We push on a fake subtest 0 and subtest 1. We fix them up after we fill in the
- // rest of the subtests.
- iv_program.iv_subtests.push_back(iv_subtest);
- iv_program.iv_subtests.push_back(iv_subtest);
-
- // a generic 0 - DIMM address range.
- //
- // Subtests 2-9: One subtest per port/dimm each covering the whole range of that
- // port/dimm. scrub_subtests by default are using address config 0, so each of
- // these get their full address complement.
- for (const auto& p : iv_target.template getChildren<TARGET_TYPE_MCA>())
- {
- for (const auto& d : p.template getChildren<TARGET_TYPE_DIMM>())
- {
- // Don't destroy the subtest passed in, copy it
- auto l_subtest = iv_subtest;
-
- l_subtest.enable_port(mss::relative_pos<TARGET_TYPE_MCBIST>(p));
- l_subtest.enable_dimm(mss::index(d));
- iv_program.iv_subtests.push_back(l_subtest);
- FAPI_INF("adding scrub subtest for %s (dimm %d) ( 0x%04x)", mss::c_str(d), mss::index(d), l_subtest);
- }
- }
-
- //
- // Subtest 10: goto subtest 2. This causes us to loop back to the first port/dimm and go thru them all
- // This subtest will be marked the last when the MCBMR registers are filled in.
- //
- iv_program.iv_subtests.push_back(mss::mcbist::goto_subtest<TARGET_TYPE_MCBIST>(2));
- FAPI_INF("last goto subtest (10) is going to subtest 2 ( 0x%04x) for %s", iv_program.iv_subtests[2],
- mss::c_str(iv_target));
-
- // Ok, now we can go back in to fill in the first two subtests.
-
- {
- auto l_subtest = iv_subtest;
- auto l_port = iv_const.iv_start_address.get_port();
- auto l_dimm = iv_const.iv_start_address.get_dimm();
- size_t l_index = 2;
-
- // By default if we don't find our port/dimm in the subtests, we just go back to the beginning.
- uint64_t l_goto_subtest = 2;
-
- //
- // subtest 0
- //
-
- // load the start address given and calculate the end address. Stick this into address config 1
- // We don't need to account for the simulator here as the caller can do that when they setup the
- // start address.
- // *INDENT-OFF*
- iv_sim ?
- iv_const.iv_start_address.get_sim_end_address(iv_const.iv_end_address) :
- iv_const.iv_start_address.get_range<mss::mcbist::address::DIMM>(iv_const.iv_end_address);
- // *INDENT-ON*
-
- FAPI_TRY( mss::mcbist::config_address_range1(i_target, iv_const.iv_start_address, iv_const.iv_end_address) );
-
- // We need to use this address range. We know it's ok to write to element 0 as we pushed it on above
- l_subtest.change_addr_sel(1);
- l_subtest.enable_port(l_port);
- l_subtest.enable_dimm(l_dimm);
-
- iv_program.iv_subtests[0] = l_subtest;
- FAPI_INF("adding scrub subtest 0 for port %d dimm %d (0x%04x) for %s", l_port, l_dimm, l_subtest, mss::c_str(i_target));
-
- //
- // subtest 1
- //
-
- // From the port/dimm specified in the start address, we know what subtest should execute next. The idea
- // being that this 0'th subtest is a mechanism to allow the caller to start a scrub 'in the middle' and
- // jump to the next port/dimm which would have been scrubbed. The hard part is that we don't know where
- // in the subtest vector the 'next' port/dimm are placed. So we look for our port/dimm (skipping subtest 0
- // since we know that's us and skipping subtest 1 since it isn't there yet.)
- for (; l_index < iv_program.iv_subtests.size(); ++l_index)
- {
- auto l_my_dimm = iv_program.iv_subtests[l_index].get_dimm();
- auto l_my_port = iv_program.iv_subtests[l_index].get_port();
-
- if ((l_dimm == l_my_dimm) && (l_port == l_my_port))
- {
- l_goto_subtest = l_index + 1;
- break;
- }
- }
-
- // Since we set l_goto_subtest up with a meaningful default, we can just make a subtest with the
- // l_goto_subtest subtest specified and pop that in to index 1.
- FAPI_INF("adding scrub subtest 1 to goto subtest %d (port %d, dimm %d, test 0x%04x) for %s", l_goto_subtest,
- iv_program.iv_subtests[l_goto_subtest].get_port(),
- iv_program.iv_subtests[l_goto_subtest].get_dimm(),
- iv_program.iv_subtests[l_goto_subtest], mss::c_str(i_target) );
-
- iv_program.iv_subtests[1] = mss::mcbist::goto_subtest<TARGET_TYPE_MCBIST>(l_goto_subtest);
- }
-
- // Initialize the common sections
- FAPI_TRY( base_init() );
-
-fapi_try_exit:
- o_rc = fapi2::current_err;
- return;
-}
-
-///
-/// @brief Super Fast Read Init - used to init all memory behind a target with a given pattern
-/// @note Uses broadcast mode if possible
-/// @param[in] i_target the target behind which all memory should be initialized
-/// @param[in] i_pattern an index representing a pattern to use to initize memory (defaults to 0)
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-///
-template<>
-fapi2::ReturnCode sf_init( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const uint64_t i_pattern )
-{
- FAPI_INF("superfast init start for %s", mss::c_str(i_target));
-
- uint8_t l_sim = false;
- FAPI_TRY( mss::is_simulation( l_sim) );
-
- if (l_sim)
- {
- // Use some sort of pattern in sim in case the verification folks need to look for something
- // TK. Need a verification pattern. This is a not-good pattern for verification ... We don't really
- // have a good pattern for verification defined.
- FAPI_INF("running mss sim init in place of sf_init for %s", mss::c_str(i_target));
- return mss::mcbist::sim::sf_init(i_target, i_pattern);
- }
- else
- {
- fapi2::ReturnCode l_rc;
- constraints l_const(i_pattern);
- sf_init_operation<TARGET_TYPE_MCBIST> l_init_op(i_target, l_const, l_rc);
-
- FAPI_ASSERT( l_rc == FAPI2_RC_SUCCESS,
- fapi2::MSS_MEMDIAGS_SUPERFAST_INIT_FAILED_TO_INIT().set_MCBIST_TARGET(i_target),
- "Unable to initialize the MCBIST engine for a sf read %s", mss::c_str(i_target) );
-
- return l_init_op.execute();
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Super Fast Read to End of MCBIST - used to run superfast read on all memory behind the target
-/// @tparam T the fapi2::TargetType of the target
-/// @param[in] i_target the target behind which all memory should be read
-/// @param[in] i_stop stop conditions
-/// @param[in] i_address mcbist::address representing the address from which to start.
-// Defaults to the first address behind the target
-/// @param[in] i_end whether to end, and where
-/// Defaults to stop after slave rank
-/// @param[in] i_end_address mcbist::address representing the address to end.
-// Defaults to mcbist::address::LARGEST_ADDRESS
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-/// @note The address is often the port, dimm, rank but this is not enforced in the API.
-///
-template<>
-fapi2::ReturnCode sf_read( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const stop_conditions& i_stop,
- const mss::mcbist::address& i_address,
- const end_boundary i_end,
- const mss::mcbist::address& i_end_address )
-{
- FAPI_INF("superfast read - start for %s", mss::c_str(i_target));
-
- fapi2::ReturnCode l_rc;
- constraints l_const(i_stop, speed::LUDICROUS, i_end, i_address, i_end_address);
- sf_read_operation<TARGET_TYPE_MCBIST> l_read_op(i_target, l_const, l_rc);
-
- FAPI_ASSERT( l_rc == FAPI2_RC_SUCCESS,
- fapi2::MSS_MEMDIAGS_SUPERFAST_READ_FAILED_TO_INIT().set_MCBIST_TARGET(i_target),
- "Unable to initialize the MCBIST engine for a sf read %s", mss::c_str(i_target) );
-
- return l_read_op.execute();
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-///
-/// @brief Scrub - continuous scrub all memory behind the target
-/// @param[in] i_target the target behind which all memory should be scrubbed
-/// @param[in] i_stop stop conditions
-/// @param[in] i_speed the speed to scrub
-/// @param[in] i_address mcbist::address representing the port, dimm, rank
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @warning The function is asynchronous, and the caller should be looking for a done attention
-/// @note The operation will fail immediately when a stop condition is encountered
-///
-template<>
-fapi2::ReturnCode background_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const stop_conditions& i_stop,
- const speed i_speed,
- const mss::mcbist::address& i_address )
-{
- FAPI_INF("continuous (background) scrub for %s", mss::c_str(i_target));
-
- fapi2::ReturnCode l_rc;
- constraints l_const(i_stop, i_speed, end_boundary::STOP_AFTER_ADDRESS, i_address);
- continuous_scrub_operation<TARGET_TYPE_MCBIST> l_op(i_target, l_const, l_rc);
+} // namespace memdiags
- FAPI_ASSERT( l_rc == FAPI2_RC_SUCCESS,
- fapi2::MSS_MEMDIAGS_CONTINUOUS_SCRUB_FAILED_TO_INIT().set_MCBIST_TARGET(i_target),
- "Unable to initialize the MCBIST engine for a continuous scrub %s", mss::c_str(i_target) );
-
- return l_op.execute();
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Scrub - targeted scrub all memory behind the target
-/// @param[in] i_target the target behind which all memory should be scrubbed
-/// @param[in] i_stop stop conditions
-/// @param[in] i_start_address mcbist::address representing the address from which to start.
-/// @param[in] i_end_address mcbist::address representing the address at which to end.
-/// @param[in] i_end whether to end, and where (defaults to not stop on error)
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-/// @note The caller can use the address range functions to calculate the end address as needed
-///
-template<>
-fapi2::ReturnCode targeted_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const stop_conditions& i_stop,
- const mss::mcbist::address& i_start_address,
- const mss::mcbist::address& i_end_address,
- const end_boundary i_end )
-{
- FAPI_INF("targeted scrub for %s", mss::c_str(i_target));
-
- fapi2::ReturnCode l_rc;
- constraints l_const(i_stop, speed::LUDICROUS, i_end, i_start_address, i_end_address);
- targeted_scrub_operation<TARGET_TYPE_MCBIST> l_op(i_target, l_const, l_rc);
-
- FAPI_ASSERT( l_rc == FAPI2_RC_SUCCESS,
- fapi2::MSS_MEMDIAGS_TARGETED_SCRUB_FAILED_TO_INIT().set_MCBIST_TARGET(i_target),
- "Unable to initialize the MCBIST engine for a targeted scrub %s", mss::c_str(i_target) );
-
- return l_op.execute();
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Continue current command on next address
-/// The current commaand has paused on an error, so we can record the address of the error
-/// and finish the current master or slave rank.
-/// @param[in] i_target the target
-/// @param[in] i_end whether to end, and where (default = don't stop at end of rank)
-/// @param[in] i_stop stop conditions (default - 0 meaning 'don't change conditions')
-/// @param[in] i_speed the speed to scrub (default - SAME_SPEED meaning leave speed untouched)
-/// @return FAPI2_RC_SUCCESS iff ok
-/// @note overloaded as there's no 'invalid' state for thresholds.
-///
-template<>
-fapi2::ReturnCode continue_cmd( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const end_boundary i_end,
- const stop_conditions& i_stop,
- const speed i_speed )
-{
- // Too long, make shorter
- using TT = mss::mcbistTraits<TARGET_TYPE_MCBIST>;
-
- // We can use a local mcbist::program to help with the bit processing, and then write just the registers we touch.
- mss::mcbist::program<TARGET_TYPE_MCBIST> l_program;
- fapi2::buffer<uint64_t> l_status;
-
- FAPI_INF("continue_cmd for %s", mss::c_str(i_target));
-
- // TODO RTC:155518 Check for stop or in progress before allowing continue. Not critical
- // as the caller should know and can check the in-progress bit in the event they don't
-
- if (i_end != end_boundary::DONT_CHANGE)
- {
- // Before we go too far, check to see if we're already stopped at the boundary we are asking to stop at
- bool l_stopped_at_boundary = false;
- uint64_t l_error_mode = 0;
- bool l_detect_slave = false;
-
- FAPI_TRY( mss::getScom(i_target, TT::CFGQ_REG, l_program.iv_config) );
- FAPI_TRY( mss::getScom(i_target, TT::MCBAGRAQ_REG, l_program.iv_addr_gen) );
- l_program.iv_config.extractToRight<TT::CFG_PAUSE_ON_ERROR_MODE, TT::CFG_PAUSE_ON_ERROR_MODE_LEN>(l_error_mode);
- l_detect_slave = l_program.iv_addr_gen.getBit<TT::MAINT_DETECT_SRANK_BOUNDARIES>();
-
- switch (i_end)
- {
- case end_boundary::STOP_AFTER_ADDRESS:
- l_stopped_at_boundary =
- l_program.iv_config.getBit<TT::MCBIST_CFG_FORCE_PAUSE_AFTER_ADDR>() ||
- l_error_mode == end_boundary::STOP_AFTER_ADDRESS;
- break;
-
- case end_boundary::STOP_AFTER_SLAVE_RANK:
- // Note: we really want STOP_AFTER_MASTER_RANK here even though we're in the slave
- // case because MASTER_RANK has the a 0 so that l_error_mode will check correctly
- l_stopped_at_boundary =
- l_program.iv_config.getBit<TT::MCBIST_CFG_PAUSE_AFTER_RANK>() ||
- ((l_error_mode == end_boundary::STOP_AFTER_MASTER_RANK) && (l_detect_slave == false));
- break;
-
- case end_boundary::STOP_AFTER_MASTER_RANK:
- l_stopped_at_boundary =
- l_program.iv_config.getBit<TT::MCBIST_CFG_PAUSE_AFTER_RANK>() ||
- ((l_error_mode == end_boundary::STOP_AFTER_MASTER_RANK) && (l_detect_slave == true));
- break;
-
- case end_boundary::STOP_AFTER_SUBTEST:
- l_stopped_at_boundary =
- l_program.iv_config.getBit<TT::MCBIST_CFG_FORCE_PAUSE_AFTER_SUBTEST>() ||
- l_error_mode == end_boundary::STOP_AFTER_SUBTEST;
- break;
-
- // By default we're not stopped at a boundary we're going to continue from
- default:
- break;
- };
-
- FAPI_ASSERT( l_stopped_at_boundary == false,
- fapi2::MSS_MEMDIAGS_ALREADY_AT_BOUNDARY().set_MCBIST_TARGET(i_target).set_BOUNDARY(i_stop),
- "Asked to stop at a boundary, but we're already there" );
-
- // Ok, if we're here either we need to change the stop and boundary conditions.
- // Read-modify-write the fields in the program.
- FAPI_TRY( mss::getScom(i_target, TT::MCBAGRAQ_REG, l_program.iv_addr_gen) );
-
- // Configure broadcast mode if needed
- FAPI_TRY(mss::mcbist::configure_broadcast_mode(i_target, l_program));
-
- l_program.change_end_boundary(i_end);
-
- FAPI_TRY( mss::mcbist::load_addr_gen(i_target, l_program) );
-
- FAPI_TRY( mss::mcbist::load_config(i_target, l_program) );
- }
-
- // Thresholds
- // According to API definition, 0 means don't change conditions
- if( i_stop != stop_conditions::DONT_CHANGE)
- {
- FAPI_TRY( mss::mcbist::load_thresholds(i_target, i_stop) );
- }
-
- // Setup speed
- FAPI_TRY( l_program.change_speed(i_target, i_speed) );
-
- // Load new speed unless we aren't changing it
- if( i_speed != speed::SAME_SPEED )
- {
- FAPI_TRY( load_mcbparm(i_target, l_program) );
- }
-
- // Tickle the resume from pause
- FAPI_TRY( mss::mcbist::resume(i_target) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-}
-
-}
+} // namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H
index 918342c6c..38ea0a8aa 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,10 +39,17 @@
#include <fapi2.H>
#include <lib/shared/mss_const.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ecc/ecc_traits_nimbus.H>
#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/address.H>
-#include <lib/mcbist/patterns.H>
-#include <lib/mcbist/settings.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_memdiags.H>
+
+using fapi2::TARGET_TYPE_MCBIST;
+using fapi2::TARGET_TYPE_MCA;
+using fapi2::TARGET_TYPE_DIMM;
+using fapi2::TARGET_TYPE_SYSTEM;
+using fapi2::FAPI2_RC_SUCCESS;
+using fapi2::FAPI2_RC_INVALID_PARAMETER;
namespace mss
{
@@ -50,309 +57,10 @@ namespace mss
namespace memdiags
{
-// Map some of the mcbist namespace here to make it easier for users of memdiags
-// This is an intentional using statement in a header which is typically
-// disallowed - I am intentionally pulling these into this namespace for all callers.
-using mss::mcbist::constraints;
-using mss::mcbist::speed;
-using mss::mcbist::end_boundary;
-using mss::mcbist::stop_conditions;
-using mss::mcbist::cache_line;
-using mss::mcbist::pattern;
-using mss::mcbist::patterns;
-
-// Why not mss::mcbist::address? Because the fields can't be pulled in via using,
-// and it seems even more confusing to have a memdiags address but have to use
-// mcbist fields. So, we all use mcbist address until such time that its promoted
-// to some other general namespace.
-
-using mss::mcbist::PATTERN_ZEROS;
-using mss::mcbist::PATTERN_0;
-using mss::mcbist::PATTERN_ONES;
-using mss::mcbist::PATTERN_1;
-using mss::mcbist::PATTERN_2;
-using mss::mcbist::PATTERN_3;
-using mss::mcbist::PATTERN_4;
-using mss::mcbist::PATTERN_5;
-using mss::mcbist::PATTERN_6;
-using mss::mcbist::PATTERN_7;
-using mss::mcbist::PATTERN_8;
-using mss::mcbist::PATTERN_RANDOM;
-using mss::mcbist::LAST_PATTERN;
-using mss::mcbist::NO_PATTERN;
-
-///
-/// @brief Stop the current command
-/// @tparam T the fapi2::TargetType of the target
-/// @param[in] i_target the target
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode stop( const fapi2::Target<T>& i_target );
-
-///
-/// @class Base class for memdiags operations
-/// @tparam T fapi2::TargetType of the MCBIST engine
-///
-template< fapi2::TargetType T >
-class operation
-{
- public:
- ///
- /// @brief memdiags::operation constructor
- /// @param[in] i_target the target of the mcbist engine
- /// @param[in] i_subtest the proper subtest for this operation
- /// @param[in] i_const mss::constraint structure
- ///
- operation( const fapi2::Target<T>& i_target,
- const mss::mcbist::subtest_t<T> i_subtest,
- const constraints i_const ):
- iv_target(i_target),
- iv_subtest(i_subtest),
- iv_const(i_const)
- {
- FAPI_TRY( mss::is_simulation (iv_sim) );
- return;
-
- fapi_try_exit:
- // Seems like a safe risk to take ...
- FAPI_ERR("Unable to get the attribute ATTR_IS_SIMULATION");
- return;
- }
-
- operation() = delete;
-
- ///
- /// @brief Execute the memdiags operation
- /// @return FAPI2_RC_SUCCESS iff ok
- ///
- inline fapi2::ReturnCode execute()
- {
- return mss::mcbist::execute(iv_target, iv_program);
- }
-
- ///
- /// @brief memdiags::operation destructor
- ///
- virtual ~operation() = default;
-
- ///
- /// @brief memdiags init helper
- /// Initializes common sections. Broken out rather than the base class ctor to enable checking return codes
- /// in subclassed constructores more easily.
- /// @return FAPI2_RC_SUCCESS iff everything ok
- ///
- fapi2::ReturnCode base_init();
-
- ///
- /// @brief Configures all subtests for a multiport init
- /// @param[in] i_dimms a vector of DIMM targets
- ///
- void configure_multiport_subtests(const std::vector<fapi2::Target<fapi2::TARGET_TYPE_DIMM>>& i_dimms);
-
- ///
- /// @brief memdiags multi-port init helper
- /// Initializes common sections. Broken out rather than the base class ctor to enable checking return codes
- /// in subclassed constructores more easily.
- /// @return FAPI2_RC_SUCCESS iff everything ok
- ///
- fapi2::ReturnCode multi_port_init();
-
- ///
- /// @brief memdiags multi-port address config helper
- /// Initializes the address configs needed for a multi port operation
- /// @return FAPI2_RC_SUCCESS iff everything ok
- ///
- fapi2::ReturnCode multi_port_addr();
-
- ///
- /// @brief Single port initializer
- /// Initializes common sections. Broken out rather than the base class ctor to enable checking return codes
- /// in subclassed constructores more easily.
- /// @return FAPI2_RC_SUCCESS iff everything ok
- ///
- fapi2::ReturnCode single_port_init();
-
- ///
- /// @brief get the protected mcbist program - useful for testing
- /// @return a reference to the iv_program member
- /// @note Intentionally not const ref; allows getter to set.
- ///
- mss::mcbist::program<T>& get_program()
- {
- return iv_program;
- }
-
- ///
- /// @brief get the protected mcbist subtest_t - useful for testing
- /// @return a reference to the iv_subtest member
- ///
- const mss::mcbist::subtest_t<T>& get_subtest() const
- {
- return iv_subtest;
- }
-
- protected:
- fapi2::Target<T> iv_target;
- mss::mcbist::subtest_t<T> iv_subtest;
- constraints iv_const;
- mss::mcbist::program<T> iv_program;
- uint8_t iv_sim;
-};
-
-///
-/// @class Class for memdiags' super-fast init
-/// @tparam T fapi2::TargetType of the MCBIST engine
-///
-template< fapi2::TargetType T >
-struct sf_init_operation : public operation<T>
-{
-
- ///
- /// @brief memdiags::sf_init_operation constructor
- /// @param[in] i_target the target of the mcbist engine
- /// @param[in] i_const mss::constraint structure
- /// @param[out] o_rc the fapi2::ReturnCode of the intialization process
- ///
- sf_init_operation( const fapi2::Target<T>& i_target,
- const constraints i_const,
- fapi2::ReturnCode& o_rc):
- operation<T>(i_target, mss::mcbist::init_subtest<T>(), i_const)
- {
- // If sf_init was passed the random data pattern, then modify the subtest to use the true random data
- if(i_const.iv_pattern == PATTERN_RANDOM)
- {
- this->iv_subtest.change_data_mode(mss::mcbist::data_mode::RAND_FWD_MAINT);
- }
-
- // We're a multi-port operation
- o_rc = this->multi_port_init();
- }
-
- sf_init_operation() = delete;
-};
-
-///
-/// @class Class for memdiags' super-fast read
-/// @tparam T fapi2::TargetType of the MCBIST engine
///
-template< fapi2::TargetType T >
-struct sf_read_operation : public operation<T>
-{
-
- ///
- /// @brief memdiags::sf_read_operation constructor
- /// @param[in] i_target the target of the mcbist engine
- /// @param[in] i_const mss::constraint structure
- /// @param[out] o_rc the fapi2::ReturnCode of the intialization process
- ///
- sf_read_operation( const fapi2::Target<T>& i_target,
- const constraints i_const,
- fapi2::ReturnCode& o_rc):
- operation<T>(i_target, mss::mcbist::read_subtest<T>(), i_const)
- {
- // We're a multi-port operation
- o_rc = this->multi_port_init();
- }
-
- sf_read_operation() = delete;
-};
-
-///
-/// @class Class for memdiags' super-fast read to end of port
-/// @tparam T fapi2::TargetType of the MCBIST engine
-///
-template< fapi2::TargetType T >
-struct sf_read_eop_operation : public operation<T>
-{
- ///
- /// @brief memdiags::sf_read_operation constructor
- /// @param[in] i_target the target of the mcbist engine
- /// @param[in] i_const mss::constraint structure
- /// @param[out] o_rc the fapi2::ReturnCode of the intialization process
- ///
- sf_read_eop_operation( const fapi2::Target<T>& i_target,
- const constraints i_const,
- fapi2::ReturnCode& o_rc ):
- operation<T>(i_target, mss::mcbist::read_subtest<T>(), i_const)
- {
- // We're a single-port operation
- o_rc = this->single_port_init();
- }
-
- sf_read_eop_operation() = delete;
-};
-
-///
-/// @class Class for memdiags' continuous scrub
-/// @tparam T fapi2::TargetType of the MCBIST engine
-///
-template< fapi2::TargetType T >
-struct continuous_scrub_operation : public operation<T>
-{
-
- ///
- /// @brief memdiags::continuous_scrub_operation constructor
- /// @param[in] i_target the target of the mcbist engine
- /// @param[in] i_const the contraints of the operation
- /// @param[out] o_rc the fapi2::ReturnCode of the intialization process
- ///
- continuous_scrub_operation( const fapi2::Target<T>& i_target,
- const constraints i_const,
- fapi2::ReturnCode& o_rc );
-
- continuous_scrub_operation() = delete;
-};
-
-///
-/// @class Class for memdiags' targeted scrub
-/// @tparam T fapi2::TargetType of the MCBIST engine
-///
-template< fapi2::TargetType T >
-struct targeted_scrub_operation : public operation<T>
-{
-
- ///
- /// @brief memdiags::targeted_scrub_operation constructor
- /// @param[in] i_target the target of the mcbist engine
- /// @param[in] i_const the contraints of the operation
- /// @param[out] o_rc the fapi2::ReturnCode of the intialization process
- ///
- targeted_scrub_operation( const fapi2::Target<T>& i_target,
- const constraints i_const,
- fapi2::ReturnCode& o_rc ):
- operation<T>(i_target, mss::mcbist::scrub_subtest<T>(), i_const)
- {
- // Scrub operations run 128B
- this->iv_program.change_len64(mss::OFF);
-
- // We're a single-port operation
- o_rc = this->single_port_init();
-
- // Targeted scrub needs to force a pause and the end boundary. So we make sure that happens here.
- this->iv_program.change_forced_pause( i_const.iv_end_boundary );
- }
-
- targeted_scrub_operation() = delete;
-};
-
-///
-/// @brief Super Fast Init - used to init all memory behind a target with a given pattern
-/// @note Uses broadcast mode if possible
-/// @tparam T the fapi2::TargetType of the target
-/// @param[in] i_target the target behind which all memory should be initialized
-/// @param[in] i_pattern an index representing a pattern to use to init memory (defaults to 0)
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode sf_init( const fapi2::Target<T>& i_target,
- const uint64_t i_pattern = PATTERN_0 );
-
-///
-/// @brief Start address port dimm check - helper for testing
+/// @brief Checks that the starting port/dimm address is in range for broadcast mode - helper for testing
/// @param[in] i_targets a vector of MCA targets
-/// @param[in] i_start_addr the starting port_dimm seelct address
+/// @param[in] i_start_addr the starting port_dimm select address
/// @return FAPI2_RC_SUCCESS iff okay
///
fapi2::ReturnCode broadcast_mode_start_address_check_helper(
@@ -370,82 +78,7 @@ fapi2::ReturnCode broadcast_mode_start_address_check(const fapi2::Target<fapi2::
const uint64_t i_start_addr,
std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >& o_dimms);
-///
-/// @brief Super Fast Read - used to run superfast read on all memory behind the target
-/// Determines ability to braodcast to all ports behind a target, does so if possible.
-/// @tparam T the fapi2::TargetType of the target
-/// @param[in] i_target the target behind which all memory should be read
-/// @param[in] i_stop stop conditions
-/// @param[in] i_address mcbist::address representing the address from which to start.
-// Defaults to the first address behind the target
-/// @param[in] i_end whether to end, and where
-/// Defaults to stop after slave rank
-/// @param[in] i_end_address mcbist::address representing the address to end.
-// Defaults to mcbist::address::LARGEST_ADDRESS
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-/// @note The address is often the port, dimm, rank but this is not enforced in the API.
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode sf_read( const fapi2::Target<T>& i_target,
- const stop_conditions& i_stop,
- const mss::mcbist::address& i_address = mss::mcbist::address(),
- const end_boundary i_end = end_boundary::STOP_AFTER_SLAVE_RANK,
- const mss::mcbist::address& i_end_address = mss::mcbist::address(mcbist::address::LARGEST_ADDRESS) );
-
-///
-/// @brief Scrub - continuous scrub all memory behind the target
-/// @param[in] i_target the target behind which all memory should be scrubbed
-/// @param[in] i_stop stop conditions
-/// @param[in] i_speed the speed to scrub
-/// @param[in] i_address mcbist::address representing the address from which to start.
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-/// @note The address is often the port, dimm, rank but this is not enforced in the API.
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode background_scrub( const fapi2::Target<T>& i_target,
- const stop_conditions& i_stop,
- const speed i_speed,
- const mss::mcbist::address& i_address );
-
-///
-/// @brief Scrub - targeted scrub all memory described by the input address (rank, slave, etc.)
-/// @param[in] i_target the target behind which all memory should be scrubbed
-/// @param[in] i_stop stop conditions
-/// @param[in] i_speed the speed to scrub
-/// @param[in] i_start_address mcbist::address representing the address from which to start.
-/// @param[in] i_end_address mcbist::address representing the address at which to end.
-/// @param[in] i_end whether to end, and where
-/// @return FAPI2_RC_SUCCESS iff everything ok
-/// @note The function is asynchronous, and the caller should be looking for a done attention
-/// @note The address is often the port, dimm, rank but this is not enforced in the API.
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode targeted_scrub( const fapi2::Target<T>& i_target,
- const stop_conditions& i_stop,
- const mss::mcbist::address& i_start_address,
- const mss::mcbist::address& i_end_address,
- const end_boundary i_end );
-
-///
-/// @brief Continue current command on next address
-/// The current commaand has paused on an error, so we can record the address of the error
-/// and finish the current master or slave rank.
-/// @tparam T the fapi2::TargetType of the target
-/// @param[in] i_target the target
-/// @param[in] i_end whether to end, and where (default - don't stop at end of rank)
-/// @param[in] i_stop stop conditions (default - 0 meaning 'don't change conditions')
-/// @param[in] i_speed the speed to scrub (default - SAME_SPEED meaning leave speed untouched)
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-template< fapi2::TargetType T >
-fapi2::ReturnCode continue_cmd( const fapi2::Target<T>& i_target,
- const end_boundary i_end = end_boundary::DONT_CHANGE,
- const stop_conditions& i_stop = stop_conditions(stop_conditions::DONT_CHANGE),
- const speed i_speed = speed::SAME_SPEED );
-
-} // namespace
+} // ns memdiags
-} // namespace
+} // ns mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.C
deleted file mode 100644
index ef65e381a..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.C
+++ /dev/null
@@ -1,146 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file patterns.C
-/// @brief Static definition of MCBIST patterns
-///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP HWP Backup: Marc Gollub <gollub@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#include <fapi2.H>
-#include <vector>
-#include <lib/mcbist/patterns.H>
-
-namespace mss
-{
-
-namespace mcbist
-{
-
-/// Vector of cache lines, seaprated in to two 64B chunks
-// TK Real patterns from Marc representing the proper bits for ECC checking
-const std::vector< pattern > patterns =
-{
- // Pattern index 0 (Pattern 1 is this inverted)
- { {0x0000000000000000, 0x0000000000000000},
- {0x0000000000000000, 0x0000000000000000},
- {0x0000000000000000, 0x0000000000000000},
- {0x0000000000000000, 0x0000000000000000},
- },
-
- // Pattern index 2 (Pattern 3 is this inverted)
- { {0x5555555555555555, 0x5555555555555555},
- {0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA},
- {0x5555555555555555, 0x5555555555555555},
- {0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA},
- },
-
- // Pattern index 4 (Pattern 5 is this inverted)
- { {0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF},
- {0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF},
- {0x0000000000000000, 0x0000000000000000},
- {0x0000000000000000, 0x0000000000000000},
- },
-
- // Pattern index 6 (Pattern 7 is this inverted)
- { {0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF},
- {0x0000000000000000, 0x0000000000000000},
- {0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF},
- {0x0000000000000000, 0x0000000000000000},
- },
-
- // Pattern index 8 Random Seed
- { {0x1234567887654321, 0x8765432112345678},
- {0x1234567887654321, 0x8765432112345678},
- {0x1234567887654321, 0x8765432112345678},
- {0x1234567887654321, 0x8765432112345678},
- },
-
- // Pattern index 10 (Pattern 11 is this inverted), MPR pattern
- { {0x0000000000000000, 0xFFFFFFFFFFFFFFFF},
- {0x0000000000000000, 0xFFFFFFFFFFFFFFFF},
- {0x0000000000000000, 0xFFFFFFFFFFFFFFFF},
- {0x0000000000000000, 0xFFFFFFFFFFFFFFFF},
- },
-};
-
-// TK Want a new RC for random 24
-/// Vector of 24b random data seeds
-const std::vector< random24_data_seed > random24_data_seeds =
-{
- // 24 Bit Pattern index 0 (Pattern 1 is this inverted)
- { {0x010203},
- {0x040506},
- {0x070809},
- },
-
- // 24 Bit Pattern index 2 (Pattern 3 is this inverted)
- { {0x112233},
- {0x445566},
- {0x778899},
- },
-
-};
-
-/// Vector of 24b random data seed mappings
-// Not sure how many mapping we will want, for now it should be sufficient to
-// have all bytes point to a different LFSR or all bytes point to the same LFSR
-const std::vector< random24_seed_map > random24_seed_maps =
-{
- // 8 Bit Pattern index 0
- // This selection maps every data byte to a different random LFSR
- { {0x0},
- {0x1},
- {0x2},
- {0x3},
- {0x4},
- {0x5},
- {0x6},
- {0x7},
- {0x8},
- },
-
- // 8 Bit Pattern index 1
- // This selection maps every data byte to random LFSR 0
- { {0x0},
- {0x0},
- {0x0},
- {0x0},
- {0x0},
- {0x0},
- {0x0},
- {0x0},
- {0x0},
- },
-
-};
-
-}
-
-}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.H
deleted file mode 100644
index b5faeeffd..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.H
+++ /dev/null
@@ -1,104 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/mcbist/patterns.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file patterns.H
-/// @brief Static definition of MCBIST patterns
-///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP HWP Backup: Marc Gollub <gollub@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#ifndef _MSS_MCBIST_PATTERNS_
-#define _MSS_MCBIST_PATTERNS_
-
-#include <vector>
-
-namespace mss
-{
-namespace mcbist
-{
-
-/// Memory diagnostic Pattern indexes.
-// Why not an enum? I want to do math on them to generate a proper index in to a vector of
-// patterns and enums really don't like that.
-// Couple of extra symbols in here to keep things easy if desired
-constexpr uint64_t PATTERN_ZEROS = 0;
-constexpr uint64_t PATTERN_0 = PATTERN_ZEROS;
-constexpr uint64_t PATTERN_ONES = 1;
-constexpr uint64_t PATTERN_1 = PATTERN_ONES;
-constexpr uint64_t PATTERN_2 = 2;
-constexpr uint64_t PATTERN_3 = 3;
-constexpr uint64_t PATTERN_4 = 4;
-constexpr uint64_t PATTERN_5 = 5;
-constexpr uint64_t PATTERN_6 = 6;
-constexpr uint64_t PATTERN_7 = 7;
-constexpr uint64_t PATTERN_8 = 8;
-constexpr uint64_t PATTERN_9 = 9;
-constexpr uint64_t PATTERN_10 = 10;
-constexpr uint64_t PATTERN_RANDOM = PATTERN_8;
-constexpr uint64_t LAST_PATTERN = PATTERN_10;
-
-// Don't mess with the patterns
-constexpr uint64_t NO_PATTERN = LAST_PATTERN + 1;
-
-//Pattern references for the 24b random data pattern seeds
-constexpr uint64_t MAX_NUM_RANDOM24_SEEDS = 3;
-constexpr uint64_t RANDOM24_SEEDS_0 = 0;
-constexpr uint64_t RANDOM24_SEEDS_1 = 1;
-constexpr uint64_t RANDOM24_SEEDS_2 = 2;
-constexpr uint64_t RANDOM24_SEEDS_3 = 3;
-constexpr uint64_t LAST_RANDOM24_SEEDS = RANDOM24_SEEDS_3;
-constexpr uint64_t NO_RANDOM24_SEEDS = LAST_RANDOM24_SEEDS + 1;
-
-//Pattern references for the 24b random data pattern seeds
-constexpr uint64_t MAX_NUM_RANDOM24_MAPS = 9;
-constexpr uint64_t RANDOM24_SEED_MAP_0 = 0;
-constexpr uint64_t RANDOM24_SEED_MAP_1 = 1;
-constexpr uint64_t LAST_RANDOM24_SEED_MAP = RANDOM24_SEED_MAP_1;
-constexpr uint64_t NO_RANDOM24_SEED_MAP = LAST_RANDOM24_SEED_MAP + 1;
-constexpr uint64_t RANDOM24_SEED_MAP_FIELD_LEN = 4;
-
-
-/// Vector of cache lines, separated in to two 64B chunks
-typedef std::pair<uint64_t, uint64_t> cache_line;
-typedef std::vector< cache_line > pattern;
-extern const std::vector< pattern > patterns;
-
-// Vector of 24b random data seeds
-typedef std::vector< uint64_t > random24_data_seed;
-extern const std::vector< random24_data_seed > random24_data_seeds;
-
-// Vector of 24b random data seed maps
-typedef std::vector< uint64_t > random24_seed_map;
-extern const std::vector< random24_seed_map > random24_seed_maps;
-
-}// mcbist
-
-}// mss
-#endif
-
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H
index 3e89ee647..f4d822105 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,759 +38,11 @@
#include <fapi2.H>
-#include <p9_mc_scom_addresses.H>
-#include <p9_mc_scom_addresses_fld.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ecc/ecc_traits_nimbus.H>
+#include <lib/mcbist/mcbist_traits.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_settings.H>
-#include <lib/mcbist/address.H>
-#include <lib/utils/bit_count.H>
+// This file is still necessary to put traits and generic code together
-namespace mss
-{
-
-namespace mcbist
-{
-
-/// End boundaries for MCBIST programs - where to stop when stopping or pausing
-enum end_boundary : uint64_t
-{
- // We're gonna get a little hacky here. The pause on error mode field
- // is two bits, with another bit representing slave/master. So we craft
- // the enum so that we can insertFromRight and get the proper vaules, and
- // leave one bit out of that two-bit range to represent master or slave
- NONE = 0b000,
- STOP_AFTER_ADDRESS = 0b001,
- STOP_AFTER_MASTER_RANK = 0b010,
- STOP_AFTER_SLAVE_RANK = 0b110,
- STOP_AFTER_SUBTEST = 0b011,
-
- DONT_CHANGE = 0xFF,
-};
-
-/// Speeds for performing MCBIST operations
-enum speed
-{
- /// As fast as possible, often the default
- LUDICROUS = 0,
-
- /// Background scrubbing speed.
- BG_SCRUB = 1,
-
- /// Used to indicate to the continue current command to not change the speed of the commands
- SAME_SPEED = 4,
-};
-
-///
-/// @class Memory diagnostic subsystem stop-on-error settings and thresholds
-/// @note Matches Nimbus MBSTRQ, but might be changed later for Centaur, or mapped.
-///
-class stop_conditions
-{
- public:
-
- // Many of the config fields share a disable bit pattern, so we define it here
- static constexpr uint64_t DISABLE = 0b1111;
- static constexpr uint64_t MAX_THRESHOLD = 0b1110;
- static constexpr uint64_t DONT_CHANGE = 0;
-
- private:
-
- ///
- /// @brief Little helper to convert threshold inputs to exponents
- /// @param[in] i_value, the value of the threshold (presumably)
- /// @return a value n such that 2^n <= i_value && n < 15
- ///
- uint64_t make_threshold_setting( const uint64_t i_value )
- {
- // If the user passes in DISABLE, let it past. This prevents callers from having to
- // do the conditional. Zero is none which is disable
- if ((i_value == DISABLE) || (i_value == 0))
- {
- return DISABLE;
- }
-
- // Find the first bit set. This represents the largest power of 2 this input can represent
- // The subtraction from 63 switches from a left-count to a right-count (e.g., 0 (left most
- // bit) is really bit 63 if you start on the right.)
- const uint64_t l_largest = 63 - first_bit_set(i_value);
-
- // If the first bit set is off in space and greater than 2^14, we just return 0b1110
- // Otherwise, l_largest is the droid we're looking for
- return l_largest >= MAX_THRESHOLD ? MAX_THRESHOLD : l_largest;
- }
-
- ///
- /// @brief Generic pause on threshold
- /// @tparam F, the bit field to manipulate
- /// @tparam L, the length of F
- /// @param[in] the state of the error - mss::ON or mss::OFF
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- template< uint64_t F, uint64_t L >
- inline stop_conditions& set_pause_on_threshold( const states i_on_or_off )
- {
- if (i_on_or_off == mss::OFF)
- {
- iv_value.insertFromRight<F, L>(DISABLE);
- return *this;
- }
-
- uint64_t l_thresh = 0;
- iv_value.extractToRight<F, L>(l_thresh);
-
- if (l_thresh == DISABLE)
- {
- // Note the threshold field is an exponent, so this is 2^0, or 1 count
- iv_value.insertFromRight<F, L>(0);
- }
-
- return *this;
- }
-
- public:
- ///
- /// @brief Stop/Thresholds class ctor
- ///
- stop_conditions():
- iv_value(0)
- {
- // By default we want to start everything in 'don't stop' mode. This means disabling
- // the errors which contain thresholds
- set_thresh_nce_int(DISABLE)
- .set_thresh_nce_soft(DISABLE)
- .set_thresh_nce_hard(DISABLE)
- .set_thresh_rce(DISABLE)
- .set_thresh_ice(DISABLE)
- .set_thresh_mce_int(DISABLE)
- .set_thresh_mce_soft(DISABLE)
- .set_thresh_mce_hard(DISABLE);
- }
-
- ///
- /// @brief Stop/Thresholds class ctor
- /// @param[in] uint64_t representing the threshold register contents
- ///
- stop_conditions(const uint64_t i_value):
- iv_value(i_value)
- {
- }
-
- ///
- /// @brief Stop/Thresholds class dtor
- ///
- ~stop_conditions() = default;
-
- ///
- /// @brief uint64_t conversion
- ///
- inline operator uint64_t() const
- {
- return uint64_t(iv_value);
- }
-
- ///
- /// @brief set_thresh_nce_int
- /// @param[in] i_value the value of the field
- /// NCE intermittent error threshold magnitude to trigger for triggering pause. If
- /// 1111, then pause will never be triggered (disabled). Else, then MCBIST will
- /// pause if it takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_nce_int( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_INT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_INT_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_nce_int - enable NCE intermittent error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_nce_int( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_INT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_INT_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_nce_soft
- /// @param[in] i_value the value of the field
- /// NCE soft error threshold magnitude to trigger for triggering pause. If 1111,
- /// then pause will never be triggered (disabled). Else, then MCBIST will pause if it
- /// takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_nce_soft( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_SOFT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_SOFT_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_nce_int - enable NCE soft error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_nce_soft( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_SOFT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_SOFT_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_nce_hard
- /// @param[in] i_value the value of the field
- /// NCE hard error threshold magnitude to trigger for triggering pause. If 1111,
- /// then pause will never be triggered (disabled). Else, then MCBIST will pause if it
- /// takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_nce_hard( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_HARD,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_HARD_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_nce_hard - enable NCE hard error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_nce_hard( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_HARD,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_NCE_HARD_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_rce
- /// @param[in] i_value the value of the field
- /// RCE error threshold magnitude to trigger for triggering pause. If 1111, then
- /// pause will never be triggered (disabled). Else, then MCBIST will pause if it takes
- /// sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_rce( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_RCE,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_RCE_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_rce - enable RCE error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_rce( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_RCE,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_RCE_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_ice
- /// @param[in] i_value the value of the field
- /// ICE (IMPE) error threshold magnitude to trigger for triggering pause. If 1111,
- /// then pause will never be triggered (disabled). Else, then MCBIST will pause if
- /// it takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_ice( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_ICE,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_ICE_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_ice - enable ICE (IMPE) error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_ice( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_ICE,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_ICE_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_mce_int
- /// @param[in] i_value the value of the field
- /// MCE intermittent error threshold magnitude to trigger for triggering pause. If
- /// 1111, then pause will never be triggered (disabled). Else, then MCBIST will
- /// pause if it takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_mce_int( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_INT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_INT_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_mce_int - enable MCE intermittent error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_mce_int( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_INT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_INT_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_mce_soft
- /// @param[in] i_value the value of the field
- /// MCE soft error threshold magnitude to trigger for triggering pause. If 1111,
- /// then pause will never be triggered (disabled). Else, then MCBIST will pause if it
- /// takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_mce_soft( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_SOFT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_SOFT_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_mce_soft - enable MCE soft error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_mce_soft( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_SOFT,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_SOFT_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_thresh_mce_hard
- /// @param[in] i_value the value of the field
- /// MCE hard error threshold magnitude to trigger for triggering pause. If 1111,
- /// then pause will never be triggered (disabled). Else, then MCBIST will pause if it
- /// takes sees 2^[this value] number of errors of this type.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note The register field is actually an exponent. The hardware will count 2^n for the
- /// threshold. However, the input represents a count - how many. Thus we need to convert
- /// the input to a power of 2 to get a proper exponent. Your input will be rounded down
- /// to the nearest power of 2 which is less than 2^15 before being set in the register.
- ///
- inline stop_conditions& set_thresh_mce_hard( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_HARD,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_HARD_LEN>(make_threshold_setting(i_value));
- return *this;
- }
-
- ///
- /// @brief set_pause_on_mce_hard - enable MCE hard error
- /// @param[in] i_on_or_off - the desired state.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- /// @note If the input is mss::ON, this method enables the error, it's corresponding
- /// threshold defines the threshold at which the engine will stop. If no threshold is
- /// defined (the error is disabled) this method will set the threshold to 1. A previously
- /// defined threshold (i.e., not disabled) will be left intact. If the input
- /// is mss::OFF, this method will disable the error by setting the threshold to disabled.
- ///
- inline stop_conditions& set_pause_on_mce_hard( const states i_on_or_off )
- {
- return set_pause_on_threshold<MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_HARD,
- MCBIST_MBSTRQ_CFG_THRESH_MAG_MCE_HARD_LEN>(i_on_or_off);
- }
-
- ///
- /// @brief set_pause_on_sce
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on SCE error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_sce( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_SCE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_on_mce
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on MCE error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_mce( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_MCE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_on_mpe
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on MPE error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_mpe( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_MPE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_on_ue
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on UE error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_ue( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_UE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_on_sue
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on SUE error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_sue( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_SUE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_on_aue
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on AUE error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_aue( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_AUE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_on_rcd
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause on RCD error. When enabled, MCBIST will pause at the boundary
- /// configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_on_rcd( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_ON_RCD>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_symbol_counter_mode
- /// @param[in] i_value the value of the field
- /// Selects which mode to use symbol counter latches: Mode 0) MAINT 8-bit error
- /// counters for of 72 symbols Mode 1) MCBIST 4-bit error counters for 18 nibbles x 8
- /// ranks (port agnostic) Mode 2) MCBIST 4-bit error counters for 18 nibbles x 4
- /// ports (rank agnostic) and 1-bit error rank map for 18 nibbles x 4 ports
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_symbol_counter_mode( const uint64_t i_value )
- {
- iv_value.insertFromRight<MCBIST_MBSTRQ_CFG_SYMBOL_COUNTER_MODE,
- MCBIST_MBSTRQ_CFG_SYMBOL_COUNTER_MODE_LEN>(i_value);
- return *this;
- }
-
- ///
- /// @brief set_nce_soft_symbol_count_enable
- /// @param[in] i_on_or_off - the desired state.
- /// Enables soft NCEs to trigger per symbol NCE error counting Only applies to
- /// scrub where we have different types of NCE. Non scrub counts all NCE.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_nce_soft_symbol_count_enable( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_NCE_SOFT_SYMBOL_COUNT_ENABLE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_nce_inter_symbol_count_enable
- /// @param[in] i_on_or_off - the desired state.
- /// Enables intermittent NCEs to trigger per symbol NCE error counting Only applies
- /// to scrub where we have different types of NCE. Non scrub counts all NCE.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_nce_inter_symbol_count_enable( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_NCE_INTER_SYMBOL_COUNT_ENABLE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_nce_hard_symbol_count_enable
- /// @param[in] i_on_or_off - the desired state.
- /// Enables hard NCEs to trigger per symbol NCE error counting Only applies to
- /// scrub where we have different types of NCE. Non scrub counts all NCE.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_nce_hard_symbol_count_enable( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_NCE_HARD_SYMBOL_COUNT_ENABLE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_mcb_error
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause when MCBIST error is logged. When enabled, MCBIST will pause at
- /// the boundary configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_mcb_error( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_MCB_ERROR>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_pause_mcb_log_full
- /// @param[in] i_on_or_off - the desired state.
- /// Enable pause when MCBIST log is full. When enabled, MCBIST will pause at the
- /// boundary configured if this error is seen.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_pause_mcb_log_full( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_PAUSE_MCB_LOG_FULL>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_maint_rce_with_ce
- /// @param[in] i_on_or_off - the desired state.
- /// cfg_maint_rce_with_ce - not implemented. Need to investigate if needed for nimbus.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_maint_rce_with_ce( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_MAINT_RCE_WITH_CE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_mce_soft_symbol_count_enable
- /// @param[in] i_on_or_off - the desired state.
- /// Enables soft MCEs to trigger per symbol MCE error counting Only applies to
- /// scrub where we have different types of MCE. Non scrub counts all MCE.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_mce_soft_symbol_count_enable( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_MCE_SOFT_SYMBOL_COUNT_ENABLE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_mce_inter_symbol_count_enable
- /// @param[in] i_on_or_off - the desired state.
- /// Enables intermittent MCEs to trigger per symbol MCE error counting Only applies
- /// to scrub where we have different types of MCE. Non scrub counts all MCE.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_mce_inter_symbol_count_enable( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_MCE_INTER_SYMBOL_COUNT_ENABLE>(i_on_or_off);
- return *this;
- }
-
- ///
- /// @brief set_mce_hard_symbol_count_enable
- /// @param[in] i_on_or_off - the desired state.
- /// Enables hard MCEs to trigger per symbol MCE error counting Only applies to
- /// scrub where we have different types of MCE. Non scrub counts all MCE.
- /// @return fapi2::buffer<uint64_t>& this->iv_value useful for method chaining
- ///
- inline stop_conditions& set_mce_hard_symbol_count_enable( const states i_on_or_off )
- {
- iv_value.writeBit<MCBIST_MBSTRQ_CFG_MCE_HARD_SYMBOL_COUNT_ENABLE>(i_on_or_off);
- return *this;
- }
-
- private:
-
- fapi2::buffer<uint64_t> iv_value;
-};
-
-///
-/// @class memdiags operational constraints
-///
-struct constraints
-{
- ///
- /// @brief constraints default constructor
- ///
- constraints():
- iv_stop(),
- iv_pattern(NO_PATTERN),
- iv_end_boundary(NONE),
- iv_speed(LUDICROUS),
- iv_start_address(0),
- iv_end_address(mcbist::address::LARGEST_ADDRESS)
- {
- }
-
- ///
- /// @brief constraints constructor
- /// @param[in] i_pattern a pattern to set
- ///
- constraints( const uint64_t i_pattern ):
- constraints()
- {
- iv_pattern = i_pattern;
- FAPI_INF("setting up constraints with pattern %d", i_pattern);
- }
-
- ///
- /// @brief constraints constructor
- /// @param[in] i_stop stop conditions
- ///
- constraints( const stop_conditions& i_stop ):
- constraints()
- {
- iv_stop = i_stop;
- FAPI_INF("setting up constraints with stop 0x%016lx", uint64_t(i_stop));
- }
-
- ///
- /// @brief constraints constructor
- /// @param[in] i_stop stop conditions
- /// @param[in] i_start_address address to start from
- ///
- constraints( const stop_conditions& i_stop,
- const address& i_start_address ):
- constraints(i_stop)
- {
- iv_start_address = i_start_address;
- FAPI_INF("setting up constraints with start address 0x%016lx", uint64_t(i_start_address));
- }
-
- ///
- /// @brief constraints constructor
- /// @param[in] i_stop stop conditions
- /// @param[in] i_speed the speed at which to run
- /// @param[in] i_end_boundary the place to stop on error
- /// @param[in] i_start_address address to start from
- /// @param[in] i_end_address address to end at (optional, run to end)
- ///
- constraints( const stop_conditions& i_stop,
- const speed i_speed,
- const end_boundary i_end_boundary,
- const address& i_start_address,
- const address& i_end_address = mcbist::address(mcbist::address::LARGEST_ADDRESS) ):
- constraints(i_stop, i_start_address)
- {
- iv_end_boundary = i_end_boundary;
- iv_speed = i_speed;
- iv_end_address = i_end_address;
-
- FAPI_INF("setting up constraints with end boundary %d and speed 0x%x", i_end_boundary, i_speed);
-
- // If our end address is 'before' our start address, make the end address the same as the start.
- if (iv_start_address > iv_end_address)
- {
- iv_end_address = iv_start_address;
- }
- }
-
- // Member variable declaration
- stop_conditions iv_stop;
- uint64_t iv_pattern;
- end_boundary iv_end_boundary;
- speed iv_speed;
- mcbist::address iv_start_address;
- mcbist::address iv_end_address;
-};
-
-
-} // namespace
-} // namespace
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C
deleted file mode 100644
index 2fa88eb98..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C
+++ /dev/null
@@ -1,175 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2019 */
-/* [+] 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 */
-
-///
-/// @file mcbist/sim.C
-/// @brief MCBIST/memdiags functions for when we're in simulation mode
-///
-// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: FSP:HB
-
-#include <lib/shared/nimbus_defaults.H>
-#include <fapi2.H>
-
-#include <lib/dimm/rank.H>
-#include <lib/mcbist/address.H>
-#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/patterns.H>
-#include <lib/mcbist/sim.H>
-#include <generic/memory/lib/utils/count_dimm.H>
-#include <generic/memory/lib/utils/pos.H>
-
-using fapi2::TARGET_TYPE_MCBIST;
-using fapi2::TARGET_TYPE_MCA;
-using fapi2::TARGET_TYPE_SYSTEM;
-using fapi2::FAPI2_RC_SUCCESS;
-
-namespace mss
-{
-
-namespace mcbist
-{
-
-namespace sim
-{
-
-///
-/// @brief Perform a sim version of initializing memory
-/// @param[in] i_target MCBIST
-/// @param[in] i_pattern an index representing a pattern to use to initize memory (defaults to 0)
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-template<>
-fapi2::ReturnCode sf_init( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- const uint64_t i_pattern )
-{
- FAPI_INF("Start sim init");
-
- // If we're running in the simulator, we want to only touch the addresses which training touched
-
- for (const auto& p : i_target.getChildren<TARGET_TYPE_MCA>())
- {
- std::vector<uint64_t> l_pr;
- mss::mcbist::program<TARGET_TYPE_MCBIST> l_program;
-
- mss::mcbist::address l_start;
- mss::mcbist::address l_end;
-
- size_t l_rank_address_pair = 0;
-
- // No point in bothering if we don't have any DIMM
- if (mss::count_dimm(p) == 0)
- {
- FAPI_INF("No DIMM on %s, not running sf_init", mss::c_str(p));
- continue;
- }
-
- // In sim we know a few things ...
- // Get the primary ranks for this port. We know there can only be 4, and we know we only trained the primary
- // ranks. Therefore, we only need to clean up the primary ranks. And because there's 4 max, we can do it
- // all using the 4 address range registers of tne MCBIST (broadcast currently not considered.)
- // So we can write 0's to those to get their ECC fixed up.
- FAPI_TRY( mss::rank::primary_ranks(p, l_pr) );
- fapi2::Assert( l_pr.size() <= mss::MAX_RANK_PER_DIMM );
-
- for (auto r = l_pr.begin(); r != l_pr.end(); ++l_rank_address_pair, ++r)
- {
- FAPI_INF("sim init %s, rank %d", mss::c_str(p), *r);
-
- // Setup l_start to represent this rank, and then make the end address from that.
- l_start.set_master_rank(*r);
-
- // Set C3 bit to get an entire cache line
- l_start.get_sim_end_address(l_end);
-
- // By default we're in maint address mode, not address counting mode. So we give it a start and end, and ignore
- // anything invalid - that's what maint address mode is all about
- mss::mcbist::config_address_range(i_target, l_start, l_end, l_rank_address_pair);
-
- // Write
- {
- // Run in ECC mode, 64B writes (superfast mode)
-
- mss::mcbist::subtest_t<TARGET_TYPE_MCBIST> l_fw_subtest =
- mss::mcbist::write_subtest<TARGET_TYPE_MCBIST>();
-
- l_fw_subtest.enable_port(mss::relative_pos<TARGET_TYPE_MCBIST>(p));
- l_fw_subtest.change_addr_sel(l_rank_address_pair);
- l_fw_subtest.enable_dimm(mss::rank::get_dimm_from_rank(*r));
- l_program.iv_subtests.push_back(l_fw_subtest);
- FAPI_DBG("adding superfast write for %s rank %d (dimm %d)", mss::c_str(p), *r, mss::rank::get_dimm_from_rank(*r));
- }
-
- // Read - we do a read here as verification can use this as a tool as we do the write and then the read.
- // If we failed to write properly the read would thow ECC errors. Just a write (which the real hardware would
- // do) doesn't catch that. This takes longer, but it's not terribly long in any event.
- {
- // Run in ECC mode, 64B writes (superfast mode)
- mss::mcbist::subtest_t<TARGET_TYPE_MCBIST> l_fr_subtest =
- mss::mcbist::read_subtest<TARGET_TYPE_MCBIST>();
-
- l_fr_subtest.enable_port(mss::relative_pos<TARGET_TYPE_MCBIST>(p));
- l_fr_subtest.change_addr_sel(l_rank_address_pair);
- l_fr_subtest.enable_dimm(mss::rank::get_dimm_from_rank(*r));
- l_program.iv_subtests.push_back(l_fr_subtest);
- FAPI_DBG("adding superfast read for %s rank %d (dimm %d)", mss::c_str(p), *r, mss::rank::get_dimm_from_rank(*r));
- }
- }
-
- // Write pattern
- FAPI_TRY( mss::mcbist::load_pattern(i_target, i_pattern) );
-
- // Setup the sim polling based on a heuristic <cough>guess</cough>
- // Looks like ~400ck per address for a write/read program on the sim-dimm, and add a long number of polls
- // On real hardware wait 100ms and then start polling for another 5s
- l_program.iv_poll.iv_initial_sim_delay = mss::cycles_to_simcycles(((l_end - l_start) * l_pr.size()) * 800);
- l_program.iv_poll.iv_initial_delay = 100 * mss::DELAY_1MS;
- l_program.iv_poll.iv_sim_delay = 100000;
- l_program.iv_poll.iv_delay = 10 * mss::DELAY_1MS;
- l_program.iv_poll.iv_poll_count = 500;
-
- // Just one port for now. Per Shelton we need to set this in maint address mode
- // even tho we specify the port/dimm in the subtest.
- fapi2::buffer<uint8_t> l_port;
- l_port.setBit(mss::relative_pos<TARGET_TYPE_MCBIST>(p));
- l_program.select_ports(l_port >> 4);
-
- // Kick it off, wait for a result
- FAPI_TRY( mss::mcbist::execute(i_target, l_program) );
- }
-
-fapi_try_exit:
- FAPI_INF("End sim init");
- return fapi2::current_err;
-}
-
-} // namespace sim
-
-} // namespace mcbist
-
-} // namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk b/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk
index 2b07ee18c..878c51e37 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2015,2017
+# Contributors Listed Below - COPYRIGHT 2015,2019
# [+] International Business Machines Corp.
#
#
@@ -44,6 +44,7 @@ $(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PATH)/include)
$(call ADD_MODULE_INCDIR,$(1),$(GENPATH))
$(call ADD_MODULE_INCDIR,$(1),$(FAPI2_PLAT_INCLUDE))
$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH))
+$(call ADD_MODULE_INCDIR,$(1),$(ROOTPATH)/generic/memory/lib)
endef
MODULE = mss
OBJS += $(MSS_MODULE_OBJS)
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
index c482989dd..709d3af1b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H
@@ -14142,6 +14142,31 @@ fapi_try_exit:
///
+/// @brief ATTR_MSS_MRW_NVDIMM_SLOT_POSITION getter
+/// @param[in] const ref to the TARGET_TYPE_DIMM
+/// @param[out] uint8_t& reference to store the value
+/// @note Generated by gen_accessors.pl generateParameters (PROC_CHIP)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note The position of a dimm is based on which mca it is associated with and which
+/// drop behind that mca, with 16 dimms possible per processor socket. The formula
+/// is: [processor position with no gaps, i.e. 0,1,2,3]*16 + [mca position on this
+/// processor * 2] + [dimm location behind this
+/// mca]
+///
+inline fapi2::ReturnCode mrw_nvdimm_slot_position(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value)
+{
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_NVDIMM_SLOT_POSITION, i_target, o_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MSS_MRW_NVDIMM_SLOT_POSITION: 0x%lx",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
/// @brief ATTR_MSS_MRW_UNSUPPORTED_RANK_CONFIG getter
/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA>
/// @param[out] ref to the value uint64_t
@@ -21501,6 +21526,172 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT getter
+/// @param[out] uint64_t* memory to store the value
+/// @note Generated by gen_accessors.pl generateParameters (SYSTEM A)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Machine Readable Workbook Thermal Memory Power Limit Used to calculate throttles
+/// to meet the thermal power per DIMM limit Per DIMM basis, uses first matching KEY
+/// entry KEY (0-21): In order DIMM_SIZE = bits 0-3, DIMM_GEN = 4-5, DIMM_TYPE =
+/// 6-8, DIMM_WIDTH = 9-11, DIMM_DENSITY = 12-14, DIMM_STACK_TYPE = 15-16,
+/// DRAM_MFGID = 17-19, DIMM_HEIGHT = 20-21, Bits 22-32: Not used VALUE (bits 32-47)
+/// in cW: thermal power limit DDIMM: Total OCMB+DRAM power limit per DDIMM
+/// non-DDIMM: VMEM+VPP power limit per
+/// DIMM
+///
+inline fapi2::ReturnCode mrw_ocmb_thermal_memory_power_limit(uint64_t* o_array)
+{
+ uint64_t l_value[25];
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
+ l_value) );
+ memcpy(o_array, &l_value, 200);
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT: 0x%lx (system target)",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_MRW_OCMB_PWR_SLOPE getter
+/// @param[out] uint64_t* memory to store the value
+/// @note Generated by gen_accessors.pl generateParameters (SYSTEM A)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Machine Readable Workbook Power Curve Slope for DIMM Used to calculate thermal
+/// throttles and port power Per DIMM basis, uses first matching KEY entry KEY
+/// (0-21): In order DIMM_SIZE = bits 0-3, DIMM_GEN = 4-5, DIMM_TYPE = 6-8,
+/// DIMM_WIDTH = 9-11, DIMM_DENSITY = 12-14, DIMM_STACK_TYPE = 15-16, DRAM_MFGID =
+/// 17-19, DIMM_HEIGHT = 20-21, Bits 22-32: Not used VALUE (bits 32-47) in
+/// cW/utilization: DIMM power slope DDIMM: Total OCMB+DRAM power slope per DDIMM
+/// non-DDIMM: VMEM+VPP power slope per
+/// DIMM
+///
+inline fapi2::ReturnCode mrw_ocmb_pwr_slope(uint64_t* o_array)
+{
+ uint64_t l_value[50];
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_OCMB_PWR_SLOPE, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), l_value) );
+ memcpy(o_array, &l_value, 400);
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MSS_MRW_OCMB_PWR_SLOPE: 0x%lx (system target)",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_MRW_OCMB_PWR_INTERCEPT getter
+/// @param[out] uint64_t* memory to store the value
+/// @note Generated by gen_accessors.pl generateParameters (SYSTEM A)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Machine Readable Workbook Power Curve Intercept for DIMM Used to calculate
+/// thermal throttles and port power Per DIMM basis, uses first matching KEY entry
+/// KEY (0-21): In order DIMM_SIZE = bits 0-3, DIMM_GEN = 4-5, DIMM_TYPE = 6-8,
+/// DIMM_WIDTH = 9-11, DIMM_DENSITY = 12-14, DIMM_STACK_TYPE = 15-16, DRAM_MFGID =
+/// 17-19, DIMM_HEIGHT = 20-21, Bits 22-32: Not used VALUE (bits 32-47) in
+/// cW/utilization: DIMM power intercept DDIMM: Total OCMB+DRAM power intercept per
+/// DDIMM non-DDIMM: VMEM+VPP power intercept per
+/// DIMM
+///
+inline fapi2::ReturnCode mrw_ocmb_pwr_intercept(uint64_t* o_array)
+{
+ uint64_t l_value[50];
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_OCMB_PWR_INTERCEPT, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), l_value) );
+ memcpy(o_array, &l_value, 400);
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MSS_MRW_OCMB_PWR_INTERCEPT: 0x%lx (system target)",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT getter
+/// @param[out] uint64_t* memory to store the value
+/// @note Generated by gen_accessors.pl generateParameters (SYSTEM A)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Machine Readable Workbook Current Curve Intercept and limit for DIMM Used to
+/// calculate throttles to meet regulator current per DIMM limit Per DIMM basis,
+/// uses first matching KEY entry For DDIMM, use PMIC SW output that provides worst
+/// case throttling KEY (0-21): In order DIMM_SIZE = bits 0-3, DIMM_GEN = 4-5,
+/// DIMM_TYPE = 6-8, DIMM_WIDTH = 9-11, DIMM_DENSITY = 12-14, DIMM_STACK_TYPE =
+/// 15-16, DRAM_MFGID = 17-19, DIMM_HEIGHT = 20-21, Bits 22-32: Not used VALUE (bits
+/// 32-39): Current limit (dA) DDIMM: PMIC output current limit per DDIMM non-DDIMM:
+/// VMEM regulator current limit per DIMM VALUE (bits 40-51): Current slope
+/// (cA/utilization) DDIMM: PMIC output current slope per DDIMM non-DDIMM: VMEM
+/// regulator current slope per DIMM VALUE (bits 52-63): Current intercept (cA)
+/// DDIMM: PMIC output current intercept per DDIMM non-DDIMM: VMEM regulator current
+/// intercept per
+/// DIMM
+///
+inline fapi2::ReturnCode mrw_ocmb_current_curve_with_limit(uint64_t* o_array)
+{
+ uint64_t l_value[25];
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
+ l_value) );
+ memcpy(o_array, &l_value, 200);
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT: 0x%lx (system target)",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_MRW_SAFEMODE_DRAM_DATABUS_UTIL getter
+/// @param[out] uint32_t& reference to store the value
+/// @note Generated by gen_accessors.pl generateParameters (SYSTEM)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Machine Readable Workbook value for safe mode dram data bus utilization in centi
+/// percent (c%). Set to below optimum value/ rate. On a per port basis Also used
+/// for emergency mode throttle Used to thermally protect the system in all
+/// supported environmental conditions when OCC is not functional Consumer:
+/// thermal_init, initfile Default to 2500
+/// c%%
+///
+inline fapi2::ReturnCode mrw_safemode_dram_databus_util(uint32_t& o_value)
+{
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_SAFEMODE_DRAM_DATABUS_UTIL, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
+ o_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MSS_MRW_SAFEMODE_DRAM_DATABUS_UTIL: 0x%lx (system target)",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE getter
+/// @param[out] uint64_t& reference to store the value
+/// @note Generated by gen_accessors.pl generateParameters (SYSTEM)
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note This is the fapi position of the port that failed to calculate memory throttles
+/// given the passed in watt target and or
+/// utilization
+///
+inline fapi2::ReturnCode port_pos_of_fail_throttle(uint64_t& o_value)
+{
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
+ o_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed accessing ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE: 0x%lx (system target)",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H
index 201b1ee39..cf0884182 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -40,7 +40,7 @@
#define MSS_ATTR_ACCESS_MANUAL_H_
#include <fapi2.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/mss_attribute_accessors.H>
namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_vpd_decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_vpd_decoder.H
index d33f69a26..fd6485d83 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_vpd_decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_vpd_decoder.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,7 +33,7 @@
#include <lib/shared/mss_const.H>
#include <lib/mss_utils.H>
#include <lib/mss_attribute_accessors.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/index.H>
namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.C
index f68b7dab9..c12adbab8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,7 +37,7 @@
#include <lib/phy/adr32s.H>
#include <lib/phy/dcd.H>
#include <lib/workarounds/adr32s_workarounds.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/mss_attribute_accessors_manual.H>
using fapi2::TARGET_TYPE_MCA;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.H b/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.H
index 0de3f350e..ee8e54121 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/adr32s.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -42,7 +42,7 @@
#include <lib/mss_attribute_accessors.H>
#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
namespace mss
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C
index 88337c26c..82769de0f 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C
@@ -48,6 +48,7 @@
#include <lib/phy/adr.H>
#include <lib/phy/seq.H>
#include <lib/fir/check.H>
+#include <lib/ccs/ccs_nimbus.H>
#include <lib/workarounds/dp16_workarounds.H>
#include <lib/workarounds/wr_vref_workarounds.H>
#include <lib/dimm/ddr4/latch_wr_vref.H>
@@ -55,10 +56,10 @@
#include <lib/workarounds/dll_workarounds.H>
#include <lib/workarounds/dqs_align_workarounds.H>
#include <lib/phy/mss_training.H>
-#include <generic/memory/lib/utils/find_magic.H>
+#include <lib/utils/find_magic.H>
#include <generic/memory/lib/utils/bit_count.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/utils/dump_regs.H>
+#include <lib/utils/nimbus_find.H>
+#include <generic/memory/lib/utils/dump_regs.H>
#include <generic/memory/lib/utils/scom.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/dimm/rank.H>
@@ -1038,9 +1039,9 @@ fapi2::ReturnCode execute_cal_steps_helper( const fapi2::Target<TARGET_TYPE_MCA>
const uint64_t i_total_cycles)
{
const auto& l_mcbist = mss::find_target<TARGET_TYPE_MCBIST>(i_target);
- auto l_cal_inst = mss::ccs::initial_cal_command<TARGET_TYPE_MCBIST>(i_rp);
+ auto l_cal_inst = mss::ccs::initial_cal_command(i_rp);
- mss::ccs::program<TARGET_TYPE_MCBIST, TARGET_TYPE_MCA> l_program;
+ ccs::program l_program;
FAPI_DBG("%s executing training CCS instruction: 0x%016llx, 0x%016llx for cal config 0x%16x",
mss::c_str(i_target),
@@ -1303,7 +1304,7 @@ fapi2::ReturnCode override_odt_wr_config( const fapi2::Target<fapi2::TARGET_TYPE
FAPI_ASSERT( i_rank < MAX_MRANK_PER_PORT,
fapi2::MSS_INVALID_RANK()
.set_RANK(i_rank)
- .set_MCA_TARGET(i_target)
+ .set_PORT_TARGET(i_target)
.set_FUNCTION(OVERRIDE_ODT_WR_CONFIG),
"%s had invalid rank (0x%016lx) passed into override_odt_wr_config",
mss::c_str(i_target),
@@ -1337,7 +1338,7 @@ fapi_try_exit:
template<>
fapi2::ReturnCode setup_wr_level_terminations( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_rp,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// Danger: Make sure this DIMM target doesn't get used/accessed until it is populated
// by get_dimm_target_from_rank below!
@@ -1396,7 +1397,7 @@ fapi_try_exit:
template<>
fapi2::ReturnCode restore_mainline_terminations( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_rp,
- std::vector< ccs::instruction_t<TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// Danger: Make sure this DIMM target doesn't get used/accessed until it is populated
// by get_dimm_target_from_rank below!
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.H b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.H
index 9195725ae..06a115d85 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,7 +37,10 @@
#define _MSS_DDR_PHY_H_
#include <fapi2.H>
-#include <lib/ccs/ccs.H>
+#include <lib/shared/mss_const.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+
namespace mss
{
@@ -295,16 +298,15 @@ fapi2::ReturnCode override_odt_wr_config( const fapi2::Target<fapi2::TARGET_TYPE
///
/// @brief Setup terminations for WR_LEVEL cal for a given RP
/// @tparam T the target type of the MCA/MBA
-/// @tparam CT TargetType of the CCS instruction
/// @param[in] i_target the target associated with this cal setup
/// @param[in] i_rp selected rank pair
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-template< fapi2::TargetType T, fapi2::TargetType CT >
+template< fapi2::TargetType T >
fapi2::ReturnCode setup_wr_level_terminations( const fapi2::Target<T>& i_target,
const uint64_t i_rp,
- std::vector< ccs::instruction_t<CT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Setup terminations for WR_LEVEL cal for a given RP
@@ -313,24 +315,23 @@ fapi2::ReturnCode setup_wr_level_terminations( const fapi2::Target<T>& i_target,
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-template<>
+template< >
fapi2::ReturnCode setup_wr_level_terminations( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_rp,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Restore terminations after WR_LEVEL cal for a given RP
/// @tparam T the target type of the MCA/MBA
-/// @tparam CT TargetType of the CCS instruction
/// @param[in] i_target the target associated with this cal setup
/// @param[in] i_rp selected rank pair
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-template< fapi2::TargetType T, fapi2::TargetType CT >
+template< fapi2::TargetType T >
fapi2::ReturnCode restore_mainline_terminations( const fapi2::Target<T>& i_target,
const uint64_t i_rp,
- std::vector< ccs::instruction_t<CT> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Restore terminations after WR_LEVEL cal for a given RP
@@ -339,10 +340,10 @@ fapi2::ReturnCode restore_mainline_terminations( const fapi2::Target<T>& i_targe
/// @param[in,out] io_inst a vector of CCS instructions we should add to
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-template<>
+template< >
fapi2::ReturnCode restore_mainline_terminations( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_rp,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
///
/// @brief Perform the DLL calibration
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
index 507f95f86..81b8114ff 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
@@ -51,7 +51,7 @@
#include <generic/memory/lib/utils/scom.H>
#include <generic/memory/lib/utils/pos.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <generic/memory/lib/utils/find_magic.H>
+#include <lib/utils/find_magic.H>
#include <lib/workarounds/dp16_workarounds.H>
#include <lib/fir/check.H>
#include <generic/memory/lib/utils/mss_math.H>
@@ -4626,7 +4626,7 @@ fapi2::ReturnCode check_rp_and_dram( const fapi2::Target<fapi2::TARGET_TYPE_MCA>
// Checks for i_rp in bounds
FAPI_ASSERT(i_rp < MAX_RANK_PAIRS,
fapi2::MSS_INVALID_RANK().
- set_MCA_TARGET(i_target).
+ set_PORT_TARGET(i_target).
set_RANK(i_rp).
set_FUNCTION(i_function),
"%s rank pair is out of bounds %lu", mss::c_str(i_target), i_rp);
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H
index 73e011b94..1f9f9714d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.H
@@ -42,7 +42,7 @@
#include <p9_mc_scom_addresses_fld.H>
#include <generic/memory/lib/utils/scom.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/mss_bad_bits.H>
#include <lib/mss_attribute_accessors.H>
#include <lib/shared/mss_const.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C
index 8994a75d0..b57aa7070 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C
@@ -38,6 +38,7 @@
#include <lib/shared/nimbus_defaults.H>
#include <p9_mc_scom_addresses.H>
#include <p9_mc_scom_addresses_fld.H>
+#include <lib/shared/mss_const.H>
#include <lib/phy/mss_lrdimm_training.H>
#include <lib/phy/mss_training.H>
#include <lib/dimm/rank.H>
@@ -45,13 +46,15 @@
#include <lib/dimm/ddr4/control_word_ddr4.H>
#include <lib/dimm/ddr4/data_buffer_ddr4.H>
#include <lib/workarounds/ccs_workarounds.H>
-#include <lib/ccs/ccs.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/mc/port.H>
#include <lib/rosetta_map/rosetta_map.H>
#include <lib/dimm/ddr4/pba.H>
#include <lib/eff_config/timing.H>
#include <generic/memory/lib/utils/pos.H>
+
#ifdef LRDIMM_CAPABLE
#include <lib/phy/mss_lrdimm_training_helper.H>
#endif
@@ -190,7 +193,7 @@ fapi2::ReturnCode mpr_pattern_wr_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCA
return fapi2::FAPI2_RC_SUCCESS;
}
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
// Gets the DIMM target
@@ -250,16 +253,17 @@ fapi_try_exit:
///
fapi2::ReturnCode execute_nttm_mode_read(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target)
{
- using TT = ccsTraits<fapi2::TARGET_TYPE_MCBIST>;
+
+ using TT = ccsTraits<mss::mc_type::NIMBUS>;
// A hardware bug requires us to increase our delay significanlty for NTTM mode reads
constexpr uint64_t SAFE_NTTM_READ_DELAY = 0x40;
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
// Note: CKE are enabled by default in the NTTM mode read command, so we should be good to go
// set the NTTM read mode
- auto l_nttm_read = mss::ccs::nttm_read_command<fapi2::TARGET_TYPE_MCBIST>();
+ auto l_nttm_read = mss::ccs::nttm_read_command();
l_nttm_read.arr1.template insertFromRight<TT::ARR1_IDLES, TT::ARR1_IDLES_LEN>(SAFE_NTTM_READ_DELAY);
l_program.iv_instructions.push_back(l_nttm_read);
@@ -439,21 +443,21 @@ fapi2::ReturnCode mrep::set_delay(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&
const uint8_t i_rank,
const uint8_t i_delay ) const
{
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
std::vector<cw_info> l_bcws =
{
- {i_rank, NIBBLE0_BCW_NUMBER, i_delay, mss::tmrc(), mss::CW8_DATA_LEN, cw_info::BCW},
- {i_rank, NIBBLE1_BCW_NUMBER, i_delay, mss::tmrc(), mss::CW8_DATA_LEN, cw_info::BCW},
+ {i_rank, NIBBLE0_BCW_NUMBER, i_delay, mss::tmrd_l2(), mss::CW8_DATA_LEN, cw_info::BCW},
+ {i_rank, NIBBLE1_BCW_NUMBER, i_delay, mss::tmrd_l2(), mss::CW8_DATA_LEN, cw_info::BCW},
};
uint8_t l_sim = 0;
FAPI_TRY(mss::is_simulation(l_sim));
// Ensure our CKE's are powered on
- l_program.iv_instructions.push_back(mss::ccs::des_command<fapi2::TARGET_TYPE_MCBIST>());
+ l_program.iv_instructions.push_back(mss::ccs::des_command());
// Inserts the function space selects
FAPI_TRY(mss::ddr4::insert_function_space_select(l_bcws));
@@ -807,9 +811,11 @@ void deconfigure_steps(const uint8_t i_dimm_type,
// If the DIMM type is an LRDIMM, configure for LRDIMM
if(i_dimm_type == fapi2::ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM)
{
- FAPI_INF("LRDIMM: deconfigure WR VREF 2D");
+ FAPI_INF("LRDIMM: deconfigure WR VREF 2D and RD VREF 2D");
// We clear WRITE_CTR_2D_VREF as the HW calibration algorithm will not work with LRDIMM
- io_cal_steps.clearBit<WRITE_CTR_2D_VREF>();
+ // Same for RD VREF
+ io_cal_steps.clearBit<WRITE_CTR_2D_VREF>()
+ .clearBit<READ_CTR_2D_VREF>();
return;
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.H b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.H
index c7d92d98a..eef2c09d4 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,8 +39,10 @@
#define MSS_LRDIMM_TRAINING_H
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
+#include <lib/shared/mss_const.H>
#include <lib/phy/mss_training.H>
-#include <lib/ccs/ccs.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
#include <lib/dimm/ddr4/control_word_ddr4.H>
#include <lib/dimm/ddr4/data_buffer_ddr4.H>
@@ -52,6 +54,7 @@
#include <lib/rosetta_map/rosetta_map.H>
#include <lib/phy/ddr_phy.H>
+
// Disables LRDIMM support for HB
#ifndef __HOSTBOOT_MODULE
#define CONFIG_LRDIMM_CAPABLE 1
@@ -86,18 +89,16 @@ fapi2::ReturnCode mpr_pattern_wr_all_ranks(const fapi2::Target<fapi2::TARGET_TYP
///
/// @brief Adds all write commands for the passed in pattern
-/// @tparam fapi2::TargetType T target type for the CCS instruction
/// @param[in] i_target DIMM target on which to operate
/// @param[in] i_rank the DIMM rank to set the MPR on
/// @param[in] i_pattern the pattern to write into the MPRS
/// @param[in,out] io_insts CCS instructions
/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS iff ok
///
-template<fapi2::TargetType T>
inline fapi2::ReturnCode add_mpr_pattern_writes(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_pattern,
- std::vector<mss::ccs::instruction_t<T>>& io_insts)
+ std::vector<mss::ccs::instruction_t>& io_insts)
{
constexpr uint64_t NUM_MPR_PATTERNS = 4;
@@ -122,10 +123,10 @@ inline fapi2::ReturnCode add_mpr_pattern_writes(const fapi2::Target<fapi2::TARGE
FAPI_TRY(l_swizzled_pattern.extract(l_pattern, l_ba * PATTERN_LEN, PATTERN_LEN, ADDR_START), "%s ba%u",
mss::c_str(i_target), l_ba);
{
- auto l_wr = mss::ccs::wr_command<fapi2::TARGET_TYPE_MCBIST>( i_rank,
- l_ba,
- MPR_WR_BG,
- l_pattern);
+ auto l_wr = mss::ccs::wr_command( i_rank,
+ l_ba,
+ MPR_WR_BG,
+ l_pattern);
// Swaps the bank addresses so they're a true to the BA we tried to pass in above
swap<BA0, BA1>(l_wr.arr0);
@@ -142,14 +143,12 @@ fapi_try_exit:
///
/// @brief Helper function to disable address inversion
-/// @tparam fapi2::TargetType T target type for the CCS instruction
/// @param[in] i_target DIMM target on which to operate
/// @param[in,out] io_insts CCS instructions
/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS iff ok
///
-template<fapi2::TargetType T>
inline fapi2::ReturnCode disable_address_inversion(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector<mss::ccs::instruction_t<T>>& io_insts)
+ std::vector<mss::ccs::instruction_t>& io_insts)
{
// Declares the default control word that handles address inversion
// Data of 0 as we're going to override it below
@@ -177,14 +176,12 @@ fapi_try_exit:
///
/// @brief Helper function to restore default address inversion
-/// @tparam fapi2::TargetType T target type for the CCS instruction
/// @param[in] i_target DIMM target on which to operate
/// @param[in,out] io_insts CCS instructions
/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS iff ok
///
-template<fapi2::TargetType T>
inline fapi2::ReturnCode restore_address_inversion(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- std::vector<mss::ccs::instruction_t<T>>& io_insts)
+ std::vector<mss::ccs::instruction_t>& io_insts)
{
// Declares the default control word that handles address inversion
// Data of 0 as we're going to override it below
@@ -590,7 +587,7 @@ inline fapi2::ReturnCode set_buffer_training(const fapi2::Target<fapi2::TARGET_T
const mss::ddr4::training i_mode )
{
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
@@ -615,7 +612,7 @@ inline fapi2::ReturnCode mpr_load(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&
const uint8_t i_mode,
const uint64_t i_rank)
{
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
@@ -647,7 +644,7 @@ inline fapi2::ReturnCode mpr_read( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&
constexpr uint64_t SAFETY_CYCLES = 2;
constexpr uint64_t ODT_CYCLE_LEN = 5 + SAFETY_CYCLES * 2;
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST> l_program;
+ mss::ccs::program l_program;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
uint8_t l_cl = 0;
@@ -661,16 +658,16 @@ inline fapi2::ReturnCode mpr_read( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>&
FAPI_TRY(mss::eff_odt_rd(i_target, &l_rd_odt[0]));
- FAPI_TRY( ddr4::mpr_read<fapi2::TARGET_TYPE_MCBIST>(i_target, i_mpr_loc, i_rank, l_program.iv_instructions));
+ FAPI_TRY( ddr4::mpr_read(i_target, i_mpr_loc, i_rank, l_program.iv_instructions));
l_program.iv_instructions[0].arr1.template insertFromRight<MCBIST_CCS_INST_ARR1_00_IDLES,
MCBIST_CCS_INST_ARR1_00_IDLES_LEN>(l_delay);
// Holds the RD ODT's for 5 cycles
{
- const auto l_ccs_value = mss::ccs::convert_odt_attr_to_ccs<fapi2::TARGET_TYPE_MCBIST>(fapi2::buffer<uint8_t>
+ const auto l_ccs_value = mss::ccs::convert_odt_attr_to_ccs(fapi2::buffer<uint8_t>
(l_rd_odt[l_dimm_rank]));
- auto l_odt = mss::ccs::odt_command<fapi2::TARGET_TYPE_MCBIST>(l_ccs_value, ODT_CYCLE_LEN);
+ auto l_odt = mss::ccs::odt_command(l_ccs_value, ODT_CYCLE_LEN);
l_program.iv_instructions.push_back(l_odt);
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_training.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_training.C
index 50574d764..d48202d17 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_training.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_training.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2019 */
+/* Contributors Listed Below - COPYRIGHT 2017,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -55,6 +55,7 @@
#include <lib/dimm/ddr4/pda.H>
#include <lib/phy/seq.H>
#include <lib/phy/read_cntrl.H>
+#include <lib/mss_attribute_accessors.H>
#ifdef LRDIMM_CAPABLE
#include <lib/phy/mss_dwl.H>
@@ -67,6 +68,19 @@
namespace mss
{
+///
+/// @brief Bad bit getter - Nimbus specialization
+/// @param[in] i_target the fapi2 target oon which training was conducted
+/// @param[out] o_array the bad bits
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error code
+///
+template <>
+fapi2::ReturnCode get_bad_dq_bitmap<mss::mc_type::NIMBUS>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint8_t (&o_array)[BAD_BITS_RANKS][BAD_DQ_BYTE_COUNT])
+{
+ return mss::bad_dq_bitmap(i_target, &(o_array[0][0]));
+}
+
namespace training
{
// Below definitions are used to avoid linker errors
@@ -198,7 +212,7 @@ fapi2::ReturnCode wr_lvl::pre_workaround( const fapi2::Target<fapi2::TARGET_TYPE
const uint64_t i_rp,
const uint8_t i_abort_on_error ) const
{
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> > l_rtt_inst;
+ std::vector< ccs::instruction_t > l_rtt_inst;
FAPI_DBG("%s Running Pre-WR_LEVEL workaround steps on RP%d", mss::c_str(i_target), i_rp);
// Setup WR_LEVEL specific terminations
@@ -208,7 +222,7 @@ fapi2::ReturnCode wr_lvl::pre_workaround( const fapi2::Target<fapi2::TARGET_TYPE
if (!l_rtt_inst.empty())
{
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST, fapi2::TARGET_TYPE_MCA> l_program;
+ ccs::program l_program;
l_program.iv_instructions.insert(l_program.iv_instructions.end(), l_rtt_inst.begin(), l_rtt_inst.end() );
FAPI_TRY( mss::ccs::execute(l_mcbist, l_program, i_target) );
l_program.iv_instructions.clear();
@@ -261,7 +275,7 @@ fapi2::ReturnCode wr_lvl::post_workaround( const fapi2::Target<fapi2::TARGET_TYP
const uint64_t i_rp,
const uint8_t i_abort_on_error ) const
{
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> > l_rtt_inst;
+ std::vector< ccs::instruction_t > l_rtt_inst;
FAPI_DBG("%s Running Post-WR_LEVEL workaround steps on RP%d", mss::c_str(i_target), i_rp);
@@ -270,7 +284,7 @@ fapi2::ReturnCode wr_lvl::post_workaround( const fapi2::Target<fapi2::TARGET_TYP
if (!l_rtt_inst.empty())
{
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST, fapi2::TARGET_TYPE_MCA> l_program;
+ ccs::program l_program;
l_program.iv_instructions.insert(l_program.iv_instructions.end(),
l_rtt_inst.begin(),
l_rtt_inst.end() );
@@ -660,14 +674,14 @@ fapi2::ReturnCode write_ctr::post_workaround( const fapi2::Target<fapi2::TARGET_
// If the rank vector is empty log an error
FAPI_ASSERT(!l_ranks.empty(),
fapi2::MSS_INVALID_RANK().
- set_MCA_TARGET(i_target).
+ set_PORT_TARGET(i_target).
set_RANK(i_rp).
set_FUNCTION(mss::ffdc_function_codes::WR_VREF_TRAINING_WORKAROUND),
"%s rank pair is empty! %lu", mss::c_str(i_target), i_rp);
FAPI_ASSERT(l_ranks[0] != NO_RANK,
fapi2::MSS_INVALID_RANK().
- set_MCA_TARGET(i_target).
+ set_PORT_TARGET(i_target).
set_RANK(NO_RANK).
set_FUNCTION(mss::ffdc_function_codes::WR_VREF_TRAINING_WORKAROUND),
"%s rank pair has no ranks %lu", mss::c_str(i_target), i_rp);
@@ -767,7 +781,7 @@ fapi2::ReturnCode write_ctr::post_workaround( const fapi2::Target<fapi2::TARGET_
// As such, let's run the nvdimm with rank median vref value so later on we can just load
// the vref in 1 ccs sequence.
if ((l_hybrid[0] == fapi2::ENUM_ATTR_EFF_HYBRID_IS_HYBRID) &&
- (l_hybrid_type[0] == fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM) && !iv_wr_vref)
+ (l_hybrid_type[0] == fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM) && iv_wr_vref)
{
FAPI_TRY(mss::workarounds::wr_vref::nvdimm_workaround(i_target, i_rp, i_abort_on_error));
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/accessor_wrapper.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/accessor_wrapper.H
index a9cebab3a..fd0991a7a 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/accessor_wrapper.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/accessor_wrapper.H
@@ -22,3 +22,260 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+///
+/// @file accessor_wrapper.H
+/// @brief The wrapper of new accessor API(get_/set_) to old accessor API
+///
+
+// *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: FSP:HB
+
+#ifndef _MSS_ACCESSOR_WRAPPER_
+#define _MSS_ACCESSOR_WRAPPER_
+
+#include <fapi2.H>
+#include <lib/shared/mss_const.H>
+#include <lib/mss_attribute_accessors.H>
+
+
+namespace mss
+{
+namespace attr
+{
+///
+/// @brief ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint16_t& reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Runtime throttle numerator setting for cfg_nm_n_per_slot
+///
+inline fapi2::ReturnCode get_runtime_mem_throttled_n_commands_per_slot(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
+ i_target, uint16_t& o_value)
+{
+ return mss::runtime_mem_throttled_n_commands_per_slot(i_target, o_value);
+}
+
+///
+/// @brief ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT setter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[in] uint16_t the value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+/// @note Runtime throttle numerator setting for cfg_nm_n_per_slot
+///
+inline fapi2::ReturnCode set_runtime_mem_throttled_n_commands_per_slot(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
+ i_target, uint16_t i_value)
+{
+ uint16_t l_value[2] = {};
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT,
+ i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) );
+ l_value[mss::index(i_target)] = i_value;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT,
+ i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+
+///
+/// @brief ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint16_t& reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Runtime throttled N commands per M DRAM clocks setting for cfg_nm_n_per_port.
+///
+inline fapi2::ReturnCode get_runtime_mem_throttled_n_commands_per_port(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
+ i_target, uint16_t& o_value)
+{
+ return mss::runtime_mem_throttled_n_commands_per_port(i_target, o_value);
+}
+
+///
+/// @brief ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT setter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[in] uint16_t the value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+/// @note Runtime throttled N commands per M DRAM clocks setting for cfg_nm_n_per_port.
+///
+inline fapi2::ReturnCode set_runtime_mem_throttled_n_commands_per_port(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
+ i_target, uint16_t i_value)
+{
+ uint16_t l_value[2] = {};
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT,
+ i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) );
+ l_value[mss::index(i_target)] = i_value;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT,
+ i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint16_t& reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note This is the throttle numerator setting for cfg_nm_n_per_slot
+///
+inline fapi2::ReturnCode get_mem_throttled_n_commands_per_slot(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint16_t& o_value)
+{
+ return mss::mem_throttled_n_commands_per_slot(i_target, o_value);
+}
+
+///
+/// @brief ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT setter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[in] uint16_t the value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+/// @note This is the throttled N commands per window of M DRAM clocks setting for cfg_nm_n_per_port.
+///
+inline fapi2::ReturnCode set_mem_throttled_n_commands_per_port(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint16_t i_value)
+{
+ uint16_t l_value[2] = {};
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT, i_target.getParent<fapi2::TARGET_TYPE_MCS>(),
+ l_value) );
+ l_value[mss::index(i_target)] = i_value;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT, i_target.getParent<fapi2::TARGET_TYPE_MCS>(),
+ l_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint16_t& reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note This is the throttled N commands per window of M DRAM clocks setting for cfg_nm_n_per_port.
+///
+inline fapi2::ReturnCode get_mem_throttled_n_commands_per_port(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint16_t& o_value)
+{
+ return mss::mem_throttled_n_commands_per_port(i_target, o_value);
+}
+
+///
+/// @brief ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT setter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[in] uint16_t the value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+/// @note This is the throttle numerator setting for cfg_nm_n_per_slot
+///
+inline fapi2::ReturnCode set_mem_throttled_n_commands_per_slot(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint16_t i_value)
+{
+ uint16_t l_value[2] = {};
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, i_target.getParent<fapi2::TARGET_TYPE_MCS>(),
+ l_value) );
+ l_value[mss::index(i_target)] = i_value;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, i_target.getParent<fapi2::TARGET_TYPE_MCS>(),
+ l_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MSS_PORT_MAXPOWER setter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[in] uint32_t the value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+/// @note Channel Pair Max Power output from thermal procedures
+///
+inline fapi2::ReturnCode set_port_maxpower(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint32_t i_value)
+{
+ uint32_t l_value[2] = {};
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_PORT_MAXPOWER, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) );
+ l_value[mss::index(i_target)] = i_value;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MSS_PORT_MAXPOWER, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MSS_PORT_MAXPOWER: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+
+///
+/// @brief ATTR_MSS_DIMM_THERMAL_LIMIT getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint32_t&[] array reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note DIMM Max Power based on a thermal limit Decoded from ATTR_MSS_MRW_THERMAL_POWER_LIMIT
+///
+inline fapi2::ReturnCode get_dimm_thermal_limit(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint32_t (&o_array)[2])
+{
+ return mss::dimm_thermal_limit(i_target, o_array);
+}
+
+///
+/// @brief ATTR_MSS_TOTAL_PWR_INTERCEPT getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint16_t&[] array reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note VDDR+VPP Power intercept value for dimm creator: mss_eff_config consumer: mss_bulk_pwr_throttles
+///
+inline fapi2::ReturnCode get_total_pwr_intercept(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint16_t (&o_array)[2])
+{
+ return total_pwr_intercept(i_target, o_array);
+}
+
+///
+/// @brief ATTR_MSS_TOTAL_PWR_SLOPE getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint16_t&[] array reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note VDDR+VPP Power slope value for dimm creator: mss_eff_config consumer: mss_bulk_pwr_throttles
+///
+inline fapi2::ReturnCode get_total_pwr_slope(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ uint16_t (&o_array)[2])
+{
+ return mss::total_pwr_slope(i_target, o_array);
+}
+
+///
+/// @brief ATTR_MSS_MEM_WATT_TARGET getter
+/// @param[in] const ref to the TARGET_TYPE_MCA
+/// @param[out] uint32_t&[] array reference to store the value
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Total memory power used to throttle for each dimm Used to compute the throttles
+/// on the channel and/or dimms for OCC OCC sets after IPL creator: mss_eff_config consumer:
+/// mss_bulk_pwr_throttle, mss_utils_to_throttle firmware notes: none.
+///
+inline fapi2::ReturnCode get_mem_watt_target(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint32_t& o_value)
+{
+ return mss::mem_watt_target(i_target, o_value);
+}
+
+}// namespace attr
+}// namespace mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C
index b381042a2..8855a30f7 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -32,6 +32,7 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+#include <lib/shared/nimbus_defaults.H>
// fapi2
#include <fapi2.H>
#include <vector>
@@ -41,103 +42,24 @@
#include <mss.H>
#include <lib/power_thermal/throttle.H>
#include <lib/power_thermal/decoder.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/c_str.H>
#include <generic/memory/lib/utils/count_dimm.H>
-#include <lib/dimm/kind.H>
-#include <lib/shared/mss_const.H>
+#include <generic/memory/lib/utils/power_thermal/gen_decoder.H>
+#include <lib/dimm/nimbus_kind.H>
-using fapi2::TARGET_TYPE_MCA;
-using fapi2::TARGET_TYPE_MCS;
-using fapi2::TARGET_TYPE_DIMM;
-using fapi2::TARGET_TYPE_MCBIST;
namespace mss
{
namespace power_thermal
{
-///
-/// @brief generates the 32 bit encoding for the power curve attributes
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
-/// @note populates iv_gen_keys
-///
-fapi2::ReturnCode decoder::generate_encoding()
+const std::vector< std::pair<uint8_t , uint8_t> > throttle_traits<mss::mc_type::NIMBUS>::DIMM_TYPE_MAP =
{
- //DIMM_SIZE
- FAPI_TRY(( encode<DIMM_SIZE_START, DIMM_SIZE_LEN>
- (iv_kind.iv_target, iv_kind.iv_size, DIMM_SIZE_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DIMM_SIZE", iv_kind.iv_size, c_str(iv_kind.iv_target) );
-
- //DRAM_GEN
- FAPI_TRY(( encode<DRAM_GEN_START, DRAM_GEN_LEN>
- (iv_kind.iv_target, iv_kind.iv_dram_generation, DRAM_GEN_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DRAM_GEN", iv_kind.iv_dram_generation, c_str(iv_kind.iv_target) );
-
- //DIMM_TYPE
- FAPI_TRY(( encode<DIMM_TYPE_START, DIMM_TYPE_LEN>
- (iv_kind.iv_target, iv_kind.iv_dimm_type, DIMM_TYPE_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DIMM_TYPE", iv_kind.iv_dimm_type, c_str(iv_kind.iv_target) );
-
- //DRAM WIDTH
- FAPI_TRY(( encode<DRAM_WIDTH_START, DRAM_WIDTH_LEN>
- (iv_kind.iv_target, iv_kind.iv_dram_width, DRAM_WIDTH_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DRAM_WIDTH", iv_kind.iv_dram_width, c_str(iv_kind.iv_target) );
-
- //DRAM DENSITY
- FAPI_TRY(( encode<DRAM_DENSITY_START, DRAM_DENSITY_LEN>
- (iv_kind.iv_target, iv_kind.iv_dram_density, DRAM_DENSITY_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DRAM_DENSITY", iv_kind.iv_dram_density, c_str(iv_kind.iv_target) );
-
- //DRAM STACK TYPE
- FAPI_TRY(( encode<DRAM_STACK_TYPE_START, DRAM_STACK_TYPE_LEN>
- (iv_kind.iv_target, iv_kind.iv_stack_type, DRAM_STACK_TYPE_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DRAM_STACK_TYPE", iv_kind.iv_stack_type, c_str(iv_kind.iv_target) );
-
- //DRAM MFG ID
- FAPI_TRY(( encode<DRAM_MFGID_START, DRAM_MFGID_LEN>
- (iv_kind.iv_target, iv_kind.iv_mfgid, DRAM_MFGID_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DRAM_MFG_ID", iv_kind.iv_mfgid, c_str(iv_kind.iv_target) );
-
- //NUM DROPS PER PORT
- FAPI_TRY(( encode<DIMMS_PER_PORT_START, DIMMS_PER_PORT_LEN>
- (iv_kind.iv_target, iv_dimms_per_port, DIMMS_PORT_MAP, iv_gen_key)),
- "Failed to generate power thermal encoding for %s val %d on target: %s",
- "DIMMS_PER_PORT", iv_dimms_per_port, c_str(iv_kind.iv_target) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-///
-///@brief a compare functor for the decoder::find_attr functions below
-///@note AND's the input hash with the generated hash from the DIMM to see if they match
-///@note Using an AND instead of == because not all DIMM configs have power slopes, so defaults are needed
-///
-struct is_match
-{
- ///
- ///@brief functor constructor
- ///@param[in] i_gen_key the class object's constructed hash for the installed dimm, to be compared with the attr array
- ///
- is_match(const uint32_t i_gen_key) : iv_gen_key(i_gen_key) {}
- const fapi2::buffer<uint32_t> iv_gen_key;
-
- ///
- ///@brief Boolean compare used for find_if function
- ///
- bool operator()(const uint64_t i_hash)
- {
- // l_this_hash is the first half of the i_hash's bits
- uint32_t l_this_hash = i_hash >> 32;
- return ((l_this_hash & iv_gen_key) == iv_gen_key);
- }
+ {fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_RDIMM, 0b00},
+ {fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_UDIMM, 0b01},
+ {fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_LRDIMM, 0b10},
+ {ANY_TYPE, 0b11}
};
///
@@ -146,16 +68,21 @@ struct is_match
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
/// @note populates iv_vddr_slope, iv_total_slop
///
-fapi2::ReturnCode decoder::find_slope (const std::vector<uint64_t>& i_slope)
+template<>
+fapi2::ReturnCode decoder<mss::mc_type::NIMBUS>::find_slope (
+ const std::vector< const std::vector<uint64_t>* >& i_slope)
{
+ using TT = throttle_traits<mss::mc_type::NIMBUS>;
+
+ // For nimbus only one attribute is used to get slope (i_slope[0])
// Find iterator to matching key (if it exists)
- const auto l_value_iterator = std::find_if(i_slope.begin(),
- i_slope.end(),
- is_match(iv_gen_key));
+ const auto l_value_iterator = std::find_if((*i_slope[0]).begin(),
+ (*i_slope[0]).end(),
+ is_match<>(iv_gen_key));
//Should have matched with the default ATTR value at least
//The last value should always be the default value
- FAPI_ASSERT(l_value_iterator != i_slope.end(),
+ FAPI_ASSERT(l_value_iterator != (*i_slope[0]).end(),
fapi2::MSS_NO_POWER_THERMAL_ATTR_FOUND()
.set_GENERATED_KEY(iv_gen_key)
.set_FUNCTION(SLOPE)
@@ -184,8 +111,8 @@ fapi2::ReturnCode decoder::find_slope (const std::vector<uint64_t>& i_slope)
{
const fapi2::buffer<uint64_t> l_temp(*l_value_iterator);
- l_temp.extractToRight<VDDR_START, VDDR_LENGTH>( iv_vddr_slope);
- l_temp.extractToRight<TOTAL_START, TOTAL_LENGTH>(iv_total_slope);
+ l_temp.extractToRight<TT::VDDR_START, TT::VDDR_LENGTH>( iv_vddr_slope);
+ l_temp.extractToRight<TT::TOTAL_START, TT::TOTAL_LENGTH>(iv_total_slope);
}
fapi_try_exit:
return fapi2::current_err;
@@ -197,15 +124,19 @@ fapi_try_exit:
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
/// @note populates iv_vddr_intercept, iv_total_intercept
///
-fapi2::ReturnCode decoder::find_intercept (const std::vector<uint64_t>& i_intercept)
+template<>
+fapi2::ReturnCode decoder<mss::mc_type::NIMBUS>::find_intercept (
+ const std::vector< const std::vector<uint64_t>* >& i_intercept)
{
+ using TT = throttle_traits<mss::mc_type::NIMBUS>;
+
// Find iterator to matching key (if it exists)
- const auto l_value_iterator = std::find_if(i_intercept.begin(),
- i_intercept.end(),
- is_match(iv_gen_key));
+ const auto l_value_iterator = std::find_if((*i_intercept[0]).begin(),
+ (*i_intercept[0]).end(),
+ is_match<>(iv_gen_key));
//Should have matched with the all default ATTR at least
//The last value should always be the default value
- FAPI_ASSERT(l_value_iterator != i_intercept.end(),
+ FAPI_ASSERT(l_value_iterator != (*i_intercept[0]).end(),
fapi2::MSS_NO_POWER_THERMAL_ATTR_FOUND()
.set_GENERATED_KEY(iv_gen_key)
.set_FUNCTION(INTERCEPT)
@@ -234,31 +165,36 @@ fapi2::ReturnCode decoder::find_intercept (const std::vector<uint64_t>& i_interc
{
const fapi2::buffer<uint64_t> l_temp(*l_value_iterator);
- l_temp.extractToRight<VDDR_START, VDDR_LENGTH>( iv_vddr_intercept);
- l_temp.extractToRight<TOTAL_START, TOTAL_LENGTH>(iv_total_intercept);
+ l_temp.extractToRight<TT::VDDR_START, TT::VDDR_LENGTH>( iv_vddr_intercept);
+ l_temp.extractToRight<TT::TOTAL_START, TT::TOTAL_LENGTH>(iv_total_intercept);
}
fapi_try_exit:
return fapi2::current_err;
}
+
///
/// @brief Finds a value from ATTR_MSS_MRW_THERMAL_MEMORY_POWER_LIMIT and stores in iv variable
/// @param[in] i_thermal_limits is a vector of the generated values from ATTR_MSS_MRW_THERMAL_POWER_LIMIT
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
-/// @note populates thermal_power_limit
+/// @note populates thermal_power_limit.
///
-fapi2::ReturnCode decoder::find_thermal_power_limit (const std::vector<uint64_t>& i_thermal_limits)
+template<>
+fapi2::ReturnCode decoder<mss::mc_type::NIMBUS>::find_thermal_power_limit (
+ const std::vector< const std::vector<uint64_t>* >& i_thermal_limits)
{
+ using TT = throttle_traits<mss::mc_type::NIMBUS>;
+
// Find iterator to matching key (if it exists)
- const auto l_value_iterator = std::find_if(i_thermal_limits.begin(),
- i_thermal_limits.end(),
- is_match(iv_gen_key));
+ const auto l_value_iterator = std::find_if((*i_thermal_limits[0]).begin(),
+ (*i_thermal_limits[0]).end(),
+ is_match<>(iv_gen_key));
fapi2::buffer<uint64_t> l_temp;
//Should have matched with the all default ATTR at least
//The last value should always be the default value
- FAPI_ASSERT(l_value_iterator != i_thermal_limits.end(),
+ FAPI_ASSERT(l_value_iterator != (*i_thermal_limits[0]).end(),
fapi2::MSS_NO_POWER_THERMAL_ATTR_FOUND()
.set_GENERATED_KEY(iv_gen_key)
.set_FUNCTION(POWER_LIMIT)
@@ -287,11 +223,13 @@ fapi2::ReturnCode decoder::find_thermal_power_limit (const std::vector<uint64_t>
{
const fapi2::buffer<uint64_t> l_temp(*l_value_iterator);
- l_temp.extractToRight<THERMAL_POWER_START, THERMAL_POWER_LENGTH>( iv_thermal_power_limit);
+ l_temp.extractToRight<TT::THERMAL_POWER_START, TT::THERMAL_POWER_LENGTH>( iv_thermal_power_limit);
}
fapi_try_exit:
return fapi2::current_err;
}
+
+
///
/// @brief find the power curve attributes for each dimm on an MCS target
/// @param[in] i_targets vector of MCS targets on which dimm attrs will be set
@@ -317,13 +255,15 @@ fapi2::ReturnCode get_power_attrs (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&
uint16_t o_total_int [PORTS_PER_MCS][MAX_DIMM_PER_PORT],
uint32_t o_thermal_power [PORTS_PER_MCS][MAX_DIMM_PER_PORT])
{
+ using TT = throttle_traits<mss::mc_type::NIMBUS>;
+
for (const auto& l_dimm : find_targets <fapi2::TARGET_TYPE_DIMM> (i_mcs))
{
- const auto l_mca_pos = mss::index (find_target<TARGET_TYPE_MCA>(l_dimm));
+ const auto l_mca_pos = mss::index (find_target<fapi2::TARGET_TYPE_MCA>(l_dimm));
const auto l_dimm_pos = mss::index (l_dimm);
- mss::dimm::kind l_kind (l_dimm);
- mss::power_thermal::decoder l_decoder(l_kind);
+ mss::dimm::kind<> l_kind (l_dimm);
+ mss::power_thermal::decoder<> l_decoder(l_kind);
FAPI_TRY( l_decoder.generate_encoding(), "%s Error in get_power_attrs", mss::c_str(i_mcs) );
// The first entry into these arrays must be valid
@@ -331,12 +271,13 @@ fapi2::ReturnCode get_power_attrs (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&
if (i_slope.empty() || i_slope[0] == 0)
{
FAPI_INF("%s ATTR_MSS_MRW_PWR_SLOPE not found!!", mss::c_str(i_mcs));
- o_vddr_slope [l_mca_pos][l_dimm_pos] = default_power::VDDR_SLOPE;
- o_total_slope [l_mca_pos][l_dimm_pos] = default_power::TOTAL_SLOPE;
+ o_vddr_slope [l_mca_pos][l_dimm_pos] = TT::VDDR_SLOPE;
+ o_total_slope [l_mca_pos][l_dimm_pos] = TT::TOTAL_SLOPE;
}
else
{
- FAPI_TRY( l_decoder.find_slope(i_slope), "%s Error in get_power_attrs", mss::c_str(i_mcs) );
+ const std::vector< const std::vector<uint64_t>* > l_slope {&i_slope};
+ FAPI_TRY( l_decoder.find_slope(l_slope), "%s Error in get_power_attrs", mss::c_str(i_mcs) );
o_vddr_slope [l_mca_pos][l_dimm_pos] = l_decoder.iv_vddr_slope;
o_total_slope [l_mca_pos][l_dimm_pos] = l_decoder.iv_total_slope;
}
@@ -344,12 +285,13 @@ fapi2::ReturnCode get_power_attrs (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&
if (i_intercept.empty() || i_intercept[0] == 0)
{
FAPI_INF("%s ATTR_MSS_MRW_PWR_INTERCEPT not found!!", mss::c_str(i_mcs));
- o_total_int [l_mca_pos][l_dimm_pos] = default_power::TOTAL_INT;
- o_vddr_int [l_mca_pos][l_dimm_pos] = default_power::VDDR_INT;
+ o_total_int [l_mca_pos][l_dimm_pos] = TT::TOTAL_INT;
+ o_vddr_int [l_mca_pos][l_dimm_pos] = TT::VDDR_INT;
}
else
{
- FAPI_TRY( l_decoder.find_intercept(i_intercept), "%s Error in get_power_attrs", mss::c_str(i_mcs) );
+ std::vector< const std::vector<uint64_t>* > l_intercept {&i_intercept};
+ FAPI_TRY( l_decoder.find_intercept(l_intercept), "%s Error in get_power_attrs", mss::c_str(i_mcs) );
o_vddr_int [l_mca_pos][l_dimm_pos] = l_decoder.iv_vddr_intercept;
o_total_int [l_mca_pos][l_dimm_pos] = l_decoder.iv_total_intercept;
}
@@ -357,11 +299,12 @@ fapi2::ReturnCode get_power_attrs (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&
if (i_thermal_power_limit.empty() || i_thermal_power_limit[0] == 0)
{
FAPI_INF("%s ATTR_MSS_MRW_THERMAL_MEMORY_POWER_LIMIT not found!!", mss::c_str(i_mcs));
- o_thermal_power [l_mca_pos][l_dimm_pos] = default_power::THERMAL_LIMIT;
+ o_thermal_power [l_mca_pos][l_dimm_pos] = TT::THERMAL_LIMIT;
}
else
{
- FAPI_TRY( l_decoder.find_thermal_power_limit(i_thermal_power_limit),
+ std::vector< const std::vector<uint64_t>* > l_thermal_power_limit {&i_thermal_power_limit};
+ FAPI_TRY( l_decoder.find_thermal_power_limit(l_thermal_power_limit),
"%s Error in get_power_attrs", mss::c_str(i_mcs) );
o_thermal_power [l_mca_pos][l_dimm_pos] = l_decoder.iv_thermal_power_limit;
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H
index ac1efcdbe..f6f9bf5ea 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H
@@ -36,222 +36,17 @@
#define _MSS_POWER_DECODER__
#include <fapi2.H>
-#include <lib/dimm/kind.H>
+#include <lib/shared/mss_const.H>
+#include <lib/dimm/nimbus_kind.H>
#include <generic/memory/lib/utils/count_dimm.H>
+#include <generic/memory/lib/utils/power_thermal/gen_decoder.H>
+
namespace mss
{
namespace power_thermal
{
-enum size_of_attrs : size_t
-{
- SIZE_OF_POWER_CURVES_ATTRS = 100,
- SIZE_OF_THERMAL_ATTR = 10,
-};
-
-enum default_power
-{
- //Values are the worst case defaults for power curves
- //They are the default/ catch-all values from the power curve attributes
- //Shouldn't be used if system is set up correctly and attributes are available
- //This will throttle the DIMMs to ~76% dram data bus utilization
- //(using the mrw regulator power limit of 1700 cW and thermal power limit here of 1940 cW).
- VDDR_SLOPE = 0x41A,
- VDDR_INT = 0x384,
- TOTAL_SLOPE = 0x44C,
- TOTAL_INT = 0x44C,
- THERMAL_LIMIT = 0x794,
-};
-
-//Currently needs to be in sorted order for lookup to work
-static const std::vector< std::pair<uint32_t , uint8_t> > DIMM_SIZE_MAP =
-{
- {4, 0b0000},
- {8, 0b0001},
- {16, 0b0010},
- {32, 0b0011},
- {64, 0b0100},
- {128, 0b0101},
- {256, 0b0110},
- {512, 0b0111},
-};
-
-static const std::vector< std::pair<uint8_t , uint8_t> > DIMM_TYPE_MAP =
-{
- {fapi2::ENUM_ATTR_EFF_DIMM_TYPE_RDIMM, 0b00},
- {fapi2::ENUM_ATTR_EFF_DIMM_TYPE_UDIMM, 0b01},
- {fapi2::ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM, 0b10},
-};
-
-static const std::vector< std::pair<uint8_t , uint8_t> > DRAM_GEN_MAP =
-{
- {fapi2::ENUM_ATTR_EFF_DRAM_GEN_EMPTY, 0b00},
- {fapi2::ENUM_ATTR_EFF_DRAM_GEN_DDR3, 0b01},
- {fapi2::ENUM_ATTR_EFF_DRAM_GEN_DDR4, 0b10}
-};
-
-static const std::vector <std::pair<uint8_t, uint8_t> > DRAM_WIDTH_MAP =
-{
- {fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4, 0b000},
- {fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8, 0b001},
- {fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X16, 0b010},
- {fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X32, 0b011}
-};
-
-static const std::vector< std::pair<uint8_t , uint8_t> > DRAM_DENSITY_MAP =
-{
- {4, 0b000},
- {8, 0b001},
- {16, 0b010},
- {32, 0b011},
- {64, 0b100},
-};
-
-static const std::vector <std::pair<uint8_t, uint8_t> > DRAM_STACK_TYPE_MAP =
-{
- {fapi2::ENUM_ATTR_EFF_PRIM_STACK_TYPE_SDP, 0b00},
- {fapi2::ENUM_ATTR_EFF_PRIM_STACK_TYPE_DDP_QDP, 0b01},
- {fapi2::ENUM_ATTR_EFF_PRIM_STACK_TYPE_3DS, 0b10}
-};
-
-//Note, the first entries of the pairs need to be in sorted order!!
-static const std::vector <std::pair<uint16_t, uint8_t> > DRAM_MFGID_MAP =
-{
- //Kingston
- {0x0198, 0b011},
- //A-data
- {0x04CB, 0b101},
- //Micron
- {0x802C, 0b000},
- //HYNIX
- {0x80AD, 0b001},
- //SAMSUNG
- {0x80CE, 0b010},
- //Innodisk
- {0x86F1, 0b100},
-};
-
-static const std::vector < std::pair< uint8_t, uint8_t> > DIMMS_PORT_MAP =
-{
- //Num dimms per MCA, only 1 or 2 possible options. 0 is no-op
- {1, 0b00},
- {2, 0b01}
-};
-
-//Bit positions for different section of the attribute
-//first 32 bits are the encoding, second are for values
-enum DECODE_BUFFER_POS
-{
- ENCODING_START = 0,
- ENCODING_LENGTH = 32,
- VDDR_START = 32,
- VDDR_LENGTH = 16,
- TOTAL_START = 48,
- TOTAL_LENGTH = 16,
- THERMAL_POWER_START = 32,
- THERMAL_POWER_LENGTH = 32,
-};
-
-//Positions and lengths of the encodings
-enum ATTR_DECODE_INFO
-{
- DIMM_SIZE_START = 0,
- DIMM_SIZE_LEN = 4,
-
- DRAM_GEN_START = 4,
- DRAM_GEN_LEN = 2,
-
- DIMM_TYPE_START = 6,
- DIMM_TYPE_LEN = 2,
-
- DRAM_WIDTH_START = 8,
- DRAM_WIDTH_LEN = 3,
-
- DRAM_DENSITY_START = 11,
- DRAM_DENSITY_LEN = 3,
-
- DRAM_STACK_TYPE_START = 14,
- DRAM_STACK_TYPE_LEN = 2,
-
- DRAM_MFGID_START = 16,
- DRAM_MFGID_LEN = 3,
-
- DIMMS_PER_PORT_START = 19,
- DIMMS_PER_PORT_LEN = 2,
-};
-
-///
-/// @class decoder
-/// @brief Decodes the power curve and thermal power limit attributes for eff_config_thermal
-///
-class decoder
-{
- public:
-
- //IVs for all of the attributes per MCS
- const mss::dimm::kind iv_kind;
-
- //Left in here rather than calculating during encode for testing
- uint8_t iv_dimms_per_port;
-
- //Power thermal attributes, both total and vddr versions will be used in eff_config_thermal
- uint16_t iv_vddr_slope;
- uint16_t iv_vddr_intercept;
- uint16_t iv_total_slope;
- uint16_t iv_total_intercept;
-
- uint32_t iv_thermal_power_limit;
- //Generated key, used to decode all three power curve attributes
- fapi2::buffer<uint32_t> iv_gen_key;
-
- ///
- /// @brief Constructor
- /// @param[in] dimm::kind to call power thermal stuff on
- ///
- decoder( mss::dimm::kind& i_kind):
- iv_kind(i_kind)
- {
- iv_dimms_per_port = mss::count_dimm (find_target<fapi2::TARGET_TYPE_MCA>(iv_kind.iv_target));
- };
-
- //
- // @brief Default destructor
- //
- ~decoder() = default;
-
- ///
- /// @brief generates the 32 bit encoding for the power curve attributes
- /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
- /// @note populates iv_gen_key
- ///
- fapi2::ReturnCode generate_encoding ();
-
- ///
- /// @brief Finds a value for the power curve slope attributes by matching the generated hashes
- /// @param[in] i_array is a vector of the attribute values
- /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
- /// @note populates iv_vddr_slope, iv_total_slope
- ///
- fapi2::ReturnCode find_slope (const std::vector<uint64_t>& i_slope);
-
- ///
- /// @brief Finds a value for power curve intercept attributes by matching the generated hashes
- /// @param[in] i_array is a vector of the attribute values
- /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
- /// @note populates iv_vddr_intercept, iv_total_intercept
- ///
- fapi2::ReturnCode find_intercept (const std::vector<uint64_t>& i_intercept);
-
- ///
- /// @brief Finds a value from ATTR_MSS_MRW_THERMAL_MEMORY_POWER_LIMIT and stores in iv variable
- /// @param[in] i_array is a vector of the attribute values
- /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful
- /// @note populates iv_thermal_power_limit
- ///
- fapi2::ReturnCode find_thermal_power_limit (const std::vector<uint64_t>& i_thermal_limits);
-
-};
///
/// @brief find the power curve attributes for each dimm on an MCS target
@@ -277,70 +72,6 @@ fapi2::ReturnCode get_power_attrs (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&
uint16_t o_total_slope [PORTS_PER_MCS][MAX_DIMM_PER_PORT],
uint16_t o_total_int [PORTS_PER_MCS][MAX_DIMM_PER_PORT],
uint32_t o_thermal_power [PORTS_PER_MCS][MAX_DIMM_PER_PORT]);
-///
-/// @brief Encode the attribute into a bit encoding
-/// @tparam[in] S *ATTR*_SIZE enum used for fapi2::buffer position
-/// @tparam[in] L *ATTR*_LEN enum used for fapi2::buffer position
-/// @tparam[in] OT fapi2::buffer of some integral type
-/// @tparam[in] T integral type of key
-/// @param[in] i_target the DIMM the encoding is for
-/// @param[in] i_attr the attribute key being used for the encoding
-/// @param[in] i_map a vector of pairs of the ATTR values and encodings for each value, sorted
-/// @param[out] o_buf the fapi2::buffer where the encoding is going into
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff attribute is found in map lookup
-///
-template<size_t S, size_t L, typename T, typename OT>
-inline fapi2::ReturnCode encode ( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const T& i_attr,
- const std::vector<std::pair<T, OT> >& i_map,
- fapi2::buffer<uint32_t>& o_buf)
-{
- //used to hold result from vector pair lookup
- OT l_encoding = 0;
-
- //Failing out if we don't find an encoding. All suported types should be encoded above
- FAPI_ASSERT( mss::find_value_from_key (i_map, i_attr, l_encoding),
- fapi2::MSS_POWER_THERMAL_ENCODE_ERROR()
- .set_ATTR(i_attr)
- .set_DIMM_TARGET(i_target),
- "Couldn't find encoding for power thermal encode for value: %x target: %s", i_attr, mss::c_str(i_target));
- o_buf.insertFromRight<S, L>(l_encoding);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Decode the attribute into a bit encoding
-/// @tparam[in] S DRAM_GEN_SIZE enum used for fapi2::buffer position
-/// @tparam[in] L DRAM_GEN_LEN enum used for fapi2::buffer position
-/// @tparam[in] OT fapi2::buffer of some integral type
-/// @tparam[in] T integral type of key
-/// @param[in] i_target the DIMM the encoding is for
-/// @param[in] i_map a vector of pairs of the ATTR values and encodings for each value
-/// @param[in] i_buf the fapi2::buffer that has the encoding to parse
-/// @param[out] o_attr the attribute value from the encoding is going
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff attribute is found in map lookup
-///
-template<size_t S, size_t L, typename T, typename OT>
-inline fapi2::ReturnCode decode ( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
- const std::vector<std::pair<T, OT> >& i_map,
- fapi2::buffer<uint32_t>& i_buf,
- T& o_attr )
-{
- //used to hold result from vector pair lookup
- OT l_encoding = 0;
- i_buf.extractToRight<S, L>(l_encoding);
-
- //Failing out if we don't find an decoding. All suported types should be encoded above
- FAPI_ASSERT( mss::find_key_from_value (i_map, l_encoding, o_attr),
- fapi2::MSS_POWER_THERMAL_DECODE_ERROR()
- .set_ATTR(l_encoding)
- .set_DIMM_TARGET(i_target),
- "Couldn't find encoding for power thermal decode for target: %s", mss::c_str(i_target));
-fapi_try_exit:
- return fapi2::current_err;
-}
} // power_thermal
} // mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C
index 82a5e2c6e..0ef22bddd 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C
@@ -31,6 +31,8 @@
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+
+#include <lib/shared/nimbus_defaults.H>
//std lib
#include<algorithm>
// fapi2
@@ -41,687 +43,12 @@
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/utils/pos.H>
-using fapi2::TARGET_TYPE_MCA;
-using fapi2::TARGET_TYPE_MCS;
-using fapi2::TARGET_TYPE_DIMM;
-using fapi2::TARGET_TYPE_MCBIST;
-
namespace mss
{
namespace power_thermal
{
///
-/// @brief Constructor
-/// @param[in] i_target MCS target to call power thermal stuff on
-/// @param[out] o_rc, a return code which determines the success of the constructor
-///
-throttle::throttle( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_mca, fapi2::ReturnCode& o_rc) :
- iv_target(i_mca),
- iv_databus_port_max(0),
- iv_runtime_n_slot(0),
- iv_runtime_n_port(0),
- iv_n_slot(0),
- iv_n_port(0),
- iv_port_power_limit(0),
- iv_calc_port_maxpower(0)
-{
- //holder for watt_target to add up for port
- uint32_t l_dimm_power_limits [MAX_DIMM_PER_PORT] = {};
-
- FAPI_TRY( mrw_max_dram_databus_util(iv_databus_port_max), "%s Error in throttle ctor", mss::c_str(i_mca) );
- FAPI_TRY( mrw_dimm_power_curve_percent_uplift(iv_power_uplift), "%s Error in throttle ctor", mss::c_str(i_mca) );
- FAPI_TRY( mrw_dimm_power_curve_percent_uplift_idle(iv_power_uplift_idle), "%s Error in throttle ctor",
- mss::c_str(i_mca) );
- FAPI_TRY( dimm_thermal_limit( iv_target, iv_dimm_thermal_limit), "%s Error in throttle ctor", mss::c_str(i_mca) );
- FAPI_TRY( total_pwr_intercept( iv_target, iv_pwr_int), "%s Error in throttle ctor", mss::c_str(i_mca) );
- FAPI_TRY( total_pwr_slope( iv_target, iv_pwr_slope), "%s Error in throttle ctor", mss::c_str(i_mca) );
- FAPI_TRY( runtime_mem_throttled_n_commands_per_slot(iv_target, iv_runtime_n_slot ), "%s Error in throttle ctor",
- mss::c_str(i_mca) );
- FAPI_TRY( runtime_mem_throttled_n_commands_per_port(iv_target, iv_runtime_n_port ), "%s Error in throttle ctor",
- mss::c_str(i_mca) );
- FAPI_TRY( mem_watt_target( iv_target, l_dimm_power_limits), "%s Error in throttle ctor", mss::c_str(i_mca) );
- FAPI_TRY( mrw_mem_m_dram_clocks(iv_m_clocks), "%s Error in throttle ctor", mss::c_str(i_mca) );
-
- //Port power limit = sum of dimm power limits
- for ( const auto& l_dimm : mss::find_targets<TARGET_TYPE_DIMM>(iv_target) )
- {
- iv_port_power_limit += l_dimm_power_limits[mss::index(l_dimm)];
- }
-
- FAPI_INF("Setting up throttle for target %s, Values are: max databus is %d, uplifts are %d %d, runtime throttles are %d %d",
- mss::c_str(iv_target),
- iv_databus_port_max,
- iv_power_uplift,
- iv_power_uplift_idle,
- iv_runtime_n_slot,
- iv_runtime_n_port);
-
- FAPI_INF("The dimm power limit for dimm0 is %d, dimm1 is %d, port power limit is %d, dram clocks are %d, dimm power curve slopes are %d %d,",
- l_dimm_power_limits[0],
- l_dimm_power_limits[1],
- iv_port_power_limit,
- iv_m_clocks,
- iv_pwr_slope[0],
- iv_pwr_slope[1]);
-
- FAPI_INF("DIMM power curve intercepts are %d %d, DIMM power thermal limits are %d %d",
- iv_pwr_int[0],
- iv_pwr_int[1],
- iv_dimm_thermal_limit[0],
- iv_dimm_thermal_limit[1]);
-
- FAPI_ASSERT( (iv_databus_port_max != 0),
- fapi2::MSS_NO_DATABUS_UTILIZATION()
- .set_PORT_DATABUS_UTIL(iv_databus_port_max)
- .set_DIMM_COUNT(mss::count_dimm(iv_target)),
- "Failed to get max databus utilization for target %s",
- mss::c_str(iv_target));
-
- FAPI_ASSERT( (iv_port_power_limit != 0),
- fapi2::MSS_NO_PORT_POWER_LIMIT()
- .set_COUNT_DIMMS( mss::count_dimm(iv_target))
- .set_PORT_POWER_LIMIT( iv_port_power_limit),
- "Error calculating port_power_limit on target %s with %d DIMMs installed",
- mss::c_str(iv_target),
- iv_port_power_limit);
-
- //Checking to make sure all of the attributes are valid
- for ( const auto& l_dimm : mss::find_targets<TARGET_TYPE_DIMM>(iv_target) )
- {
- const auto l_pos = mss::index(l_dimm);
- FAPI_ASSERT( (iv_pwr_int[l_pos] != 0),
- fapi2::MSS_POWER_INTERCEPT_NOT_SET(),
- "The attribute ATTR_MSS_TOTAL_PWR_INTERCEPT equals 0 for %s",
- mss::c_str(l_dimm));
-
- FAPI_ASSERT( (iv_pwr_slope[l_pos] != 0),
- fapi2::MSS_POWER_SLOPE_NOT_SET(),
- "The attribute ATTR_MSS_TOTAL_PWR_SLOPE equals 0 for %s",
- mss::c_str(l_dimm));
- }
-
-fapi_try_exit:
- o_rc = fapi2::current_err;
- return;
-}
-
-///
-/// @brief Set ATTR_MSS_CHANNEL_PAIR_MAXPOWER, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT and _PER_PORT
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-/// @note Called in p9_mss_bulk_pwr_throttles
-/// @note determines the throttle levels based off of the port's power curve,
-/// @note the _per_slot throttles are set to the _per_port values
-/// @note throttles are all equalized and set to the worst case value
-///
-fapi2::ReturnCode throttle::power_regulator_throttles ()
-{
- double l_port_power_calc_idle = 0;
- double l_port_power_calc_max = 0;
- uint32_t l_port_power_slope = 0;
- uint32_t l_port_power_int = 0;
- double l_calc_util_port = 0;
- double l_databus_dimm_max[MAX_DIMM_PER_PORT] = {};
- double l_calc_databus_port_idle[MAX_DIMM_PER_PORT] = {IDLE_UTIL, IDLE_UTIL};
-
- FAPI_INF("Starting power regulator throttles");
-
- //Decide utilization for each dimm based off of dimm count and power slopes
- FAPI_TRY( calc_databus(iv_databus_port_max, l_databus_dimm_max),
- "Failed to calculate each DIMMs' percentage of dram databus utilization for target %s, max port databus is %d",
- mss::c_str(iv_target),
- iv_databus_port_max);
-
- //Use the dimm utilizations and dimm power slopes to calculate port min and max power
- FAPI_TRY( calc_port_power(l_calc_databus_port_idle,
- l_databus_dimm_max,
- l_port_power_calc_idle,
- l_port_power_calc_max),
- "Failed to calculate the max and idle power for port %s",
- mss::c_str(iv_target));
-
- FAPI_INF("POWER throttles: %s max port power is %f", mss::c_str(iv_target), l_port_power_calc_max);
-
- //Calculate the power curve slope and intercept using the port's min and max power values
- FAPI_TRY(calc_power_curve(l_port_power_calc_idle,
- l_port_power_calc_max,
- l_port_power_slope,
- l_port_power_int),
- "Failed to calculate the power curve for port %s, calculated port power max is %d, idle is %d",
- mss::c_str(iv_target),
- l_port_power_calc_max,
- l_port_power_calc_idle);
-
- FAPI_INF("%s POWER Port power limit is %d", mss::c_str(iv_target), iv_port_power_limit);
- //Calculate the port's utilization to get under watt target using the port's calculated slopes
- calc_util_usage(l_port_power_slope,
- l_port_power_int,
- iv_port_power_limit,
- l_calc_util_port);
-
- FAPI_INF("%s POWER calc util port is %f", mss::c_str(iv_target), l_calc_util_port);
-
- //Calculate the new slot values and the max power value for the port
- FAPI_TRY( calc_slots_and_power( l_calc_util_port),
- "%s Error calculating the final throttles and power values for target with passed in port utilization %d",
- mss::c_str(iv_target),
- l_calc_util_port);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief set iv_n_port, iv_n_slot, iv_calc_port_maxpower
-/// @param[in] i_util_port pass in the calculated port databus utilization
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-///
-fapi2::ReturnCode throttle::calc_slots_and_power (const double i_util_port)
-{
- //Calculate the Port N throttles
- iv_n_port = power_thermal::throttled_cmds(i_util_port, iv_m_clocks);
-
- //Set iv_n_slot to the lower value between the slot runtime and iv_n_port
- iv_n_slot = (iv_runtime_n_slot != 0) ? std::min (iv_n_port, iv_runtime_n_slot) : iv_n_port;
-
- //Choose the lowest value of the runtime and the calculated
- iv_n_port = (iv_runtime_n_port != 0) ? std::min (iv_n_port, iv_runtime_n_port) : iv_n_port;
-
- //Use the throttle value to calculate the power that gets to exactly that value
- FAPI_TRY( calc_power_from_n(iv_n_slot, iv_n_port, iv_calc_port_maxpower));
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Set ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT and PER_PORT
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
-/// @note Called in p9_mss_bulk_pwr_throttles
-/// @note Sets the throttle levels based off of the dimm's thermal limits
-/// @note both DIMM's on a port are set to the same throttle level
-///
-fapi2::ReturnCode throttle::thermal_throttles ()
-{
- double l_dimm_power_idle [MAX_DIMM_PER_PORT] = {};
- double l_dimm_power_max [MAX_DIMM_PER_PORT] = {};
- uint32_t l_dimm_power_slope [MAX_DIMM_PER_PORT] = {};
- uint32_t l_dimm_power_int [MAX_DIMM_PER_PORT] = {};
- double l_calc_util [MAX_DIMM_PER_PORT] = {};
- const auto l_count = count_dimm (iv_target);
-
- //Calculate the dimm power range for each dimm at max utilization for each
- calc_dimm_power(power_thermal::IDLE_UTIL,
- iv_databus_port_max,
- l_dimm_power_idle,
- l_dimm_power_max);
-
- //Let's calculate the N throttle for each DIMM
- for ( const auto& l_dimm : mss::find_targets<TARGET_TYPE_DIMM>(iv_target) )
- {
- uint16_t l_temp_n_slot = 0;
- uint8_t l_pos = mss::index(l_dimm);
- //Calculate the power curve taking the thermal limit into account
- FAPI_TRY( calc_power_curve(l_dimm_power_idle[l_pos],
- l_dimm_power_max[l_pos],
- l_dimm_power_slope[l_pos],
- l_dimm_power_int[l_pos]),
- "Failed to calculate the power curve for dimm %s, calculated dimm power curve slope is %d, intercept %d",
- mss::c_str(l_dimm),
- l_dimm_power_slope[l_pos],
- l_dimm_power_int[l_pos]);
-
- //Calculate the databus utilization at the calculated power curve
- calc_util_usage(l_dimm_power_slope[l_pos],
- l_dimm_power_int[l_pos],
- iv_dimm_thermal_limit[l_pos],
- l_calc_util[l_pos]);
-
- FAPI_INF("THERMAL throttles: %s dram databus utilization is %f", mss::c_str(l_dimm), l_calc_util[l_pos]);
-
- l_temp_n_slot = power_thermal::throttled_cmds (l_calc_util[l_pos], iv_m_clocks);
-
- //Set to the min between the two value
- //If iv_n_slot == 0 (so uninitialized), set it to the calculated slot value
- //The l_n_slot value can't be equal to 0 because there's a dimm installed
- if ((l_temp_n_slot < iv_n_slot) || (iv_n_slot == 0))
- {
- iv_n_slot = l_temp_n_slot;
- }
- }
-
- //Set to lowest value between calculated and runtime
- FAPI_INF("THERMAL throttles: runtime slot is %d, calc n slot is %d", iv_runtime_n_slot, iv_n_slot);
- //Taking the min of the SLOT * (# of dimms on the port) and the iv_runtime_port throttle value
- //Thermal throttling happens after the POWER calculations. the iv_runtime_n_port value shouldn't be set to 0
- iv_n_port = std::min(iv_runtime_n_port, static_cast<uint16_t>(iv_n_slot * l_count));
- iv_n_port = (iv_n_port == 0) ? MIN_THROTTLE : iv_n_port;
-
- iv_n_slot = std::min(iv_n_slot, iv_runtime_n_slot);
- iv_n_slot = (iv_n_slot == 0) ? MIN_THROTTLE : iv_n_slot;
-
- //Now time to get and set iv_calc_port_max from the calculated N throttle
- FAPI_TRY( calc_power_from_n(iv_n_slot, iv_n_port, iv_calc_port_maxpower),
- "Failed to calculate the final max port maxpower. Slot throttle value is %d, port value is %d",
- iv_n_slot,
- iv_n_port);
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- FAPI_ERR("Error calculating mss::power_thermal::thermal_throttles()");
- return fapi2::current_err;
-}
-
-///
-/// @brief Calculates the min and max power usage for a port based off of power curves and utilizations
-/// @param[in] i_idle_util the utilization of the databus in idle mode (0% most likely)
-/// @param[in] i_max_util the utilization of the dimm at maximum possible percentage (mrw or calculated)
-/// @param[out] o_port_power_idle max value of port power in cW
-/// @param[out] o_port_power_max max value of port power in cW
-/// @return fapi2::FAPI2_RC_SUCCESS iff the method was a success
-/// @note Called twice in p9_mss_bulk_pwr_throttles
-/// @note uses dimm power curves from class variables
-///
-fapi2::ReturnCode throttle::calc_port_power(const double i_idle_util [MAX_DIMM_PER_PORT],
- const double i_max_util [MAX_DIMM_PER_PORT],
- double& o_port_power_idle,
- double& o_port_power_max) const
-{
- //Playing it safe
- o_port_power_idle = 0;
- o_port_power_max = 0;
-
- //Calculate the port power curve info by summing the dimms on the port
- for ( const auto& l_dimm : mss::find_targets<TARGET_TYPE_DIMM>(iv_target) )
- {
- const auto l_pos = mss::index(l_dimm);
- //Printing as decimals because HB messes up floats
- FAPI_INF("%s max dram databus for DIMM in pos %d is %d, databus for idle is %d",
- mss::c_str(iv_target),
- l_pos,
- static_cast<uint64_t>( i_max_util[l_pos]),
- static_cast<uint64_t>( i_idle_util[l_pos]) );
- //Sum up the dim's power to calculate the port power curve
- o_port_power_idle += calc_power(i_idle_util[l_pos], l_pos);
- o_port_power_max += calc_power(i_max_util[l_pos], l_pos);
- }
-
- //Raise the powers by the uplift percent
- calc_power_uplift(iv_power_uplift_idle, o_port_power_idle);
- calc_power_uplift(iv_power_uplift, o_port_power_max);
-
- FAPI_ASSERT( (o_port_power_max > 0),
- fapi2::MSS_NO_PORT_POWER()
- .set_COUNT_DIMMS(mss::count_dimm(iv_target))
- .set_MAX_UTILIZATION_DIMM_0(i_max_util[0])
- .set_MAX_UTILIZATION_DIMM_1(i_max_util[1]),
- "No Port Power limit was calculated for %s, %d DIMMs installed, utilizations: DIMM 0 %d, DIMM 1 %d",
- mss::c_str(iv_target),
- mss::count_dimm(iv_target),
- i_max_util[0],
- i_max_util[1]);
-
- //FAPI_ASSERTs don't set the current err to good
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Calculates max and min power usages based off of DIMM power curves
-/// @param[in] i_databus_idle idle databus utilization (either calculated or mrw)
-/// @param[in] i_databus_max max databus utilization (either calculated or mrw)
-/// @param[out] o_dimm_power_idle array of dimm power in cW
-/// @param[out] o_dimm_power_max array of dimm power in cW
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
-/// @note Called in p9_mss_bulk_pwr_throttles
-/// @note used for the thermal throttles
-///
-void throttle::calc_dimm_power(const double i_databus_idle,
- const double i_databus_max,
- double o_dimm_power_idle [MAX_DIMM_PER_PORT],
- double o_dimm_power_max [MAX_DIMM_PER_PORT]) const
-{
- for ( const auto& l_dimm : mss::find_targets<TARGET_TYPE_DIMM>(iv_target) )
- {
- const uint8_t l_pos = mss::index(l_dimm);
- o_dimm_power_idle[l_pos] = calc_power(i_databus_idle, l_pos);
- o_dimm_power_max[l_pos] = calc_power(i_databus_max, l_pos);
-
- //Raise the powers by the uplift percent
-
- calc_power_uplift(iv_power_uplift_idle, o_dimm_power_idle[l_pos]);
- calc_power_uplift(iv_power_uplift, o_dimm_power_max[l_pos]);
-
- FAPI_INF("Calc_dimm_power: dimm (%d) power max is %f, %f for dimm slope of %d, intercept of %d",
- l_pos,
- o_dimm_power_max[l_pos],
- o_dimm_power_max[l_pos],
- iv_pwr_slope[l_pos],
- iv_pwr_int[l_pos]);
- }
-}
-
-///
-/// @brief Calculate the port power curve in order to calculate the port utilization
-/// @param[in] i_power_idle double of the port's power consumption at idle
-/// @param[in] i_power_max double of the port's power consumption at max utilization
-/// @param[out] o_slope
-/// @param[out] o_int
-/// @note Called in p9_mss_bulk_pwr_throttles
-/// @note Port power curve needed to calculate the port utilization
-///
-fapi2::ReturnCode throttle::calc_power_curve(const double i_power_idle,
- const double i_power_max,
- uint32_t& o_slope,
- uint32_t& o_int) const
-{
- const double l_divisor = ((static_cast<double>(iv_databus_port_max) / UTIL_CONVERSION) - IDLE_UTIL);
- FAPI_ASSERT ((l_divisor > 0),
- fapi2::MSS_CALC_POWER_CURVE_DIVIDE_BY_ZERO()
- .set_PORT_DATABUS_UTIL(iv_databus_port_max)
- .set_UTIL_CONVERSION(UTIL_CONVERSION)
- .set_IDLE_UTIL(IDLE_UTIL)
- .set_RESULT(l_divisor),
- "Calculated zero for the divisor in calc_power_curve on target %s",
- mss::c_str(iv_target) );
-
- o_slope = (i_power_max - i_power_idle) / l_divisor;
- o_int = i_power_idle - (o_slope * IDLE_UTIL);
- FAPI_INF("Calc_power_curve: power idle is %f, max is %f, slope is %d, int is %d",
- i_power_idle,
- i_power_max,
- o_slope,
- o_int);
- return fapi2::FAPI2_RC_SUCCESS;
-
-fapi_try_exit:
- FAPI_INF("Error calculating mss::power_thermal::calc_power_curve");
- return fapi2::current_err;
-
-}
-
-///
-/// @brief Calculate the databus utilization given the power curve
-/// @param[in] i_slope
-/// @param[in] i_int
-/// @param[in] i_power_limit either the port_power_limit or the dimm thermal power limit
-/// @param[out] o_port_util the port's databus utilization
-/// @note Called in p9_mss_bulk_pwr_throttles
-/// @note Chooses worst case between the maximum allowed databus utilization and the calculated value
-///
-void throttle::calc_util_usage(const uint32_t i_slope,
- const uint32_t i_int,
- const uint32_t i_power_limit,
- double& o_util) const
-{
- o_util = ((static_cast<double>(i_power_limit) - i_int) / i_slope ) * UTIL_CONVERSION;
-
- //Cast to uint32 for edge case where it has decimals
- o_util = (static_cast<uint32_t>(o_util) < iv_databus_port_max) ? static_cast<uint32_t>(o_util) : iv_databus_port_max;
-
- // Check for the minimum threshnold and update if need be
- if(o_util < MIN_UTIL)
- {
- FAPI_INF("Calculated utilization (%lu) is less than the minimum utilization: %lu. Setting to minimum value", o_util,
- MIN_UTIL);
- o_util = MIN_UTIL;
- }
-}
-
-///
-/// @brief calculated the output power estimate from the calculated N throttle
-/// @param[in] i_n_slot the throttle per slot in terms of N commands
-/// @param[in] i_n_port the throttle per port in terms of N commands
-/// @param[out] o_power the calculated power
-/// @return fapi2::ReturnCode iff it was a success
-///
-fapi2::ReturnCode throttle::calc_power_from_n (const uint16_t i_n_slot,
- const uint16_t i_n_port,
- uint32_t& o_power) const
-{
- double l_calc_util_port = 0;
- double l_calc_util_slot = 0;
- double l_calc_databus_port_max[MAX_DIMM_PER_PORT] = {};
- double l_calc_databus_port_idle[MAX_DIMM_PER_PORT] = {};
- double l_port_power_max = 0;
- double l_port_power_idle = 0;
-
- FAPI_TRY( calc_util_from_throttles(i_n_slot, iv_m_clocks, l_calc_util_slot),
- "%s Error calculating utilization from slot throttle %d and mem clocks %d",
- mss::c_str(iv_target),
- i_n_slot,
- iv_m_clocks);
- FAPI_TRY( calc_util_from_throttles(i_n_port, iv_m_clocks, l_calc_util_port),
- "%s Error calculating utilization from port throttle %d and mem clocks %d",
- mss::c_str(iv_target),
- i_n_port,
- iv_m_clocks);
-
- //Determine the utilization for each DIMM that will maximize the port power
- FAPI_TRY( calc_split_util(l_calc_util_slot, l_calc_util_port, l_calc_databus_port_max),
- "Error splitting the utilization for target %s with slot utilizatio %d and port util %d",
- mss::c_str(iv_target),
- l_calc_util_slot,
- l_calc_util_port);
-
- FAPI_TRY( calc_port_power(l_calc_databus_port_idle,
- l_calc_databus_port_max,
- l_port_power_idle,
- l_port_power_max),
- "Error calculating the port power value for %s. Slot value is %d, port value is %d",
- mss::c_str(iv_target),
- i_n_slot,
- i_n_port);
-
- o_power = power_thermal::round_up (l_port_power_max);
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Converts the port maximum databus to a dimm level based on powerslopes and dimms installed
-/// @param[in] i_databus_port_max max databus utilization for the port (either calculated or mrw)
-/// @param[out] o_databus_dimm_max array of dimm utilization values
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
-/// @note Called in p9_mss_bulk_pwr_throttles
-/// @used to calculate the port power based off of DIMM power curves
-///
-fapi2::ReturnCode throttle::calc_databus (const double i_databus_port_max,
- double o_databus_dimm_max [MAX_DIMM_PER_PORT])
-{
- uint8_t l_count_dimms = count_dimm(iv_target);
-
- //No work for no dimms
- if (l_count_dimms == 0)
- {
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- for (const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(iv_target))
- {
- //Left early if count_dimms == 0
- o_databus_dimm_max[mss::index(l_dimm)] = i_databus_port_max / l_count_dimms;
- }
-
- //If the power slopes aren't equal, set the dimm with the highest power slope
- //Should be correct even if only one DIMM is installed
- if (iv_pwr_slope[0] != iv_pwr_slope[1])
- {
- o_databus_dimm_max[0] = (iv_pwr_slope[0] > iv_pwr_slope[1]) ? i_databus_port_max : 0;
- o_databus_dimm_max[1] = (iv_pwr_slope[1] > iv_pwr_slope[0]) ? i_databus_port_max : 0;
- }
-
- //Make sure both are not 0
- FAPI_ASSERT ( (o_databus_dimm_max[0] != 0) || (o_databus_dimm_max[1] != 0),
- fapi2::MSS_NO_DATABUS_UTILIZATION()
- .set_PORT_DATABUS_UTIL(i_databus_port_max)
- .set_DIMM_COUNT(l_count_dimms),
- "Failed to calculated databus utilization for target %s",
- mss::c_str(iv_target));
-
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Converts the port and slot util to a dimm level based on powerslopes and number of dimms installed
-/// @param[in] i_util_slot databus utilization for the slot
-/// @param[in] i_util_port databus utilization for the port
-/// @param[out] o_util_dimm_max array of dimm utilization values
-/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
-/// @note determines worst case utilization per dimms, takes into account port and combine slot throttles
-/// @note used in calculating the port power, not for calculating the slot and port utilization
-///
-fapi2::ReturnCode throttle::calc_split_util(
- const double i_util_slot,
- const double i_util_port,
- double o_util_dimm_max [MAX_DIMM_PER_PORT]) const
-{
- uint8_t l_count_dimms = count_dimm (iv_target);
- //The total utilization to be used is limited by either what the port can allow or what the dimms can use
- FAPI_ASSERT( (i_util_slot <= i_util_port),
- fapi2::MSS_SLOT_UTIL_EXCEEDS_PORT()
- .set_SLOT_UTIL(i_util_slot)
- .set_PORT_UTIL(i_util_port),
- "The slot utilization (%f) exceeds the port's utilization (%f)",
- i_util_slot,
- i_util_port);
-
- if (l_count_dimms == 0)
- {
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- //assumptions slot <= port, l_count_dimms <=2
- else if (i_util_slot * l_count_dimms > i_util_port)
- {
- FAPI_INF("In mss::power_thermal::calc_split i_util_slot is %f, i_util_port is %f, l_count_dimms is %d",
- i_util_slot,
- i_util_port,
- l_count_dimms);
- const uint8_t l_high_pos = (iv_pwr_slope[0] >= iv_pwr_slope[1]) ? 0 : 1;
-
- //Highest power_slope gets the higher utilization
- o_util_dimm_max[l_high_pos] = std::min(i_util_slot, i_util_port);
- //Set the other dimm to the left over utilization (i_util_port - i_util_slot)
- o_util_dimm_max[(!l_high_pos)] = (l_count_dimms == 2) ? (i_util_port - o_util_dimm_max[l_high_pos]) : 0;
-
- FAPI_INF("Split utilization for target %s, DIMM in %d gets %f, DIMM in %d gets %f",
- mss::c_str(iv_target),
- l_high_pos,
- o_util_dimm_max[l_high_pos],
- !l_high_pos,
- o_util_dimm_max[!l_high_pos]);
- }
-
- else
- {
- //If only 1 dimm, i_util_port == i_util_slot
- //If 2 dimms, 2*i_util_slot <= i_util_pot
- //Either way, limit utilization by the slot value
- for (const auto& l_dimm : mss::find_targets<TARGET_TYPE_DIMM>(iv_target))
- {
- const size_t l_pos = mss::index(l_dimm);
- o_util_dimm_max[l_pos] = i_util_slot;
- }
- }
-
- //make sure both are not 0
- FAPI_ASSERT ( (o_util_dimm_max[0] != 0) || (o_util_dimm_max[1] != 0),
- fapi2::MSS_NO_DATABUS_UTILIZATION()
- .set_PORT_DATABUS_UTIL(i_util_port)
- .set_DIMM_COUNT(mss::count_dimm(iv_target)),
- "Failed to calculated util utilization for target %s",
- mss::c_str(iv_target));
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Perform thermal calculations as part of the effective configuration
-/// @param[in] i_target the MCS target in which the runtime throttles will be reset
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-fapi2::ReturnCode restore_runtime_throttles( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target )
-{
- uint16_t l_run_throttles [MAX_DIMM_PER_PORT] = {};
- uint32_t l_max_databus = 0;
- uint32_t l_throttle_m_clocks = {};
-
- FAPI_TRY( mrw_mem_m_dram_clocks(l_throttle_m_clocks) );
- FAPI_TRY( mrw_max_dram_databus_util(l_max_databus) );
-
- //Set runtime throttles to unthrottled value, using max dram utilization and M throttle
- //Do I need to check to see if any DIMMS configured on the port?
- for (const auto& l_mca : mss::find_targets<TARGET_TYPE_MCA>(i_target))
- {
- const auto l_pos = mss::index(l_mca);
-
- if (mss::count_dimm (l_mca) != 0)
- {
- l_run_throttles[l_pos] = mss::power_thermal::throttled_cmds (l_max_databus, l_throttle_m_clocks);
- }
- }
-
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT, i_target, l_run_throttles) );
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT, i_target, l_run_throttles) );
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Update the runtime throttles to the worst case of the general throttle values and the runtime values
-/// @param[in] i_target the MCS target in which the runtime throttles will be set
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-fapi2::ReturnCode update_runtime_throttles( const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_targets )
-{
- for (const auto& l_mcs : i_targets)
- {
- if (mss::count_dimm(l_mcs) == 0)
- {
- continue;
- }
-
- uint16_t l_run_slot [PORTS_PER_MCS] = {};
- uint16_t l_run_port [PORTS_PER_MCS] = {};
- uint16_t l_calc_slot [PORTS_PER_MCS] = {};
- uint16_t l_calc_port [PORTS_PER_MCS] = {};
-
- FAPI_TRY(runtime_mem_throttled_n_commands_per_slot(l_mcs, l_run_slot));
- FAPI_TRY(runtime_mem_throttled_n_commands_per_port(l_mcs, l_run_port));
- FAPI_TRY(mem_throttled_n_commands_per_slot(l_mcs, l_calc_slot));
- FAPI_TRY(mem_throttled_n_commands_per_port(l_mcs, l_calc_port));
-
- for (const auto& l_mca : mss::find_targets<TARGET_TYPE_MCA>(l_mcs))
- {
- const auto l_pos = mss::index(l_mca);
- //Choose the worst case between runtime and calculated throttles
- //Have to make sure the calc_slot isn't equal to 0 though
- l_run_slot[l_pos] = (l_calc_slot[l_pos] != 0) ?
- std::min(l_run_slot[l_pos], l_calc_slot[l_pos]) : l_run_slot[l_pos];
- l_run_port[l_pos] = (l_calc_port[l_pos] != 0) ?
- std::min(l_run_port[l_pos], l_calc_port[l_pos]) : l_run_port[l_pos];
-
- FAPI_INF("New runtime throttles for %s for slot are %d, port are %d",
- mss::c_str(l_mca),
- l_run_slot[l_pos],
- l_run_port[l_pos]);
- }
-
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT, l_mcs, l_run_port) );
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_SLOT, l_mcs, l_run_slot) );
- }
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
/// @brief set ATTR_MSS_RUNTIME_MEM_M_DRAM_CLOCKS and ATTR_MSS_MEM_WATT_TARGET
/// @param[in] i_targets vector of mcs targets all on the same vddr domain
/// @return FAPI2_RC_SUCCESS iff it was a success
@@ -785,149 +112,5 @@ fapi_try_exit:
return fapi2::current_err;
}
-///
-/// @brief Equalize the throttles and estimated power at those throttle levels
-/// @param[in] i_targets vector of MCS targets all on the same VDDR domain
-/// @param[in] i_throttle_type denotes if this was done for POWER (VMEM) or THERMAL (VMEM+VPP) throttles
-/// @param[out] o_exceeded_power vector of MCA targets where the estimated power exceeded the maximum allowed
-/// @return FAPI2_RC_SUCCESS iff ok
-/// @note sets the throttles and power to the worst case
-/// Called by p9_mss_bulk_pwr_throttles and by p9_mss_utils_to_throttle (so by IPL or by OCC)
-///
-fapi2::ReturnCode equalize_throttles (const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_targets,
- const throttle_type i_throttle_type,
- std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >& o_exceeded_power)
-{
- o_exceeded_power.clear();
-
- //Set to max values so every compare will change to min value
- uint16_t l_min_slot = ~(0);
- uint16_t l_min_port = ~(0);
-
- //Loop through all of the MCS targets to find the worst case throttle value (lowest) for the slot and port
- for (const auto& l_mcs : i_targets)
- {
- uint16_t l_calc_slot [mss::PORTS_PER_MCS] = {};
- uint16_t l_calc_port [mss::PORTS_PER_MCS] = {};
- uint16_t l_run_slot [mss::PORTS_PER_MCS] = {};
- uint16_t l_run_port [mss::PORTS_PER_MCS] = {};
-
- FAPI_TRY(mem_throttled_n_commands_per_slot(l_mcs, l_calc_slot));
- FAPI_TRY(mem_throttled_n_commands_per_port(l_mcs, l_calc_port));
- FAPI_TRY(runtime_mem_throttled_n_commands_per_slot(l_mcs, l_run_slot));
- FAPI_TRY(runtime_mem_throttled_n_commands_per_port(l_mcs, l_run_port));
-
- for (const auto& l_mca : mss::find_targets<TARGET_TYPE_MCA>(l_mcs))
- {
- if (mss::count_dimm(l_mca) == 0)
- {
- continue;
- }
-
- const auto l_pos = mss::index(l_mca);
- //Find the smaller of the three values (calculated slot, runtime slot, and min slot)
- l_min_slot = (l_calc_slot[l_pos] != 0) ? std::min( std::min (l_calc_slot[l_pos], l_run_slot[l_pos]),
- l_min_slot) : l_min_slot;
- l_min_port = (l_calc_port[l_pos] != 0) ? std::min( std::min( l_calc_port[l_pos], l_run_port[l_pos]),
- l_min_port) : l_min_port;
- }
- }
-
- FAPI_INF("Calculated min slot is %d, min port is %d for the system", l_min_slot, l_min_port);
-
- //Now set every port to have those values
- {
- for (const auto& l_mcs : i_targets)
- {
- uint16_t l_fin_slot [mss::PORTS_PER_MCS] = {};
- uint16_t l_fin_port [mss::PORTS_PER_MCS] = {};
- uint32_t l_fin_power [mss::PORTS_PER_MCS] = {};
-
- for (const auto& l_mca : mss::find_targets<TARGET_TYPE_MCA>(l_mcs))
- {
- if (mss::count_dimm(l_mca) == 0)
- {
- continue;
- }
-
- const auto l_pos = mss::index(l_mca);
- // Declaring above to avoid fapi2 jump
- uint64_t l_power_limit = 0;
-
- l_fin_slot[l_pos] = (mss::count_dimm(l_mca)) ? l_min_slot : 0;
- l_fin_port[l_pos] = (mss::count_dimm(l_mca)) ? l_min_port : 0;
-
- //Need to create throttle object for each mca in order to get dimm configuration and power curves
- //To calculate the slot/port utilization and total port power consumption
- fapi2::ReturnCode l_rc;
-
- const auto l_dummy = mss::power_thermal::throttle(l_mca, l_rc);
- FAPI_TRY(l_rc, "Failed creating a throttle object in equalize_throttles");
-
- FAPI_TRY( l_dummy.calc_power_from_n(l_fin_slot[l_pos], l_fin_port[l_pos], l_fin_power[l_pos]),
- "Failed calculating the power value for throttles: slot %d, port %d for target %s",
- l_fin_slot[l_pos],
- l_fin_port[l_pos],
- mss::c_str(l_mca));
-
- //Only calculate the power for ports that have dimms
- l_fin_power[l_pos] = (mss::count_dimm(l_mca) != 0 ) ? l_fin_power[l_pos] : 0;
-
- // You may ask why this is not a variable within the throttle struct
- // It's because POWER throttling is on a per port basis while the THERMAL throttle is per dimm
- // Didn't feel like adding a variable just for this check
- l_power_limit = (i_throttle_type == throttle_type::POWER) ?
- l_dummy.iv_port_power_limit : (l_dummy.iv_dimm_thermal_limit[0] + l_dummy.iv_dimm_thermal_limit[1]);
-
- FAPI_INF("Calculated power is %d, limit is %d", l_fin_power[l_pos], l_power_limit);
-
- //If there's an error with calculating port power, the wrong watt target was passed in
- //Returns an error but doesn't deconfigure anything. Calling function can log if it wants to
- //Called by OCC and by p9_mss_eff_config_thermal, thus different ways for error handling
- //Continue setting throttles to prevent a possible throttle == 0
- //The error will be the last bad port found
- if (l_fin_power[l_pos] > l_power_limit)
- {
- //Need this because of pos traits and templating stuff
- uint64_t l_fail = mss::fapi_pos(l_mca);
- //Set the failing port. OCC just needs one failing port, doesn't need all of them
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_MEM_PORT_POS_OF_FAIL_THROTTLE,
- fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
- l_fail) );
-
- FAPI_ASSERT_NOEXIT( false,
- fapi2::MSS_CALC_PORT_POWER_EXCEEDS_MAX()
- .set_CALCULATED_PORT_POWER(l_fin_power[l_pos])
- .set_MAX_POWER_ALLOWED(l_power_limit)
- .set_PORT_POS(mss::pos(l_mca))
- .set_MCA_TARGET(l_mca),
- "Error calculating the final port power value for target %s, calculated power is %d, max value can be %d",
- mss::c_str(l_mca),
- l_fin_power[l_pos],
- l_power_limit);
-
- o_exceeded_power.push_back(l_mca);
- }
-
- FAPI_INF("%s Final throttles values for slot %d, for port %d, power value %d",
- mss::c_str(l_mca),
- l_fin_port[l_pos],
- l_fin_slot[l_pos],
- l_fin_power[l_pos]);
- }
-
- //Even if there's an error, still calculate and set the throttles.
- //OCC will set to safemode if there's an error
- //Better to set the throttles than leave them 0, and potentially brick the memory
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT, l_mcs, l_fin_port) );
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, l_mcs, l_fin_slot) );
- FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_PORT_MAXPOWER, l_mcs, l_fin_power) );
- }
- }
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- FAPI_ERR("Error equalizing memory throttles");
- return fapi2::current_err;
-}
}//namespace power_thermal
}//namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H
index 189583cfa..bfc978492 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,332 +39,24 @@
#include <fapi2.H>
#include <lib/shared/mss_const.H>
#include <lib/mss_attribute_accessors.H>
+#include <lib/power_thermal/accessor_wrapper.H>
+#include <lib/power_thermal/throttle_traits.H>
+#include <lib/dimm/nimbus_kind.H>
+#include <generic/memory/lib/utils/power_thermal/gen_throttle.H>
namespace mss
{
namespace power_thermal
{
///
-/// @brief throttle constants used in the power_thermal functions
-///
-enum throttle_const : size_t
-{
- /// Dram data bus utilization is bus utilization / 4
- DRAM_BUS_UTILS = 4,
-
- /// 10000 to convert to and from c%
- UTIL_CONVERSION = 10000,
-
- /// Conversion to percentage
- PERCENT_CONVERSION = 100,
-
- /// MIN_UTIL is in c%
- MIN_UTIL = 2500,
-
- /// IDLE_UTIL is in c%
- IDLE_UTIL = 0,
-
- /// Minimum throttle allowed for the port and or slot. If we set to 0, we brick the port
- MIN_THROTTLE = 1,
-};
-
-///
-/// @class throttle
-/// @brief Determine power_thermal throttles for memory
-///
-class throttle
-{
- private:
- ///
- /// @brief Calculate the power (cW) of inputs and the power curve
- /// @tparam T
- /// @param[in] i_util the databus utilization that the power will be based on
- /// @param[in] l_pos the dimm position for the power value being calculated.
- /// @return Integral type T
- ///
- template<typename T>
- inline T calc_power (const T i_util, const size_t i_pos) const
- {
- return ((i_util / UTIL_CONVERSION) * iv_pwr_slope[i_pos]) + iv_pwr_int[i_pos];
- }
-
- ///
- /// @brief Raise the o_value by the percent passed in
- /// @param[in] i_uplift the percent the o_Value should be raised by
- /// @param[out] o_value the value that will be modified
- ///
- inline void calc_power_uplift (const uint8_t i_uplift, double& o_value) const
- {
- o_value *= (1 + (static_cast<double>(i_uplift) / PERCENT_CONVERSION));
- }
-
- public:
- const fapi2::Target<fapi2::TARGET_TYPE_MCA>& iv_target;
-
- uint32_t iv_databus_port_max;
-
- uint8_t iv_power_uplift_idle;
- uint8_t iv_power_uplift;
-
- uint16_t iv_runtime_n_slot;
- uint16_t iv_runtime_n_port;
- uint32_t iv_m_clocks;
- uint32_t iv_dimm_thermal_limit[MAX_DIMM_PER_PORT] = {};
- uint16_t iv_pwr_slope[MAX_DIMM_PER_PORT] = {};
- uint16_t iv_pwr_int[MAX_DIMM_PER_PORT] = {};
- uint16_t iv_n_slot;
- uint16_t iv_n_port;
- uint32_t iv_port_power_limit;
- uint32_t iv_calc_port_maxpower;
-
- //default ctor deleted
- throttle() = delete;
-
- ///
- /// @brief Constructor
- /// @param[in] i_target MCA target to call power thermal stuff on
- /// @param[out] o_rc fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS iff ctor was successful
- ///
- throttle( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_mca, fapi2::ReturnCode& o_rc);
-
- //
- // @brief Destructor
- //
- ~throttle() = default;
-
- ///
- /// @brief Calculates the min and max power usage for a port
- /// @param[in] i_idle_util the utilization of the databus in idle mode
- /// @param[in] i_max_util the utilization of the port at maximum possible (mrw or calculated)
- /// @param[out] o_port_power_idle max value of port power in cW
- /// @param[out] o_port_power_max max value of port power in cW
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
- /// @note Called twice in p9_mss_bulk_pwr_throttles
- ///
- fapi2::ReturnCode calc_port_power( const double i_idle_util [MAX_DIMM_PER_PORT],
- const double i_max_util [MAX_DIMM_PER_PORT],
- double& o_port_power_idle,
- double& o_port_power_max) const;
- ///
- /// @brief Calculates max and min power usages based off of DIMM power curves
- /// @param[in] i_databus_port_max max databus utilization for the port (either calculated or mrw)
- /// @param[in] i_port_power_calc_idle double of the port's power consumption at idle
- /// @param[out] o_dimm_power_idle array of dimm power in cW
- /// @param[out] o_dimm_power_max array of dimm power in cW
- /// @note Called in p9_mss_bulk_pwr_throttles
- /// @note used for the thermal throttles
- ///
- void calc_dimm_power(const double i_databus_idle,
- const double i_databus_max,
- double o_dimm_power_idle [MAX_DIMM_PER_PORT],
- double o_dimm_power_max [MAX_DIMM_PER_PORT]) const;
-
- ///
- /// @brief Calculate the power curve in order to calculate databus utilization
- /// @param[in] i_power_idle double of the port's power consumption at idle
- /// @param[in] i_power_max double of the port's power consumption at max utilization
- /// @param[out] o_power_slope
- /// @param[out] o_power_int
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
- /// @note Called in p9_mss_bulk_pwr_throttles
- /// @note Power curve needed to calculate the utilization
- ///
- fapi2::ReturnCode calc_power_curve(const double i_power_idle,
- const double i_power_max,
- uint32_t& o_power_slope,
- uint32_t& o_power_int) const;
- ///
- /// @brief Calculate the databus utilization given the power curve
- /// @param[in] i_slope
- /// @param[in] i_int
- /// @param[in] i_power_limit either iv_port_power_limit or thermal_power_limit depending on throttle type
- /// @param[out] o_port_util the port's databus utilization
- /// @note Called in p9_mss_bulk_pwr_throttles
- /// @note Chooses worst case between the maximum allowed databus utilization and the calculated value
- ///
- void calc_util_usage(const uint32_t i_slope,
- const uint32_t i_int,
- const uint32_t i_power_limit,
- double& o_util) const;
- ///
- /// @brief set iv_n_port, iv_n_slot, iv_calc_port_maxpower
- /// @param[in] i_util_port pass in the calculated port databus utilization
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
- ///
- fapi2::ReturnCode calc_slots_and_power (const double i_util_port);
-
- ///
- /// @brief calculated the output power estimate from the calculated N throttle
- /// @param[in] i_n_slot the N throttle per slot
- /// @param[in] i_n_port the N throttle per port
- /// @param[out] o_power the calculated power
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
- ///
- fapi2::ReturnCode calc_power_from_n (const uint16_t i_n_slot, const uint16_t i_n_port, uint32_t& o_power) const;
-
- ///
- /// @brief Converts the port maximum databus util to a dimm level based on powerslopes and dimms installed
- /// @param[in] i_databus_port_max max databus utilization for the port (either calculated or mrw)
- /// @param[out] o_databus_dimm_max array of dimm utilization values
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
- /// @note Called in p9_mss_bulk_pwr_throttles
- /// @used to calculate the port power based off of DIMM power curves
- ///
- fapi2::ReturnCode calc_databus( const double i_databus_port_max,
- double o_databus_dimm_max [MAX_DIMM_PER_PORT]);
- ///
- /// @brief Converts the port and slot util to a dimm level based on powerslopes and number of dimms installed
- /// @param[in] i_util_slot databus utilization for the slot
- /// @param[in] i_util_port databus utilization for the port
- /// @param[out] o_util_dimm_max array of dimm utilization values
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff the split is OK
- /// @note determines worst case utilization per dimms, takes into account port and combine slot throttles
- ///
- fapi2::ReturnCode calc_split_util(
- const double i_util_slot,
- const double i_util_port,
- double o_util_dimm_max [MAX_DIMM_PER_PORT]) const;
-
-
- ///
- /// @brief Calculate ATTR_MSS_CHANNEL_PAIR_MAXPOWER and ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT,
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
- /// @note Called in p9_mss_bulk_pwr_throttles
- /// @note determines the throttle levels based off of the port's power curve, max databus utilization,
- /// and memwat target.
- /// @note currently sets the slot and port throttles to the same value
- ///
- fapi2::ReturnCode power_regulator_throttles ();
-
- ///
- /// @brief Set ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT,
- /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
- /// @note Called in p9_mss_bulk_pwr_throttles
- /// @note Sets the throttle levels based off of the dimm's thermal limits
- /// @note both DIMM's on a port are set to the same throttle level
- ///
- fapi2::ReturnCode thermal_throttles ();
-};
-
-///
-/// @brief Calculate N (address operations) allowed within a window of M DRAM clocks
-/// @param[in] i_databus_util databus utilization percentage (e.g. 5% = 5)
-/// @param[in] i_num_dram_clocks window of M DRAM clocks
-/// @return number of throttled commands allowed
-/// @note Uses N/M Throttling.
-/// Equation: N = (DRAM data bus utilization * M) / (4 * 10000)
-///
-inline uint32_t throttled_cmds(const uint32_t i_databus_util, const uint32_t i_num_dram_clocks)
-{
- constexpr uint64_t l_divisor = DRAM_BUS_UTILS * UTIL_CONVERSION;
- const uint64_t l_dividend = i_databus_util * i_num_dram_clocks;
- const uint64_t l_result = l_dividend / l_divisor;
-
- //Make sure N is not equal to 0, or we brick the dram until reboot
- return ((l_result == 0) ? 1 : l_result);
-}
-
-///
-/// @brief Calculate the port databus utilization based off of N throttles and M dram clocks
-/// @tparam T output type
-/// @param[in] i_n_throttles N (address operations) allowed within a window of M DRAM clocks
-/// @param[in] i_num_dram_clocks window of M DRAM clocks
-/// @param[out] o_calc_util
-/// @return FAPI2_RC_SUCCESS iff method was a success
-/// @note Uses N/M Throttling.
-/// @note DRAM databus utilization = N * 4 * 10000 / M
-///
-template<typename T>
-fapi2::ReturnCode calc_util_from_throttles(const uint16_t i_n_throttles,
- const uint32_t i_num_dram_clocks,
- T& o_calc_util)
-{
- constexpr uint32_t l_multiplier = DRAM_BUS_UTILS * UTIL_CONVERSION;
- FAPI_ASSERT( (i_num_dram_clocks != 0),
- fapi2::MSS_M_DRAM_CLOCKS_EQUALS_ZERO(),
- "ATTR_MSS_MRW_MEM_M_DRAM_CLOCKS was not set and equals zero");
-
- o_calc_util = (static_cast<double>(i_n_throttles) * l_multiplier) / i_num_dram_clocks;
-
- // Best way to check for overflow if o_calc_util can be a double?
- // If o_calc_util overflows, the value inside will be below the expected outcome
- // So compare o_calc_util with the calculated value, but store calculated value in largest storage
- // Compare ">=" because o_calc_util can be a double, and so we can't compare just equality due to truncation
- FAPI_ASSERT( o_calc_util >= static_cast<uint64_t>((static_cast<double>(i_n_throttles) * l_multiplier) /
- i_num_dram_clocks),
- fapi2::MSS_OUTPUT_OVERFLOW_CALC_UTIL()
- .set_RESULT((static_cast<double>(i_n_throttles) * l_multiplier) / i_num_dram_clocks),
- "Overflow of output variable in calc_util_from_throttles throttles: %d, multiplier %d, dram_clocks %d",
- i_n_throttles,
- l_multiplier,
- i_num_dram_clocks);
-
- // Check for the minimum
- if(o_calc_util < MIN_UTIL)
- {
- FAPI_INF("Calculated utilization (%f) is less than the minimum utilization: %lu. Setting to minimum value",
- o_calc_util, MIN_UTIL);
- o_calc_util = MIN_UTIL;
- }
-
- FAPI_INF("In calc_util_from_throttles, calculated %f for output utilization", o_calc_util);
- return fapi2::FAPI2_RC_SUCCESS;
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
-/// @brief Determines if the double has decimal digits and adds 1 and rounds if true
-/// @param[in] i_val the double to be rounded up if trialing digits
-/// @return the input value rounded up to the next whole digit
-/// @note Called in p9_mss_bulk_pwr_throttles
-///
-inline uint32_t round_up(double i_val)
-{
- //convert to uint to truncate decimals and convert back to double for comparison
- uint32_t temp = uint32_t (i_val);
-
- //if not equal, lost something from truncating, so add 1
- temp += (temp == i_val) ? 0 : 1;
-
- //Truncate final value
- return temp;
-}
-
-///
-/// @brief Perform thermal calculations as part of the effective configuration
-/// @param[in] i_target the MCS target in which the runtime throttles will be reset
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-fapi2::ReturnCode restore_runtime_throttles( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target );
-
-///
-/// @brief Update the runtime throttles to the worst case of the general throttle values and the runtime values
-/// @param[in] i_target the MCS target in which the runtime throttles will be set
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-fapi2::ReturnCode update_runtime_throttles(const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_targets);
-
-///
/// @brief set ATTR_MSS_RUNTIME_MEM_M_DRAM_CLOCKS and ATTR_MSS_MEM_WATT_TARGET
/// @param[in] i_targets vector of mcs targets all on the same vddr domain
/// @return FAPI2_RC_SUCCESS iff it was a success
///
fapi2::ReturnCode set_runtime_m_and_watt_limit( const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_targets );
-///
-/// @brief Equalize the throttles and estimated power at those throttle levels
-/// @param[in] i_targets vector of MCS targets all on the same VDDR domain
-/// @param[in] i_throttle_type denotes if this was done for POWER (VMEM) or THERMAL (VMEM+VPP) throttles
-/// @param[out] o_exceeded_power vector of MCA targets where the estimated power exceeded the maximum allowed
-/// @return FAPI2_RC_SUCCESS iff ok
-/// @note sets the throttles and power to the worst case
-///
-fapi2::ReturnCode equalize_throttles (const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_targets,
- const throttle_type i_throttle_type,
- std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >& o_exceeded_power);
-
}//power_thermal
+
}// mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle_traits.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle_traits.H
index da277d6fb..15407e3a4 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle_traits.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle_traits.H
@@ -22,3 +22,125 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+///
+/// @file p9_mss_utils_to_throttle.H
+/// @brief throttle API
+///
+
+// *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: FSP:HB
+
+#ifndef _MSS_POWER_THROTTLE_TRAITS_
+#define _MSS_POWER_THROTTLE_TRAITS_
+
+#include <fapi2.H>
+#include <generic/memory/lib/utils/power_thermal/gen_throttle_traits.H>
+
+namespace mss
+{
+namespace power_thermal
+{
+
+///
+/// @class Traits and policy class for throttle code - specialization for the NIMBUS mc type
+///
+template<>
+class throttle_traits<mss::mc_type::NIMBUS>
+{
+ public:
+ //////////////////////////////////////////////////////////////
+ // Target types
+ //////////////////////////////////////////////////////////////
+ static constexpr fapi2::TargetType MC_TARGET_TYPE = fapi2::TARGET_TYPE_MCS;
+ static constexpr fapi2::TargetType PORT_TARGET_TYPE = fapi2::TARGET_TYPE_MCA;
+
+ // MIN_UTIL is in c%
+ static const uint64_t MIN_UTIL = 2500;
+ // IDLE_UTIL is in c%
+ static const uint64_t IDLE_UTIL = 0;
+ // Minimum throttle allowed for the port and or slot. If we set to 0, we brick the port
+ static const uint64_t MIN_THROTTLE = 1;
+
+ enum size_of_attrs : size_t
+ {
+ SIZE_OF_POWER_CURVES_ATTRS = 100,
+ SIZE_OF_THERMAL_ATTR = 10,
+ };
+
+ enum default_power
+ {
+ //Values are the worst case defaults for power curves
+ //They are the default/ catch-all values from the power curve attributes
+ //Shouldn't be used if system is set up correctly and attributes are available
+ //This will throttle the DIMMs to ~76% dram data bus utilization
+ //(using the mrw regulator power limit of 1700 cW and thermal power limit here of 1940 cW).
+ VDDR_SLOPE = 0x41A,
+ VDDR_INT = 0x384,
+ TOTAL_SLOPE = 0x44C,
+ TOTAL_INT = 0x44C,
+ THERMAL_LIMIT = 0x794,
+ };
+
+ enum
+ {
+ PORTS_PER_MC = 2,
+ DIMMS_PER_PORT = 2,
+ };
+
+ //Bit positions for different section of the attribute
+ //first 32 bits are the encoding, second are for values
+ enum DECODE_BUFFER_POS
+ {
+ ENCODING_START = 0,
+ ENCODING_LENGTH = 32,
+ VDDR_START = 32,
+ VDDR_LENGTH = 16,
+ TOTAL_START = 48,
+ TOTAL_LENGTH = 16,
+ THERMAL_POWER_START = 32,
+ THERMAL_POWER_LENGTH = 32,
+ };
+
+ //Positions and lengths of the encodings
+ enum ATTR_DECODE_INFO
+ {
+ DIMM_SIZE_START = 0,
+ DIMM_SIZE_LEN = 4,
+
+ DRAM_GEN_START = 4,
+ DRAM_GEN_LEN = 2,
+
+ DIMM_TYPE_START = 6,
+ DIMM_TYPE_LEN = 2,
+
+ DRAM_WIDTH_START = 8,
+ DRAM_WIDTH_LEN = 3,
+
+ DRAM_DENSITY_START = 11,
+ DRAM_DENSITY_LEN = 3,
+
+ DRAM_STACK_TYPE_START = 14,
+ DRAM_STACK_TYPE_LEN = 2,
+
+ DRAM_MFGID_START = 16,
+ DRAM_MFGID_LEN = 3,
+
+ DIMMS_PER_PORT_START = 19,
+ DIMMS_PER_PORT_LEN = 2,
+
+ // Invalid for Nimbus but compile will fail without them
+ DIMM_MODULE_HEIGHT_START = 0,
+ DIMM_MODULE_HEIGHT_LEN = 1,
+ };
+
+
+ // Definition is in chip folder
+ static const std::vector< std::pair<uint8_t , uint8_t> > DIMM_TYPE_MAP;
+};
+}//power_thermal
+}// mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H b/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H
index bf84c1662..679459d74 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H
@@ -51,7 +51,6 @@ enum sizes
MC_PER_MODULE = 2,
MCBIST_PER_MC = 1,
MAX_DIMM_PER_PORT = 2,
- MAX_RANK_PER_DIMM = 4,
PORTS_PER_MODULE = MC_PER_MODULE * MCS_PER_MC * PORTS_PER_MCS,
BITS_PER_DP = 16,
NIBBLES_PER_DP = BITS_PER_DP / BITS_PER_NIBBLE,
@@ -64,7 +63,7 @@ enum sizes
RANK_MID_POINT = 4, ///< Which rank number indicates the switch to the other DIMM
MAX_NUM_IMP = 4, ///< number of impedances valid per slew type
MAX_NUM_CAL_SLEW_RATES = 4, ///< 3V/ns, 4V/ns, 5V/ns, 6V/n
- MAX_DQ_BITS = 72, /// TODO RTC:157753 This is Nimbus specific. Should be attribute/trait of processor.
+ MAX_DQ_BITS = 72,
MAX_DQ_NIBBLES = MAX_DQ_BITS / BITS_PER_NIBBLE, ///< For ISDIMMs are 18 DQ nibbles for DQ 72 bits
MAX_DRAMS_X8 = MAX_DQ_BITS / BITS_PER_BYTE, ///< For x8's there are 9 DRAM for 72 bits
MAX_DRAMS_X4 = MAX_DQ_BITS / BITS_PER_NIBBLE, ///< For x4's there are 18 DRAM for 72 bits
@@ -75,10 +74,6 @@ enum sizes
ROW_REPAIR_BYTE_COUNT = 4, ///< Elements in a ROW_REPAIR_DATA attribute array.
- BYTES_PER_GB = 1000000000, ///< Multiplier to go from GB to B
- T_PER_MT = 1000000, ///< Multiplier to go from MT/s to T/s
- CYCLES_PER_CMD = 4, ///< Best case cycles per MCBIST command
-
// All need to be attributes? - BRS
WR_LVL_BIG_STEP = 0b0111,
WR_LVL_SMALL_STEP = 0b000,
@@ -99,27 +94,11 @@ enum sizes
// Largest size a VPD keyword can be
VPD_KEYWORD_MAX = 255,
-
- // Number of double words in...
- NUM_DW_IN_128B = 16,
- NUM_DW_IN_64B = 8,
-
- // MCBIST polling constant for actual HW
- // The specific value here is not important, only that it is very large to avoid polling timeouts,
- // but not to avoid any actual hardware timeouts
- // Note: ~0 is not used as that would cause MCBIST to never timeout even if the hardware is in an infinite loop
- // You can't get greater than ~0, so you'd never timeout
- // TODO RTC:166340 - Clean up MCBIST polling
- OVERLY_LARGE_NUMBER_OF_POLLS = 5000000000000,
};
enum times
{
// Not *exactly* a time but go with i
- BG_SCRUB_IN_HOURS = 12,
-
- CMD_TIMEBASE = 8192, ///< Represents the timebase multiplier for the MCBIST inter cmd gap
- MAX_CMD_GAP = 4095, ///< Represents the maximum (non-multplied) time for MCBIST inter cmd gap
FULL_DLL_CAL_DELAY = 37382, ///< Full DLL calibration (in ddphy_nck cycles)
};
@@ -154,26 +133,9 @@ enum ffdc_function_codes
SOFT_POST_PACKAGE_REPAIR = 27,
EFF_BC07 = 28,
- // Used in fw_mark_store.H for MSS_INVALID_RANK_PASSED
- FWMS_READ = 30,
- FWMS_WRITE = 31,
-
- // Used in hw_mark_store.H for MSS_INVALID_RANK_PASSED
- HWMS_READ = 40,
- HWMS_WRITE = 41,
-
- // MSS_INVALID_INDEX_PASSED
- SYMBOL_COUNT_READ = 50,
- SYMBOL_COUNT_WRITE = 51,
-
// Used in rank.H
MAP_RP_PRIMARY_TO_INIT_CAL = 60,
- // Power thermal functions
- SLOPE = 70,
- INTERCEPT = 71,
- POWER_LIMIT = 72,
-
// PDA function codes
PDA_WR_VREF_LATCH_CONTAINER = 80,
PDA_WR_VREF_LATCH_VECTOR = 81,
@@ -198,6 +160,7 @@ enum ffdc_function_codes
DRAM_TO_RP_REG = 101,
// eff_dimm.C
+ RAW_CARD_FACTORY = 115,
PRIMARY_STACK_TYPE = 116,
// CW engine information
@@ -212,9 +175,6 @@ enum ffdc_function_codes
// LR training function
DWL_CALL_OUT = 130,
MREP_CALL_OUT = 131,
-
-
- CCS_INST_CONFIGURE_RANK = 132,
};
// Static consts describing the bits used in the cal_step_enable attribute
@@ -276,44 +236,6 @@ enum voltages : uint64_t
};
-enum port_select
-{
- // Port selects for MCBIST and CCS
- // Select for 1 port
- PORT0 = 0b1000,
- PORT1 = 0b0100,
- PORT2 = 0b0010,
- PORT3 = 0b0001,
- // Selects for 2 port combinations
- PORT01 = PORT0 | PORT1,
- PORT02 = PORT0 | PORT2,
- PORT03 = PORT0 | PORT3,
- PORT12 = PORT1 | PORT2,
- PORT13 = PORT1 | PORT3,
- PORT23 = PORT2 | PORT3,
- // Selects for 3 port combinations
- PORT012 = PORT0 | PORT1 | PORT2,
- PORT013 = PORT0 | PORT1 | PORT3,
- PORT023 = PORT0 | PORT2 | PORT3,
- PORT123 = PORT1 | PORT2 | PORT3,
- // Select all
- PORT0123 = PORT0 | PORT1 | PORT2 | PORT3,
- // Maybe a better name for disabling all
- PORT_NONE = 0b0000,
-};
-
-enum dimm_select
-{
- // Dimm selects for MCBIST and CCS
- // Select for 1 dimm
- DIMM0 = 0b10,
- DIMM1 = 0b01,
- // Selects for 2 dimm combinations
- DIMM01 = DIMM0 | DIMM1,
- // Maybe a better name for disabling all
- DIMM_NONE = 0b00,
-};
-
// Possible values for power domains in MBARPC0Q
enum min_max_domains : uint64_t
{
@@ -324,179 +246,5 @@ enum min_max_domains : uint64_t
MAX1_MIN0 = 0b100,
};
-namespace mcbist
-{
-
-enum broadcast_timebase
-{
- // Number of 1024 2:1 cycle timebases to wait starting MCBIST
- // for SRQs to get synced for broadcast mode
- TB_COUNT_2 = 0b0000001,
- TB_COUNT_4 = 0b0000011,
- TB_COUNT_8 = 0b0000111,
- TB_COUNT_16 = 0b0001111,
- TB_COUNT_32 = 0b0011111,
- TB_COUNT_64 = 0b0111111,
- TB_COUNT_128 = 0b1111111,
-};
-
-enum rmw_address
-{
- // 32B block addresses into the maint portion of the rmw buffer
- DW0 = 0b111110000,
- DW1 = 0b111110001,
- DW2 = 0b111110010,
- DW3 = 0b111110011,
- DW4 = 0b111110100,
- DW5 = 0b111110101,
- DW6 = 0b111110110,
- DW7 = 0b111110111,
- DW8 = 0b111111000,
- DW9 = 0b111111001,
- DWA = 0b111111010,
- DWB = 0b111111011,
- DWC = 0b111111100,
- DWD = 0b111111101,
- DWE = 0b111111110,
- DWF = 0b111111111,
-};
-
-enum data_rotate_mode
-{
- // MCBIST data rotate modes refer to register MCBDRCR bits 0:3
- ROTATE_0_BITS = 0b0000,
- ROTATE_1_BITS = 0b0001,
- ROTATE_2_BITS = 0b0010,
- ROTATE_3_BITS = 0b0011,
- ROTATE_4_BITS = 0b0100,
- ROTATE_5_BITS = 0b0101,
- ROTATE_6_BITS = 0b0110,
- ROTATE_7_BITS = 0b0111,
- ROTATE_8_BITS = 0b1000,
- ROTATE_9_BITS = 0b1001,
- ROTATE_10_BITS = 0b1010,
- ROTATE_11_BITS = 0b1011,
- ROTATE_12_BITS = 0b1100,
- ROTATE_13_BITS = 0b1101,
- ROTATE_14_BITS = 0b1110,
- ROTATE_15_BITS = 0b1111,
-};
-
-enum data_seed_mode
-{
- // MCBIST data seed modes refer to register MCBDRCR bits 21:22
- ALL_UNIQUE = 0b00,
- REPEAT_SEED_0 = 0b01,
- REPEAT_SEED_1 = 0b10,
- REPEAT_SEED_2 = 0b11,
-};
-
-enum data_mode
-{
- // MCBIST test data modes
- FIXED_DATA_MODE = 0b000,
- RAND_FWD_MODE = 0b001,
- RAND_REV_MODE = 0b010,
- RAND_FWD_MAINT = 0b011,
- RAND_REV_MAINT = 0b100,
- DATA_EQ_ADDR = 0b101,
- ROTATE_LEFT_MODE = 0b110,
- ROTATE_RIGHT_MODE = 0b111,
-};
-
-// 0:3 Operation Type
-enum op_type
-{
- WRITE = 0b0000, // fast, with no concurrent traffic
- READ = 0b0001, // fast, with no concurrent traffic
- READ_WRITE = 0b0010,
- WRITE_READ = 0b0011,
- READ_WRITE_READ = 0b0100,
- READ_WRITE_WRITE = 0b0101,
- RAND_SEQ = 0b0110,
- READ_READ_WRITE = 0b1000,
- SCRUB_RRWR = 0b1001,
- STEER_RW = 0b1010,
- ALTER = 0b1011, // (W)
- DISPLAY = 0b1100, // (R, slow)
- CCS_EXECUTE = 0b1111,
-
- // if bits 9:11 (Data Mode bits) = 000 (bits 4:8 used to specify which subtest to go to)
- // Refresh only cmd if bits 9:11 (Data Mode bits) /= 000
- GOTO_SUBTEST_N = 0b0111,
-};
-
-
-enum test_type
-{
- USER_MODE = 0,
- CENSHMOO = 1,
- SUREFAIL = 2,
- MEMWRITE = 3,
- MEMREAD = 4,
- CBR_REFRESH = 5,
- MCBIST_SHORT = 6,
- SHORT_SEQ = 7,
- DELTA_I = 8,
- DELTA_I_LOOP = 9,
- SHORT_RAND = 10,
- LONG1 = 11,
- BUS_TAT = 12,
- SIMPLE_FIX = 13,
- SIMPLE_RAND = 14,
- SIMPLE_RAND_2W = 15,
- SIMPLE_RAND_FIXD = 16,
- SIMPLE_RA_RD_WR = 17,
- SIMPLE_RA_RD_R = 18,
- SIMPLE_RA_FD_R = 19,
- SIMPLE_RA_FD_R_INF = 20,
- SIMPLE_SA_FD_R = 21,
- SIMPLE_RA_FD_W = 22,
- INFINITE = 23,
- WR_ONLY = 24,
- W_ONLY = 25,
- R_ONLY = 26,
- W_ONLY_RAND = 27,
- R_ONLY_RAND = 28,
- R_ONLY_MULTI = 29,
- SHORT = 30,
- SIMPLE_RAND_BARI = 31,
- W_R_INFINITE = 32,
- W_R_RAND_INFINITE = 33,
- R_INFINITE1 = 34,
- R_INFINITE_RF = 35,
- MARCH = 36,
- SIMPLE_FIX_RF = 37,
- SHMOO_STRESS = 38,
- SIMPLE_RAND_RA = 39,
- SIMPLE_FIX_RA = 40,
- SIMPLE_FIX_RF_RA = 41,
- TEST_RR = 42,
- TEST_RF = 43,
- W_ONLY_INFINITE_RAND = 44,
- MCB_2D_CUP_SEQ = 45,
- MCB_2D_CUP_RAND = 46,
- SHMOO_STRESS_INFINITE = 47,
- HYNIX_1_COL = 48,
- RMWFIX = 49,
- RMWFIX_I = 50,
- W_INFINITE = 51,
- R_INFINITE = 52,
-};
-
-
-} // namespace mcbist
-
-enum class shmoo_edge : std::size_t
-{
- LEFT,
- RIGHT
-};
-
-enum visual_max : uint64_t
-{
- MAX_VISUAL_VALUE = 9999
-};
-
} // namespace mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/shared/nimbus_defaults.H b/src/import/chips/p9/procedures/hwp/memory/lib/shared/nimbus_defaults.H
index 5863d063f..0a10d2522 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/shared/nimbus_defaults.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/shared/nimbus_defaults.H
@@ -36,12 +36,15 @@
#ifndef _MSS_NIMBUS_DEFAULTS_H_
#define _MSS_NIMBUS_DEFAULTS_H_
+#include <fapi2.H>
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
namespace mss
{
constexpr mss::mc_type DEFAULT_MC_TYPE = mss::mc_type::NIMBUS;
+constexpr fapi2::TargetType DEFAULT_MC_TARGET = fapi2::TARGET_TYPE_MCBIST;
+constexpr fapi2::TargetType DEFAULT_MEM_PORT_TARGET = fapi2::TARGET_TYPE_MCA;
} // ns mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C b/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C
index be8343c71..2d6aef4c8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/spd/spd_factory.C
@@ -53,7 +53,7 @@
#include <generic/memory/lib/spd/spd_checker.H>
#include <generic/memory/lib/spd/spd_utils.H>
#include <lib/utils/mss_nimbus_conversions.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/eff_config/timing.H>
#include <lib/shared/mss_const.H>
@@ -131,7 +131,8 @@ fapi2::ReturnCode raw_card_factory(const fapi2::Target<TARGET_TYPE_DIMM>& i_targ
FAPI_ASSERT( false,
fapi2::MSS_INVALID_DIMM_TYPE()
.set_DIMM_TYPE(l_dimm_type)
- .set_DIMM_TARGET(i_target),
+ .set_DIMM_TARGET(i_target)
+ .set_FUNCTION(mss::ffdc_function_codes::RAW_CARD_FACTORY),
"Recieved invalid dimm type: %d for %s",
l_dimm_type, mss::spd::c_str(i_target) );
break;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/find_magic.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/find_magic.H
new file mode 100644
index 000000000..3c8a385c4
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/find_magic.H
@@ -0,0 +1,140 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/utils/find_magic.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 _MSS_FIND_WITH_MAGIC_H
+#define _MSS_FIND_WITH_MAGIC_H
+
+#include <fapi2.H>
+#include <vector>
+#include <generic/memory/lib/utils/pos.H>
+#include <generic/memory/lib/utils/c_str.H>
+#include <generic/memory/lib/utils/find.H>
+
+namespace mss
+{
+
+///
+/// @brief find the union of functionl targets and any magic targets
+/// @note The PHY has a logic block which is only contained in the 0th PHY in the controller.
+/// This makes the 0th PHY 'magic' in that it needs to always be present if not functional.
+/// This function returns all functional targets and includes the magic target whether or not
+/// it is truly functional.
+/// @tparam M the target type to be returned
+/// @tparam T the fapi2 target type of the argument
+/// @param[in] i_target the fapi2 target T
+/// @return a vector of M targets.
+///
+template< fapi2::TargetType M, fapi2::TargetType T >
+inline std::vector< fapi2::Target<M> > find_targets_with_magic( const fapi2::Target<T>& i_target);
+
+///
+/// @brief find a set of magic elements based on a fapi2 target
+/// @note The PHY has a logic block which is only contained in the 0th PHY in the controller.
+/// This makes the 0th PHY 'magic' in that it needs to always be present if not functional.
+/// This function returns all magic targets whether or not it is truly functional.
+/// It does not include other functional or present targets.
+/// @tparam M the target type to be returned
+/// @tparam T the fapi2 target type of the argument
+/// @param[in] i_target the fapi2 target T
+/// @return a vector of M targets.
+///
+template< fapi2::TargetType M, fapi2::TargetType T >
+inline std::vector< fapi2::Target<M> > find_magic_targets( const fapi2::Target<T>& i_target);
+
+///
+/// @brief find the magic MCA connected to an MCBIST
+/// @param[in] i_target the fapi2::Target MCBIST
+/// @return a vector of fapi2::TARGET_TYPE_MCA
+///
+template<>
+inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >
+find_magic_targets(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target)
+{
+ // The magic port is in position 0, relative to the MCBIST
+ constexpr uint64_t RELATIVE_MAGIC_POS = 0;
+
+ // This is only one magic MCA on every MCBIST, so we only return a vector of one
+ std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCA>> l_magic_ports;
+
+ // Get all the present MCA children and find the target with the relative position of 0
+ for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>(fapi2::TARGET_STATE_PRESENT))
+ {
+ if (mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(p) == RELATIVE_MAGIC_POS)
+ {
+ l_magic_ports.push_back(p);
+ }
+ }
+
+ // We don't care if the vector is empty. We don't know what the caller will do with this
+ // and they might not care if there is no magic port either ...
+ return l_magic_ports;
+}
+
+///
+/// @brief find the union of functionl targets and any magic targets
+/// @param[in] i_target the fapi2::Target MCBIST
+/// @return a vector of i2::Target<fapi2::TARGET_TYPE_MCA>
+///
+template<>
+inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >
+find_targets_with_magic( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target)
+{
+ // We need the union of the functional target list and the magic target list. We can
+ // get a little tricky with the MCA's - we know there's only one magic port.
+ // So if the one magic port isn't in the list of functional ports, add it
+ auto l_magic_ports = find_magic_targets<fapi2::TARGET_TYPE_MCA>(i_target);
+
+ if (l_magic_ports.size() != 1)
+ {
+ FAPI_ERR("Found wrong number of magic ports on %s (%d)", mss::c_str(i_target), l_magic_ports.size());
+ fapi2::Assert(false);
+ }
+
+ auto l_ports = mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target);
+ const auto l_magic_pos = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(l_magic_ports[0]);
+ const auto l_magic_port = std::find_if(l_ports.begin(), l_ports.end(),
+ [&l_magic_pos](const fapi2::Target<fapi2::TARGET_TYPE_MCA>& t)
+ {
+ // Check ports by relative position.
+ const auto l_pos = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(t);
+ FAPI_DBG("checking for magic port at %d candidate is %d", l_magic_pos, l_pos);
+ return l_magic_pos == l_pos;
+ });
+
+ if (l_magic_port == l_ports.end())
+ {
+ // Add the magic port to the front of the port vector.
+ FAPI_DBG("inserting magic port %d", l_magic_pos);
+ l_ports.insert(l_ports.begin(), l_magic_ports[0]);
+ }
+
+ // In either case, l_ports is the proper thing to return. Either the magic port was in
+ // l_ports or it is now because we inserted it.
+ return l_ports;
+}
+
+}// mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/hwp_wrappers_nim.C b/src/import/chips/p9/procedures/hwp/memory/lib/utils/hwp_wrappers_nim.C
new file mode 100644
index 000000000..7f5dd54e7
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/hwp_wrappers_nim.C
@@ -0,0 +1,169 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/utils/hwp_wrappers_nim.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file hwp_wrappers_nim.C
+/// @brief Main wrapper file for PRD calling Nimbus memory procedure code
+///
+// *HWP HWP Owner: Matthew Hickman <Matthew.Hickman@ibm.com>
+// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#include <fapi2.H>
+#include <lib/shared/nimbus_defaults.H>
+#include <lib/mcbist/mcbist_traits.H>
+#include <generic/memory/lib/utils/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
+#include <lib/dimm/rank.H>
+#include <mss.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_memdiags.H>
+
+///
+/// @brief Memdiags stop command wrapper for Nimbus
+/// @param[in] i_target the target
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+fapi2::ReturnCode nim_stop( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
+{
+ return mss::memdiags::stop<mss::mc_type::NIMBUS>(i_target);
+}
+
+///
+/// @brief Memdiags Super Fast Init command wrapper for Nimbus
+/// @param[in] i_target the target behind which all memory should be initialized
+/// @param[in] i_pattern an index representing a pattern to use to init memory (defaults to 0)
+/// @return FAPI2_RC_SUCCESS iff everything ok
+///
+fapi2::ReturnCode nim_sf_init( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const uint64_t i_pattern )
+{
+ return mss::memdiags::sf_init<mss::mc_type::NIMBUS>(i_target, i_pattern);
+}
+
+///
+/// @brief Memdiags Super Fast Read command wrapper for Nimbus
+/// @param[in] i_target the target behind which all memory should be read
+/// @param[in] i_stop stop conditions
+/// @param[in] i_address mcbist::address representing the address from which to start.
+// Defaults to the first address behind the target
+/// @param[in] i_end whether to end, and where
+/// Defaults to stop after slave rank
+/// @param[in] i_end_address mcbist::address representing the address to end.
+// Defaults to TT::LARGEST_ADDRESS
+/// @return FAPI2_RC_SUCCESS iff everything ok
+///
+fapi2::ReturnCode nim_sf_read( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const mss::mcbist::stop_conditions<mss::mc_type::NIMBUS>& i_stop,
+ const mss::mcbist::address& i_address,
+ const mss::mcbist::end_boundary i_end,
+ const mss::mcbist::address& i_end_address )
+{
+ return mss::memdiags::sf_read<mss::mc_type::NIMBUS>(i_target, i_stop, i_address, i_end, i_end_address);
+}
+
+///
+/// @brief Continuous background scrub command wrapper for Nimbus
+/// @param[in] i_target the target behind which all memory should be scrubbed
+/// @param[in] i_stop stop conditions
+/// @param[in] i_speed the speed to scrub
+/// @param[in] i_address mcbist::address representing the address from which to start.
+/// @return FAPI2_RC_SUCCESS iff everything ok
+///
+fapi2::ReturnCode nim_background_scrub( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const mss::mcbist::stop_conditions<mss::mc_type::NIMBUS>& i_stop,
+ const mss::mcbist::speed i_speed,
+ const mss::mcbist::address& i_address )
+{
+ return mss::memdiags::background_scrub<mss::mc_type::NIMBUS>(i_target, i_stop, i_speed, i_address);
+}
+
+///
+/// @brief Targeted scrub command wrapper for Nimbus
+/// @param[in] i_target the target behind which all memory should be scrubbed
+/// @param[in] i_stop stop conditions
+/// @param[in] i_speed the speed to scrub
+/// @param[in] i_start_address mcbist::address representing the address from which to start.
+/// @param[in] i_end_address mcbist::address representing the address at which to end.
+/// @param[in] i_end whether to end, and where
+/// @return FAPI2_RC_SUCCESS iff everything ok
+///
+fapi2::ReturnCode nim_targeted_scrub( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const mss::mcbist::stop_conditions<mss::mc_type::NIMBUS>& i_stop,
+ const mss::mcbist::address& i_start_address,
+ const mss::mcbist::address& i_end_address,
+ const mss::mcbist::end_boundary i_end )
+{
+ return mss::memdiags::targeted_scrub<mss::mc_type::NIMBUS>(i_target, i_stop, i_start_address, i_end_address, i_end);
+}
+
+///
+/// @brief Continue current command wrapper for Nimbus
+/// @param[in] i_target the target
+/// @param[in] i_end whether to end, and where (default - don't stop at end of rank)
+/// @param[in] i_stop stop conditions (default - 0 meaning 'don't change conditions')
+/// @param[in] i_speed the speed to scrub (default - SAME_SPEED meaning leave speed untouched)
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+fapi2::ReturnCode nim_continue_cmd( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ const mss::mcbist::end_boundary i_end,
+ const mss::mcbist::stop_conditions<mss::mc_type::NIMBUS>& i_stop,
+ const mss::mcbist::speed i_speed )
+{
+ return mss::memdiags::continue_cmd<mss::mc_type::NIMBUS>(i_target, i_end, i_stop, i_speed);
+}
+
+///
+/// @brief Broadcast mode check wrapper for Nimbus
+/// @param[in] i_target the target to effect
+/// @return o_capable - yes iff these vector of targets are broadcast capable
+///
+const mss::states nim_is_broadcast_capable(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target)
+{
+ return mss::mcbist::is_broadcast_capable<mss::mc_type::NIMBUS>(i_target);
+}
+
+
+///
+/// @brief Broadcast mode check wrapper for Nimbus
+/// @param[in] i_targets the vector of targets to analyze
+/// @return o_capable - yes iff these vector of targets are broadcast capable
+///
+const mss::states nim_is_broadcast_capable(const std::vector<fapi2::Target<fapi2::TARGET_TYPE_MCA>>& i_targets)
+{
+ return mss::mcbist::is_broadcast_capable<mss::mc_type::NIMBUS>(i_targets);
+}
+
+///
+/// @brief Broadcast mode check wrapper for Nimbus
+/// @param[in] i_kinds the dimms to effect
+/// @return o_capable - yes iff these vector of targets are broadcast capable
+///
+const mss::states nim_is_broadcast_capable(const std::vector<mss::dimm::kind<mss::mc_type::NIMBUS>>& i_kinds)
+{
+ return mss::mcbist::is_broadcast_capable(i_kinds);
+}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_nimbus_conversions.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_nimbus_conversions.H
index 1b7f749fd..9a560f72a 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_nimbus_conversions.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_nimbus_conversions.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,7 +36,7 @@
#define _MSS_NIMBUS_CONVERSIONS_H_
#include <generic/memory/lib/utils/conversions.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/mss_attribute_accessors.H>
namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H
index 9b2a7a1af..ddea7c7fd 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/mss_pair.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -38,7 +38,7 @@
#define _MSS_PAIR_CONST_H_
#include <fapi2.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/c_str.H>
namespace mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_find.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_find.H
new file mode 100644
index 000000000..b922938d4
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_find.H
@@ -0,0 +1,112 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_find.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file nimbus_find.H
+/// @brief Nimbus templates specialization for finding things
+///
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: HB:FSP
+
+#ifndef _MSS_NIMBUS_FIND_H
+#define _MSS_NIMBUS_FIND_H
+
+#include <fapi2.H>
+#include <vector>
+#include <generic/memory/lib/utils/find.H>
+
+namespace mss
+{
+
+///
+/// @brief find the McBIST given a DIMM
+/// @param[in] i_target the fapi2 target DIMM
+/// @return a McBIST target.
+///
+template<>
+inline fapi2::Target<fapi2::TARGET_TYPE_MCBIST> find_target(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target)
+{
+ return i_target.getParent<fapi2::TARGET_TYPE_MCA>().getParent<fapi2::TARGET_TYPE_MCBIST>();
+}
+
+///
+/// @brief find all the dimm connected to an MCS
+/// @param[in] i_target a fapi2::Target MCS
+/// @return a vector of fapi2::TARGET_TYPE_DIMM
+///
+template<>
+inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ fapi2::TargetState i_state )
+{
+ std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > l_dimms;
+
+ for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state))
+ {
+ auto l_these_dimms( p.getChildren<fapi2::TARGET_TYPE_DIMM>(i_state) );
+ l_dimms.insert(l_dimms.end(), l_these_dimms.begin(), l_these_dimms.end());
+ }
+
+ return l_dimms;
+}
+
+///
+/// @brief find all the dimms connected to an MCBIST
+/// @param[in] i_target a fapi2::Target MCBIST
+/// @return a vector of fapi2::TARGET_TYPE_DIMM
+///
+template<>
+inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ fapi2::TargetState i_state )
+{
+ std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > l_dimms;
+
+ for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state))
+ {
+ auto l_these_dimms( p.getChildren<fapi2::TARGET_TYPE_DIMM>(i_state) );
+ l_dimms.insert(l_dimms.end(), l_these_dimms.begin(), l_these_dimms.end());
+ }
+
+ return l_dimms;
+}
+
+///
+/// @brief find the MCS given a DIMM
+/// @param[in] i_target the fapi2 target DIMM
+/// @return a MCS target.
+///
+template<>
+inline fapi2::Target<fapi2::TARGET_TYPE_MCS> find_target( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target)
+{
+ return i_target.getParent<fapi2::TARGET_TYPE_MCA>().getParent<fapi2::TARGET_TYPE_MCS>();
+}
+
+}// mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/num.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/num.H
deleted file mode 100644
index 051aa214b..000000000
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/num.H
+++ /dev/null
@@ -1,55 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/utils/num.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
-/* [+] 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 */
-
-///
-/// @file num.H
-/// @brief Miscellaneous number checking functions
-///
-// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
-// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
-// *HWP Team: Memory
-// *HWP Level: 3
-// *HWP Consumed by: HB:FSP
-
-#ifndef _MSS_NUM_H_
-#define _MSS_NUM_H_
-
-namespace mss
-{
-
-///
-/// @brief Return whether or not a number is odd
-/// @param[in] i_number the number to check
-/// @return true if i_number is odd
-///
-template< typename T >
-constexpr bool is_odd(const T i_number)
-{
- return (i_number & 0x1);
-}
-
-
-}
-#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/adr32s_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/adr32s_workarounds.C
index cb9e22594..107cca50c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/adr32s_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/adr32s_workarounds.C
@@ -48,7 +48,7 @@
#include <lib/workarounds/adr32s_workarounds.H>
#include <lib/phy/ddr_phy.H>
#include <lib/phy/dcd.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_SYSTEM;
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.C
index f6a8b3467..de136357f 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.C
@@ -34,13 +34,16 @@
// *HWP Consumed by: FSP:HB Memory Lab
#include <lib/shared/nimbus_defaults.H>
+#include <lib/shared/mss_const.H>
#include <lib/workarounds/ccs_workarounds.H>
#include <lib/dimm/rank.H>
#include <p9_mc_scom_addresses.H>
#include <generic/memory/lib/utils/scom.H>
#include <generic/memory/lib/utils/pos.H>
#include <lib/eff_config/timing.H>
-#include <lib/ccs/ccs.H>
+#include <generic/memory/lib/ccs/ccs.H>
+#include <lib/mc/port.H>
+#include <lib/mc/mc.H>
namespace mss
{
@@ -105,7 +108,7 @@ fapi_try_exit:
///
fapi2::ReturnCode exit( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- ccs::program<fapi2::TARGET_TYPE_MCBIST>& io_program )
+ ccs::program& io_program )
{
const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
// Issues A-side MRS
@@ -150,9 +153,9 @@ fapi_try_exit:
/// ccs program execution will be handled by OCC
///
fapi2::ReturnCode preload_ccs_for_epow( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- ccs::program<fapi2::TARGET_TYPE_MCBIST>& i_program)
+ ccs::program& i_program)
{
- typedef ccsTraits<fapi2::TARGET_TYPE_MCBIST> TT;
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
// Subtract one for the idle we insert at the end
constexpr size_t CCS_INSTRUCTION_DEPTH = 32 - 1;
@@ -219,6 +222,66 @@ namespace nvdimm
{
///
+/// @brief add_refreshes() helper
+/// @param[in] i_target The MCA target where the program will be executed on
+/// @param[in,out] i_program the MCBIST ccs program to append the refreshes
+/// @return FAPI2_RC_SUCCESS iff success
+///
+fapi2::ReturnCode add_refreshes_helper(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ mss::ccs::program& io_program)
+{
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
+
+ uint16_t l_trefi = 0;
+
+ // 3 refreshes because the maximum number of instructions we can have is 28 for
+ // dual-rank NVDIMM (MRS)
+ constexpr size_t l_num_refreshes = 3;
+ constexpr uint64_t CS_N_ACTIVE = 0b00;
+
+ //get tREFI
+ FAPI_TRY(mss::eff_dram_trefi(i_target, l_trefi));
+
+ //load the refreshes into the program
+ for (size_t i = 0; i < l_num_refreshes; i++)
+ {
+ // We want to make sure the refresh hit all the ranks, so let's get the refresh command and change the chip select manually later
+ mss::ccs::instruction_t l_inst = mss::ccs::refresh_command(0, l_trefi);
+ l_inst.arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1, TT::ARR0_DDR_CSN_0_1_LEN>(CS_N_ACTIVE);
+ l_inst.arr0.insertFromRight<TT::ARR0_DDR_CSN_2_3, TT::ARR0_DDR_CSN_2_3_LEN>(CS_N_ACTIVE);
+ l_inst.iv_update_rank = false;
+ io_program.iv_instructions.push_back(l_inst);
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Adds refreshes at the beginning and end of the program
+/// @param[in] i_target The MCA target where the program will be executed on
+/// @param[in,out] io_program the MCBIST ccs program to add the refreshes
+/// @return FAPI2_RC_SUCCESS iff success
+///
+fapi2::ReturnCode add_refreshes(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ mss::ccs::program& io_program)
+{
+ mss::ccs::program l_program;
+
+ // Add the refreshes at the beginning
+ FAPI_TRY(add_refreshes_helper(i_target, l_program));
+
+ // Append the instructions from io_program
+ l_program.iv_instructions.insert(l_program.iv_instructions.end(), io_program.iv_instructions.begin(),
+ io_program.iv_instructions.end());
+
+ io_program = l_program;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
/// @brief Execute the contents of the CCS array with ccs_addr_mux_sel control
/// @param[in] i_target The MCBIST containing the array
/// @param[in] i_program the MCBIST ccs program - to get the polling parameters
@@ -229,10 +292,10 @@ namespace nvdimm
/// CCS can properly drive the bus during the nvdimm post-restore sequence.
///
fapi2::ReturnCode execute_inst_array(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST>& i_program,
+ mss::ccs::program& i_program,
const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_port)
{
- typedef ccsTraits<fapi2::TARGET_TYPE_MCBIST> TT;
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
fapi2::buffer<uint64_t> status;
@@ -256,7 +319,7 @@ fapi2::ReturnCode execute_inst_array(const fapi2::Target<fapi2::TARGET_TYPE_MCBI
i_program.iv_probes);
// Check for done and success. DONE being the only bit set.
- if (status == STAT_QUERY_SUCCESS)
+ if (status == TT::STAT_QUERY_SUCCESS)
{
FAPI_INF("%s CCS Executed Successfully.", mss::c_str(i_port) );
goto fapi_try_exit;
@@ -280,105 +343,130 @@ fapi_try_exit:
/// @note This is a copy of execute() with minor tweaks to the namespace and single port only
///
fapi2::ReturnCode execute( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST>& i_program,
+ mss::ccs::program& i_program,
const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_port)
{
- typedef ccsTraits<fapi2::TARGET_TYPE_MCBIST> TT;
+ typedef ccsTraits<mss::mc_type::NIMBUS> TT;
// Subtract one for the idle we insert at the end
constexpr size_t CCS_INSTRUCTION_DEPTH = 32 - 1;
constexpr uint64_t CCS_ARR0_ZERO = MCBIST_CCS_INST_ARR0_00;
constexpr uint64_t CCS_ARR1_ZERO = MCBIST_CCS_INST_ARR1_00;
+ mss::states l_str_state = mss::states::OFF;
+ fapi2::buffer<uint64_t> l_farb6q;
- mss::ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> l_des = ccs::des_command<fapi2::TARGET_TYPE_MCBIST>();
+ mss::ccs::instruction_t l_des = ccs::des_command();
FAPI_INF("loading ccs instructions (%d) for %s", i_program.iv_instructions.size(), mss::c_str(i_target));
- auto l_inst_iter = i_program.iv_instructions.begin();
+ //Check if we are in str. If we are not, throw some refreshes into the program
+ FAPI_TRY(mss::mc::read_farb6q(i_port, l_farb6q));
+ mss::mc::get_self_time_refresh_state(l_farb6q, l_str_state);
- // Stop the CCS engine just for giggles - it might be running ...
- FAPI_TRY( mss::ccs::start_stop(i_target, mss::states::STOP), "Error in ccs::execute" );
-
- FAPI_ASSERT( mss::poll(i_target, TT::STATQ_REG, poll_parameters(),
- [](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
+ if (l_str_state == mss::states::OFF)
{
- FAPI_INF("ccs statq (stop) 0x%llx, remaining: %d", stat_reg, poll_remaining);
- return stat_reg.getBit<TT::CCS_IN_PROGRESS>() != 1;
- }),
- fapi2::MSS_CCS_HUNG_TRYING_TO_STOP().set_MCBIST_TARGET(i_target) );
+ // Since we are executing the CCS program with data in the DRAMs, we need to be congnizant
+ // about the refreshes. Refresh from mc is fenced off when CCS has the bus, and by the time
+ // the control is given back to the mc, we would have violated 8*trefi refresh window.
+ // As such, let's start off each program with couple of refreshes so we don't violate the
+ // rolling 8*trefi window (verified on logic analyzer)
+ FAPI_TRY(add_refreshes(i_port, i_program));
+ }
- while (l_inst_iter != i_program.iv_instructions.end())
{
- size_t l_inst_count = 0;
+ auto l_inst_iter = i_program.iv_instructions.begin();
- uint64_t l_total_delay = 0;
- uint64_t l_delay = 0;
- uint64_t l_repeat = 0;
- uint8_t l_current_cke = 0;
+ std::vector<rank_configuration> l_rank_configs;
+ FAPI_TRY(get_rank_config(i_target, l_rank_configs));
- // Shove the instructions into the CCS engine, in 32 instruction chunks, and execute them
- for (; l_inst_iter != i_program.iv_instructions.end()
- && l_inst_count < CCS_INSTRUCTION_DEPTH; ++l_inst_count, ++l_inst_iter)
+ // Stop the CCS engine just for giggles - it might be running ...
+ FAPI_TRY( mss::ccs::start_stop(i_target, mss::states::STOP), "Error in ccs::execute" );
+
+ FAPI_ASSERT( mss::poll(i_target, TT::STATQ_REG, poll_parameters(),
+ [](const size_t poll_remaining, const fapi2::buffer<uint64_t>& stat_reg) -> bool
{
- l_inst_iter->arr0.extractToRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_current_cke);
+ FAPI_INF("ccs statq (stop) 0x%llx, remaining: %d", stat_reg, poll_remaining);
+ return stat_reg.getBit<TT::CCS_IN_PROGRESS>() != 1;
+ }),
+ fapi2::MSS_CCS_HUNG_TRYING_TO_STOP().set_MCBIST_TARGET(i_target) );
- // Make sure this instruction leads to the next. Notice this limits this mechanism to pretty
- // simple (straight line) CCS programs. Anything with a loop or such will need another mechanism.
- l_inst_iter->arr1.insertFromRight<MCBIST_CCS_INST_ARR1_00_GOTO_CMD,
- MCBIST_CCS_INST_ARR1_00_GOTO_CMD_LEN>(l_inst_count + 1);
- FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_inst_iter->arr0), "Error in ccs::execute" );
- FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_inst_iter->arr1), "Error in ccs::execute" );
+ while (l_inst_iter != i_program.iv_instructions.end())
+ {
+ size_t l_inst_count = 0;
- // arr1 contains a specification of the delay and repeat after this instruction, as well
- // as a repeat. Total up the delays as we go so we know how long to wait before polling
- // the CCS engine for completion
- l_inst_iter->arr1.extractToRight<MCBIST_CCS_INST_ARR1_00_IDLES, MCBIST_CCS_INST_ARR1_00_IDLES_LEN>(l_delay);
- l_inst_iter->arr1.extractToRight<MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT,
- MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT>(l_repeat);
+ uint64_t l_total_delay = 0;
+ uint64_t l_delay = 0;
+ uint64_t l_repeat = 0;
+ uint8_t l_current_cke = 0;
+ const auto l_port_index = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_port);
- l_total_delay += l_delay * (l_repeat + 1);
+ // Shove the instructions into the CCS engine, in 32 instruction chunks, and execute them
+ for (; l_inst_iter != i_program.iv_instructions.end()
+ && l_inst_count < CCS_INSTRUCTION_DEPTH; ++l_inst_count, ++l_inst_iter)
+ {
+ // First, update the current instruction's chip selects for the current port
+ FAPI_TRY(l_inst_iter->configure_rank(i_port, l_rank_configs[l_port_index]), "Error in rank config");
- FAPI_INF("css inst %d: 0x%016lX 0x%016lX (0x%lx, 0x%lx) delay: 0x%x (0x%x) %s",
- l_inst_count, l_inst_iter->arr0, l_inst_iter->arr1,
- CCS_ARR0_ZERO + l_inst_count, CCS_ARR1_ZERO + l_inst_count,
- l_delay, l_total_delay, mss::c_str(i_target));
- }
+ l_inst_iter->arr0.extractToRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_current_cke);
- // Check our program for any delays. If there isn't a iv_initial_delay configured, then
- // we use the delay we just summed from the instructions.
- if (i_program.iv_poll.iv_initial_delay == 0)
- {
- i_program.iv_poll.iv_initial_delay = cycles_to_ns(i_target, l_total_delay);
- }
+ // Make sure this instruction leads to the next. Notice this limits this mechanism to pretty
+ // simple (straight line) CCS programs. Anything with a loop or such will need another mechanism.
+ l_inst_iter->arr1.insertFromRight<MCBIST_CCS_INST_ARR1_00_GOTO_CMD,
+ MCBIST_CCS_INST_ARR1_00_GOTO_CMD_LEN>(l_inst_count + 1);
+ FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_inst_iter->arr0), "Error in ccs::execute" );
+ FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_inst_iter->arr1), "Error in ccs::execute" );
+
+ // arr1 contains a specification of the delay and repeat after this instruction, as well
+ // as a repeat. Total up the delays as we go so we know how long to wait before polling
+ // the CCS engine for completion
+ l_inst_iter->arr1.extractToRight<MCBIST_CCS_INST_ARR1_00_IDLES, MCBIST_CCS_INST_ARR1_00_IDLES_LEN>(l_delay);
+ l_inst_iter->arr1.extractToRight<MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT,
+ MCBIST_CCS_INST_ARR1_00_REPEAT_CMD_CNT>(l_repeat);
+
+ l_total_delay += l_delay * (l_repeat + 1);
+
+ FAPI_INF("css inst %d: 0x%016lX 0x%016lX (0x%lx, 0x%lx) delay: 0x%x (0x%x) %s",
+ l_inst_count, l_inst_iter->arr0, l_inst_iter->arr1,
+ CCS_ARR0_ZERO + l_inst_count, CCS_ARR1_ZERO + l_inst_count,
+ l_delay, l_total_delay, mss::c_str(i_target));
+ }
- if (i_program.iv_poll.iv_initial_sim_delay == 0)
- {
- i_program.iv_poll.iv_initial_sim_delay = cycles_to_simcycles(l_total_delay);
- }
+ // Check our program for any delays. If there isn't a iv_initial_delay configured, then
+ // we use the delay we just summed from the instructions.
+ if (i_program.iv_poll.iv_initial_delay == 0)
+ {
+ i_program.iv_poll.iv_initial_delay = cycles_to_ns(i_target, l_total_delay);
+ }
- FAPI_INF("executing ccs instructions (%d:%d, %d) for %s",
- i_program.iv_instructions.size(), l_inst_count, i_program.iv_poll.iv_initial_delay, mss::c_str(i_target));
-
- // Deselect
- l_des.arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_current_cke);
-
- // Insert a DES as our last instruction. DES is idle state anyway and having this
- // here as an instruction forces the CCS engine to wait the delay specified in
- // the last instruction in this array (which it otherwise doesn't do.)
- l_des.arr1.setBit<MCBIST_CCS_INST_ARR1_00_END>();
- FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_des.arr0), "Error in ccs::execute" );
- FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_des.arr1), "Error in ccs::execute" );
-
- FAPI_INF("css inst %d fixup: 0x%016lX 0x%016lX (0x%lx, 0x%lx) %s",
- l_inst_count, l_des.arr0, l_des.arr1,
- CCS_ARR0_ZERO + l_inst_count, CCS_ARR1_ZERO + l_inst_count, mss::c_str(i_target));
-
- // Kick off the CCS engine - per port. No broadcast mode for CCS (per Shelton 9/23/15)
- FAPI_INF("executing CCS array for port %d (%s)", mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_port),
- mss::c_str(i_port));
- FAPI_TRY( mss::ccs::select_ports( i_target, mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_port)),
- "Error in ccs execute" );
- FAPI_TRY( execute_inst_array(i_target, i_program, i_port), "Error in ccs execute" );
+ if (i_program.iv_poll.iv_initial_sim_delay == 0)
+ {
+ i_program.iv_poll.iv_initial_sim_delay = cycles_to_simcycles(l_total_delay);
+ }
+
+ FAPI_INF("executing ccs instructions (%d:%d, %d) for %s",
+ i_program.iv_instructions.size(), l_inst_count, i_program.iv_poll.iv_initial_delay, mss::c_str(i_target));
+
+ // Deselect
+ l_des.arr0.insertFromRight<TT::ARR0_DDR_CKE, TT::ARR0_DDR_CKE_LEN>(l_current_cke);
+
+ // Insert a DES as our last instruction. DES is idle state anyway and having this
+ // here as an instruction forces the CCS engine to wait the delay specified in
+ // the last instruction in this array (which it otherwise doesn't do.)
+ l_des.arr1.setBit<MCBIST_CCS_INST_ARR1_00_END>();
+ FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_des.arr0), "Error in ccs::execute" );
+ FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_des.arr1), "Error in ccs::execute" );
+
+ FAPI_INF("css inst %d fixup: 0x%016lX 0x%016lX (0x%lx, 0x%lx) %s",
+ l_inst_count, l_des.arr0, l_des.arr1,
+ CCS_ARR0_ZERO + l_inst_count, CCS_ARR1_ZERO + l_inst_count, mss::c_str(i_target));
+
+ // Kick off the CCS engine - per port. No broadcast mode for CCS (per Shelton 9/23/15)
+ FAPI_INF("executing CCS array for port %d (%s)", mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_port),
+ mss::c_str(i_port));
+ FAPI_TRY( mss::ccs::select_ports<mss::mc_type::NIMBUS>( i_target, mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_port)),
+ "Error in ccs execute" );
+ FAPI_TRY( execute_inst_array(i_target, i_program, i_port), "Error in ccs execute" );
+ }
}
fapi_try_exit:
@@ -413,7 +501,7 @@ void update_mrs(mss::ddr4::mrs01_data& io_mrs, const mss::states i_state)
fapi2::ReturnCode add_mrs(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_rank,
const mss::states& i_state,
- std::vector<ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>>& io_inst)
+ std::vector<ccs::instruction_t>& io_inst)
{
// First, get the DIMM target
// Note: the target is setup below based upon the rank
@@ -555,7 +643,7 @@ fapi2::ReturnCode configure_non_calibrating_ranks(const fapi2::Target<fapi2::TAR
const mss::states& i_state)
{
// Declares variables
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST, fapi2::TARGET_TYPE_MCA> l_program;
+ ccs::program l_program;
std::vector<uint64_t> l_ranks;
const auto& l_mcbist = mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target);
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.H
index 067f8481f..5cb57295b 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/ccs_workarounds.H
@@ -38,12 +38,15 @@
#include <fapi2.H>
#include <p9_mc_scom_addresses.H>
+#include <lib/shared/mss_const.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <generic/memory/lib/utils/find.H>
-#include <lib/ccs/ccs.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
#include <lib/dimm/ddr4/mrs_load_ddr4.H>
+
namespace mss
{
@@ -66,7 +69,7 @@ namespace workarounds
///
fapi2::ReturnCode exit( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
- ccs::program<fapi2::TARGET_TYPE_MCBIST>& io_program );
+ ccs::program& io_program );
///
/// @brief Re-enables PDA mode on a given rank in the shadow registers
@@ -83,7 +86,7 @@ fapi2::ReturnCode enable_pda_shadow_reg( const fapi2::Target<fapi2::TARGET_TYPE_
/// @param[in,out] io_inst - the CCS instruction
///
inline void hold_cke_low_helper( fapi2::buffer<uint8_t>& io_cke,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst )
+ ccs::instruction_t& io_inst )
{
fapi2::buffer<uint8_t> l_cur_cke;
io_inst.arr0.extractToRight<MCBIST_CCS_INST_ARR0_00_DDR_CKE, MCBIST_CCS_INST_ARR0_00_DDR_CKE_LEN>(l_cur_cke);
@@ -95,7 +98,7 @@ inline void hold_cke_low_helper( fapi2::buffer<uint8_t>& io_cke,
/// @brief Holds the lower order rank cke low in higher order rank instruction
/// @param[in,out] io_program - CCS program with instructions on multi-rank DIMM
///
-inline void hold_cke_low( ccs::program<fapi2::TARGET_TYPE_MCBIST>& io_program )
+inline void hold_cke_low( ccs::program& io_program )
{
fapi2::buffer<uint8_t> l_cke(CKE_HIGH);
@@ -111,7 +114,7 @@ inline void hold_cke_low( ccs::program<fapi2::TARGET_TYPE_MCBIST>& io_program )
/// @param[in,out] io_inst - the CCS instruction
///
inline void hold_cke_high_helper( fapi2::buffer<uint8_t>& io_cke,
- ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>& io_inst )
+ ccs::instruction_t& io_inst )
{
fapi2::buffer<uint8_t> l_cur_cke;
io_inst.arr0.extractToRight<MCBIST_CCS_INST_ARR0_00_DDR_CKE, MCBIST_CCS_INST_ARR0_00_DDR_CKE_LEN>(l_cur_cke);
@@ -123,7 +126,7 @@ inline void hold_cke_high_helper( fapi2::buffer<uint8_t>& io_cke,
/// @brief Holds the lower order rank cke high in higher order rank instruction
/// @param[in,out] io_inst - CCS program with instructions on multi-rank DIMM
///
-inline void hold_cke_high( std::vector<ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>>& io_inst )
+inline void hold_cke_high( std::vector<ccs::instruction_t>& io_inst )
{
fapi2::buffer<uint8_t> l_cke(CKE_LOW);
@@ -137,7 +140,7 @@ inline void hold_cke_high( std::vector<ccs::instruction_t<fapi2::TARGET_TYPE_MCB
/// @brief Holds the lower order rank cke high in higher order rank instruction
/// @param[in,out] io_program - CCS program with instructions on multi-rank DIMM
///
-inline void hold_cke_high( ccs::program<fapi2::TARGET_TYPE_MCBIST>& io_program )
+inline void hold_cke_high( ccs::program& io_program )
{
fapi2::buffer<uint8_t> l_cke(CKE_LOW);
@@ -155,12 +158,30 @@ inline void hold_cke_high( ccs::program<fapi2::TARGET_TYPE_MCBIST>& io_program )
/// @note This is written specifically to support EPOW on NVDIMM
///
fapi2::ReturnCode preload_ccs_for_epow( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- ccs::program<fapi2::TARGET_TYPE_MCBIST>& i_program);
+ ccs::program& i_program);
namespace nvdimm
{
///
+/// @brief add_refreshes() helper
+/// @param[in] i_target The MCA target where the program will be executed on
+/// @param[in,out] i_program the MCBIST ccs program to append the refreshes
+/// @return FAPI2_RC_SUCCESS iff success
+///
+fapi2::ReturnCode add_refreshes_helper(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ mss::ccs::program& io_program);
+
+///
+/// @brief Adds refreshes at the beginning and end of the program
+/// @param[in] i_target The MCA target where the program will be executed on
+/// @param[in,out] io_program the MCBIST ccs program to add the refreshes
+/// @return FAPI2_RC_SUCCESS iff success
+///
+fapi2::ReturnCode add_refreshes(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ mss::ccs::program& io_program);
+
+///
/// @brief Execute a set of CCS instructions
/// @param[in] i_target the target to effect
/// @param[in] i_program the vector of instructions
@@ -169,7 +190,7 @@ namespace nvdimm
/// @note This is a copy of execute() with minor tweaks to the namespace and single port only
///
fapi2::ReturnCode execute( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST>& i_program,
+ mss::ccs::program& i_program,
const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_port);
///
@@ -183,7 +204,7 @@ fapi2::ReturnCode execute( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_tar
/// CCS can properly drive the bus during the nvdimm post-restore sequence.
///
fapi2::ReturnCode execute_inst_array(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- mss::ccs::program<fapi2::TARGET_TYPE_MCBIST>& i_program,
+ mss::ccs::program& i_program,
fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_port);
}
@@ -208,7 +229,7 @@ void update_mrs(mss::ddr4::mrs01_data& io_mrs, const mss::states i_state);
fapi2::ReturnCode add_mrs(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_rank,
const mss::states& i_state,
- std::vector<ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST>>& io_inst);
+ std::vector<ccs::instruction_t>& io_inst);
///
/// @brief Gets a vector of ranks that are not going to be calibrated in the given rank pair
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C
index 4e73323f2..584dc36c8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,7 +33,7 @@
#include <fapi2.H>
#include <lib/workarounds/dll_workarounds.H>
#include <lib/fir/check.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/scom.H>
#include <lib/phy/dp16.H>
#include <lib/fir/fir.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C
index 798447c83..f9e3b08d7 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.C
@@ -59,6 +59,79 @@ namespace mss
namespace workarounds
{
+// Putting the NVDIMM workarounds here as it's a bit of a hybrid case
+// Also there are issues as the nvdimm_workarounds.* files are picked up externally
+namespace nvdimm
+{
+
+///
+/// @brief Checks if the NVDIMM RD DQ delay adjust is needed
+/// @param[in] i_target the fapi2 target of the port
+/// @param[out] o_is_needed true if the workaround is needed
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
+///
+fapi2::ReturnCode is_adjust_rd_dq_delay_needed( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ bool& o_is_needed )
+{
+ uint8_t l_hybrid_type[mss::MAX_DIMM_PER_PORT] = {};
+ uint8_t l_is_hybrid[mss::MAX_DIMM_PER_PORT] = {};
+ o_is_needed = false;
+
+ FAPI_TRY(mss::eff_hybrid_memory_type(i_target, l_hybrid_type));
+ FAPI_TRY(mss::eff_hybrid(i_target, l_is_hybrid));
+
+ // This workaround is only needed if we're dealing with NVDIMM
+ // We only need DIMM0 as NVDIMM will only ever be single drop
+ o_is_needed = (l_hybrid_type[0] == fapi2::ENUM_ATTR_EFF_HYBRID_IS_HYBRID) &&
+ (l_is_hybrid[0] == fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM);
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Adjusts NVDIMM RD DQ delays
+/// @param[in] i_target the fapi2 target of the port
+/// @param[in] i_rp the rank pair on which to adjust delays
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
+///
+fapi2::ReturnCode adjust_rd_dq_delay( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, const uint64_t i_rp )
+{
+ // Constexpr's for some general beautification
+ constexpr uint64_t VALUE0_START = MCA_DDRPHY_DP16_READ_DELAY0_RANK_PAIR0_P0_0_01_RD;
+ constexpr uint64_t VALUE1_START = MCA_DDRPHY_DP16_READ_DELAY0_RANK_PAIR0_P0_0_01_RD_DELAY1;
+ typedef mss::dp16Traits<fapi2::TARGET_TYPE_MCA> TT;
+
+ bool l_is_needed = false;
+ std::vector<fapi2::buffer<uint64_t>> l_data;
+ FAPI_TRY(is_adjust_rd_dq_delay_needed(i_target, l_is_needed));
+
+ // If the adjust is not needed, exit out
+ if(!l_is_needed)
+ {
+ FAPI_INF("%s RD DQ delay adjust isn't needed. Skipping the workaround", mss::c_str(i_target));
+ return fapi2::FAPI2_RC_SUCCESS;
+ }
+
+ // Read
+ FAPI_TRY(mss::scom_suckah(i_target, TT::READ_DELAY_REG[i_rp], l_data));
+
+ // Modify
+ for(auto& l_info : l_data)
+ {
+ update_rd_dq_delay<VALUE0_START>(l_info);
+ update_rd_dq_delay<VALUE1_START>(l_info);
+ }
+
+ // Write
+ FAPI_TRY(mss::scom_blastah(i_target, TT::READ_DELAY_REG[i_rp], l_data));
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+} // close namespace nvdimm
+
namespace dp16
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H
index daf9780d6..ddee4f42a 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dp16_workarounds.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -52,6 +52,48 @@ namespace mss
namespace workarounds
{
+// Putting the NVDIMM workarounds here as it's a bit of a hybrid case
+// Also there are issues as the nvdimm_workarounds.* files are picked up externally
+namespace nvdimm
+{
+
+///
+/// @brief Updates a single RD DQ value for the NVDIMM workaround
+/// @tparam P the bit position to update
+/// @param[in,out] io_data the data bufffer to update
+///
+template<uint64_t P>
+void update_rd_dq_delay(fapi2::buffer<uint64_t>& io_data)
+{
+ constexpr uint64_t MAX_VALUE = 0x7f;
+ constexpr uint64_t OFFSET = 2;
+ constexpr uint64_t LEN = MCA_DDRPHY_DP16_READ_DELAY0_RANK_PAIR0_P0_0_01_RD_LEN;
+ uint64_t l_value = 0;
+ io_data.extractToRight<P, LEN>(l_value);
+ l_value += OFFSET;
+ l_value = std::min(l_value, MAX_VALUE);
+ io_data.insertFromRight<P, LEN>(l_value);
+}
+
+///
+/// @brief Checks if the NVDIMM RD DQ delay adjust is needed
+/// @param[in] i_target the fapi2 target of the port
+/// @param[out] o_is_needed true if the workaround is needed
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
+///
+fapi2::ReturnCode is_adjust_rd_dq_delay_needed( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ bool& o_is_needed );
+
+///
+/// @brief Adjusts NVDIMM RD DQ delays
+/// @param[in] i_target the fapi2 target of the port
+/// @param[in] i_rp the rank pair on which to adjust delays
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
+///
+fapi2::ReturnCode adjust_rd_dq_delay( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, const uint64_t i_rp );
+
+} // close namespace nvdimm
+
namespace dp16
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.C
index a0a375f2b..dd5275288 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -55,7 +55,7 @@ namespace workarounds
///
fapi2::ReturnCode rcw_reset_dram( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const bool i_sim,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst)
+ std::vector< ccs::instruction_t >& io_inst)
{
// Note: we're always going to run this guy
FAPI_INF("%s running the DRAM RCW DRAM reset workaround", mss::c_str(i_target));
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.H
index 1b43c1416..437065578 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/draminit_workarounds.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -53,7 +53,7 @@ namespace workarounds
///
fapi2::ReturnCode rcw_reset_dram( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const bool i_sim,
- std::vector< ccs::instruction_t<fapi2::TARGET_TYPE_MCBIST> >& io_inst);
+ std::vector< ccs::instruction_t >& io_inst);
} // namespace workarounds
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.C
new file mode 100644
index 000000000..dae18167b
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.C
@@ -0,0 +1,94 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 <fapi2.H>
+#include <lib/mss_attribute_accessors.H>
+#include <lib/workarounds/eff_config_workarounds.H>
+
+namespace mss
+{
+
+namespace workarounds
+{
+
+namespace eff_config
+{
+
+///
+/// @brief Checks if the NVDIMM RC drive strength workaround is needed
+/// @param[in] i_target DIMM target on which to operate
+/// @param[out] o_is_needed true if the workaround is needed
+/// @return SUCCESS if the code executes successfully
+///
+fapi2::ReturnCode is_nvdimm_rc_drive_strength_needed(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ bool& o_is_needed)
+{
+ o_is_needed = false;
+
+ uint8_t l_hybrid = 0;
+ uint8_t l_hybrid_type = 0;
+ uint32_t l_size = 0;
+
+ FAPI_TRY(mss::eff_hybrid(i_target, l_hybrid));
+ FAPI_TRY(mss::eff_hybrid_memory_type(i_target, l_hybrid_type));
+ FAPI_TRY(mss::eff_dimm_size(i_target, l_size));
+
+ if(l_hybrid == fapi2::ENUM_ATTR_EFF_HYBRID_IS_HYBRID &&
+ l_hybrid_type == fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM &&
+ l_size == fapi2::ENUM_ATTR_EFF_DIMM_SIZE_32GB)
+ {
+ o_is_needed = true;
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Updates the RC drive strength if the workaround is needed
+/// @param[in] i_target DIMM target on which to operate
+/// @param[in] i_override_value the value to override if the workaround needs to be applied
+/// @param[in,out] io_rc_value Register Control word value to update
+/// @return SUCCESS if the code executes successfully
+///
+fapi2::ReturnCode nvdimm_rc_drive_strength(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint8_t i_override_value,
+ fapi2::buffer<uint8_t>& io_rc_value)
+{
+ bool l_is_needed = false;
+ FAPI_TRY(is_nvdimm_rc_drive_strength_needed(i_target, l_is_needed));
+
+ // If the workaround is needed, overwrite it to be ALL_MODERATE values
+ // Otherwise keep it as it is
+ io_rc_value = l_is_needed ? fapi2::buffer<uint8_t>(i_override_value) : io_rc_value;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+} // ns eff_config
+} // ns workarounds
+} // ns mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.H
index 5e8291a21..f41d9b89c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.H $ */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/workarounds/eff_config_workarounds.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -24,8 +24,10 @@
/* IBM_PROLOG_END_TAG */
///
-/// @file mcbist/sim.H
-/// @brief MCBIST/memdiags functions for when we're in simulation mode
+/// @file eff_config_workarounds.H
+/// @brief Workarounds for effective config
+/// Workarounds are very device specific, so there is no attempt to generalize
+/// this code in any way.
///
// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
@@ -33,32 +35,41 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
-#ifndef _MSS_MCBIST_SIM_H_
-#define _MSS_MCBIST_SIM_H_
+#ifndef _EFF_CONFIG_WORKAROUNDS_H_
+#define _EFF_CONFIG_WORKAROUNDS_H_
#include <fapi2.H>
namespace mss
{
-namespace mcbist
+namespace workarounds
{
-namespace sim
+namespace eff_config
{
///
-/// @brief Perform a sim version of initializing memory
-/// @param T a fapi2::TargetType
-/// @param[in] i_target
-/// @param[in] i_pattern an index representing a pattern to use to initize memory (defaults to 0)
-/// @return FAPI2_RC_SUCCESS iff ok
+/// @brief Checks if the NVDIMM RC drive strength workaround is needed
+/// @param[in] i_target DIMM target on which to operate
+/// @param[out] o_is_needed true if the workaround is needed
+/// @return SUCCESS if the code executes successfully
///
-template< fapi2::TargetType T >
-fapi2::ReturnCode sf_init( const fapi2::Target<T>& i_target, const uint64_t i_pattern );
+fapi2::ReturnCode is_nvdimm_rc_drive_strength_needed(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ bool& o_is_needed);
-} // ns sim
-} // ns mcbist
+///
+/// @brief Updates the RC drive strength if the workaround is needed
+/// @param[in] i_target DIMM target on which to operate
+/// @param[in] i_override_value the value to override if the workaround needs to be applied
+/// @param[in,out] io_rc_value Register Control word value to update
+/// @return SUCCESS if the code executes successfully
+///
+fapi2::ReturnCode nvdimm_rc_drive_strength(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint8_t i_override_value,
+ fapi2::buffer<uint8_t>& io_rc_value);
+
+} // ns eff_config
+} // ns workarounds
} // ns mss
#endif
-
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mca_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mca_workarounds.C
index d9e8f6416..164fbe580 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mca_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mca_workarounds.C
@@ -66,6 +66,17 @@ bool check_str_non_tsv_parity_workaround(const fapi2::Target<fapi2::TARGET_TYPE_
bool l_tsv = false;
bool l_str_enabled = false;
bool l_is_nvdimm = false;
+ bool l_has_4r_dimm = false;
+ uint8_t l_master_ranks[MAX_DIMM_PER_PORT] = {};
+
+ FAPI_TRY(eff_num_master_ranks_per_dimm(i_target, l_master_ranks));
+
+ // If we have either DIMM having four ranks, we need to disable parity mode
+ if((l_master_ranks[0] == fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R) ||
+ (l_master_ranks[1] == fapi2::ENUM_ATTR_EFF_NUM_MASTER_RANKS_PER_DIMM_4R))
+ {
+ l_has_4r_dimm = true;
+ }
// Figure out if any hybrid memory is plugged
FAPI_TRY(mss::eff_hybrid(i_target, l_hybrid));
@@ -101,11 +112,13 @@ bool check_str_non_tsv_parity_workaround(const fapi2::Target<fapi2::TARGET_TYPE_
// 1) greater than or equal to DD2
// 2) self time refresh is enabled
// 3) the DIMM's are not TSV
- FAPI_INF("%s %s DD2 STR: %s DIMM %s TSV", mss::c_str(i_target),
+ // 4) a 4R DIMM is present
+ FAPI_INF("%s %s DD2 STR: %s DIMM %s TSV %s DIMM", mss::c_str(i_target),
l_less_than_dd2 ? "less than" : "greater than or equal to",
l_str_enabled ? "enabled" : "disabled",
- l_tsv ? "is" : "isn't");
- return (!l_less_than_dd2) && l_str_enabled && (!l_tsv);
+ l_tsv ? "is" : "isn't",
+ l_has_4r_dimm ? "4R" : "not 4R");
+ return ((!l_less_than_dd2) && l_str_enabled && (!l_tsv)) || (l_has_4r_dimm);
fapi_try_exit:
FAPI_ERR("failed calling check_str_non_tsv_parity_workaround: 0x%lx (target: %s)",
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C
index 9316abaa5..f87d01078 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.C
@@ -43,7 +43,7 @@
#include <lib/mss_attribute_accessors.H>
#include <generic/memory/lib/utils/scom.H>
#include <generic/memory/lib/utils/pos.H>
-#include <lib/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
#include <lib/workarounds/mcbist_workarounds.H>
#include <lib/mcbist/mcbist.H>
#include <lib/fir/fir.H>
@@ -66,9 +66,9 @@ namespace mcbist
/// @param[in,out] the MCBIST program to check for read/display replacement
/// @note Useful for testing
///
-void replace_read_helper(mss::mcbist::program<TARGET_TYPE_MCBIST>& io_program)
+void replace_read_helper(mss::mcbist::program<>& io_program)
{
- using TT = mss::mcbistTraits<TARGET_TYPE_MCBIST>;
+ using TT = mss::mcbistTraits<>;
io_program.change_maint_broadcast_mode(mss::OFF);
io_program.change_end_boundary(mss::mcbist::end_boundary::STOP_AFTER_ADDRESS);
@@ -99,9 +99,9 @@ void replace_read_helper(mss::mcbist::program<TARGET_TYPE_MCBIST>& io_program)
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
///
fapi2::ReturnCode end_of_rank( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
- mss::mcbist::program<TARGET_TYPE_MCBIST>& io_program )
+ mss::mcbist::program<>& io_program )
{
- using TT = mss::mcbistTraits<TARGET_TYPE_MCBIST>;
+ using TT = mss::mcbistTraits<>;
// If we don't need the mcbist work-around, we're done.
if (! mss::chip_ec_feature_mcbist_end_of_rank(i_target) )
@@ -110,8 +110,9 @@ fapi2::ReturnCode end_of_rank( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target
}
// First things first - lets find out if we have an 1R DIMM on our side of the chip.
- const auto l_dimm_kinds = dimm::kind::vector( mss::find_targets<TARGET_TYPE_DIMM>(i_target) );
- const auto l_kind = std::find_if(l_dimm_kinds.begin(), l_dimm_kinds.end(), [](const dimm::kind & k) -> bool
+ const auto l_dimm_kinds = dimm::kind<>::vector( mss::find_targets<TARGET_TYPE_DIMM>(i_target) );
+ const auto l_kind = std::find_if(l_dimm_kinds.begin(),
+ l_dimm_kinds.end(), [](const dimm::kind<>& k) -> bool
{
// If total ranks are 1, we have a 1R DIMM, SDP. This is the fellow of concern
return k.iv_total_ranks == 1;
@@ -146,26 +147,6 @@ fapi2::ReturnCode end_of_rank( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target
}
///
-/// @brief WAT debug attention
-/// For Nimbus DD1 the MCBIST engine uses the WAT debug bit as a workaround
-/// For Nimbus DD2 the WAT debug bit is used for a different workaround
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-fapi2::ReturnCode wat_debug_attention( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
-{
- // MCBIST attentions are already special attention
- fapi2::ReturnCode l_rc;
- fir::reg<MCBIST_MCBISTFIRQ> mcbist_fir_register(i_target, l_rc);
- FAPI_TRY(l_rc, "unable to create fir::reg for %d", MCBIST_MCBISTFIRQ);
-
- FAPI_TRY(mcbist_fir_register.attention<MCBIST_MCBISTFIRQ_WAT_DEBUG_ATTN>().write());
-
-fapi_try_exit:
- return fapi2::current_err;
-}
-
-///
/// @brief BROADCAST OUT OF SYNC workaround
/// A UE noise window is triggered by UE/AUEs causing an out of sync error
/// @param[in] i_target the fapi2 target of the mcbist
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.H
index 1e5d9662a..7a4533c6d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/mcbist_workarounds.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -55,7 +55,7 @@ namespace mcbist
/// @param[in] the MCBIST program to check for read/display replacement
/// @note Useful for testing
///
-void replace_read_helper(mss::mcbist::program<fapi2::TARGET_TYPE_MCBIST>& i_program);
+void replace_read_helper(mss::mcbist::program<>& i_program);
///
/// @brief End of rank work around
@@ -69,15 +69,7 @@ void replace_read_helper(mss::mcbist::program<fapi2::TARGET_TYPE_MCBIST>& i_prog
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
///
fapi2::ReturnCode end_of_rank( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
- mss::mcbist::program<fapi2::TARGET_TYPE_MCBIST>& i_program );
-
-///
-/// @brief WAT debug attention
-/// For Nimbus DD1 the MCBIST engine uses the WAT debug bit as a workaround
-/// @param[in] i_target the fapi2 target of the mcbist
-/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
-///
-fapi2::ReturnCode wat_debug_attention( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target );
+ mss::mcbist::program<>& i_program );
///
/// @brief BROADCAST OUT OF SYNC workaround
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C
index 86e2cce75..f5942b528 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.C
@@ -48,33 +48,8 @@ namespace workarounds
namespace nvdimm
{
-// MBASTR0Q for each MCA
// Note: Since the scoms are executed at the chip, it needs the dedicated
// address for each MCA
-constexpr const uint64_t MBASTR0Q_REG[] =
-{
- MCA_0_MBASTR0Q,
- MCA_1_MBASTR0Q,
- MCA_2_MBASTR0Q,
- MCA_3_MBASTR0Q,
- MCA_4_MBASTR0Q,
- MCA_5_MBASTR0Q,
- MCA_6_MBASTR0Q,
- MCA_7_MBASTR0Q,
-};
-
-// MBARPC0Q for each MCA
-constexpr const uint64_t MBARPC0Q_REG[] =
-{
- MCA_0_MBARPC0Q,
- MCA_1_MBARPC0Q,
- MCA_2_MBARPC0Q,
- MCA_3_MBARPC0Q,
- MCA_4_MBARPC0Q,
- MCA_5_MBARPC0Q,
- MCA_6_MBARPC0Q,
- MCA_7_MBARPC0Q,
-};
// FARB5Q for each MCA
constexpr const uint64_t FARB5Q_REG[] =
@@ -89,6 +64,15 @@ constexpr const uint64_t FARB5Q_REG[] =
MCA_7_MBA_FARB5Q,
};
+// MCFGP for each MCS
+constexpr const uint64_t MCFGP[] =
+{
+ MCS_0_MCFGP,
+ MCS_1_MCFGP,
+ MCS_2_MCFGP,
+ MCS_3_MCFGP,
+};
+
// MCB_CNTLQ
constexpr const uint64_t MCB_CNTLQ_REG[] =
{
@@ -96,89 +80,159 @@ constexpr const uint64_t MCB_CNTLQ_REG[] =
MCBIST_1_MCB_CNTLQ,
};
+// MCB_MCBAGRAQ
+constexpr const uint64_t MCB_MCBAGRAQ_REG[] =
+{
+ MCBIST_0_MCBAGRAQ,
+ MCBIST_1_MCBAGRAQ,
+};
+
+// CCS_MODEQ
+constexpr const uint64_t CCS_MODEQ_REG[] =
+{
+ MCBIST_0_CCS_MODEQ,
+ MCBIST_1_CCS_MODEQ,
+};
+
+// CCS_CNTLQ
+constexpr const uint64_t CCS_CNTLQ_REG[] =
+{
+ MCBIST_0_CCS_CNTLQ,
+ MCBIST_1_CCS_CNTLQ,
+};
+
constexpr uint8_t PORTS_PER_MODULE = 8;
+constexpr uint8_t PORTS_PER_MCBIST = 4;
+constexpr uint8_t MCBISTS_PER_PROC = 2;
///
-/// @brief Helper for trigger_csave. This subroutine puts the MCA into STR
-/// This is the same thing as mss::nvdimm::self_refresh_entry() but rewritten
-/// to support SBE
+/// @brief Program the necessary scom regs to prepare for CSAVE
/// @param[in] i_target - PROC_CHIP target
-/// @param[in] l_mca_pos - The MCA position relative to the PROC
+/// @param[in] i_mcbist - mcbist position relative to the proc
+/// @param[out] o_addresses - list of addresses that require restore
+/// @param[out] o_data - data to restore to o_addresses
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-fapi2::ReturnCode self_refresh_entry( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
- const uint8_t l_mca_pos)
+fapi2::ReturnCode prep_for_csave( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const uint8_t i_mcbist,
+ std::vector<uint64_t>& o_addresses,
+ std::vector<fapi2::buffer<uint64_t>>& o_data)
{
- FAPI_ASSERT((l_mca_pos < PORTS_PER_MODULE),
- fapi2::MSS_SRE_MCA_OUT_OF_RANGE().
- set_PROC_TARGET(i_target).
- set_MCA_POS(l_mca_pos),
- "Invalid port number %u provided", l_mca_pos);
+ fapi2::buffer<uint64_t> l_mcbcntlq_data;
+ fapi2::buffer<uint64_t> l_mcbagraq_data;
+ fapi2::buffer<uint64_t> l_ccs_modeq_data;
- FAPI_DBG("Entering STR on port %u.", l_mca_pos);
+ // Stop mcbist first otherwise it can kick the DIMM out of STR
+ FAPI_TRY(fapi2::getScom(i_target, MCB_CNTLQ_REG[i_mcbist], l_mcbcntlq_data));
+ l_mcbcntlq_data.setBit<MCBIST_CCS_CNTLQ_STOP>();
+ FAPI_TRY(fapi2::putScom(i_target, MCB_CNTLQ_REG[i_mcbist], l_mcbcntlq_data));
- {
- fapi2::buffer<uint64_t> l_mbarpc0_data, l_mbastr0_data, l_mcbcntlq_data;
- constexpr uint64_t ENABLE = 1;
- constexpr uint64_t DISABLE = 0;
- constexpr uint64_t MAXALL_MIN0 = 0b010;
- constexpr uint64_t STOP = 1;
- constexpr uint64_t PORTS_PER_MCBIST = 4;
- constexpr uint64_t TIME_0 = 0;
- const uint8_t l_mcbist = l_mca_pos < PORTS_PER_MCBIST ? 0 : 1;
-
- // Stop mcbist first otherwise it can kick the DIMM out of STR
- FAPI_TRY(fapi2::getScom(i_target, MCB_CNTLQ_REG[l_mcbist], l_mcbcntlq_data));
- l_mcbcntlq_data.writeBit<MCBIST_CCS_CNTLQ_STOP>(STOP);
- FAPI_TRY(fapi2::putScom(i_target, MCB_CNTLQ_REG[l_mcbist], l_mcbcntlq_data));
-
- // Step 1 - In MBARPC0Q, disable power domain control, set domain to MAXALL_MIN0,
- // and disable minimum domain reduction (allow immediate entry of STR)
- FAPI_TRY(fapi2::getScom(i_target, MBARPC0Q_REG[l_mca_pos], l_mbarpc0_data));
- l_mbarpc0_data.writeBit<MCA_MBARPC0Q_CFG_MIN_MAX_DOMAINS_ENABLE>(DISABLE);
- l_mbarpc0_data.insertFromRight<MCA_MBARPC0Q_CFG_MIN_MAX_DOMAINS, MCA_MBARPC0Q_CFG_MIN_MAX_DOMAINS_LEN>(MAXALL_MIN0);
- l_mbarpc0_data.writeBit<MCA_MBARPC0Q_CFG_MIN_DOMAIN_REDUCTION_ENABLE>(DISABLE);
- FAPI_TRY(fapi2::putScom(i_target, MBARPC0Q_REG[l_mca_pos], l_mbarpc0_data));
-
- // Step 2 - In MBASTR0Q, enable STR entry
- FAPI_TRY(fapi2::getScom(i_target, MBASTR0Q_REG[l_mca_pos], l_mbastr0_data));
- l_mbastr0_data.writeBit<MCA_MBASTR0Q_CFG_STR_ENABLE>(ENABLE);
- l_mbastr0_data.insertFromRight<MCA_MBASTR0Q_CFG_ENTER_STR_TIME, MCA_MBASTR0Q_CFG_ENTER_STR_TIME_LEN>(TIME_0);
- FAPI_TRY(fapi2::putScom(i_target, MBASTR0Q_REG[l_mca_pos], l_mbastr0_data));
-
- // Step 3 - In MBARPC0Q, enable power domain control.
- l_mbarpc0_data.writeBit<MCA_MBARPC0Q_CFG_MIN_MAX_DOMAINS_ENABLE>(ENABLE);
- FAPI_TRY(fapi2::putScom(i_target, MBARPC0Q_REG[l_mca_pos], l_mbarpc0_data));
- }
+ // Backup the address and data for the following scoms to restore later
+
+ // Disable maint. address mode
+ FAPI_TRY(fapi2::getScom(i_target, MCB_MCBAGRAQ_REG[i_mcbist], l_mcbagraq_data));
+ o_addresses.push_back(MCB_MCBAGRAQ_REG[i_mcbist]);
+ o_data.push_back(l_mcbagraq_data);
+ l_mcbagraq_data.clearBit<MCBIST_MCBAGRAQ_CFG_MAINT_ADDR_MODE_EN>();
+ FAPI_TRY(fapi2::putScom(i_target, MCB_MCBAGRAQ_REG[i_mcbist], l_mcbagraq_data));
+
+ // Required for CCS to drive RESETn
+ FAPI_TRY(fapi2::getScom(i_target, CCS_MODEQ_REG[i_mcbist], l_ccs_modeq_data));
+ o_addresses.push_back(CCS_MODEQ_REG[i_mcbist]);
+ o_data.push_back(l_ccs_modeq_data);
+ l_ccs_modeq_data.setBit<MCBIST_CCS_MODEQ_IDLE_PAT_BANK_2>();
+ FAPI_TRY(fapi2::putScom(i_target, CCS_MODEQ_REG[i_mcbist], l_ccs_modeq_data));
fapi_try_exit:
return fapi2::current_err;
}
///
-/// @brief Helper for trigger_csave. This subroutine assert RESET_n to trigger
-/// the backup on nvdimm
-/// @param[in] i_target - PROC_CHIP targetdefine
-/// @param[in] l_mca_pos - The MCA position relative to the PROC
+/// @brief Start or stop CCS
+/// @param[in] i_target - PROC_CHIP target
+/// @param[in] i_mcbist - mcbist position relative to the proc
+/// @param[in] i_start_stop - start or stop CCS
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-fapi2::ReturnCode assert_resetn( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, const uint8_t l_mca_pos)
+fapi2::ReturnCode start_stop_ccs( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const uint8_t i_mcbist,
+ const uint8_t i_start_stop)
{
- FAPI_ASSERT((l_mca_pos < PORTS_PER_MODULE),
- fapi2::MSS_RESETN_MCA_OUT_OF_RANGE().
+ fapi2::buffer<uint64_t> l_data;
+ constexpr uint8_t START = 1;
+
+ FAPI_TRY(fapi2::getScom(i_target, CCS_CNTLQ_REG[i_mcbist], l_data));
+ FAPI_TRY(fapi2::putScom(i_target, CCS_CNTLQ_REG[i_mcbist],
+ i_start_stop == START ? l_data.setBit<MCBIST_CCS_CNTLQ_START>() : l_data.setBit<MCBIST_CCS_CNTLQ_STOP>()));
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Select which port to run CCS on
+/// @param[in] i_target - PROC_CHIP target
+/// @param[in] i_mca - mca position relative to the proc
+/// @param[out] o_addresses - list of addresses that require restore
+/// @param[out] o_data - data to restore to o_addresses
+/// @return FAPI2_RC_SUCCESS iff setup was successful
+///
+fapi2::ReturnCode select_port(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const uint8_t i_mca,
+ std::vector<uint64_t>& o_addresses,
+ std::vector<fapi2::buffer<uint64_t>>& o_data)
+{
+ FAPI_ASSERT((i_mca < PORTS_PER_MODULE),
+ fapi2::MSS_SELECT_PORT_MCA_OUT_OF_RANGE().
set_PROC_TARGET(i_target).
- set_MCA_POS(l_mca_pos),
- "Invalid port number %u provided", l_mca_pos);
+ set_MCA_POS(i_mca),
+ "Invalid port number %u provided", i_mca);
+ {
+ // MCB_CNTLQ[2:5]. Default to port 0 then shift right as needed
+ constexpr uint8_t PORT_0 = 0b1000;
+ const uint64_t l_port_sel = PORT_0 >> (i_mca % PORTS_PER_MCBIST);
+ const uint8_t l_mcbist = i_mca < PORTS_PER_MCBIST ? 0 : 1;
+ fapi2::buffer<uint64_t> l_data;
- FAPI_DBG("Asserting RESETn on port %d.", l_mca_pos);
+ FAPI_TRY(fapi2::getScom(i_target, MCB_CNTLQ_REG[l_mcbist], l_data));
+ l_data.insertFromRight<MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL, MCBIST_MCB_CNTLQ_MCBCNTL_PORT_SEL_LEN>(l_port_sel);
+ FAPI_TRY(fapi2::putScom(i_target, MCB_CNTLQ_REG[l_mcbist], l_data));
+ // For each port, set the address mux to CCS and enable CCS to drive RESETn
+ FAPI_TRY(fapi2::getScom(i_target, FARB5Q_REG[i_mca], l_data));
+ o_addresses.push_back(FARB5Q_REG[i_mca]);
+ o_data.push_back(l_data);
+ l_data.setBit<MCA_MBA_FARB5Q_CFG_CCS_ADDR_MUX_SEL>();
+ l_data.setBit<MCA_MBA_FARB5Q_CFG_CCS_INST_RESET_ENABLE>();
+ FAPI_TRY(fapi2::putScom(i_target, FARB5Q_REG[i_mca], l_data));
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief change the BAR valid state on MCS with NVDIMM installed
+/// @param[in] i_target - PROC_CHIP target
+/// @param[in] i_port_bitmap - port bitmap that indicates port with nvdimm
+/// @param[in] i_state - BAR state to change to
+/// @return FAPI2_RC_SUCCESS iff setup was successful
+///
+fapi2::ReturnCode change_bar_valid_state( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const fapi2::buffer<uint8_t> i_port_bitmap,
+ const uint64_t i_state)
+{
+ for (uint8_t l_mca_pos = 0; l_mca_pos < PORTS_PER_MODULE; l_mca_pos++)
{
- fapi2::buffer<uint64_t> l_farb5q_data;
- constexpr uint64_t LOW = 0;
+ if (i_port_bitmap.getBit(l_mca_pos) == fapi2::ENUM_ATTR_SBE_NVDIMM_IN_PORT_YES)
+ {
+ const uint8_t l_mcs = l_mca_pos / 2;
+ fapi2::buffer<uint64_t> l_data;
- FAPI_TRY(fapi2::getScom(i_target, FARB5Q_REG[l_mca_pos], l_farb5q_data));
- l_farb5q_data.writeBit<MCA_MBA_FARB5Q_CFG_DDR_RESETN>(LOW);
- FAPI_TRY(fapi2::putScom(i_target, FARB5Q_REG[l_mca_pos], l_farb5q_data));
+ FAPI_TRY(fapi2::getScom(i_target, MCFGP[l_mcs], l_data));
+ l_data.writeBit<MCS_MCFGP_VALID>(i_state);
+ FAPI_TRY(fapi2::putScom(i_target, MCFGP[l_mcs], l_data));
+ }
}
fapi_try_exit:
@@ -195,23 +249,70 @@ fapi_try_exit:
fapi2::ReturnCode trigger_csave( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target )
{
fapi2::buffer<uint8_t> l_nvdimm_port_bitmap = 0;
+ constexpr uint64_t INVALID = 0;
+ constexpr uint64_t VALID = 1;
+ constexpr uint8_t START = 1;
+ constexpr uint8_t STOP = 0;
+ constexpr uint64_t MS_IN_NS = 1000000;
+ const uint64_t DELAY_20MS_IN_NS = 20 * MS_IN_NS;
FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_SBE_NVDIMM_IN_PORT, i_target, l_nvdimm_port_bitmap) );
- for (uint8_t l_mca_pos = 0; l_mca_pos < PORTS_PER_MODULE; l_mca_pos++)
+ // Invalidate the BAR temporarily. This prevents any memory access (proc, IO, etc.) from
+ // remove the port out of STR
+ FAPI_TRY( change_bar_valid_state(i_target, l_nvdimm_port_bitmap, INVALID));
+
+ // Get all the mcbists/mcas with NVDIMM
+ for (uint8_t l_mcbist = 0; l_mcbist < MCBISTS_PER_PROC; l_mcbist++)
{
- if (l_nvdimm_port_bitmap.getBit(l_mca_pos) == fapi2::ENUM_ATTR_SBE_NVDIMM_IN_PORT_YES)
+ std::vector<uint8_t> l_mcas;
+ std::vector<uint64_t> l_addresses;
+ std::vector<fapi2::buffer<uint64_t>> l_data;
+ const uint8_t MCA_STARTING_POS = (PORTS_PER_MCBIST * l_mcbist);
+
+ // For each mcbist, gather a list of mcas with nvdimm installed
+ for (uint8_t l_mca_pos = 0 + MCA_STARTING_POS;
+ l_mca_pos < PORTS_PER_MCBIST + MCA_STARTING_POS;
+ l_mca_pos++)
{
- FAPI_DBG("NVDIMM found in port %d ", l_mca_pos);
+ if (l_nvdimm_port_bitmap.getBit(l_mca_pos) == fapi2::ENUM_ATTR_SBE_NVDIMM_IN_PORT_YES)
+ {
+ l_mcas.push_back(l_mca_pos);
+ }
+ }
- // Enter STR
- FAPI_TRY(self_refresh_entry(i_target, l_mca_pos));
+ // Nothing to do
+ if (l_mcas.empty())
+ {
+ FAPI_DBG("No mca with nvdimm detect. l_mcbist = 0x%x, l_mcas.size = %u",
+ l_mcbist, l_mcas.size());
+ continue;
+ }
+
+ // Prep mcbist/ccs for csave
+ FAPI_TRY( prep_for_csave(i_target, l_mcbist, l_addresses, l_data));
- // Assert ddr_resetn
- FAPI_TRY(assert_resetn(i_target, l_mca_pos));
+ // Start and stop CCS, one port at a time.
+ for (const auto l_mca : l_mcas)
+ {
+ FAPI_TRY( select_port(i_target, l_mca, l_addresses, l_data), "Error returned from select_port(). l_mca = %u", l_mca);
+ FAPI_TRY( start_stop_ccs(i_target, l_mcbist, START), "Error to START from start_stop_ccs()");
+ FAPI_TRY( fapi2::delay(DELAY_20MS_IN_NS, 0), "Error returned from fapi2::delay call");
+ FAPI_TRY( start_stop_ccs(i_target, l_mcbist, STOP), "Error to STOP from start_stop_ccs()");
+ }
+
+ // Restore the original value. This is a don't care for poweroff/warm reboot,
+ // needed for MPIPL
+ for (size_t index = 0; index < l_addresses.size(); index++)
+ {
+ FAPI_TRY(fapi2::putScom(i_target, l_addresses[index], l_data[index]));
}
}
+ // Set the BAR back to valid. This is a don't care for the power down but required
+ // for MPIPL.
+ FAPI_TRY( change_bar_valid_state(i_target, l_nvdimm_port_bitmap, VALID));
+
fapi_try_exit:
return fapi2::current_err;
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.H
index a5d1b4a07..39952ddf8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/nvdimm_workarounds.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -58,27 +58,55 @@ typedef fapi2::ReturnCode (*p9_flush_nvdimm_FP_t) (const fapi2::Target<fapi2::TA
/// @param[in] i_target - PROC_CHIP target
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
-
fapi2::ReturnCode trigger_csave( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target );
///
-/// @brief Helper for trigger_csave. This subroutine assert RESET_n to trigger
-/// the backup on nvdimm
+/// @brief Program the necessary scom regs to prepare for CSAVE
/// @param[in] i_target - PROC_CHIP target
-/// @param[in] l_mca_pos - The MCA position relative to the PROC
+/// @param[in] i_mcbist - mcbist position relative to the proc
+/// @param[out] o_addresses - list of addresses that require restore
+/// @param[out] o_data - data to restore to o_addresses
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
+fapi2::ReturnCode prep_for_csave( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const uint8_t i_mcbist,
+ std::vector<uint64_t>& o_addresses,
+ std::vector<fapi2::buffer<uint64_t>>& o_data);
-fapi2::ReturnCode assert_resetn( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, uint8_t l_mca_pos);
+///
+/// @brief Select which port to run CCS on
+/// @param[in] i_target - PROC_CHIP target
+/// @param[in] i_mca - mca position relative to the proc
+/// @param[out] o_addresses - list of addresses that require restore
+/// @param[out] o_data - data to restore to o_addresses
+/// @return FAPI2_RC_SUCCESS iff setup was successful
+///
+fapi2::ReturnCode select_port(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const uint8_t i_mca,
+ std::vector<uint64_t>& o_addresses,
+ std::vector<fapi2::buffer<uint64_t>>& o_data);
///
-/// @brief Helper for trigger_csave. This subroutine puts the MCA into STR
+/// @brief Start or stop CCS
/// @param[in] i_target - PROC_CHIP target
-/// @param[in] l_mca_pos - The MCA position relative to the PROC
+/// @param[in] i_mcbist - mcbist position relative to the proc
+/// @param[in] i_start_stop - start or stop CCS
/// @return FAPI2_RC_SUCCESS iff setup was successful
///
+fapi2::ReturnCode start_stop_ccs( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const uint8_t i_mcbist,
+ const bool i_start_stop);
-fapi2::ReturnCode self_refresh_entry( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, uint8_t l_mca_pos);
+///
+/// @brief change the BAR valid state on MCS with NVDIMM installed
+/// @param[in] i_target - PROC_CHIP target
+/// @param[in] i_port_bitmap - port bitmap that indicates port with nvdimm
+/// @param[in] i_state - BAR state to change to
+/// @return FAPI2_RC_SUCCESS iff setup was successful
+///
+fapi2::ReturnCode change_bar_valid_state( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const fapi2::buffer<uint8_t> i_port_bitmap,
+ const uint64_t i_state);
}//ns nvdimm
}//ns workarounds
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.C
new file mode 100644
index 000000000..cf13e917a
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.C
@@ -0,0 +1,256 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file quad_encode_workarounds.C
+/// @brief Contains workarounds having to do with quad-encode CS
+///
+// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB Memory Lab
+
+#include <lib/shared/nimbus_defaults.H>
+#include <fapi2.H>
+#include <p9n2_mc_scom_addresses.H>
+
+#include <generic/memory/lib/utils/c_str.H>
+#include <lib/utils/nimbus_find.H>
+#include <lib/ccs/ccs_traits_nimbus.H>
+#include <generic/memory/lib/ccs/ccs.H>
+#include <lib/mss_attribute_accessors.H>
+#include <lib/dimm/ddr4/mrs_load_ddr4.H>
+#include <lib/workarounds/quad_encode_workarounds.H>
+
+namespace mss
+{
+
+namespace workarounds
+{
+
+const std::vector< uint64_t> shadow_regs_traits<0>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR0_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR0_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR0_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR0_RP3_P0,
+};
+const std::vector< uint64_t> shadow_regs_traits<1>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR1_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR1_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR1_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR1_RP3_P0,
+};
+const std::vector< uint64_t> shadow_regs_traits<2>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR2_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR2_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR2_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR2_RP3_P0,
+};
+const std::vector< uint64_t> shadow_regs_traits<3>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR3_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR3_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR3_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR3_RP3_P0,
+};
+const std::vector< uint64_t> shadow_regs_traits<4>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR4_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR4_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR4_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR4_RP3_P0,
+};
+const std::vector< uint64_t> shadow_regs_traits<5>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR5_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR5_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR5_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR5_RP3_P0,
+};
+const std::vector< uint64_t> shadow_regs_traits<6>::REGS =
+{
+ P9N2_MCA_DDRPHY_PC_MR6_RP0_P0,
+ P9N2_MCA_DDRPHY_PC_MR6_RP1_P0,
+ P9N2_MCA_DDRPHY_PC_MR6_RP2_P0,
+ P9N2_MCA_DDRPHY_PC_MR6_RP3_P0,
+};
+
+///
+/// @brief Returns true if an MRS command was run
+/// @param[in] i_inst instruction to check for an MRS command
+/// @return true iff the command contains an MRS command
+///
+bool is_command_mrs(const ccs::instruction_t& i_inst)
+{
+ // An MRS command is
+ // 1) at least one chip select active
+ // 2) at ACT HI, RAS/CAS/WEN low
+ // 3) not BA7
+
+ const auto l_cs_low = !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_CSN_0_1>() ||
+ !i_inst.arr0.getBit < MCBIST_CCS_INST_ARR0_00_DDR_CSN_0_1 + 1 > () ||
+ !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_CSN_2_3>() ||
+ !i_inst.arr0.getBit < MCBIST_CCS_INST_ARR0_00_DDR_CSN_2_3 + 1 > ();
+
+ const auto l_mrs_cmd = i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_ACTN>() &&
+ !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_16>() &&
+ !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_15>() &&
+ !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_ADDRESS_14>();
+
+ const auto l_mrs_ba = !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_BANK_0_1>() ||
+ !i_inst.arr0.getBit < MCBIST_CCS_INST_ARR0_00_DDR_BANK_0_1 + 1 > () ||
+ !i_inst.arr0.getBit<MCBIST_CCS_INST_ARR0_00_DDR_BANK_GROUP_0>();
+ return l_cs_low && l_mrs_cmd && l_mrs_ba;
+}
+///
+/// @brief Returns true if a vector of commands contains an MRS command
+/// @param[in] i_inst instruction to check for an MRS command
+/// @return true iff the command contains an MRS command
+///
+bool contains_command_mrs(const std::vector<ccs::instruction_t>& i_inst)
+{
+ bool l_contains_mrs = false;
+
+ for(const auto& l_inst : i_inst)
+ {
+ l_contains_mrs = is_command_mrs(l_inst);
+
+ if(l_contains_mrs)
+ {
+ FAPI_DBG("0x%016lx is an MRS command. Exiting", uint64_t(l_inst.arr0));
+ break;
+ }
+ }
+
+ return l_contains_mrs;
+}
+
+///
+/// @brief Fixes shadow register corruption over all ranks if needed
+/// @param[in] i_target - the DIMM target on which to operate
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+fapi2::ReturnCode fix_shadow_register_corruption( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target)
+{
+ std::vector< uint64_t > l_ranks;
+ FAPI_TRY(mss::rank::primary_ranks( i_target, l_ranks ));
+
+ for(const auto l_rank : l_ranks)
+ {
+ FAPI_TRY(fix_shadow_register_corruption(i_target, l_rank));
+ }
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @brief Fixes shadow register corruption if needed
+/// @param[in] i_target - the DIMM target on which to operate
+/// @param[in] i_rank - the rank on which to operate
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+fapi2::ReturnCode fix_shadow_register_corruption( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ const uint64_t i_rank)
+{
+ fapi2::Target<fapi2::TARGET_TYPE_DIMM> l_dimm;
+ const auto l_dimm_rank = mss::index(i_rank);
+ uint64_t l_rp = 0;
+ bool l_fix_needed = false;
+
+ // In this case, the rank is really to get the DIMM in question
+ FAPI_TRY(mss::rank::get_dimm_target_from_rank(i_target, i_rank, l_dimm),
+ "%s failed to get DIMM from rank%u", mss::c_str(i_target), i_rank);
+
+ FAPI_TRY(check_shadow_register_corruption(l_dimm, i_rank, l_fix_needed),
+ "%s failed to check if the fix is needed", mss::c_str(i_target));
+
+ // If the fix isn't needed, exit out
+ if(!l_fix_needed)
+ {
+ FAPI_INF("%s workaround not needed. Skipping", mss::c_str(i_target));
+ return fapi2::FAPI2_RC_SUCCESS;
+ }
+
+ // Shadow registers are on a per-rank pair basis
+ FAPI_TRY(mss::rank::get_pair_from_rank(i_target, i_rank, l_rp),
+ "%s rank%u failed to get RP nominal values", mss::c_str(i_target), i_rank);
+
+ FAPI_TRY(fix_shadow_register_corruption_mr<0>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR0", mss::c_str(i_target));
+ FAPI_TRY(fix_shadow_register_corruption_mr<1>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR1", mss::c_str(i_target));
+ FAPI_TRY(fix_shadow_register_corruption_mr<2>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR2", mss::c_str(i_target));
+ FAPI_TRY(fix_shadow_register_corruption_mr<3>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR3", mss::c_str(i_target));
+ FAPI_TRY(fix_shadow_register_corruption_mr<4>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR4", mss::c_str(i_target));
+ FAPI_TRY(fix_shadow_register_corruption_mr<5>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR5", mss::c_str(i_target));
+ FAPI_TRY(fix_shadow_register_corruption_mr<6>(l_dimm, l_rp, l_dimm_rank),
+ "%s failed to fix shadow regs on MR6", mss::c_str(i_target));
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+///
+/// @param[in] i_target - the DIMM target on which to operate
+/// @param[in] i_rank - the rank on which to operate
+/// @param[out] o_fix_needed - true iff the shadow register's could be corrupted (aka are we a 4R DIMM?)
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+
+fapi2::ReturnCode check_shadow_register_corruption( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint64_t i_rank,
+ bool& o_fix_needed)
+{
+ // Number of master ranks for this DIMM - if we have 4, we need the workaround
+ // Also, always run the workaround if we have an LRDIMM
+ constexpr uint8_t RANKS_FOR_FIX_NEEDED = 4;
+ uint8_t l_master_ranks = 0;
+ uint8_t l_dimm_type = 0;
+ o_fix_needed = false;
+
+ FAPI_TRY(mss::eff_num_master_ranks_per_dimm(i_target, l_master_ranks), "%s failed to get master ranks",
+ mss::c_str(i_target));
+ FAPI_TRY(mss::eff_dimm_type(i_target, l_dimm_type), "%s failed to get dimm_type",
+ mss::c_str(i_target));
+ o_fix_needed = (l_master_ranks == RANKS_FOR_FIX_NEEDED) ||
+ (l_dimm_type == fapi2::ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM);
+ FAPI_INF("%s workaround %s needed. num master ranks %u dimm type %u", mss::c_str(i_target), o_fix_needed ? "is" : "not",
+ l_master_ranks, l_dimm_type);
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+} // ns workarounds
+} // ns mss
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.H
new file mode 100644
index 000000000..1d7ea180f
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.H
@@ -0,0 +1,373 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/workarounds/quad_encode_workarounds.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+
+///
+/// @file quad_encode_workaround.H
+/// @brief Contains workarounds having to do with quad-encode CS
+///
+// *HWP HWP Owner: Stephen Glancy <sglancy@us.ibm.com>
+// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 3
+// *HWP Consumed by: FSP:HB Memory Lab
+
+#ifndef _QUAD_ENCODE_WORKAROUND_H_
+#define _QUAD_ENCODE_WORKAROUND_H_
+
+#include <fapi2.H>
+#include <p9_mc_scom_addresses.H>
+
+#include <lib/shared/mss_const.H>
+#include <generic/memory/lib/utils/c_str.H>
+#include <lib/utils/nimbus_find.H>
+#include <generic/memory/lib/ccs/ccs.H>
+#include <lib/dimm/rank.H>
+#include <lib/dimm/ddr4/mrs_load_ddr4.H>
+#include <p9_mc_scom_addresses_fld.H>
+
+namespace mss
+{
+
+namespace workarounds
+{
+
+static constexpr uint64_t MAX_MR = 6;
+
+///
+/// @brief Fixes shadow register corruption over all ranks if needed
+/// @param[in] i_target - the DIMM target on which to operate
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+fapi2::ReturnCode fix_shadow_register_corruption( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target);
+
+///
+/// @brief Fixes shadow register corruption if needed
+/// @param[in] i_target - the DIMM target on which to operate
+/// @param[in] i_rank - the rank on which to operate
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+fapi2::ReturnCode fix_shadow_register_corruption( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ const uint64_t i_rank);
+
+///
+/// @param[in] i_target - the DIMM target on which to operate
+/// @param[in] i_rank - the rank on which to operate
+/// @param[out] o_fix_needed - true iff the shadow register's could be corrupted (aka are we a 4R DIMM?)
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+
+fapi2::ReturnCode check_shadow_register_corruption( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint64_t i_rank,
+ bool& o_fix_needed);
+
+///
+/// @brief Returns true if an MRS command was run
+/// @param[in] i_inst instruction to check for an MRS command
+/// @return true iff the command contains an MRS command
+///
+bool is_command_mrs(const ccs::instruction_t& i_inst);
+
+///
+/// @brief Returns true if a vector of commands contains an MRS command
+/// @param[in] i_inst instruction to check for an MRS command
+/// @return true iff the command contains an MRS command
+///
+bool contains_command_mrs(const std::vector<ccs::instruction_t>& i_inst);
+
+///
+/// @brief Converts the CCS instructions to the shadow register configuration
+/// @param[in] i_inst CCS instruction to convert
+/// @return the register value for the shadow register
+///
+inline fapi2::buffer<uint64_t> convert_to_shadow_reg(const ccs::instruction_t& i_inst)
+{
+ fapi2::buffer<uint64_t> l_arr0(i_inst.arr0);
+ mss::reverse(l_arr0);
+ constexpr uint64_t SHADOW_REG_START = 50;
+ l_arr0.clearBit<0, SHADOW_REG_START>();
+ return l_arr0;
+}
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register
+/// @tparam MR the MR number for which to fix the shadow regs
+///
+template< uint64_t MR >
+class shadow_regs_traits;
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR0
+///
+template<>
+class shadow_regs_traits<0>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ constexpr uint8_t LR_2666_MARGIN_ADJUST = 2;
+
+ // So, why is MRS0 being reset differently compared to the other mode register sets?
+ // For LRDIMM, at 2666, we're running at the edge of the PHY's capabilities to account for the read delay
+ // This means, we've started taking some fails related to not being able to wait long enough for the data to come back
+ // A handy workaround for this is to increase our CAS latency within the PHY itself by changing the value of the mode register
+ // This tricks the PHY's snooping capabilities to think that the data is coming back a bit later
+ // This allows the gate delay and RLO to account for the increased delay correctly
+ // Note: we need the DRAM to send the data back at the same time, but fake the PHY into thinking that it's coming later
+
+ uint8_t l_dimm_type = 0;
+ uint64_t l_freq = 0;
+
+ // Check to make sure our ctor worked ok
+ mss::ddr4::mrs00_data l_data( i_target, fapi2::current_err );
+ FAPI_TRY( fapi2::current_err, "%s Unable to construct MRS00 data from attributes", mss::c_str(i_target) );
+ FAPI_TRY( mss::eff_dimm_type(i_target, l_dimm_type));
+ FAPI_TRY( mss::freq(mss::find_target<fapi2::TARGET_TYPE_MCBIST>(i_target), l_freq));
+
+ // Apply the CAS latency offset if we have an LRDIMM at 2666
+ l_data.iv_cas_latency += ((l_dimm_type == fapi2::ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM) &&
+ (l_freq == fapi2::ENUM_ATTR_MSS_FREQ_MT2666)) ?
+ LR_2666_MARGIN_ADJUST : 0;
+ FAPI_TRY( mss::ddr4::mrs00(i_target, l_data, io_inst, i_rank) );
+ fapi_try_exit:
+ return fapi2::current_err;
+ };
+};
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR1
+///
+template<>
+class shadow_regs_traits<1>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ return mss::ddr4::mrs01(i_target, io_inst, i_rank);
+ };
+};
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR2
+///
+template<>
+class shadow_regs_traits<2>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ return mss::ddr4::mrs02(i_target, io_inst, i_rank);
+ };
+};
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR3
+///
+template<>
+class shadow_regs_traits<3>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ return mss::ddr4::mrs03(i_target, io_inst, i_rank);
+ };
+};
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR4
+///
+template<>
+class shadow_regs_traits<4>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ return mss::ddr4::mrs04(i_target, io_inst, i_rank);
+ };
+};
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR5
+///
+template<>
+class shadow_regs_traits<5>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ return mss::ddr4::mrs05(i_target, io_inst, i_rank);
+ };
+};
+
+///
+/// @class shadow_regs_traits
+/// @brief a collection of traits associated with each shadow register - specialization for MR6
+///
+template<>
+class shadow_regs_traits<6>
+{
+ public:
+
+ static const std::vector<uint64_t> REGS;
+
+ ///
+ /// @brief Configure the ARR0 of the CCS isntruction for mrs00
+ /// @param[in] i_target a fapi2::Target<fapi2::TARGET_TYPE_DIMM>
+ /// @param[in,out] io_inst the instruction to fixup
+ /// @param[in] i_rank ths rank in question
+ /// @return FAPI2_RC_SUCCESS iff OK
+ ///
+ static inline fapi2::ReturnCode mrs_gen(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ ccs::instruction_t& io_inst,
+ const uint64_t i_rank)
+ {
+ return mss::ddr4::mrs06(i_target, io_inst, i_rank);
+ };
+};
+
+
+///
+/// @brief Fixes shadow register corruption on the associated MR
+/// @tparam MR the MR number for which to fix the shadow regs
+/// @tparam traits associated with this shadow register
+/// @param[in] i_target - the DIMM target on which to operate
+/// @param[in] i_rp - the rank pair on which to operate
+/// @param[in] i_rank - the rank on which to operate
+/// @return fapi2::ReturnCode - SUCCESS iff everything executes successfully
+///
+template< uint64_t MR, typename TT = shadow_regs_traits<MR> >
+fapi2::ReturnCode fix_shadow_register_corruption_mr( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ const uint64_t i_rp,
+ const uint64_t i_rank)
+{
+ static_assert( MR <= MAX_MR, "MR instance out of range");
+
+ ccs::instruction_t l_inst;
+ const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
+
+ // Converts this to DIMM rank. just. in. case.
+ const auto l_dimm_rank = mss::index(i_rank);
+
+ FAPI_ASSERT( i_rp < MAX_RANK_PAIRS,
+ fapi2::MSS_INVALID_RANK_PAIR()
+ .set_RANK_PAIR(i_rp)
+ .set_FUNCTION(mss::ffdc_function_codes::FIX_SHADOW_REGISTER)
+ .set_MCA_TARGET(l_mca),
+ "%s invalid RP %u. Max is %u",
+ mss::c_str(l_mca), i_rp, MAX_RANK_PAIRS);
+
+ FAPI_TRY(TT::mrs_gen(i_target, l_inst, l_dimm_rank), "%s failed to get MRS%u nominal values", mss::c_str(i_target), MR);
+
+ // Issues the scom to the shadow regiser
+ FAPI_TRY(mss::putScom(l_mca, TT::REGS[i_rp], convert_to_shadow_reg(l_inst)),
+ "%s rank%u failed to set the shadow register", mss::c_str(i_target), l_dimm_rank);
+
+ return fapi2::FAPI2_RC_SUCCESS;
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+} // ns workarounds
+} // ns mss
+
+#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/mss.H b/src/import/chips/p9/procedures/hwp/memory/mss.H
index f8c5dabf9..47200a2eb 100644
--- a/src/import/chips/p9/procedures/hwp/memory/mss.H
+++ b/src/import/chips/p9/procedures/hwp/memory/mss.H
@@ -49,26 +49,26 @@
#include <lib/shared/mss_const.H>
#include <lib/shared/mss_kind.H>
+#include <lib/ccs/ccs_nimbus.H>
#include <generic/memory/lib/utils/index.H>
#include <generic/memory/lib/utils/c_str.H>
-#include <lib/utils/num.H>
+#include <generic/memory/lib/utils/num.H>
#include <generic/memory/lib/utils/pos.H>
#include <generic/memory/lib/utils/buffer_ops.H>
#include <lib/utils/mss_nimbus_conversions.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/poll.H>
#include <lib/utils/checker.H>
-#include <lib/utils/dump_regs.H>
+#include <generic/memory/lib/utils/dump_regs.H>
-#include <lib/ccs/ccs.H>
#include <lib/mcbist/mcbist.H>
#include <lib/dimm/rcd_load.H>
#include <lib/dimm/mrs_load.H>
#include <lib/dimm/rank.H>
-#include <lib/dimm/kind.H>
+#include <lib/dimm/nimbus_kind.H>
#include <lib/phy/ddr_phy.H>
#include <lib/phy/dp16.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_background_scrub.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_background_scrub.C
index aaf7b6195..e9e4fd0d1 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_background_scrub.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_background_scrub.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -40,52 +40,32 @@
#include <lib/dimm/rank.H>
#include <lib/mcbist/address.H>
#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/patterns.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>
#include <lib/mcbist/memdiags.H>
-#include <lib/mcbist/sim.H>
#include <generic/memory/lib/utils/count_dimm.H>
-#include <lib/fir/memdiags_fir.H>
+#include <lib/fir/unmask.H>
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_SYSTEM;
using fapi2::FAPI2_RC_SUCCESS;
-///
-/// @brief Begin background scrub
-/// @param[in] i_target MCBIST
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-fapi2::ReturnCode p9_mss_background_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
-{
- FAPI_INF("Start mss background scrub on: %s", mss::c_str( i_target ));
- // If there are no DIMM we don't need to bother. In fact, we can't as we didn't setup
- // attributes for the PHY, etc.
- if (mss::count_dimm(i_target) == 0)
- {
- FAPI_INF("... skipping background scrub for %s - no DIMM ...", mss::c_str(i_target));
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- // If we're running in the simulator, we want to only touch the addresses which training touched
- uint8_t l_sim = 0;
- FAPI_TRY( mss::is_simulation(l_sim) );
+extern "C"
+{
- // Kick off background scrub if we are not running in sim
- if (!(l_sim))
+ ///
+ /// @brief Begin background scrub
+ /// @param[in] i_target MCBIST
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode p9_mss_background_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
{
- // Start background scrub
- FAPI_TRY ( mss::memdiags::background_scrub( i_target,
- mss::mcbist::stop_conditions(),
- mss::mcbist::speed::BG_SCRUB,
- mss::mcbist::address() ) );
+ FAPI_INF("Start mss background scrub on: %s", mss::c_str( i_target ));
+ FAPI_TRY(mss::memdiags::mss_background_scrub_helper(i_target));
+ fapi_try_exit:
+ return fapi2::current_err;
}
- // Unmask firs after background scrub is started
- FAPI_TRY ( mss::unmask::after_background_scrub( i_target ) );
-
-fapi_try_exit:
- return fapi2::current_err;
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C
index 84cc1c73e..e88962861 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -32,11 +32,13 @@
// *HWP Team: Memory
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+
+#include <lib/shared/nimbus_defaults.H>
#include <vector>
#include <fapi2.H>
#include <p9_mss_bulk_pwr_throttles.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/power_thermal/throttle.H>
@@ -88,7 +90,7 @@ extern "C"
const uint8_t l_pos = mss::index(l_mca);
- mss::power_thermal::throttle l_pwr_struct(l_mca, l_rc);
+ mss::power_thermal::throttle<> l_pwr_struct(l_mca, l_rc);
FAPI_TRY(l_rc, "Error constructing mss:power_thermal::throttle object for target %s",
mss::c_str(l_mca));
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C
index 27b616a72..8d439b9d8 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_ddr_phy_reset.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,6 +33,7 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+#include <lib/shared/nimbus_defaults.H>
#include <stdint.h>
#include <string.h>
@@ -198,7 +199,7 @@ extern "C"
// The algorithm is 'good path do after_phy_reset, all paths (error or not) perform the checks
// which are defined in during_phy_reset'. We won't run after_phy_reset (unmask of FIR) unless
// we're done with a success.
- FAPI_TRY( mss::unmask::after_phy_reset<mss::mc_type::NIMBUS>(i_target), "%s Error in p9_mss_ddr_phy_reset.C",
+ FAPI_TRY( mss::unmask::after_phy_reset(i_target), "%s Error in p9_mss_ddr_phy_reset.C",
mss::c_str(i_target) );
// Leave as we're all good and checked the FIR already ...
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit.C
index 559593111..62a9e3114 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit.C
@@ -60,10 +60,6 @@ extern "C"
{
fapi2::buffer<uint64_t> l_data;
- mss::ccs::instruction_t<TARGET_TYPE_MCBIST> l_des = mss::ccs::des_command<TARGET_TYPE_MCBIST>();
-
- mss::ccs::program<TARGET_TYPE_MCBIST> l_program;
-
// Up, down P down, up N. Somewhat magic numbers - came from Centaur and proven to be the
// same on Nimbus. Why these are what they are might be lost to time ...
constexpr uint64_t PCLK_INITIAL_VALUE = 0b10;
@@ -158,16 +154,10 @@ extern "C"
mss::c_str(i_target) );
}
- // Also a Deselect command must be registered as required from the Spec.
- // Register DES instruction, which pulls CKE high. Idle 400 cycles, and then begin RCD loading
- // Note: This only is sent to one of the MCA as we still have the mux_addr_sel bit set, meaning
- // we'll PDE/DES all DIMM at the same time.
- l_des.arr1.insertFromRight<MCBIST_CCS_INST_ARR1_00_IDLES, MCBIST_CCS_INST_ARR1_00_IDLES_LEN>(400);
- l_program.iv_instructions.push_back(l_des);
-
- FAPI_TRY( mss::ccs::execute(i_target, l_program, l_mcas[0]),
- "%s Failed execute in p9_mss_draminit",
- mss::c_str(i_target) );
+ // Holds our CKE high for 400 cycles - required by the JEDEC spec
+ FAPI_TRY( mss::draminit_cke_helper(l_mcas[0]),
+ "%s Failed to hold CKE high in p9_mss_draminit",
+ mss::c_str(i_target));
// Per conversation with Shelton and Steve 10/9/15, turn off addr_mux_sel after the CKE CCS but
// before the RCD/MRS CCSs
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_mc.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_mc.C
index 66892c8bd..22a6bacb4 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_mc.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_mc.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2019 */
+/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,13 +33,14 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
#include <mss.H>
#include <p9_mc_scom_addresses_fld.H>
#include <p9_mss_draminit_mc.H>
#include <lib/fir/unmask.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/workarounds/mca_workarounds.H>
@@ -87,7 +88,6 @@ extern "C"
for(const auto& l_mca : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target))
{
FAPI_TRY(mss::workarounds::str_non_tsv_parity(l_mca));
- FAPI_TRY(mss::configure_cid_parity(l_mca));
}
// TODO:RTC179508 - Cleanup draminit_mc
@@ -140,14 +140,14 @@ extern "C"
FAPI_TRY( mss::enable_periodic_cal(p), "%s Failed enable_periodic_cal", mss::c_str(i_target) );
// Step Six: Setup Control Bit ECC
- FAPI_TRY( mss::enable_read_ecc(p), "%s Failed enable_read_ecc", mss::c_str(i_target) );
+ FAPI_TRY( mss::enable_read_ecc<mss::mc_type::NIMBUS>(p), "%s Failed enable_read_ecc", mss::c_str(i_target) );
// apply marks from MVPD
- FAPI_TRY( mss::apply_mark_store(p), "%s Failed enable_read_ecc", mss::c_str(i_target) );
+ FAPI_TRY( mss::apply_mark_store(p), "%s Failed apply_mark_store", mss::c_str(i_target) );
}
// At this point the DDR interface must be monitored for memory errors. Memory related FIRs should be unmasked.
- FAPI_TRY( mss::unmask::after_draminit_mc<mss::mc_type::NIMBUS>(i_target), "%s Failed after_draminit_mc",
+ FAPI_TRY( mss::unmask::after_draminit_mc(i_target), "%s Failed after_draminit_mc",
mss::c_str(i_target) );
fapi_try_exit:
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training.C
index e4084b461..0a13ac90c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training.C
@@ -33,6 +33,7 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
#include <mss.H>
#include <vector>
@@ -212,7 +213,7 @@ extern "C"
// We do it here in order to train every port
FAPI_TRY( mss::draminit_training_error_handler(l_fails) );
// Unmask FIR
- FAPI_TRY( mss::unmask::after_draminit_training<mss::mc_type::NIMBUS>(i_target), "Error in p9_mss_draminit" );
+ FAPI_TRY( mss::unmask::after_draminit_training(i_target), "Error in p9_mss_draminit" );
fapi_try_exit:
FAPI_INF("End draminit training");
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training_adv.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training_adv.C
index 95a662883..67c3074a2 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training_adv.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_draminit_training_adv.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -43,6 +43,7 @@
#include <lib/phy/seq.H>
#include <lib/phy/ddr_phy.H>
#include <lib/phy/mss_training.H>
+#include <lib/workarounds/dp16_workarounds.H>
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
@@ -125,6 +126,9 @@ extern "C"
{
FAPI_TRY( l_step->execute(p, rp, l_cal_abort_on_error) );
}
+
+ // Adjusts values for NVDIMM's
+ FAPI_TRY(mss::workarounds::nvdimm::adjust_rd_dq_delay(p, rp));
}// rank pairs
// Resetting current_err.
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C
index 7ce96a63d..9a8217e52 100755
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C
@@ -42,10 +42,11 @@
#include <fapi2.H>
// mss lib
+#include <lib/shared/nimbus_defaults.H>
#include <generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H>
#include <generic/memory/lib/utils/pos.H>
#include <lib/utils/checker.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/shared/mss_kind.H>
#include <lib/dimm/eff_dimm.H>
#include <lib/eff_config/plug_rules.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
index bd5819fd2..b9d63f3fc 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -33,13 +33,13 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+#include <lib/shared/nimbus_defaults.H>
#include <fapi2.H>
#include <vector>
#include <p9_mss_eff_config_thermal.H>
#include <p9_mss_bulk_pwr_throttles.H>
#include <lib/power_thermal/throttle.H>
#include <lib/power_thermal/decoder.H>
-#include <lib/dimm/kind.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/shared/mss_const.H>
#include <mss.H>
@@ -52,12 +52,14 @@ extern "C"
/// @note sets ATTR_MSS_MEM_WATT_TARGET, ATTR_MSS_RUNTIME_MEM_THROTTLED_N_COMMANDS_PER_PORT and _PER_SLOT, and ATTR_MSS_PORT_MAXPOWER
fapi2::ReturnCode p9_mss_eff_config_thermal( const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_targets )
{
+ using TT = mss::power_thermal::throttle_traits<mss::mc_type::NIMBUS>;
+
FAPI_INF("Start effective config thermal");
fapi2::ReturnCode l_rc;
- std::vector< uint64_t > l_slope (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS, 0);
- std::vector< uint64_t > l_intercept (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS, 0);
- std::vector< uint64_t > l_thermal_power_limit (mss::power_thermal::SIZE_OF_THERMAL_ATTR, 0);
+ std::vector< uint64_t > l_slope (TT::SIZE_OF_POWER_CURVES_ATTRS, 0);
+ std::vector< uint64_t > l_intercept (TT::SIZE_OF_POWER_CURVES_ATTRS, 0);
+ std::vector< uint64_t > l_thermal_power_limit (TT::SIZE_OF_THERMAL_ATTR, 0);
uint16_t l_vddr_slope [mss::PORTS_PER_MCS][mss::MAX_DIMM_PER_PORT] = {};
uint16_t l_vddr_int [mss::PORTS_PER_MCS][mss::MAX_DIMM_PER_PORT] = {};
@@ -75,19 +77,21 @@ extern "C"
// Return error if safemode throttle utilization is less than MIN_UTIL
// This section needs to be in braces otherwise the compile will fail
{
+ using TT = mss::power_thermal::throttle_traits<>;
+ const uint64_t l_min_util = TT::MIN_UTIL;
uint16_t l_throttle_per_port = 0;
uint32_t l_throttle_denominator = 0;
FAPI_TRY(mss::mrw_mem_m_dram_clocks(l_throttle_denominator), "Error in p9_mss_eff_config_thermal" );
FAPI_TRY(mss::mrw_safemode_mem_throttled_n_commands_per_port(l_throttle_per_port),
"Error in p9_mss_eff_config_thermal" );
- FAPI_ASSERT( (l_throttle_per_port >= (mss::power_thermal::MIN_UTIL * l_throttle_denominator /
+ FAPI_ASSERT( (l_throttle_per_port >= (TT::MIN_UTIL * l_throttle_denominator /
mss::power_thermal::DRAM_BUS_UTILS / mss::power_thermal::UTIL_CONVERSION)),
fapi2::MSS_MRW_SAFEMODE_THROTTLE_NOT_SUPPORTED()
.set_MRW_SAFEMODE_N_VALUE(l_throttle_per_port)
.set_MRW_DRAM_CLOCK_THROTTLE_M(l_throttle_denominator)
- .set_MIN_UTIL_VALUE(mss::power_thermal::MIN_UTIL),
+ .set_MIN_UTIL_VALUE(l_min_util),
"MRW safemode attribute (N=%d, M=%d) has less util than the min util allowed (%d centi percent)",
- l_throttle_per_port, l_throttle_denominator, mss::power_thermal::MIN_UTIL);
+ l_throttle_per_port, l_throttle_denominator, l_min_util);
}
//Restore runtime_throttles from safemode setting
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C
index 7d770fc13..6c24fd182 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq.C
@@ -48,7 +48,7 @@
#include <lib/freq/nimbus_freq_traits.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/utils/freq/gen_mss_freq.H>
-#include <generic/memory/lib/data_engine/pre_data_init.H>
+#include <lib/eff_config/pre_data_init.H>
using fapi2::TARGET_TYPE_MCS;
using fapi2::TARGET_TYPE_MCA;
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.C
index cba559c16..7721c724d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_freq_system.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,7 +39,7 @@
#include <mss.H>
#include <p9_mss_freq_system.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/freq/sync.H>
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C
index 150f725a3..80b54d1ff 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C
@@ -39,16 +39,15 @@
#include <lib/dimm/rank.H>
#include <generic/memory/lib/utils/poll.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <lib/mcbist/address.H>
-#include <lib/mcbist/patterns.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>
#include <lib/mcbist/memdiags.H>
#include <lib/mcbist/mcbist.H>
#include <lib/mc/port.H>
-#include <lib/mcbist/sim.H>
-#include <lib/ecc/ecc.H>
-#include <lib/fir/memdiags_fir.H>
+#include <lib/fir/unmask.H>
+#include <generic/memory/lib/ecc/ecc.H>
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_SYSTEM;
@@ -181,7 +180,7 @@ extern "C"
l_probes);
FAPI_ASSERT( l_poll_results == true,
- fapi2::MSS_MEMDIAGS_SUPERFAST_INIT_FAILED_TO_INIT().set_MCBIST_TARGET(i_target),
+ fapi2::MSS_MEMDIAGS_SUPERFAST_INIT_FAILED_TO_INIT().set_MC_TARGET(i_target),
"p9_mss_memdiag (init) timedout %s", mss::c_str(i_target) );
// Unmask firs after memdiags and turn off FIFO mode
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C
index 3ee15dc3b..9dc8d134c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C
@@ -40,11 +40,11 @@
#include <p9n_mcbist_scom.H>
#include <p9n_ddrphy_scom.H>
#include <generic/memory/lib/utils/count_dimm.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/phy/ddr_phy.H>
#include <lib/mc/mc.H>
#include <lib/fir/unmask.H>
-#include <generic/memory/lib/utils/find_magic.H>
+#include <lib/utils/find_magic.H>
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_MCBIST;
@@ -119,7 +119,7 @@ fapi2::ReturnCode p9_mss_scominit( const fapi2::Target<TARGET_TYPE_MCBIST>& i_ta
FAPI_TRY( mss::phy_scominit(i_target), "%s failed phy_scominit", mss::c_str(i_target) );
// Do FIRry things
- FAPI_TRY( mss::unmask::after_scominit<mss::mc_type::NIMBUS>(i_target), "%s failed after_scominit",
+ FAPI_TRY( mss::unmask::after_scominit(i_target), "%s failed after_scominit",
mss::c_str(i_target) );
fapi_try_exit:
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C
index b6845295e..caba47caf 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.C
@@ -40,106 +40,34 @@
#include <lib/dimm/rank.H>
#include <lib/mcbist/address.H>
#include <lib/mcbist/mcbist.H>
-#include <lib/mcbist/patterns.H>
+#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>
#include <lib/mcbist/memdiags.H>
-#include <lib/mcbist/sim.H>
#include <generic/memory/lib/utils/count_dimm.H>
-#include <lib/fir/memdiags_fir.H>
+#include <lib/fir/unmask.H>
using fapi2::TARGET_TYPE_MCBIST;
using fapi2::TARGET_TYPE_MCA;
using fapi2::TARGET_TYPE_SYSTEM;
using fapi2::FAPI2_RC_SUCCESS;
-///
-/// @brief Begin background scrub
-/// @param[in] i_target MCBIST
-/// @return FAPI2_RC_SUCCESS iff ok
-///
-fapi2::ReturnCode p9_mss_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
+extern "C"
{
- FAPI_INF("Start mss scrub");
-
- // If there are no DIMM we don't need to bother. In fact, we can't as we didn't setup
- // attributes for the PHY, etc.
- if (mss::count_dimm(i_target) == 0)
- {
- FAPI_INF("... skipping scrub for %s - no DIMM ...", mss::c_str(i_target));
- return fapi2::FAPI2_RC_SUCCESS;
- }
-
- // If we're running in the simulator, we want to only touch the addresses which training touched
- uint8_t l_sim = 0;
- bool l_poll_results = false;
- fapi2::buffer<uint64_t> l_status;
-
- // A small vector of addresses to poll during the polling loop
- const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes =
- {
- {i_target, "mcbist current address", MCBIST_MCBMCATQ},
- };
-
- // We'll fill in the initial delay below
- mss::poll_parameters l_poll_parameters(0, 200, 100 * mss::DELAY_1MS, 200, 10000);
- uint64_t l_memory_size = 0;
-
- FAPI_TRY( mss::eff_memory_size<mss::mc_type::NIMBUS>(i_target, l_memory_size) );
- l_poll_parameters.iv_initial_delay = mss::calculate_initial_delay(i_target, (l_memory_size * mss::BYTES_PER_GB));
- FAPI_TRY( mss::is_simulation( l_sim) );
-
- if (l_sim)
+ ///
+ /// @brief Begin background scrub
+ /// @param[in] i_target MCBIST
+ /// @return FAPI2_RC_SUCCESS iff ok
+ ///
+ fapi2::ReturnCode p9_mss_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target )
{
- fapi2::ReturnCode l_rc;
-
- // Use some sort of pattern in sim in case the verification folks need to look for something
- // TK. Need a verification pattern. This is a not-good pattern for verification ... We don't really
- // have a good pattern for verification defined.
- FAPI_INF("running mss sim init in place of scrub");
- l_rc = mss::mcbist::sim::sf_init(i_target, mss::mcbist::PATTERN_0);
-
- // Unmask firs and turn off FIFO mode before returning
- FAPI_TRY ( mss::unmask::after_memdiags( i_target ) );
- FAPI_TRY ( mss::unmask::after_background_scrub( i_target ) );
- FAPI_TRY ( mss::reset_reorder_queue_settings(i_target) );
-
- return l_rc;
+ FAPI_INF("Start mss scrub for %s", mss::c_str(i_target));
+ // Initialize memory and set firs accordingly
+ FAPI_TRY(mss::memdiags::mss_initialize_memory(i_target));
+ // Kickoff background scrub and unmask firs
+ FAPI_TRY(mss::memdiags::mss_background_scrub_helper(i_target));
+
+ fapi_try_exit:
+ return fapi2::current_err;
}
- // In Cronus on hardware (which is how we got here - f/w doesn't call this) we want
- // to call sf_init (0's)
- // TK we need to check FIR given the way this is right now, we should adjust with better stop
- // conditions when we learn more about what we want to find in the lab
- FAPI_TRY( mss::memdiags::sf_init(i_target, mss::mcbist::PATTERN_0) );
-
- // Poll for completion.
- l_poll_results = mss::poll(i_target, MCBIST_MCBISTFIRQ, l_poll_parameters,
- [&l_status](const size_t poll_remaining,
- const fapi2::buffer<uint64_t>& stat_reg) -> bool
- {
- FAPI_DBG("mcbist firq 0x%llx, remaining: %d", stat_reg, poll_remaining);
- l_status = stat_reg;
- return l_status.getBit<MCBIST_MCBISTFIRQ_MCBIST_PROGRAM_COMPLETE>() == true;
- },
- l_probes);
-
- FAPI_ASSERT( l_poll_results == true,
- fapi2::MSS_MEMDIAGS_SUPERFAST_INIT_FAILED_TO_INIT().set_MCBIST_TARGET(i_target),
- "p9_mss_scrub (init) timedout %s", mss::c_str(i_target) );
-
- // Unmask firs after memdiags and turn off FIFO mode
- FAPI_TRY ( mss::unmask::after_memdiags( i_target ) );
- FAPI_TRY ( mss::reset_reorder_queue_settings(i_target) );
-
- // Start background scrub
- FAPI_TRY ( mss::memdiags::background_scrub( i_target,
- mss::mcbist::stop_conditions(),
- mss::mcbist::speed::BG_SCRUB,
- mss::mcbist::address() ) );
-
- // Unmask firs after background scrub is started
- FAPI_TRY ( mss::unmask::after_background_scrub( i_target ) );
-
-fapi_try_exit:
- return fapi2::current_err;
}
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_thermal_init.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_thermal_init.C
index 2523989fa..45ea4392d 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_thermal_init.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_thermal_init.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -34,8 +34,9 @@
// *HWP Consumed by: FSP:HB
#include <fapi2.H>
+#include <lib/shared/nimbus_defaults.H>
#include <lib/mc/mc.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <p9_mss_thermal_init.H>
using fapi2::TARGET_TYPE_MCS;
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C
index 076cd911c..01bd44749 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,6 +37,7 @@
// *HWP Level: 3
// *HWP Consumed by: FSP:HB
+#include <lib/shared/nimbus_defaults.H>
#include <p9_mss_utils_to_throttle.H>
// fapi2
@@ -45,7 +46,7 @@
// mss lib
#include <lib/power_thermal/throttle.H>
#include <generic/memory/lib/utils/index.H>
-#include <generic/memory/lib/utils/find.H>
+#include <lib/utils/nimbus_find.H>
#include <lib/utils/mss_nimbus_conversions.H>
#include <lib/power_thermal/throttle.H>
#include <lib/mss_attribute_accessors.H>
@@ -71,6 +72,8 @@ extern "C"
///
fapi2::ReturnCode p9_mss_utils_to_throttle( const std::vector< fapi2::Target<TARGET_TYPE_MCS> >& i_targets )
{
+ constexpr uint64_t l_min_util = mss::power_thermal::throttle_traits<mss::mc_type::NIMBUS>::MIN_UTIL;
+
FAPI_INF("Entering p9_mss_utils_to_throttle");
std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > l_exceeded_power;
@@ -87,20 +90,24 @@ extern "C"
uint32_t l_max_databus_util = {};
uint32_t l_dram_clocks = 0;
uint16_t l_safemode_throttle_per_port = 0;
- double l_calc_util_safemode = 0;
+ uint32_t l_calc_util = 0;
uint16_t l_n_port[mss::PORTS_PER_MCS] = {};
uint16_t l_n_slot[mss::PORTS_PER_MCS] = {};
uint32_t l_max_power[mss::PORTS_PER_MCS] = {};
- FAPI_TRY( mss::mrw_mem_m_dram_clocks(l_dram_clocks) );
+ FAPI_TRY(mss::mrw_mem_m_dram_clocks(l_dram_clocks) );
//Util attribute set by OCC
- FAPI_TRY( mss::databus_util(l_mcs, l_input_databus_util) );
- FAPI_TRY( mss::mrw_max_dram_databus_util(l_max_databus_util));
+ FAPI_TRY(mss::databus_util(l_mcs, l_input_databus_util) );
+ FAPI_TRY(mss::mrw_max_dram_databus_util(l_max_databus_util));
+ FAPI_TRY(mss::mrw_safemode_mem_throttled_n_commands_per_port(l_safemode_throttle_per_port));
for( const auto& l_mca : mss::find_targets<TARGET_TYPE_MCA>(l_mcs) )
{
+ fapi2::ReturnCode l_rc;
+ bool l_safemode = false;
+
FAPI_INF("Input databus utilization for %s is %d",
mss::c_str(l_mca),
l_input_databus_util[mss::index(l_mca)]);
@@ -113,56 +120,31 @@ extern "C"
}
// If input utilization is zero, use mrw safemode throttle values for utilization
- bool l_safemode = false;
-
- if (l_input_databus_util[l_port_num] == 0)
- {
- FAPI_TRY(mss::mrw_safemode_mem_throttled_n_commands_per_port(l_safemode_throttle_per_port),
- "Error in getting safemode throttles" );
- FAPI_TRY( mss::power_thermal::calc_util_from_throttles(l_safemode_throttle_per_port, l_dram_clocks,
- l_calc_util_safemode),
- "%s Error calculating utilization from safemode throttle %d and mem clocks %d",
- mss::c_str(l_mca),
- l_safemode_throttle_per_port,
- l_dram_clocks);
- FAPI_INF( "%s Safemode throttles being used since input util is zero: Using N=%d, Utilization %f",
- mss::c_str(l_mca),
- l_safemode_throttle_per_port,
- l_calc_util_safemode);
- l_safemode = true;
- l_input_databus_util[l_port_num] = l_calc_util_safemode;
- }
-
- //Make sure MIN_UTIL <= input_utilization <= max_utilization
- const uint32_t l_databus_util = ( l_input_databus_util[l_port_num] >= mss::power_thermal::MIN_UTIL) ?
- std::min(l_input_databus_util[l_port_num], l_max_databus_util)
- : mss::power_thermal::MIN_UTIL;
+ // else make sure we're within our maximum utilization limit
+ FAPI_TRY(mss::power_thermal::calc_utilization<mss::mc_type::NIMBUS>(l_mca,
+ l_input_databus_util[l_port_num],
+ l_dram_clocks,
+ l_safemode_throttle_per_port,
+ l_max_databus_util,
+ l_calc_util,
+ l_util_error,
+ l_safemode));
// Error if utilization is less than MIN_UTIL
// Don't exit, let HWP finish and return error at end
- if (l_input_databus_util[l_port_num] < mss::power_thermal::MIN_UTIL)
- {
- FAPI_ASSERT_NOEXIT( false,
- fapi2::MSS_MIN_UTILIZATION_ERROR()
- .set_INPUT_UTIL_VALUE(l_input_databus_util[l_port_num])
- .set_MIN_UTIL_VALUE(mss::power_thermal::MIN_UTIL),
- "%s Input utilization (%d) less than minimum utilization allowed (%d)",
- mss::c_str(l_mca), l_input_databus_util[l_port_num], mss::power_thermal::MIN_UTIL);
- l_util_error = true;
- }
-
- //Make a throttle object in order to calculate the port power
- fapi2::ReturnCode l_rc;
-
- mss::power_thermal::throttle l_throttle (l_mca, l_rc);
- FAPI_TRY(l_rc, "Error calculating mss::power_thermal::throttle constructor in p9_mss_utils_to_throttles");
+ FAPI_ASSERT_NOEXIT(!l_util_error,
+ fapi2::MSS_MIN_UTILIZATION_ERROR()
+ .set_INPUT_UTIL_VALUE(l_input_databus_util[l_port_num])
+ .set_MIN_UTIL_VALUE(l_min_util),
+ "%s Input utilization (%d) less than minimum utilization allowed (%d)",
+ mss::c_str(l_mca), l_input_databus_util[l_port_num], l_min_util);
- FAPI_INF( "%s MRW dram clock window: %d, databus utilization: %d",
- mss::c_str(l_mca),
- l_dram_clocks,
- l_databus_util);
+ // Make a throttle object in order to calculate the port power
+ mss::power_thermal::throttle<mss::mc_type::NIMBUS> l_throttle (l_mca, l_rc);
+ FAPI_TRY(l_rc, "%s Error calculating mss::power_thermal::throttle constructor in p9_mss_utils_to_throttles",
+ mss::c_str(l_mca));
- FAPI_TRY( l_throttle.calc_slots_and_power(l_databus_util));
+ FAPI_TRY( l_throttle.calc_slots_and_power(l_calc_util));
FAPI_INF( "%s Calculated N commands per port %d, per slot %d, commands per dram clock window %d, maxpower is %d",
mss::c_str(l_mca),
@@ -194,7 +176,7 @@ extern "C"
// Return a failing RC code if we had any input utilization values less than MIN_UTIL
if (l_util_error)
{
- fapi2::current_err = fapi2::FAPI2_RC_FALSE;
+ fapi2::current_err = fapi2::RC_MSS_MIN_UTILIZATION_ERROR;
}
fapi_try_exit:
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9a_omi_init.C b/src/import/chips/p9/procedures/hwp/memory/p9a_omi_init.C
index b11696597..60d52d748 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9a_omi_init.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9a_omi_init.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -90,20 +90,13 @@ fapi2::ReturnCode p9a_omi_init_enable_templates(const fapi2::Target<fapi2::TARGE
l_enable_tmpl_7),
"Error from FAPI_ATTR_GET (ATTR_PROC_ENABLE_DL_TMPL_7)");
- FAPI_ASSERT(l_enable_tmpl_1 != 0,
- fapi2::PROC_DOWNSTREAM_TMPL1_REQUIRED_ERR()
- .set_TARGET(i_target),
- "Downstream template 1 is required.");
-
- FAPI_ASSERT(l_enable_tmpl_4 != 0 || l_enable_tmpl_7 != 0,
- fapi2::PROC_DOWNSTREAM_TMPL4OR7_REQUIRED_ERR()
- .set_TARGET(i_target),
- "Downstream template 4 and/or 7 is required.");
-
- //Turn off temp0_only
- FAPI_TRY(getScom(i_target, P9A_MCC_DSTLCFG, l_data));
- l_data.clearBit<P9A_MCC_DSTLCFG_TMPL0_ONLY>();
- FAPI_TRY(putScom(i_target, P9A_MCC_DSTLCFG, l_data));
+ if (l_enable_tmpl_1 || l_enable_tmpl_4 || l_enable_tmpl_7)
+ {
+ //Turn off temp0_only
+ FAPI_TRY(getScom(i_target, P9A_MCC_DSTLCFG, l_data));
+ l_data.clearBit<P9A_MCC_DSTLCFG_TMPL0_ONLY>();
+ FAPI_TRY(putScom(i_target, P9A_MCC_DSTLCFG, l_data));
+ }
fapi_try_exit:
OpenPOWER on IntegriCloud