Skip to content

Commit

Permalink
L3 mss_memdiags
Browse files Browse the repository at this point in the history
Change-Id: Ic86bf80983e9ac5f79f527a4590cb435e2b8deeb
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42432
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42530
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
  • Loading branch information
JacobHarvey authored and sannerd committed Jul 12, 2017
1 parent 545eb2e commit da9dcab
Show file tree
Hide file tree
Showing 28 changed files with 340 additions and 123 deletions.
5 changes: 3 additions & 2 deletions src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc.H
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// @brief Top level API for MSS ECC
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#ifndef _MSS_ECC_H_
Expand Down Expand Up @@ -521,6 +521,7 @@ inline fapi2::ReturnCode get_per_symbol_error_counts( const fapi2::Target<T>& i_
{
fapi2::buffer<uint64_t> l_buffer;
uint64_t l_count = 0;
o_error_counts.clear();

for (uint64_t l_index = 0; l_index < TT::NUM_MBSSYM_REGS; ++l_index)
{
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 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -28,9 +28,9 @@
/// @brief Traits class for the MC ECC syndrome registers
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#include <fapi2.H>
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 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -28,7 +28,7 @@
/// @brief Traits class for the MC ECC syndrome registers
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Consumed by: FSP:HB
Expand Down
36 changes: 32 additions & 4 deletions src/import/chips/p9/procedures/hwp/memory/lib/ecc/fw_mark_store.H
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// @brief Subroutines for the MC firmware mark store registers
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#ifndef _MSS_FW_MARK_STORE_H_
Expand All @@ -51,12 +51,18 @@ namespace ecc
namespace fwms
{

///
/// @brief chip mark type enums
///
enum mark_type
{
SYMBOL = 1,
CHIP = 0
};

///
/// @brief Chip Mark Region. Used for region field values in the FWMS regs
///
enum mark_region
{
DISABLED = 0b000,
Expand Down Expand Up @@ -232,8 +238,19 @@ inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target,
return ( read_rank7(i_target, o_data) );

default:
return fapi2::FAPI2_RC_INVALID_PARAMETER;
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK_PASSED()
.set_RANK(i_rank)
.set_TARGET(i_target)
.set_FUNCTION(FWMS_READ),
"%s Invalid rank passed to fwms::ecc::read (%d)",
mss::c_str(i_target),
i_rank);
}

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand Down Expand Up @@ -399,8 +416,19 @@ inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target,
return ( write_rank7(i_target, i_data) );

default:
return fapi2::FAPI2_RC_INVALID_PARAMETER;
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK_PASSED()
.set_RANK(i_rank)
.set_TARGET(i_target)
.set_FUNCTION(FWMS_WRITE),
"%s Invalid rank passed to fwms::ecc::write (%d)",
mss::c_str(i_target),
i_rank);
}

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand Down
64 changes: 38 additions & 26 deletions src/import/chips/p9/procedures/hwp/memory/lib/ecc/galois.H
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// @brief Translate ECC mark Galois codes to symbol and DQ
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: HB:FSP

#ifndef _MSS_ECC_GALOIS_H_
Expand All @@ -57,14 +57,17 @@ fapi2::ReturnCode galois_to_symbol( const uint8_t i_galois, uint8_t& o_symbol )
{
const auto& l_p = std::find(TT::symbol2galois, (TT::symbol2galois + MAX_DQ_BITS), i_galois);

if (l_p == (TT::symbol2galois + MAX_DQ_BITS))
{
FAPI_ERR("galois_to_symbol: invalid Galois code: 0x%02x", i_galois);
return fapi2::FAPI2_RC_INVALID_PARAMETER;
}
FAPI_ASSERT( l_p != (TT::symbol2galois + MAX_DQ_BITS),
fapi2::MSS_INVALID_GALOIS_TO_SYMBOL()
.set_GALOIS(i_galois),
"Invalid Galois code: 0x%02x",
i_galois);

o_symbol = (l_p - TT::symbol2galois);

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand All @@ -78,14 +81,17 @@ fapi2::ReturnCode galois_to_symbol( const uint8_t i_galois, uint8_t& o_symbol )
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
fapi2::ReturnCode symbol_to_galois( const uint8_t i_symbol, uint8_t& o_galois )
{
if (i_symbol >= MAX_DQ_BITS)
{
FAPI_ERR("symbol_to_galois: invalid symbol: %d", i_symbol);
return fapi2::FAPI2_RC_INVALID_PARAMETER;
}
FAPI_ASSERT( i_symbol < MAX_DQ_BITS,
fapi2::MSS_INVALID_SYMBOL_FOR_GALOIS()
.set_SYMBOL(i_symbol),
"Invalid symbol: %d",
i_symbol);

o_galois = TT::symbol2galois[i_symbol];

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand All @@ -101,14 +107,17 @@ fapi2::ReturnCode dq_to_symbol( const uint8_t i_dq, uint8_t& o_symbol )
{
const auto& l_p = std::find(TT::symbol2dq, (TT::symbol2dq + MAX_DQ_BITS), i_dq);

if (l_p == (TT::symbol2dq + MAX_DQ_BITS))
{
FAPI_ERR("dq_to_symbol: invalid DQ index: %d", i_dq);
return fapi2::FAPI2_RC_INVALID_PARAMETER;
}
FAPI_ASSERT( l_p != (TT::symbol2dq + MAX_DQ_BITS),
fapi2::MSS_INVALID_DQ_TO_SYMBOL()
.set_DQ(i_dq),
"Invalid DQ index: %d",
i_dq);

o_symbol = (l_p - TT::symbol2dq);

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand All @@ -122,14 +131,17 @@ fapi2::ReturnCode dq_to_symbol( const uint8_t i_dq, uint8_t& o_symbol )
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
fapi2::ReturnCode symbol_to_dq( const uint8_t i_symbol, uint8_t& o_dq )
{
if (i_symbol >= MAX_DQ_BITS)
{
FAPI_ERR("symbol_to_dq: invalid symbol: %d", i_symbol);
return fapi2::FAPI2_RC_INVALID_PARAMETER;
}
FAPI_ASSERT( i_symbol < MAX_DQ_BITS,
fapi2::MSS_INVALID_SYMBOL_TO_DQ()
.set_SYMBOL(i_symbol),
"symbol_to_dq: invalid symbol: %d",
i_symbol);

o_dq = TT::symbol2dq[i_symbol];

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand All @@ -145,8 +157,8 @@ fapi2::ReturnCode galois_to_dq( const uint8_t i_galois, uint8_t& o_dq )
{
uint8_t l_symbol = 0;

FAPI_TRY( galois_to_symbol<T>(i_galois, l_symbol) );
FAPI_TRY( symbol_to_dq<T>(l_symbol, o_dq) );
FAPI_TRY( galois_to_symbol<T>(i_galois, l_symbol), "Failed galois_to_symbol");
FAPI_TRY( symbol_to_dq<T>(l_symbol, o_dq), "Failed symbol_to_dq" );

fapi_try_exit:
return fapi2::current_err;
Expand All @@ -165,8 +177,8 @@ fapi2::ReturnCode dq_to_galois( const uint8_t i_dq, uint8_t& o_galois )
{
uint8_t l_symbol = 0;

FAPI_TRY( mss::ecc::dq_to_symbol<T>(i_dq, l_symbol) );
FAPI_TRY( mss::ecc::symbol_to_galois<T>(l_symbol, o_galois) );
FAPI_TRY( mss::ecc::dq_to_symbol<T>(i_dq, l_symbol), "Failed dq_to_symbol");
FAPI_TRY( mss::ecc::symbol_to_galois<T>(l_symbol, o_galois) , "Failed symbol_to_galois" );

fapi_try_exit:
return fapi2::current_err;
Expand Down
31 changes: 27 additions & 4 deletions src/import/chips/p9/procedures/hwp/memory/lib/ecc/hw_mark_store.H
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// @brief Subroutines for the MC hardware mark store registers
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#ifndef _MSS_HW_MARK_STORE_H_
Expand All @@ -39,6 +39,7 @@
#include <fapi2.H>
#include <lib/ecc/ecc_traits.H>
#include <generic/memory/lib/utils/scom.H>
#include <lib/shared/mss_const.H>

namespace mss
{
Expand Down Expand Up @@ -212,8 +213,19 @@ inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target,
return ( read_rank7(i_target, o_data) );

default:
return fapi2::FAPI2_RC_INVALID_PARAMETER;
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK_PASSED()
.set_RANK(i_rank)
.set_TARGET(i_target)
.set_FUNCTION(HWMS_READ),
"%s Invalid rank passed to fwms::ecc::hwms::read (%d)",
mss::c_str(i_target),
i_rank);
}

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand Down Expand Up @@ -379,8 +391,19 @@ inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target,
return ( write_rank7(i_target, i_data) );

default:
return fapi2::FAPI2_RC_INVALID_PARAMETER;
FAPI_ASSERT( false,
fapi2::MSS_INVALID_RANK_PASSED()
.set_RANK(i_rank)
.set_TARGET(i_target)
.set_FUNCTION(HWMS_WRITE),
"%s Invalid rank passed to fwms::ecc::hwms::write(%d)",
mss::c_str(i_target),
i_rank);
}

return fapi2::FAPI2_RC_SUCCESS;
fapi_try_exit:
return fapi2::current_err;
}

///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// @brief Subroutines for the MC mainline aue address trap registers (MBAUER*Q)
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#ifndef _MSS_MAINLINE_AUE_TRAP_H_
Expand Down Expand Up @@ -66,7 +66,7 @@ inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<u
const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);

FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_AUE_REGS[l_port]), o_data) );
FAPI_INF("read: 0x%016lx", o_data);
FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
fapi_try_exit:
return fapi2::current_err;
}
Expand All @@ -86,7 +86,7 @@ inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::b
const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);

FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_AUE_REGS[l_port]), i_data) );
FAPI_INF("write: 0x%016lx", i_data);
FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
fapi_try_exit:
return fapi2::current_err;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/// @brief Subroutines for the MC mainline mpe address trap registers (MBNCER*Q)
///
// *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Level: 3
// *HWP Consumed by: FSP:HB

#ifndef _MSS_MAINLINE_MPE_TRAP_H_
Expand Down Expand Up @@ -66,7 +66,7 @@ inline fapi2::ReturnCode read( const fapi2::Target<T>& i_target, fapi2::buffer<u
const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);

FAPI_TRY( mss::getScom(l_mcbist_target, (TT::MAINLINE_MPE_REGS[l_port]), o_data) );
FAPI_INF("read: 0x%016lx", o_data);
FAPI_INF("%s read: 0x%016lx", mss::c_str(i_target), o_data);
fapi_try_exit:
return fapi2::current_err;
}
Expand All @@ -86,7 +86,7 @@ inline fapi2::ReturnCode write( const fapi2::Target<T>& i_target, const fapi2::b
const auto& l_port = mss::relative_pos<fapi2::TARGET_TYPE_MCBIST>(i_target);

FAPI_TRY( mss::putScom(l_mcbist_target, (TT::MAINLINE_MPE_REGS[l_port]), i_data) );
FAPI_INF("write: 0x%016lx", i_data);
FAPI_INF("%s write: 0x%016lx", mss::c_str(i_target), i_data);
fapi_try_exit:
return fapi2::current_err;
}
Expand Down

0 comments on commit da9dcab

Please sign in to comment.