diff options
author | Brian Silver <bsilver@us.ibm.com> | 2016-04-05 14:43:41 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-04-25 13:45:00 -0400 |
commit | 84245de79e62f285cd4bd3201dcf8ec8c92d1f42 (patch) | |
tree | 6b8e5de5183fd98f90875631798d1c68bcfae3a8 /src | |
parent | 6d41c4bef52f59d6363d813d6b2b3b8a0d4f828c (diff) | |
download | talos-hostboot-84245de79e62f285cd4bd3201dcf8ec8c92d1f42.tar.gz talos-hostboot-84245de79e62f285cd4bd3201dcf8ec8c92d1f42.zip |
Add L2 p9_mss_scrub
Change inversion so in sim we run with inversion off
Change address counting mode to be disabled by default
Remove ATTR_MCBIST attributes
Change-Id: I233851de5186e053df0b5a4b25eee42763b35755
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22914
Tested-by: Jenkins Server
Tested-by: Hostboot CI
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: JACOB L. HARVEY <jlharvey@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22917
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
8 files changed, 208 insertions, 2251 deletions
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 8cd30a369..68d72328f 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 @@ -53,6 +53,10 @@ namespace mcbist /// 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 @@ -78,36 +82,32 @@ class 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) + iv_address(i_value << MAGIC_PAD) { } /// /// @brief Conversion operator to uint64_t + /// @warn Right-aligns the address /// inline operator uint64_t() const { - return iv_address; - } - - /// - /// @brief Conversion operator to uint64_t reference - /// - inline operator uint64_t& () - { - return iv_address; + 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 void set_field( const uint64_t i_value ) + inline address& set_field( const uint64_t i_value ) { iv_address.insertFromRight<F.first, F.second>(i_value); + return *this; } /// @@ -162,9 +162,7 @@ class address 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); - o_start.set_dimm(i_dimm); - o_start.set_master_rank(i_mrank); + o_start.set_port(i_port).set_dimm(i_dimm).set_master_rank(i_mrank); get_mrank_range(o_start, o_end); } @@ -191,20 +189,18 @@ class address const uint64_t i_mrank, const uint64_t i_srank, address& o_start, address& o_end ) { - o_start.set_port(i_port); - o_start.set_dimm(i_dimm); - o_start.set_master_rank(i_mrank); - o_start.set_slave_rank(i_srank); + 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 void set_port( const uint64_t i_value ) + inline address& set_port( const uint64_t i_value ) { - set_field<PORT>(i_value); + return set_field<PORT>(i_value); } /// @@ -220,10 +216,11 @@ class address /// @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 void set_dimm( const uint64_t i_value ) + inline address& set_dimm( const uint64_t i_value ) { - set_field<DIMM>(i_value); + return set_field<DIMM>(i_value); } /// @@ -238,10 +235,11 @@ class address /// /// @brief Set the master rank value for an address /// @param[in] i_value the value to set + /// @return address& for method chaining /// - inline void set_master_rank( const uint64_t i_value ) + inline address& set_master_rank( const uint64_t i_value ) { - set_field<MRANK>(i_value); + return set_field<MRANK>(i_value); } /// @@ -276,10 +274,11 @@ class address /// /// @brief Set the row value for an address /// @param[in] i_value the value to set + /// @return address& for method chaining /// - inline void set_row( const uint64_t i_value ) + inline address& set_row( const uint64_t i_value ) { - set_field<ROW>(i_value); + return set_field<ROW>(i_value); } /// @@ -295,10 +294,11 @@ class address /// /// @brief Set the column value for an address /// @param[in] i_value the value to set + /// @return address& for method chaining /// - inline void set_column( const uint64_t i_value ) + inline address& set_column( const uint64_t i_value ) { - set_field<COL>(i_value); + return set_field<COL>(i_value); } /// @@ -314,10 +314,11 @@ class address /// /// @brief Set the bank value for an address /// @param[in] i_value the value to set + /// @return address& for method chaining /// - inline void set_bank( const uint64_t i_value ) + inline address& set_bank( const uint64_t i_value ) { - set_field<BANK>(i_value); + return set_field<BANK>(i_value); } /// @@ -332,10 +333,11 @@ class address /// /// @brief Set the bank group value for an address /// @param[in] i_value the value to set + /// @return address& for method chaining /// - inline void set_bank_group( const uint64_t i_value ) + inline address& set_bank_group( const uint64_t i_value ) { - set_field<BANK_GROUP>(i_value); + return set_field<BANK_GROUP>(i_value); } /// 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 ba8a672cc..5eaabc21e 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 @@ -39,6 +39,15 @@ namespace mss namespace mcbist { +const std::pair<uint64_t, uint64_t> mcbistTraits<fapi2::TARGET_TYPE_MCBIST>::address_pairs[] = +{ + { START_ADDRESS_0, END_ADDRESS_0 }, + { START_ADDRESS_1, END_ADDRESS_1 }, + { START_ADDRESS_2, END_ADDRESS_2 }, + { START_ADDRESS_3, END_ADDRESS_3 }, +}; + + /// /// @brief Load a set of MCBIST subtests in to the MCBIST registers /// @tparam T, the fapi2::TargetType - derived @@ -140,6 +149,12 @@ fapi2::ReturnCode execute( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target, fapi2::buffer<uint64_t> l_status; + // A small vector of addresses to poll during the polling loop + static const std::vector<mss::poll_probe<fapi2::TARGET_TYPE_MCBIST>> l_probes = + { + {i_target, "mcbist current address", MCBIST_MCBMCATQ}, + }; + // Slam the subtests in to the mcbist registers FAPI_TRY( load_mcbmr(i_target, i_program) ); @@ -169,7 +184,8 @@ fapi2::ReturnCode execute( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target, 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, 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 f2fefd13d..45c9d7ca2 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 @@ -96,6 +96,10 @@ class mcbistTraits<fapi2::TARGET_TYPE_MCBIST> static const uint64_t END_ADDRESS_2 = MCBIST_MCBEA2Q; static const uint64_t END_ADDRESS_3 = MCBIST_MCBEA3Q; + // 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[]; + enum { // Subtest control bits. These are the same in all '16 bit subtest' field @@ -478,16 +482,17 @@ class program // Enable the maintenance mode addressing change_maint_address_mode(mss::ON); - // Enable 64b lengths, required in maint mode. + // 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 on counting mode for all address configs - iv_addr_gen.insertFromRight<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(0b1111); + // Turn off counting mode for all address configs + iv_addr_gen.insertFromRight<TT::ADDR_COUNTER_MODE, TT::ADDR_COUNTER_MODE_LEN>(0b0000); } /// - /// @brief Change the mcbist 64/128 bit control - /// @param[in] i_state mss::ON if you want 64b,mss::OFF if you want 128b + /// @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 ) @@ -900,37 +905,54 @@ inline fapi2::ReturnCode load_addr_gen( const fapi2::Target<T>& i_target, const } /// -/// @brief Configure address range 0 +/// @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_program the mcbist::program /// @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_range0( const fapi2::Target<T>& i_target, const uint64_t i_start, - const uint64_t i_end ) +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_DBG("config MCBIST address range 0 start: 0x%016lx (0x%016lx), end/len 0x%016lx (0x%016lx)", - i_start, (i_start << 26), i_end, (i_end << 26)); - FAPI_TRY( mss::putScom(i_target, TT::START_ADDRESS_0, i_start << 26) ); - FAPI_TRY( mss::putScom(i_target, TT::END_ADDRESS_0, i_end << 26) ); + FAPI_DBG("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_program the mcbist::program /// @param[in] i_start 64b right-aligned address /// @param[in] i_end 64b right-aligned address /// @return FAPI2_RC_SUCCSS iff ok @@ -941,13 +963,7 @@ 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 ) { - FAPI_DBG("config MCBIST address range 1 start: 0x%016lx (0x%016lx), end/len 0x%016lx (0x%016lx)", - i_start, (i_start << 26), i_end, (i_end << 26)); - FAPI_TRY( mss::putScom(i_target, TT::START_ADDRESS_1, i_start << 26) ); - FAPI_TRY( mss::putScom(i_target, TT::END_ADDRESS_1, i_end << 26) ); - -fapi_try_exit: - return fapi2::current_err; + return config_address_range(i_target, i_start, i_end, 1); } @@ -956,7 +972,6 @@ fapi_try_exit: /// @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 /// @param[in] i_start 64b right-aligned address /// @param[in] i_end 64b right-aligned address /// @return FAPI2_RC_SUCCSS iff ok @@ -967,13 +982,7 @@ 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 ) { - FAPI_DBG("config MCBIST address range 2 start: 0x%016lx (0x%016lx), end/len 0x%016lx (0x%016lx)", - i_start, (i_start << 26), i_end, (i_end << 26)); - FAPI_TRY( mss::putScom(i_target, TT::START_ADDRESS_2, i_start << 26) ); - FAPI_TRY( mss::putScom(i_target, TT::END_ADDRESS_2, i_end << 26) ); - -fapi_try_exit: - return fapi2::current_err; + return config_address_range(i_target, i_start, i_end, 2); } @@ -982,7 +991,6 @@ fapi_try_exit: /// @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 /// @param[in] i_start 64b right-aligned address /// @param[in] i_end 64b right-aligned address /// @return FAPI2_RC_SUCCSS iff ok @@ -992,13 +1000,7 @@ 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 ) { - FAPI_DBG("config MCBIST address range 3 start: 0x%016lx (0x%016lx), end/len 0x%016lx (0x%016lx)", - i_start, (i_start << 26), i_end, (i_end << 26)); - FAPI_TRY( mss::putScom(i_target, TT::START_ADDRESS_3, i_start << 26) ); - FAPI_TRY( mss::putScom(i_target, TT::END_ADDRESS_3, i_end << 26) ); - -fapi_try_exit: - return fapi2::current_err; + return config_address_range(i_target, i_start, i_end, 3); } /// 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 bc9962c55..558d30947 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 @@ -28,1375 +28,6 @@ namespace mss { /// -/// @brief ATTR_MCBIST_ADDR_MODES getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Can choose mcbist address mode for full,half or quarter addressing -/// mode. -/// -inline fapi2::ReturnCode mcbist_addr_modes(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_MODES, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_MODES: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_MODES getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Can choose mcbist address mode for full,half or quarter addressing -/// mode. -/// -inline fapi2::ReturnCode mcbist_addr_modes(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_MODES, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_MODES: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_MODES getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Can choose mcbist address mode for full,half or quarter addressing -/// mode. -/// -inline fapi2::ReturnCode mcbist_addr_modes(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_MODES, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_MODES: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note No description -/// -inline fapi2::ReturnCode mcbist_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANK, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note No description -/// -inline fapi2::ReturnCode mcbist_rank(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANK, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note No description -/// -inline fapi2::ReturnCode mcbist_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANK, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_START_ADDR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Defines the start address for the Mcbist address -/// range -/// -inline fapi2::ReturnCode mcbist_start_addr(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_START_ADDR, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_START_ADDR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_START_ADDR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Defines the start address for the Mcbist address -/// range -/// -inline fapi2::ReturnCode mcbist_start_addr(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_START_ADDR, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_START_ADDR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_START_ADDR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint64_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Defines the start address for the Mcbist address -/// range -/// -inline fapi2::ReturnCode mcbist_start_addr(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint64_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_START_ADDR, i_target, l_value) ); - memcpy(o_array, &l_value, 16); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_START_ADDR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_END_ADDR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Defines the end address for the Mcbist address -/// range -/// -inline fapi2::ReturnCode mcbist_end_addr(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_END_ADDR, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_END_ADDR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_END_ADDR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Defines the end address for the Mcbist address -/// range -/// -inline fapi2::ReturnCode mcbist_end_addr(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_END_ADDR, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_END_ADDR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_END_ADDR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint64_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Defines the end address for the Mcbist address -/// range -/// -inline fapi2::ReturnCode mcbist_end_addr(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint64_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_END_ADDR, i_target, l_value) ); - memcpy(o_array, &l_value, 16); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_END_ADDR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ERROR_CAPTURE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables error capture; basically a -/// flag. -/// -inline fapi2::ReturnCode mcbist_error_capture(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ERROR_CAPTURE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ERROR_CAPTURE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ERROR_CAPTURE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables error capture; basically a -/// flag. -/// -inline fapi2::ReturnCode mcbist_error_capture(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ERROR_CAPTURE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ERROR_CAPTURE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ERROR_CAPTURE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables error capture; basically a -/// flag. -/// -inline fapi2::ReturnCode mcbist_error_capture(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ERROR_CAPTURE, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ERROR_CAPTURE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_MAX_TIMEOUT getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define mcbist Max -/// timeout -/// -inline fapi2::ReturnCode mcbist_max_timeout(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_MAX_TIMEOUT, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_MAX_TIMEOUT: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_MAX_TIMEOUT getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define mcbist Max -/// timeout -/// -inline fapi2::ReturnCode mcbist_max_timeout(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_MAX_TIMEOUT, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_MAX_TIMEOUT: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_MAX_TIMEOUT getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint64_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define mcbist Max -/// timeout -/// -inline fapi2::ReturnCode mcbist_max_timeout(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint64_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_MAX_TIMEOUT, i_target, l_value) ); - memcpy(o_array, &l_value, 16); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_MAX_TIMEOUT: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PRINT_PORT getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enable which port prints are -/// required. -/// -inline fapi2::ReturnCode mcbist_print_port(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PRINT_PORT, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PRINT_PORT: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PRINT_PORT getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enable which port prints are -/// required. -/// -inline fapi2::ReturnCode mcbist_print_port(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PRINT_PORT, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PRINT_PORT: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PRINT_PORT getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enable which port prints are -/// required. -/// -inline fapi2::ReturnCode mcbist_print_port(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PRINT_PORT, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PRINT_PORT: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_STOP_ON_ERROR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Flag to stop Mcbist on -/// Error. -/// -inline fapi2::ReturnCode mcbist_stop_on_error(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_STOP_ON_ERROR, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_STOP_ON_ERROR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_STOP_ON_ERROR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Flag to stop Mcbist on -/// Error. -/// -inline fapi2::ReturnCode mcbist_stop_on_error(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_STOP_ON_ERROR, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_STOP_ON_ERROR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_STOP_ON_ERROR getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Flag to stop Mcbist on -/// Error. -/// -inline fapi2::ReturnCode mcbist_stop_on_error(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_STOP_ON_ERROR, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_STOP_ON_ERROR: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DATA_SEED getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define data seed for the random data pattern or -/// test -/// -inline fapi2::ReturnCode mcbist_data_seed(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint32_t& o_value) -{ - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DATA_SEED, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DATA_SEED: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DATA_SEED getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define data seed for the random data pattern or -/// test -/// -inline fapi2::ReturnCode mcbist_data_seed(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint32_t& o_value) -{ - uint32_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DATA_SEED, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DATA_SEED: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DATA_SEED getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint32_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define data seed for the random data pattern or -/// test -/// -inline fapi2::ReturnCode mcbist_data_seed(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint32_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DATA_SEED, i_target, l_value) ); - memcpy(o_array, &l_value, 8); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DATA_SEED: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_INTER getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note The address interleave map with user cases or deafult cases of -/// BANK_RANK,RANK_BANK,BANK_ONLY,RANK_ONLYRANKS_DIMM0,RANKS_DIMM1,USER_PATTERN. -/// -inline fapi2::ReturnCode mcbist_addr_inter(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_INTER, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_INTER: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_INTER getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note The address interleave map with user cases or deafult cases of -/// BANK_RANK,RANK_BANK,BANK_ONLY,RANK_ONLYRANKS_DIMM0,RANKS_DIMM1,USER_PATTERN. -/// -inline fapi2::ReturnCode mcbist_addr_inter(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_INTER, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_INTER: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_INTER getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note The address interleave map with user cases or deafult cases of -/// BANK_RANK,RANK_BANK,BANK_ONLY,RANK_ONLYRANKS_DIMM0,RANKS_DIMM1,USER_PATTERN. -/// -inline fapi2::ReturnCode mcbist_addr_inter(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_INTER, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_INTER: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_NUM_ROWS getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of rows for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_num_rows(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_NUM_ROWS, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_NUM_ROWS: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_NUM_ROWS getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of rows for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_num_rows(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_NUM_ROWS, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_NUM_ROWS: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_NUM_ROWS getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of rows for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_num_rows(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_NUM_ROWS, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_NUM_ROWS: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_NUM_COLS getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of columns for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_num_cols(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_NUM_COLS, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_NUM_COLS: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_NUM_COLS getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of columns for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_num_cols(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_NUM_COLS, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_NUM_COLS: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_NUM_COLS getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of columns for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_num_cols(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_NUM_COLS, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_NUM_COLS: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of ranks for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_RANK, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of ranks for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_rank(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_RANK, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of ranks for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_RANK, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_BANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of banks for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_bank(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_BANK, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_BANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_BANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of banks for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_bank(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_BANK, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_BANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_BANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of banks for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_bank(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_BANK, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_BANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_BANK_GROUP getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of bank groups for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_bank_group(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_BANK_GROUP, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_BANK_GROUP: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_BANK_GROUP getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of bank groups for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_bank_group(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_BANK_GROUP, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_BANK_GROUP: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_BANK_GROUP getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note User defined constraint for limiting number of bank groups for -/// addressing. -/// -inline fapi2::ReturnCode mcbist_addr_bank_group(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_BANK_GROUP, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_BANK_GROUP: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_SLAVE_RANK_ON getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note If slave ranks exists;Restrict usage or enable addressing on them as -/// well. -/// -inline fapi2::ReturnCode mcbist_addr_slave_rank_on(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_SLAVE_RANK_ON, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_SLAVE_RANK_ON: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_SLAVE_RANK_ON getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note If slave ranks exists;Restrict usage or enable addressing on them as -/// well. -/// -inline fapi2::ReturnCode mcbist_addr_slave_rank_on(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_SLAVE_RANK_ON, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_SLAVE_RANK_ON: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_SLAVE_RANK_ON getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note If slave ranks exists;Restrict usage or enable addressing on them as -/// well. -/// -inline fapi2::ReturnCode mcbist_addr_slave_rank_on(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, - uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_SLAVE_RANK_ON, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_SLAVE_RANK_ON: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_STR_MAP getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note To Define custom addressing map ; Input by -/// user. -/// -inline fapi2::ReturnCode mcbist_addr_str_map(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_STR_MAP, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_STR_MAP: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_STR_MAP getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint64_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note To Define custom addressing map ; Input by -/// user. -/// -inline fapi2::ReturnCode mcbist_addr_str_map(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint64_t& o_value) -{ - uint64_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_STR_MAP, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_STR_MAP: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_STR_MAP getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint64_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note To Define custom addressing map ; Input by -/// user. -/// -inline fapi2::ReturnCode mcbist_addr_str_map(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint64_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint64_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_STR_MAP, i_target, l_value) ); - memcpy(o_array, &l_value, 16); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_STR_MAP: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_RAND getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Flag for Addressing to go sequential manner or -/// random. -/// -inline fapi2::ReturnCode mcbist_addr_rand(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_RAND, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_RAND: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_RAND getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Flag for Addressing to go sequential manner or -/// random. -/// -inline fapi2::ReturnCode mcbist_addr_rand(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_RAND, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_RAND: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_ADDR_RAND getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Flag for Addressing to go sequential manner or -/// random. -/// -inline fapi2::ReturnCode mcbist_addr_rand(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_ADDR_RAND, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_ADDR_RAND: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// /// @brief ATTR_MSS_VOLT getter /// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCBIST> /// @param[out] uint64_t& reference to store the value @@ -15803,486 +14434,6 @@ fapi_try_exit: } /// -/// @brief ATTR_MCBIST_PATTERN getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables mcbist data pattern -/// selection. -/// -inline fapi2::ReturnCode mcbist_pattern(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint32_t& o_value) -{ - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PATTERN, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PATTERN: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PATTERN getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables mcbist data pattern -/// selection. -/// -inline fapi2::ReturnCode mcbist_pattern(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint32_t& o_value) -{ - uint32_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PATTERN, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PATTERN: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PATTERN getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint32_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables mcbist data pattern -/// selection. -/// -inline fapi2::ReturnCode mcbist_pattern(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint32_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PATTERN, i_target, l_value) ); - memcpy(o_array, &l_value, 8); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PATTERN: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_WRITE_DATA getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCBIST> -/// @param[out] uint64_t& reference to store the value -/// @note Generated by gen_accessors.pl generateParameters (MCBIST A) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Define mcbist data for -/// writing -/// -inline fapi2::ReturnCode mcbist_write_data(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target, uint64_t& o_value) -{ - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_WRITE_DATA, i_target, o_value) ); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_WRITE_DATA: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_TEST_TYPE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables mcbist test type -/// selection. -/// -inline fapi2::ReturnCode mcbist_test_type(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint32_t& o_value) -{ - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_TEST_TYPE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_TEST_TYPE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_TEST_TYPE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables mcbist test type -/// selection. -/// -inline fapi2::ReturnCode mcbist_test_type(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint32_t& o_value) -{ - uint32_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_TEST_TYPE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_TEST_TYPE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_TEST_TYPE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint32_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Enables mcbist test type -/// selection. -/// -inline fapi2::ReturnCode mcbist_test_type(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint32_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_TEST_TYPE, i_target, l_value) ); - memcpy(o_array, &l_value, 8); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_TEST_TYPE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PRINTING_DISABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for -/// printing -/// -inline fapi2::ReturnCode mcbist_printing_disable(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PRINTING_DISABLE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PRINTING_DISABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PRINTING_DISABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for -/// printing -/// -inline fapi2::ReturnCode mcbist_printing_disable(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PRINTING_DISABLE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PRINTING_DISABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_PRINTING_DISABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for -/// printing -/// -inline fapi2::ReturnCode mcbist_printing_disable(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, - uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_PRINTING_DISABLE, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_PRINTING_DISABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DATA_ENABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for enabling -/// data -/// -inline fapi2::ReturnCode mcbist_data_enable(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DATA_ENABLE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DATA_ENABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DATA_ENABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for enabling -/// data -/// -inline fapi2::ReturnCode mcbist_data_enable(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DATA_ENABLE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DATA_ENABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DATA_ENABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for enabling -/// data -/// -inline fapi2::ReturnCode mcbist_data_enable(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DATA_ENABLE, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DATA_ENABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_USER_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for rank -/// selection -/// -inline fapi2::ReturnCode mcbist_user_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_USER_RANK, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_USER_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_USER_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for rank -/// selection -/// -inline fapi2::ReturnCode mcbist_user_rank(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_USER_RANK, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_USER_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_USER_RANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for rank -/// selection -/// -inline fapi2::ReturnCode mcbist_user_rank(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_USER_RANK, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_USER_RANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_USER_BANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for bank -/// selection -/// -inline fapi2::ReturnCode mcbist_user_bank(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_USER_BANK, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_USER_BANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_USER_BANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for bank -/// selection -/// -inline fapi2::ReturnCode mcbist_user_bank(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_USER_BANK, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_USER_BANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_USER_BANK getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note MCBIST support for bank -/// selection -/// -inline fapi2::ReturnCode mcbist_user_bank(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_USER_BANK, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_USER_BANK: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// /// @brief ATTR_SCHMOO_MULTIPLE_SETUP_CALL getter /// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> /// @param[out] ref to the value uint8_t @@ -16950,241 +15101,6 @@ fapi_try_exit: } /// -/// @brief ATTR_MCBIST_RANDOM_SEED_VALUE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls the MCBIST engine in the centaur chip. The value will be set in -/// mss_eff_config_shmoo. -/// -inline fapi2::ReturnCode mcbist_random_seed_value(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, - uint32_t& o_value) -{ - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANDOM_SEED_VALUE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANDOM_SEED_VALUE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANDOM_SEED_VALUE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint32_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls the MCBIST engine in the centaur chip. The value will be set in -/// mss_eff_config_shmoo. -/// -inline fapi2::ReturnCode mcbist_random_seed_value(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - uint32_t& o_value) -{ - uint32_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANDOM_SEED_VALUE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANDOM_SEED_VALUE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANDOM_SEED_VALUE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint32_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls the MCBIST engine in the centaur chip. The value will be set in -/// mss_eff_config_shmoo. -/// -inline fapi2::ReturnCode mcbist_random_seed_value(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, - uint32_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint32_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANDOM_SEED_VALUE, i_target, l_value) ); - memcpy(o_array, &l_value, 8); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANDOM_SEED_VALUE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANDOM_SEED_TYPE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls the MCBIST engine in the centaur chip. The value will be set in -/// mss_eff_config_shmoo. -/// -inline fapi2::ReturnCode mcbist_random_seed_type(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANDOM_SEED_TYPE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANDOM_SEED_TYPE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANDOM_SEED_TYPE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls the MCBIST engine in the centaur chip. The value will be set in -/// mss_eff_config_shmoo. -/// -inline fapi2::ReturnCode mcbist_random_seed_type(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANDOM_SEED_TYPE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANDOM_SEED_TYPE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_RANDOM_SEED_TYPE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls the MCBIST engine in the centaur chip. The value will be set in -/// mss_eff_config_shmoo. -/// -inline fapi2::ReturnCode mcbist_random_seed_type(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, - uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_RANDOM_SEED_TYPE, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_RANDOM_SEED_TYPE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DDR4_PDA_ENABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls PDA train enable or PBA. 00 - Disable; 01 - PDA; 02 - -/// PBA(Lrdimm) -/// -inline fapi2::ReturnCode mcbist_ddr4_pda_enable(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, uint8_t& o_value) -{ - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DDR4_PDA_ENABLE, i_target.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(i_target)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DDR4_PDA_ENABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DDR4_PDA_ENABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_DIMM> -/// @param[out] ref to the value uint8_t -/// @note Generated by gen_accessors.pl generateParameters (D.1) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls PDA train enable or PBA. 00 - Disable; 01 - PDA; 02 - -/// PBA(Lrdimm) -/// -inline fapi2::ReturnCode mcbist_ddr4_pda_enable(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, - uint8_t& o_value) -{ - uint8_t l_value[2]; - auto l_mca = i_target.getParent<fapi2::TARGET_TYPE_MCA>(); - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DDR4_PDA_ENABLE, l_mca.getParent<fapi2::TARGET_TYPE_MCS>(), l_value) ); - o_value = l_value[mss::index(l_mca)]; - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DDR4_PDA_ENABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// -/// @brief ATTR_MCBIST_DDR4_PDA_ENABLE getter -/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCS> -/// @param[out] uint8_t* memory to store the value -/// @note Generated by gen_accessors.pl generateParameters (E) -/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note Controls PDA train enable or PBA. 00 - Disable; 01 - PDA; 02 - -/// PBA(Lrdimm) -/// -inline fapi2::ReturnCode mcbist_ddr4_pda_enable(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target, uint8_t* o_array) -{ - if (o_array == nullptr) - { - FAPI_ERR("nullptr passed to attribute accessor %s", __func__); - return fapi2::FAPI2_RC_INVALID_PARAMETER; - } - - uint8_t l_value[2]; - - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MCBIST_DDR4_PDA_ENABLE, i_target, l_value) ); - memcpy(o_array, &l_value, 2); - return fapi2::current_err; - -fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MCBIST_DDR4_PDA_ENABLE: 0x%lx (target: %s)", - uint64_t(fapi2::current_err), mss::c_str(i_target)); - return fapi2::current_err; -} - -/// /// @brief ATTR_MSS_EFF_VPD_VERSION getter /// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_MCA> /// @param[out] ref to the value uint32_t 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 cf2c5a142..569461574 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 @@ -80,6 +80,7 @@ enum times DELAY_100NS = 100, ///< general purpose 100 ns delay for HW mode DELAY_1US = 1000, ///< general purpose 1 usec delay for HW mode DELAY_100US = 100000, ///< general purpose 100 usec delay for HW mode + DELAY_1MS = 1000000, ///< general purpose 1 ms delay for HW mode // From the DDR4spec 2400 speed - need to be changed to read attributes. BRS tWLO = 10, 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 8555d5f00..dd406966e 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 @@ -45,19 +45,10 @@ extern "C" /// fapi2::ReturnCode p9_mss_draminit_mc( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target ) { - auto l_mca = i_target.getChildren<TARGET_TYPE_MCA>(); - FAPI_INF("Start draminit MC"); - // If we don't have any ports, lets go. - if (l_mca.size() == 0) - { - FAPI_INF("No ports? %s", mss::c_str(i_target)); - return fapi2::FAPI2_RC_SUCCESS; - } - - // While we're doing the scominit in here, lets do it for all ports before we dump the MCS regs. - for (auto p : i_target.getChildren<TARGET_TYPE_MCA>()) + // No need to check to see if we have ports - this loop will just be skipped + for (const auto& p : i_target.getChildren<TARGET_TYPE_MCA>()) { mss::mc<TARGET_TYPE_MCS> l_mc; @@ -68,10 +59,6 @@ extern "C" #endif // Setup the MC port/dimm address translation registers FAPI_TRY( l_mc.setup_xlate_map(p) ); - } - - for (auto p : l_mca) - { // Setup the read_pointer_delay // TK: Do we need to do this in general or is this a place holder until the @@ -115,86 +102,6 @@ extern "C" FAPI_TRY( mss::enable_read_ecc(p) ); // At this point the DDR interface must be monitored for memory errors. Memory related FIRs should be unmasked. - - // Cram a fast write, followed by a read in here for giggles - { - mss::mcbist::program<TARGET_TYPE_MCBIST> l_program; - uint64_t l_start = 0; - uint64_t l_end = 0; - uint64_t l_pattern = 0; - - // Write - { - // Uses address register set 0 - 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)); - - // Run in ECC mode - - // HACK: We only need to worry about the DIMM in slot 0 right now - l_fw_subtest.enable_dimm(0); - l_program.iv_subtests.push_back(l_fw_subtest); - } - - // Read - { - // Uses address register set 0 - 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)); - - // Run in ECC mode - - // HACK: We only need to worry about the DIMM in slot 0 right now - l_fr_subtest.enable_dimm(0); - l_program.iv_subtests.push_back(l_fr_subtest); - } - - FAPI_TRY( mss::mcbist_start_addr(p, l_start) ); - FAPI_TRY( mss::mcbist_end_addr(p, l_end) ); - - // TK: calculate proper polling based on address range - - // Setup a nice pattern for writing - FAPI_TRY( mss::mcbist_write_data(i_target, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD0Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD1Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD2Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD3Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD4Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD5Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD6Q, l_pattern) ); - FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD7Q, l_pattern) ); - - // Sanity check - can't do much if end is before start. - // This is either a programming error or a mistake in attribute settings. So we'll just assert. - if (l_end < l_start) - { - FAPI_ERR("mcbist end address is less than mcbist starting address. s: 0x%x e: 0x%x", l_start, l_end); - fapi2::Assert(false); - } - - // By default we're in maint address mode so we do a start + len and the 'BIST increments for us. - // By default, the write subtest uses the 0'th address start/end registers. - mss::mcbist::config_address_range0(i_target, l_start, l_end - l_start); - - // Setup the polling based on a heuristic <cough>guess</cough> - // Looks like 20ns per address for a write/read program, and add a long number of polls - l_program.iv_poll.iv_initial_delay = (l_end - l_start) * 2 * mss::DELAY_10NS; - l_program.iv_poll.iv_initial_sim_delay = - mss::cycles_to_simcycles(mss::ns_to_cycles(i_target, l_program.iv_poll.iv_initial_delay)); - l_program.iv_poll.iv_poll_count = 100; - - // Just one port for now. Per Shelton we need to set this in maint adress 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: 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 47fb236a9..85a221a37 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 @@ -30,7 +30,14 @@ #include <fapi2.H> #include <p9_mss_scrub.H> +#include <lib/dimm/rank.H> +#include <lib/mcbist/address.H> +#include <lib/mcbist/mcbist.H> +#include <lib/dimm/kind.H> + using fapi2::TARGET_TYPE_MCBIST; +using fapi2::TARGET_TYPE_MCA; +using fapi2::TARGET_TYPE_SYSTEM; using fapi2::FAPI2_RC_SUCCESS; /// @@ -41,6 +48,107 @@ using fapi2::FAPI2_RC_SUCCESS; fapi2::ReturnCode p9_mss_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target ) { FAPI_INF("Start mss scrub"); + + // If we're running in the simulator, we want to only touch the addresses which training touched + uint8_t is_sim = 0; + FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_IS_SIMULATION, fapi2::Target<TARGET_TYPE_SYSTEM>(), is_sim) ); + + for (const auto& p : i_target.getChildren<TARGET_TYPE_MCA>()) + { + std::vector<uint64_t> l_pr; + mss::mcbist::program<TARGET_TYPE_MCBIST> l_program; + + // 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::primary_ranks(p, l_pr) ); + + for (const auto& r : l_pr) + { + mss::mcbist::address l_start; + mss::mcbist::address l_end; + + // Setup l_start to represent this rank, and then make the end address from that. + l_start.set_master_rank(r); + + // l_end starts like as the max as we want to scrub the entire thing. If we're in sim, + // we'll wratchet that back. + l_start.get_range<mss::mcbist::address::MRANK>(l_end); + + if (is_sim) + { + l_start.get_range<mss::mcbist::address::COL>(l_end); + // Set C3 bit to get an entire cache line + l_end.set_field<mss::mcbist::address::COL>(0b1000000); + } + + // 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, r); + + // 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(r); + l_fw_subtest.enable_dimm(mss::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::get_dimm_from_rank(r)); + } + + // Read + { + // 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(r); + l_fr_subtest.enable_dimm(mss::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::get_dimm_from_rank(r)); + } + } + + // Write 0's + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD0Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD1Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD2Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD3Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD4Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD5Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD6Q, 0) ); + FAPI_TRY( mss::putScom(i_target, MCBIST_MCBFD7Q, 0) ); + + // Setup the sim polling based on a heuristic <cough>guess</cough> + // Looks like ~250ck per address for a write/read program on the sim-dimm, and add a long number of polls + // and a 64x fudge factor. Testing shows this takes about 50 or so poll loops to complete, which is ok + l_program.iv_poll.iv_initial_sim_delay = mss::cycles_to_simcycles((64 * l_pr.size()) * 250); + l_program.iv_poll.iv_delay = 200; + + // On real hardware wait 100ms and then start polling for another 5s + l_program.iv_poll.iv_initial_delay = 100 * mss::DELAY_1MS; + 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 mss scrub"); - return FAPI2_RC_SUCCESS; + return fapi2::current_err; } diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.mk b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.mk index fbdb90b95..9b6609c5a 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.mk +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scrub.mk @@ -7,7 +7,7 @@ # # EKB Project # -# COPYRIGHT 2015 +# COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # @@ -17,5 +17,10 @@ # # IBM_PROLOG_END_TAG +# Include the macros and things for MSS procedures +-include 00common.mk + PROCEDURE=p9_mss_scrub +$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE))) $(call BUILD_PROCEDURE) + |