Skip to content

Commit 6f50efd

Browse files
Matthickman14dcrowell77
authored andcommitted
Added restore repairs generic
Change-Id: I9227867fd6b1b3caa32653aaf1883d462b8967c8 git-coreq:hostboot: I9227867fd6b1b3caa32653aaf1883d462b8967c8 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/102286 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: NAREN A DEVAIAH <naren.devaiah@in.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/102423 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: Daniel M Crowell <dcrowell@us.ibm.com>
1 parent 896a0ff commit 6f50efd

File tree

9 files changed

+1121
-968
lines changed

9 files changed

+1121
-968
lines changed

src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mc/exp_port.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <lib/shared/exp_consts.H>
4747
#include <lib/dimm/exp_rank.H>
4848
#include <generic/memory/lib/utils/mc/gen_mss_port.H>
49+
#include <generic/memory/lib/utils/mc/gen_mss_restore_repairs.H>
4950
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
5051
#include <mss_generic_attribute_getters.H>
5152

src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <generic/memory/lib/utils/scom.H>
4545
#include <generic/memory/lib/utils/c_str.H>
4646
#include <generic/memory/lib/utils/mc/gen_mss_port.H>
47+
#include <generic/memory/lib/utils/mc/gen_mss_restore_repairs.H>
4748
#include <p9_mc_scom_addresses.H>
4849
#include <p9_mc_scom_addresses_fld.H>
4950
#include <lib/dimm/rank.H>

src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ extern "C"
144144
uint64_t l_galois = 0;
145145
mss::states l_confirmed = mss::NO;
146146
// check for chip mark in hardware mark store
147-
FAPI_TRY( mss::ecc::get_hwms(l_mca, l_rank, l_galois, l_confirmed) );
147+
FAPI_TRY( mss::ecc::get_hwms<mss::mc_type::NIMBUS>(l_mca, l_rank, l_galois, l_confirmed) );
148148

149149
if (l_confirmed)
150150
{
151151
auto l_type = mss::ecc::fwms::mark_type::CHIP;
152152
auto l_region = mss::ecc::fwms::mark_region::DISABLED;
153153
auto l_addr = mss::mcbist::address(0);
154154
// check for symbol mark in firmware mark store
155-
FAPI_TRY( mss::ecc::get_fwms(l_mca, l_rank, l_galois, l_type, l_region, l_addr) );
155+
FAPI_TRY( mss::ecc::get_fwms<mss::mc_type::NIMBUS>(l_mca, l_rank, l_galois, l_type, l_region, l_addr) );
156156

157157
FAPI_ASSERT( l_region == mss::ecc::fwms::mark_region::DISABLED,
158158
fapi2::MSS_MEMDIAGS_CHIPMARK_AND_SYMBOLMARK().set_MCA_TARGET(l_mca).set_RANK(l_rank),

src/import/generic/memory/lib/ecc/ecc.H

Lines changed: 6 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -61,146 +61,17 @@ namespace mss
6161
namespace ecc
6262
{
6363

64-
///
65-
/// @brief Get Hardware Mark Store
66-
/// @tparam T the fapi2::TargetType - derived
67-
/// @param[in] i_target the fapi2 target
68-
/// @param[in] i_rank the desired rank
69-
/// @param[out] o_galois the Galois code of the mark
70-
/// @param[out] o_confirmed true if the mark is a chipmark
71-
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
72-
///
73-
template< fapi2::TargetType T >
74-
inline fapi2::ReturnCode get_hwms( const fapi2::Target<T>& i_target,
75-
const uint64_t i_rank,
76-
uint64_t& o_galois,
77-
mss::states& o_confirmed )
78-
{
79-
fapi2::buffer<uint64_t> l_buffer;
80-
81-
FAPI_TRY( mss::ecc::hwms::read(i_target, i_rank, l_buffer) );
82-
mss::ecc::hwms::get_chipmark(l_buffer, o_galois);
83-
mss::ecc::hwms::get_confirmed(l_buffer, o_confirmed);
84-
85-
fapi_try_exit:
86-
return fapi2::current_err;
87-
}
88-
89-
///
90-
/// @brief Set Hardware Mark Store
91-
/// @tparam T the fapi2::TargetType - derived
92-
/// @param[in] i_target the fapi2 target
93-
/// @param[in] i_rank the desired rank
94-
/// @param[in] i_galois the Galois code of the mark, or set to 0 to clear mark
95-
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
96-
///
97-
template< fapi2::TargetType T >
98-
inline fapi2::ReturnCode set_hwms( const fapi2::Target<T>& i_target,
99-
const uint64_t i_rank,
100-
const uint64_t i_galois )
101-
{
102-
fapi2::buffer<uint64_t> l_buffer;
103-
uint8_t l_symbol = 0;
104-
105-
// galois value of 0 means to clear the mark so only fill in fields if non-zero
106-
if (i_galois != 0)
107-
{
108-
// check for valid Galois code
109-
FAPI_TRY( mss::ecc::galois_to_symbol( (uint8_t)i_galois, l_symbol) );
110-
111-
mss::ecc::hwms::set_chipmark(l_buffer, i_galois);
112-
mss::ecc::hwms::set_confirmed(l_buffer, mss::YES);
113-
mss::ecc::hwms::set_exit_1(l_buffer, mss::YES);
114-
}
115-
116-
FAPI_TRY( mss::ecc::hwms::write(i_target, i_rank, l_buffer) );
117-
118-
fapi_try_exit:
119-
return fapi2::current_err;
120-
}
121-
122-
///
123-
/// @brief Get Firmware Mark Store
124-
/// @tparam T the fapi2::TargetType - derived
125-
/// @param[in] i_target the fapi2 target
126-
/// @param[in] i_rank the desired rank
127-
/// @param[out] o_galois the Galois code of the mark
128-
/// @param[out] o_type the type code of the mark
129-
/// @param[out] o_region the region code of the mark
130-
/// @param[out] o_address the starting address of the mark
131-
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
132-
///
133-
template< fapi2::TargetType T >
134-
inline fapi2::ReturnCode get_fwms( const fapi2::Target<T>& i_target,
135-
const uint64_t i_rank,
136-
uint64_t& o_galois,
137-
mss::ecc::fwms::mark_type& o_type,
138-
mss::ecc::fwms::mark_region& o_region,
139-
mss::mcbist::address& o_address )
140-
{
141-
fapi2::buffer<uint64_t> l_buffer;
142-
143-
FAPI_TRY( mss::ecc::fwms::read(i_target, i_rank, l_buffer) );
144-
mss::ecc::fwms::get_mark(l_buffer, o_galois);
145-
mss::ecc::fwms::get_type(l_buffer, o_type);
146-
mss::ecc::fwms::get_region(l_buffer, o_region);
147-
mss::ecc::fwms::get_address(l_buffer, o_address);
148-
149-
fapi_try_exit:
150-
return fapi2::current_err;
151-
}
152-
153-
///
154-
/// @brief Set Firmware Mark Store
155-
/// @tparam T the fapi2::TargetType - derived
156-
/// @param[in] i_target the fapi2 target
157-
/// @param[in] i_rank the desired rank
158-
/// @param[in] i_galois the Galois code of the mark, or set to 0 to clear mark
159-
/// @param[in] i_type the type code of the mark
160-
/// @param[in] i_region the region code of the mark
161-
/// @param[in] i_address the starting address of the mark
162-
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
163-
///
164-
template< fapi2::TargetType T >
165-
inline fapi2::ReturnCode set_fwms( const fapi2::Target<T>& i_target,
166-
const uint64_t i_rank,
167-
const uint64_t i_galois,
168-
const mss::ecc::fwms::mark_type i_type,
169-
const mss::ecc::fwms::mark_region i_region,
170-
const mss::mcbist::address i_address )
171-
{
172-
fapi2::buffer<uint64_t> l_buffer = 0;
173-
uint8_t l_symbol = 0;
174-
175-
// galois value of 0 means to clear the mark so only fill in fields if non-zero
176-
if (i_galois != 0)
177-
{
178-
// check for valid Galois code
179-
FAPI_TRY( mss::ecc::galois_to_symbol( (uint8_t)i_galois, l_symbol) );
180-
181-
mss::ecc::fwms::set_mark(l_buffer, i_galois);
182-
mss::ecc::fwms::set_type(l_buffer, i_type);
183-
mss::ecc::fwms::set_region(l_buffer, i_region);
184-
mss::ecc::fwms::set_address(l_buffer, i_address);
185-
mss::ecc::fwms::set_exit_1(l_buffer, mss::YES);
186-
}
187-
188-
FAPI_TRY( mss::ecc::fwms::write(i_target, i_rank, l_buffer) );
189-
190-
fapi_try_exit:
191-
return fapi2::current_err;
192-
}
193-
19464
///
19565
/// @brief Query Hardware Marks
66+
/// @tparam MC the memory controller type
19667
/// @tparam T the fapi2::TargetType - derived
19768
/// @tparam TT traits type defaults to eccTraits<DEFAULT_MC_TYPE, T>
19869
/// @param[in] i_target the fapi2 target
19970
/// @param[out] o_marks vector of Galois codes of any marks set
20071
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
20172
/// @note no rank information is returned
20273
///
203-
template< fapi2::TargetType T, typename TT = eccTraits<DEFAULT_MC_TYPE, T> >
74+
template< mss::mc_type MC = DEFAULT_MC_TYPE, fapi2::TargetType T, typename TT = eccTraits<MC, T> >
20475
inline fapi2::ReturnCode get_hw_marks( const fapi2::Target<T>& i_target,
20576
std::vector<uint64_t>& o_marks )
20677
{
@@ -212,7 +83,7 @@ inline fapi2::ReturnCode get_hw_marks( const fapi2::Target<T>& i_target,
21283

21384
for (uint64_t l_rank = 0; l_rank < TT::ECC_MAX_MRANK_PER_PORT; ++l_rank)
21485
{
215-
FAPI_TRY( get_hwms(i_target, l_rank, l_galois, l_confirmed) );
86+
FAPI_TRY( get_hwms<MC>(i_target, l_rank, l_galois, l_confirmed) );
21687

21788
if (l_confirmed == mss::states::YES)
21889
{
@@ -228,14 +99,15 @@ fapi_try_exit:
22899

229100
///
230101
/// @brief Query Firmware Marks
102+
/// @tparam MC the memory controller type
231103
/// @tparam T the fapi2::TargetType - derived
232104
/// @tparam TT traits type defaults to eccTraits<DEFAULT_MC_TYPE, T>
233105
/// @param[in] i_target the fapi2 target
234106
/// @param[out] o_marks vector of Galois codes of any marks set
235107
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
236108
/// @note no rank information is returned
237109
///
238-
template< fapi2::TargetType T, typename TT = eccTraits<DEFAULT_MC_TYPE, T> >
110+
template< mss::mc_type MC = DEFAULT_MC_TYPE, fapi2::TargetType T, typename TT = eccTraits<MC, T> >
239111
inline fapi2::ReturnCode get_fw_marks( const fapi2::Target<T>& i_target,
240112
std::vector<uint64_t>& o_marks )
241113
{
@@ -249,7 +121,7 @@ inline fapi2::ReturnCode get_fw_marks( const fapi2::Target<T>& i_target,
249121

250122
for (uint64_t l_rank = 0; l_rank < TT::ECC_MAX_MRANK_PER_PORT; ++l_rank)
251123
{
252-
FAPI_TRY( get_fwms(i_target, l_rank, l_galois, l_type, l_region, l_address) );
124+
FAPI_TRY( get_fwms<MC>(i_target, l_rank, l_galois, l_type, l_region, l_address) );
253125

254126
if (l_region != mss::ecc::fwms::mark_region::DISABLED)
255127
{

0 commit comments

Comments
 (0)