@@ -61,146 +61,17 @@ namespace mss
61
61
namespace ecc
62
62
{
63
63
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
-
194
64
// /
195
65
// / @brief Query Hardware Marks
66
+ // / @tparam MC the memory controller type
196
67
// / @tparam T the fapi2::TargetType - derived
197
68
// / @tparam TT traits type defaults to eccTraits<DEFAULT_MC_TYPE, T>
198
69
// / @param[in] i_target the fapi2 target
199
70
// / @param[out] o_marks vector of Galois codes of any marks set
200
71
// / @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
201
72
// / @note no rank information is returned
202
73
// /
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> >
204
75
inline fapi2::ReturnCode get_hw_marks ( const fapi2::Target<T>& i_target,
205
76
std::vector<uint64_t >& o_marks )
206
77
{
@@ -212,7 +83,7 @@ inline fapi2::ReturnCode get_hw_marks( const fapi2::Target<T>& i_target,
212
83
213
84
for (uint64_t l_rank = 0 ; l_rank < TT::ECC_MAX_MRANK_PER_PORT; ++l_rank)
214
85
{
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) );
216
87
217
88
if (l_confirmed == mss::states::YES)
218
89
{
@@ -228,14 +99,15 @@ fapi_try_exit:
228
99
229
100
// /
230
101
// / @brief Query Firmware Marks
102
+ // / @tparam MC the memory controller type
231
103
// / @tparam T the fapi2::TargetType - derived
232
104
// / @tparam TT traits type defaults to eccTraits<DEFAULT_MC_TYPE, T>
233
105
// / @param[in] i_target the fapi2 target
234
106
// / @param[out] o_marks vector of Galois codes of any marks set
235
107
// / @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
236
108
// / @note no rank information is returned
237
109
// /
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> >
239
111
inline fapi2::ReturnCode get_fw_marks ( const fapi2::Target<T>& i_target,
240
112
std::vector<uint64_t >& o_marks )
241
113
{
@@ -249,7 +121,7 @@ inline fapi2::ReturnCode get_fw_marks( const fapi2::Target<T>& i_target,
249
121
250
122
for (uint64_t l_rank = 0 ; l_rank < TT::ECC_MAX_MRANK_PER_PORT; ++l_rank)
251
123
{
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) );
253
125
254
126
if (l_region != mss::ecc::fwms::mark_region::DISABLED)
255
127
{
0 commit comments