Skip to content

Commit

Permalink
Fixes memdiags broadcast mode address check bug
Browse files Browse the repository at this point in the history
Change-Id: Ibbbfd3490686f4c43daf9a2cbe06dd8c646f25fa
CQ:SW414722
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54036
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54120
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
aamarin authored and wghoffa committed Feb 28, 2018
1 parent 10aa31b commit 443282a
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ fapi2::ReturnCode check_dead_load( const fapi2::Target<fapi2::TARGET_TYPE_MCA>&
// Otherwise, we swap because our first guess was wrong
l_dead_dimm = ( l_found == l_functional_dimms.end() ) ? l_dead_dimm : l_plugged_dimms[1];
l_live_dimm = ( l_found == l_functional_dimms.end() ) ? l_live_dimm : l_plugged_dimms[0];

FAPI_ASSERT( false,
fapi2::MSS_DEAD_LOAD_ON_PORT()
.set_FUNCTIONAL_DIMM(l_live_dimm),
Expand All @@ -496,8 +497,6 @@ fapi_try_exit:
template<>
fapi2::ReturnCode check_dead_load( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target)
{
fapi2::ReturnCode l_rc(fapi2::current_err);

for (const auto& p : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target) )
{
FAPI_TRY( check_dead_load( p ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -309,7 +309,7 @@ class address
///
inline uint64_t get_dimm() const
{
return (get_field<DIMM>() == true ? 1 : 0);
return get_field<DIMM>();
}

///
Expand All @@ -336,7 +336,7 @@ class address
fapi2::buffer<uint64_t> l_value;

l_value.insertFromRight<PORT_START, PORT_LEN>(get_port());
l_value.writeBit<DIMM_BIT>(get_field<DIMM>());
l_value.writeBit<DIMM_BIT>(get_dimm());

return l_value;
}
Expand Down
5 changes: 3 additions & 2 deletions src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,12 @@ inline subtest_t<T> write_subtest()
// - Don't need to set up anything for LFSRs
// 9:11 = 000 - Fixed data mode

// 14:15 = 0 address select config registers 0

// 12 = 1 - ecc
// By default we want to turn on ECC. Caller can turn it off.
l_subtest.change_ecc_mode(mss::ON);

// 14:15 = 0 address select config registers 0

return l_subtest;
}

Expand Down
264 changes: 184 additions & 80 deletions src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C

Large diffs are not rendered by default.

31 changes: 26 additions & 5 deletions src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -111,7 +111,7 @@ class operation
iv_subtest(i_subtest),
iv_const(i_const)
{
FAPI_TRY( mss::is_simulation (iv_l_sim) );
FAPI_TRY( mss::is_simulation (iv_sim) );
return;

fapi_try_exit:
Expand Down Expand Up @@ -197,7 +197,7 @@ class operation
mss::mcbist::subtest_t<T> iv_subtest;
constraints iv_const;
mss::mcbist::program<T> iv_program;
uint8_t iv_l_sim;
uint8_t iv_sim;
};

///
Expand All @@ -216,7 +216,7 @@ struct sf_init_operation : public operation<T>
///
sf_init_operation( const fapi2::Target<T>& i_target,
const constraints i_const,
fapi2::ReturnCode& o_rc ):
fapi2::ReturnCode& o_rc):
operation<T>(i_target, mss::mcbist::init_subtest<T>(), i_const)
{
// If sf_init was passed the random data pattern, then modify the subtest to use the true random data
Expand Down Expand Up @@ -248,7 +248,7 @@ struct sf_read_operation : public operation<T>
///
sf_read_operation( const fapi2::Target<T>& i_target,
const constraints i_const,
fapi2::ReturnCode& o_rc ):
fapi2::ReturnCode& o_rc):
operation<T>(i_target, mss::mcbist::read_subtest<T>(), i_const)
{
// We're a multi-port operation
Expand Down Expand Up @@ -349,6 +349,27 @@ template< fapi2::TargetType T >
fapi2::ReturnCode sf_init( const fapi2::Target<T>& i_target,
const uint64_t i_pattern = PATTERN_0 );

///
/// @brief Start address port dimm check - helper for testing
/// @param[in] i_targets a vector of MCA targets
/// @param[in] i_start_addr the starting port_dimm seelct address
/// @return FAPI2_RC_SUCCESS iff okay
///
fapi2::ReturnCode broadcast_mode_start_address_check_helper(
const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> >& i_targets,
const uint64_t i_start_addr);

///
/// @brief Start address port dimm check
/// @param[in] i_target the MCBIST target
/// @param[in] i_start_addr the starting address
/// @param[out] o_dimms DIMM(s) associated with the first valid MCA
/// @return FAPI2_RC_SUCCESS iff okay
///
fapi2::ReturnCode broadcast_mode_start_address_check(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
const uint64_t i_start_addr,
std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >& o_dimms);

///
/// @brief Super Fast Read - used to run superfast read on all memory behind the target
/// Determines ability to braodcast to all ports behind a target, does so if possible.
Expand Down
10 changes: 6 additions & 4 deletions src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -56,7 +56,7 @@ enum end_boundary : uint64_t
// We're gonna get a little hacky here. The pause on error mode field
// is two bits, with another bit representing slave/master. So we craft
// the enum so that we can insertFromRight and get the proper vaules, and
// leave on bit out of that two-bit range to represent master or slave
// leave one bit out of that two-bit range to represent master or slave
NONE = 0b000,
STOP_AFTER_ADDRESS = 0b001,
STOP_AFTER_MASTER_RANK = 0b010,
Expand Down Expand Up @@ -111,7 +111,7 @@ class stop_conditions
// Find the first bit set. This represents the largest power of 2 this input can represent
// The subtraction from 63 switches from a left-count to a right-count (e.g., 0 (left most
// bit) is really bit 63 if you start on the right.)
uint64_t l_largest = 63 - first_bit_set(i_value);
const uint64_t l_largest = 63 - first_bit_set(i_value);

// If the first bit set is off in space and greater than 2^14, we just return 0b1110
// Otherwise, l_largest is the droid we're looking for
Expand Down Expand Up @@ -706,7 +706,7 @@ class stop_conditions
struct constraints
{
///
/// @brief constraints constructor
/// @brief constraints default constructor
///
constraints():
iv_stop(),
Expand Down Expand Up @@ -771,6 +771,7 @@ struct constraints
iv_end_boundary = i_end_boundary;
iv_speed = i_speed;
iv_end_address = i_end_address;

FAPI_INF("setting up constraints with end boundary %d and speed 0x%x", i_end_boundary, i_speed);

// If our end address is 'before' our start address, make the end address the same as the start.
Expand All @@ -780,6 +781,7 @@ struct constraints
}
}

// Member variable declaration
stop_conditions iv_stop;
uint64_t iv_pattern;
end_boundary iv_end_boundary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2017 -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2018 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand Down Expand Up @@ -371,13 +371,24 @@
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_START_ADDR_BIGGER_THAN_END_ADDR</rc>
<description> Invalid address input. Starting address is larger than end address</description>
<ffdc>TARGET</ffdc>
<ffdc>START_ADDRESS</ffdc>
<ffdc>END_ADDRESS</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_MEMDIAGS_BCMODE_INVALID_ADDRESS</rc>
<description>An limited address scope was passed into memdiags that is not on the first port in broadcast mode</description>
<ffdc>MCA_TARGET</ffdc>
<ffdc>START_ADDRESS</ffdc>
<ffdc>MCA_START_ADDRESS</ffdc>
<ffdc>PATTERN</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
Expand Down

0 comments on commit 443282a

Please sign in to comment.