Skip to content

Commit 320f69f

Browse files
brs332dcrowell77
authored andcommitted
Change memdiags interfaces for PRD
Both of the current sf_read() APIs can now be combined into one API: The i_end parameter is no longer needed. The command should always stop at the end of the slave rank on error, unless the workaround is place. In which case, the command should stop immediately on error. The i_address parameter will be optional. By default the start address will be the first address of the first port (or all port in broadcast mode). Otherwise, start on the address given. For the targeted_scrub() API: A new parameter will be added to specify if the command should be run on a slave rank boundary or a master rank boundary. The i_end parameter will need to default to not stop on error. Otherwise, PRD will input to stop immediately when necessary. Change-Id: If5d87af93aed8732277f8f769ae4d090b2bfea4f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32335 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-by: JACOB L. HARVEY <jlharvey@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32339 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
1 parent 23101c4 commit 320f69f

File tree

3 files changed

+39
-75
lines changed

3 files changed

+39
-75
lines changed

src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C

Lines changed: 22 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@ fapi2::ReturnCode operation<TARGET_TYPE_MCBIST>::single_port_init()
225225
}
226226

227227
// The address should have the port and DIMM noted in it. All we need to do is calculate the
228-
// remainder of the address, assuming the caller didn't setup an end address already.
229-
// *INDENT-OFF*
230-
if (iv_const.iv_end_address == 0)
228+
// remainder of the address
229+
if (iv_is_sim)
231230
{
232-
iv_is_sim ?
233-
iv_const.iv_start_address.get_sim_end_address(iv_const.iv_end_address) :
234-
iv_const.iv_start_address.get_range<mss::mcbist::address::DIMM>(iv_const.iv_end_address);
231+
iv_const.iv_start_address.get_sim_end_address(iv_const.iv_end_address);
232+
}
233+
else if (iv_const.iv_end_address == 0)
234+
{
235+
iv_const.iv_start_address.get_range<mss::mcbist::address::DIMM>(iv_const.iv_end_address);
235236
}
236-
// *INDENT-ON*
237237

238238
// Configure the address range
239239
FAPI_TRY( mss::mcbist::config_address_range0(iv_target, iv_const.iv_start_address, iv_const.iv_end_address) );
@@ -426,52 +426,26 @@ fapi_try_exit:
426426
return fapi2::current_err;
427427
}
428428

429-
///
430-
/// @brief Super Fast Read All - used to run superfast read on all memory behind the target
431-
/// @note Uses broadcast mode if possible
432-
/// @param[in] i_target the target behind which all memory should be read
433-
/// @param[in] i_stop stop conditions
434-
/// @param[in] i_end whether to end, and where - defaults to immediate (stop after failed address)
435-
/// @return FAPI2_RC_SUCCESS iff everything ok
436-
/// @note The function is asynchronous, and the caller should be looking for a done attention
437-
///
438-
template<>
439-
fapi2::ReturnCode sf_read( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
440-
const stop_conditions& i_stop,
441-
const end_boundary i_end )
442-
{
443-
FAPI_INF("superfast read start");
444-
445-
fapi2::ReturnCode l_rc;
446-
constraints l_const(i_stop, speed::LUDICROUS, i_end, mss::mcbist::address());
447-
sf_read_operation<TARGET_TYPE_MCBIST> l_read_op(i_target, l_const, l_rc);
448-
449-
FAPI_ASSERT( l_rc == FAPI2_RC_SUCCESS,
450-
fapi2::MSS_MEMDIAGS_SUPERFAST_READ_FAILED_TO_INIT().set_TARGET(i_target),
451-
"Unable to initialize the MCBIST engine for a sf read %s", mss::c_str(i_target) );
452-
453-
return l_read_op.execute();
454-
455-
fapi_try_exit:
456-
return fapi2::current_err;
457-
}
458-
459429
///
460430
/// @brief Super Fast Read to End of Port - used to run superfast read on all memory behind the target
431+
/// @tparam T the fapi2::TargetType of the target
461432
/// @param[in] i_target the target behind which all memory should be read
462433
/// @param[in] i_stop stop conditions
463-
/// @param[in] i_address mcbist::address representing the port, dimm, rank
464-
/// @param[in] i_end whether to end, and where - defaults to immediate (stop after failed address)
434+
/// @param[in] i_address mcbist::address representing the address from which to start.
435+
// Defaults to the first address behind the target
436+
/// @param[in] i_end whether to end, and where
437+
/// Defaults to stop after slave rank
465438
/// @return FAPI2_RC_SUCCESS iff everything ok
466439
/// @note The function is asynchronous, and the caller should be looking for a done attention
440+
/// @note The address is often the port, dimm, rank but this is not enforced in the API.
467441
///
468442
template<>
469443
fapi2::ReturnCode sf_read( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
470444
const stop_conditions& i_stop,
471445
const mss::mcbist::address& i_address,
472-
const end_boundary i_end )
446+
const end_boundary i_end)
473447
{
474-
FAPI_INF("superfast read - end of port");
448+
FAPI_INF("superfast read - start");
475449

476450
fapi2::ReturnCode l_rc;
477451
constraints l_const(i_stop, speed::LUDICROUS, i_end, i_address);
@@ -523,29 +497,24 @@ fapi_try_exit:
523497
/// @brief Scrub - targeted scrub all memory behind the target
524498
/// @param[in] i_target the target behind which all memory should be scrubbed
525499
/// @param[in] i_stop stop conditions
526-
/// @param[in] i_speed the speed to scrub
527-
/// @param[in] i_address mcbist::address representing the port, dimm, rank
528-
/// @param[in] i_end whether to end, and where
500+
/// @param[in] i_start_address mcbist::address representing the address from which to start.
501+
/// @param[in] i_end_address mcbist::address representing the address at which to end.
502+
/// @param[in] i_end whether to end, and where (defaults to not stop on error)
529503
/// @return FAPI2_RC_SUCCESS iff everything ok
530504
/// @note The function is asynchronous, and the caller should be looking for a done attention
505+
/// @note The caller can use the address range functions to calculate the end address as needed
531506
///
532507
template<>
533508
fapi2::ReturnCode targeted_scrub( const fapi2::Target<TARGET_TYPE_MCBIST>& i_target,
534509
const stop_conditions& i_stop,
535-
const speed i_speed,
536-
const mss::mcbist::address& i_address,
510+
const mss::mcbist::address& i_start_address,
511+
const mss::mcbist::address& i_end_address,
537512
const end_boundary i_end )
538513
{
539514
FAPI_INF("targeted scrub");
540515

541-
if (i_end == end_boundary::NONE)
542-
{
543-
FAPI_ERR("targeted scrub must have end boundaries");
544-
return FAPI2_RC_INVALID_PARAMETER;
545-
}
546-
547516
fapi2::ReturnCode l_rc;
548-
constraints l_const(i_stop, i_speed, i_end, i_address);
517+
constraints l_const(i_stop, speed::LUDICROUS, i_end, i_start_address, i_end_address);
549518
targeted_scrub_operation<TARGET_TYPE_MCBIST> l_op(i_target, l_const, l_rc);
550519

551520
FAPI_ASSERT( l_rc == FAPI2_RC_SUCCESS,

src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.H

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -318,35 +318,24 @@ fapi2::ReturnCode sf_init( const fapi2::Target<T>& i_target,
318318
const uint64_t i_pattern = PATTERN_0 );
319319

320320
///
321-
/// @brief Super Fast Read All - used to run superfast read on all memory behind the target
322-
/// @note Uses broadcast mode if possible
323-
/// @param[in] i_target the target behind which all memory should be read
324-
/// @param[in] i_stop stop conditions
325-
/// @param[in] i_end whether to end, and where - defaults to stop after slave rank
326-
/// @return FAPI2_RC_SUCCESS iff everything ok
327-
/// @note The function is asynchronous, and the caller should be looking for a done attention
328-
///
329-
template< fapi2::TargetType T >
330-
fapi2::ReturnCode sf_read( const fapi2::Target<T>& i_target,
331-
const stop_conditions& i_stop,
332-
const end_boundary i_end = end_boundary::STOP_AFTER_SLAVE_RANK );
333-
334-
///
335-
/// @brief Super Fast Read to End of Port - used to run superfast read on all memory behind the target
321+
/// @brief Super Fast Read - used to run superfast read on all memory behind the target
322+
/// Determines ability to braodcast to all ports behind a target, does so if possible.
336323
/// @tparam T the fapi2::TargetType of the target
337324
/// @param[in] i_target the target behind which all memory should be read
338325
/// @param[in] i_stop stop conditions
339326
/// @param[in] i_address mcbist::address representing the address from which to start.
340-
/// @param[in] i_end whether to end, and where - defaults to immediate (stop after failed address)
327+
// Defaults to the first address behind the target
328+
/// @param[in] i_end whether to end, and where
329+
/// Defaults to stop after slave rank
341330
/// @return FAPI2_RC_SUCCESS iff everything ok
342331
/// @note The function is asynchronous, and the caller should be looking for a done attention
343332
/// @note The address is often the port, dimm, rank but this is not enforced in the API.
344333
///
345334
template< fapi2::TargetType T >
346335
fapi2::ReturnCode sf_read( const fapi2::Target<T>& i_target,
347336
const stop_conditions& i_stop,
348-
const mss::mcbist::address& i_address,
349-
const end_boundary i_end = end_boundary::STOP_AFTER_ADDRESS );
337+
const mss::mcbist::address& i_address = mss::mcbist::address(),
338+
const end_boundary i_end = end_boundary::STOP_AFTER_SLAVE_RANK );
350339

351340
///
352341
/// @brief Scrub - continuous scrub all memory behind the target
@@ -369,7 +358,8 @@ fapi2::ReturnCode background_scrub( const fapi2::Target<T>& i_target,
369358
/// @param[in] i_target the target behind which all memory should be scrubbed
370359
/// @param[in] i_stop stop conditions
371360
/// @param[in] i_speed the speed to scrub
372-
/// @param[in] i_address mcbist::address representing the address from which to start.
361+
/// @param[in] i_start_address mcbist::address representing the address from which to start.
362+
/// @param[in] i_end_address mcbist::address representing the address at which to end.
373363
/// @param[in] i_end whether to end, and where
374364
/// @return FAPI2_RC_SUCCESS iff everything ok
375365
/// @note The function is asynchronous, and the caller should be looking for a done attention
@@ -378,8 +368,8 @@ fapi2::ReturnCode background_scrub( const fapi2::Target<T>& i_target,
378368
template< fapi2::TargetType T >
379369
fapi2::ReturnCode targeted_scrub( const fapi2::Target<T>& i_target,
380370
const stop_conditions& i_stop,
381-
const speed i_speed,
382-
const mss::mcbist::address& i_address,
371+
const mss::mcbist::address& i_start_address,
372+
const mss::mcbist::address& i_end_address,
383373
const end_boundary i_end );
384374

385375
///

src/import/chips/p9/procedures/hwp/memory/lib/mcbist/settings.H

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,16 +755,21 @@ struct constraints
755755
///
756756
/// @brief constraints constructor
757757
/// @param[in] i_stop stop conditions
758+
/// @param[in] i_speed the speed at which to run
759+
/// @param[in] i_end_boundary the place to stop on error
758760
/// @param[in] i_start_address address to start from
761+
/// @param[in] i_end_address address to end at (optional, run to end)
759762
///
760763
constraints( const stop_conditions& i_stop,
761764
const speed i_speed,
762765
const end_boundary i_end_boundary,
763-
const address& i_start_address ):
766+
const address& i_start_address,
767+
const address& i_end_address = mcbist::address(0) ):
764768
constraints(i_stop, i_start_address)
765769
{
766770
iv_end_boundary = i_end_boundary;
767771
iv_speed = i_speed;
772+
iv_end_address = i_end_address;
768773
FAPI_INF("setting up constraints with end boundary %d and speed 0x%x", i_end_boundary, i_speed);
769774
}
770775

0 commit comments

Comments
 (0)