Skip to content

Commit

Permalink
Add trap_adress class in mcbist library
Browse files Browse the repository at this point in the history
Change-Id: I5f078adb708128629e9e0c4a776cc32387cf84c8
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77095
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77105
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: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
alvintpwang authored and crgeddes committed May 29, 2019
1 parent 8bde2e5 commit 03fc499
Show file tree
Hide file tree
Showing 34 changed files with 1,801 additions and 1,713 deletions.
Expand Up @@ -40,7 +40,7 @@
#include <generic/memory/lib/utils/poll.H>
#include <generic/memory/lib/utils/find.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/utils/mcbist/gen_patterns.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>

using fapi2::TARGET_TYPE_OCMB_CHIP;
using fapi2::TARGET_TYPE_SYSTEM;
Expand Down
Expand Up @@ -66,6 +66,28 @@ class eccTraits<fapi2::TARGET_TYPE_MEM_PORT>
{
FIRMWARE_MS_ADDRESS = EXPLR_RDF_FWMS0_ADDRESS,
FIRMWARE_MS_ADDRESS_LEN = EXPLR_RDF_FWMS0_ADDRESS_LEN,

// Address trap format
TRAP_ADDRESS_PORT = 0,
TRAP_ADDRESS_PORT_LEN = 0,
TRAP_ADDRESS_DIMM = 1,
TRAP_ADDRESS_DIMM_LEN = 1,
TRAP_ADDRESS_MRANK = 2,
TRAP_ADDRESS_MRANK_LEN = 2,
TRAP_ADDRESS_SRANK = 4,
TRAP_ADDRESS_SRANK_LEN = 3,
TRAP_ADDRESS_ROW = 7,
TRAP_ADDRESS_ROW_LEN = 18,
TRAP_ADDRESS_COL = 25,
// MCBIST address only need col(3 to 9) although address trap can provide col(2 to 9)
TRAP_ADDRESS_COL_LEN = 7,
TRAP_ADDRESS_BANK = 33,
TRAP_ADDRESS_BANK_LEN = 3,
TRAP_ADDRESS_BANK_GROUP = 36,
TRAP_ADDRESS_BANK_GROUP_LEN = 2,

TRAP_ADDRESS = 0,
TRAP_ADDRESS_LEN = 38,
};
};

Expand Down
Expand Up @@ -120,19 +120,19 @@ class portTraits< mss::mc_type::EXPLORER >
WRQ_FIFO_MODE = EXPLR_SRQ_MBA_WRQ0Q_CFG_WRQ_FIFO_MODE,
};
};

///
/// @brief ATTR_MSS_MEM_MVPD_FWMS getter
/// @param[in] const ref to the fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>
/// @param[out] uint32_t* memory to store the value
/// @note Generated by gen_accessors.pl generateParameters (G)
/// @param[in] const ref to the TARGET_TYPE_OCMB_CHIP
/// @param[out] uint32_t&[] array reference to store the value
/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
/// @note Mark store records from MPVD Lx
/// keyword
/// @note Mark store records from OCMB VPD. The array dimension is [port][mark]. Explorer
/// only has one port so only [0][mark] is used in explorer.
///
template<>
inline fapi2::ReturnCode mvpd_fwms< mss::mc_type::EXPLORER >(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>&
i_target,
uint32_t (&o_array)[mss::MARK_STORE_COUNT])
inline fapi2::ReturnCode mvpd_fwms< mss::mc_type::EXPLORER >(
const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
uint32_t (&o_array)[mss::MARK_STORE_COUNT])
{
return mss::attr::get_mvpd_fwms(i_target, o_array);
}
Expand All @@ -145,9 +145,9 @@ inline fapi2::ReturnCode mvpd_fwms< mss::mc_type::EXPLORER >(const fapi2::Target
/// queue
///
template< >
inline fapi2::ReturnCode reorder_queue_setting<mss::mc_type::EXPLORER>(const
fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
uint8_t& o_value)
inline fapi2::ReturnCode reorder_queue_setting<mss::mc_type::EXPLORER>(
const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
uint8_t& o_value)
{
return mss::attr::get_reorder_queue_setting(i_target, o_value);
}
Expand Down
Expand Up @@ -41,7 +41,7 @@
#include <lib/shared/exp_consts.H>
#include <lib/ecc/ecc_traits.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_traits.H>
#include <generic/memory/lib/utils/mcbist/gen_address.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H>


#endif
Expand Up @@ -48,8 +48,8 @@
#include <lib/mcbist/exp_mcbist_traits.H>
#include <generic/memory/lib/utils/poll.H>
#include <generic/memory/lib/utils/memory_size.H>
#include <generic/memory/lib/utils/mcbist/gen_patterns.H>
#include <generic/memory/lib/utils/mcbist/gen_settings.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_settings.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist.H>

// This file is still necessary to put traits and generic code together
Expand Down
Expand Up @@ -42,7 +42,7 @@
#include <explorer_scom_addresses_fld.H>

#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#include <generic/memory/lib/utils/mcbist/gen_address.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_traits.H>

namespace mss
Expand Down Expand Up @@ -78,7 +78,6 @@ class mcbistTraits< mss::mc_type::EXPLORER, fapi2::TARGET_TYPE_OCMB_CHIP>

// Multi-ports, dimms
static constexpr mss::states MULTI_PORTS = mss::states::NO;
static constexpr mss::states MULTI_DIMMS = mss::states::YES;

// Subtest
static constexpr size_t SUBTEST_PER_REG = 4;
Expand Down
Expand Up @@ -40,7 +40,7 @@
#include <lib/shared/exp_consts.H>
#include <lib/ecc/ecc_traits.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_traits.H>
#include <generic/memory/lib/utils/mcbist/gen_settings.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_settings.H>

// This file is still necessary to put traits and generic code together

Expand Down
24 changes: 23 additions & 1 deletion src/import/chips/p9/procedures/hwp/memory/lib/ecc/ecc_traits.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -194,6 +194,26 @@ class eccTraits<fapi2::TARGET_TYPE_MCA>
SHADOW_RANK = MCA_MSR_RANK,
SHADOW_RANK_LEN = MCA_MSR_RANK_LEN,

// Address trap format
TRAP_ADDRESS_PORT = 0,
TRAP_ADDRESS_PORT_LEN = 2,
TRAP_ADDRESS_DIMM = 2,
TRAP_ADDRESS_DIMM_LEN = 1,
TRAP_ADDRESS_MRANK = 3,
TRAP_ADDRESS_MRANK_LEN = 2,
TRAP_ADDRESS_SRANK = 5,
TRAP_ADDRESS_SRANK_LEN = 3,
TRAP_ADDRESS_ROW = 8,
TRAP_ADDRESS_ROW_LEN = 18,
TRAP_ADDRESS_COL = 26,
TRAP_ADDRESS_COL_LEN = 7,
TRAP_ADDRESS_BANK = 33,
TRAP_ADDRESS_BANK_LEN = 3,
TRAP_ADDRESS_BANK_GROUP = 36,
TRAP_ADDRESS_BANK_GROUP_LEN = 2,

TRAP_ADDRESS = 0,
TRAP_ADDRESS_LEN = 38
};

// Symbol to Galois code mapping table
Expand Down Expand Up @@ -244,6 +264,8 @@ class eccTraits<fapi2::TARGET_TYPE_MCA>
3, 2, 1, 0
};



};

///
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -101,8 +101,11 @@ fapi_try_exit:
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
{
io_data.insertFromRight<TT::AUE_ADDR_TRAP, TT::AUE_ADDR_TRAP_LEN>(uint64_t(i_address));
FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
// construct trap_address from mcbist address
const auto l_addr = trap_address<>(i_address);

io_data.insert<TT::AUE_ADDR_TRAP, TT::AUE_ADDR_TRAP_LEN>(uint64_t(l_addr));
FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
}

///
Expand All @@ -115,8 +118,9 @@ inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
{
uint64_t l_addr = 0;
i_data.extractToRight<TT::AUE_ADDR_TRAP, TT::AUE_ADDR_TRAP_LEN>(l_addr);
// construct trap_address from i_data
const auto l_addr = trap_address<>(uint64_t(i_data));
// construct mcbist::address from trap_address
o_address = mcbist::address(l_addr);
FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -101,8 +101,11 @@ fapi_try_exit:
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
{
io_data.insertFromRight<TT::MPE_ADDR_TRAP, TT::MPE_ADDR_TRAP_LEN>(uint64_t(i_address));
FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
// construct trap_address from mcbist address
const auto l_addr = trap_address<>(i_address);

io_data.insert<TT::MPE_ADDR_TRAP, TT::MPE_ADDR_TRAP_LEN>(uint64_t(l_addr));
FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
}

///
Expand All @@ -115,8 +118,9 @@ inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
{
uint64_t l_addr = 0;
i_data.extractToRight<TT::MPE_ADDR_TRAP, TT::MPE_ADDR_TRAP_LEN>(l_addr);
// construct trap_address from i_data
const auto l_addr = trap_address<>(uint64_t(i_data));
// construct mcbist::address from trap_address
o_address = mcbist::address(l_addr);
FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
}
Expand Down
Expand Up @@ -102,8 +102,11 @@ fapi_try_exit:
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
{
io_data.insertFromRight<TT::NCE_ADDR_TRAP, TT::NCE_ADDR_TRAP_LEN>(uint64_t(i_address));
FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
// construct trap_address from mcbist address
const auto l_addr = trap_address<>(i_address);

io_data.insert<TT::NCE_ADDR_TRAP, TT::NCE_ADDR_TRAP_LEN>(uint64_t(l_addr));
FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
}

///
Expand All @@ -116,8 +119,9 @@ inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
{
uint64_t l_addr = 0;
i_data.extractToRight<TT::NCE_ADDR_TRAP, TT::NCE_ADDR_TRAP_LEN>(l_addr);
// construct trap_address from i_data
const auto l_addr = trap_address<>(uint64_t(i_data));
// construct mcbist::address from trap_address
o_address = mcbist::address(l_addr);
FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -101,8 +101,11 @@ fapi_try_exit:
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
{
io_data.insertFromRight<TT::RCE_ADDR_TRAP, TT::RCE_ADDR_TRAP_LEN>(uint64_t(i_address));
FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
// construct trap_address from mcbist address
const auto l_addr = trap_address<>(i_address);

io_data.insert<TT::RCE_ADDR_TRAP, TT::RCE_ADDR_TRAP_LEN>(uint64_t(l_addr));
FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
}

///
Expand All @@ -115,8 +118,9 @@ inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
{
uint64_t l_addr = 0;
i_data.extractToRight<TT::RCE_ADDR_TRAP, TT::RCE_ADDR_TRAP_LEN>(l_addr);
// construct trap_address from i_data
const auto l_addr = trap_address<>(uint64_t(i_data));
// construct mcbist::address from trap_address
o_address = mcbist::address(l_addr);
FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -101,8 +101,11 @@ fapi_try_exit:
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
{
io_data.insertFromRight<TT::UE_ADDR_TRAP, TT::UE_ADDR_TRAP_LEN>(uint64_t(i_address));
FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
// construct trap_address from mcbist address
const auto l_addr = trap_address<>(i_address);

io_data.insert<TT::UE_ADDR_TRAP, TT::UE_ADDR_TRAP_LEN>(uint64_t(l_addr));
FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
}

///
Expand All @@ -115,8 +118,9 @@ inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
{
uint64_t l_addr = 0;
i_data.extractToRight<TT::UE_ADDR_TRAP, TT::UE_ADDR_TRAP_LEN>(l_addr);
// construct trap_address from i_data
const auto l_addr = trap_address<>(uint64_t(i_data));
// construct mcbist::address from trap_address
o_address = mcbist::address(l_addr);
FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -94,8 +94,11 @@ fapi_try_exit:
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address& i_address)
{
io_data.insertFromRight<TT::CURRENT_ADDR_TRAP, TT::CURRENT_ADDR_TRAP_LEN>(uint64_t(i_address));
FAPI_INF("set_address: 0x%016lx", uint64_t(i_address));
// construct trap_address from mcbist address
const auto l_addr = trap_address<>(i_address);

io_data.insert<TT::CURRENT_ADDR_TRAP, TT::CURRENT_ADDR_TRAP_LEN>(uint64_t(l_addr));
FAPI_INF("set_address: 0x%016lx", uint64_t(l_addr));
}

///
Expand All @@ -108,8 +111,9 @@ inline void set_address( fapi2::buffer<uint64_t>& io_data, const mcbist::address
template< fapi2::TargetType T = fapi2::TARGET_TYPE_MCA, typename TT = eccTraits<T> >
inline void get_address( const fapi2::buffer<uint64_t>& i_data, mcbist::address& o_address )
{
uint64_t l_addr = 0;
i_data.extractToRight<TT::CURRENT_ADDR_TRAP, TT::CURRENT_ADDR_TRAP_LEN>(l_addr);
// construct trap_address from i_data
const auto l_addr = trap_address<>(uint64_t(i_data));
// construct mcbist::address from trap_address
o_address = mcbist::address(l_addr);
FAPI_INF("get_address: 0x%016lx", uint64_t(l_addr));
}
Expand Down
Expand Up @@ -41,7 +41,7 @@
#include <lib/shared/mss_const.H>
#include <lib/ecc/ecc_traits.H>
#include <lib/mcbist/mcbist_traits.H>
#include <generic/memory/lib/utils/mcbist/gen_address.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H>

// This file is still necessary to put traits and generic code together

Expand Down
4 changes: 2 additions & 2 deletions src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H
Expand Up @@ -51,8 +51,8 @@
#include <generic/memory/lib/utils/num.H>
#include <generic/memory/lib/utils/poll.H>
#include <generic/memory/lib/utils/memory_size.H>
#include <generic/memory/lib/utils/mcbist/gen_patterns.H>
#include <generic/memory/lib/utils/mcbist/gen_settings.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_patterns.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist_settings.H>
#include <generic/memory/lib/utils/mcbist/gen_mss_mcbist.H>
#include <generic/memory/lib/utils/dump_regs.H>
#include <lib/workarounds/mcbist_workarounds.H>
Expand Down

0 comments on commit 03fc499

Please sign in to comment.