Skip to content

Commit 7eafce2

Browse files
sglancy6dcrowell77
authored andcommitted
Updates exp SPD check to use MFG, height, and size
Picked from https://rchgit01.rchland.ibm.com/gerrit1/#/c/104520/ Change-Id: I75700f54546937586cb019f3e024698999f512a6 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/104709 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Edgar R Cordero <ecordero@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/104733 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 21406ee commit 7eafce2

File tree

4 files changed

+141
-93
lines changed

4 files changed

+141
-93
lines changed

src/import/chips/p9a/procedures/hwp/memory/lib/plug_rules/p9a_plug_rules.C

Lines changed: 93 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -281,71 +281,107 @@ namespace check
281281
{
282282

283283
///
284-
/// @brief Check that we recognize DDIMM module manufacturing ID
284+
/// @brief Check that we recognize SPD lookup key and return the SPD versions associated with the key
285285
/// @param[in] i_target dimm target
286-
/// @param[in] i_module_mfg_id DIMM module manufacturing ID
287-
/// @param[out] o_latest_combined_rev latest SPD combined revision
286+
/// @param[in] i_key the SPD lookup key to be used to grab the combined revisions
287+
/// @param[out] o_minimum_combined_rev minimum SPD combined revisions
288+
/// @param[out] o_latest_combined_rev latest SPD combined revisions
288289
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
289290
///
290-
fapi2::ReturnCode module_mfg_id(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
291-
const uint16_t i_module_mfg_id,
292-
uint16_t& o_latest_combined_rev)
291+
fapi2::ReturnCode spd_revision_key(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
292+
const spd_lookup_key& i_key,
293+
uint16_t& o_minimum_combined_rev,
294+
uint16_t& o_latest_combined_rev)
293295
{
294296
// Check that we can find the ID in our latest revision list
295-
FAPI_ASSERT( mss::find_value_from_key(LATEST_SPD_COMBINED_REV, i_module_mfg_id, o_latest_combined_rev),
296-
fapi2::MSS_UNKNOWN_DIMM_MODULE_MFG_ID()
297+
FAPI_ASSERT( mss::find_value_from_key(MINIMUM_SPD_KEY_COMBINED_REV, i_key, o_minimum_combined_rev),
298+
fapi2::MSS_UNKNOWN_DIMM_SPD_KEY()
297299
.set_DIMM_TARGET(i_target)
298-
.set_MODULE_MFG_ID(i_module_mfg_id),
299-
"%s DDIMM has unrecognized module manufacturing ID (0x%04X)",
300-
mss::c_str(i_target), i_module_mfg_id );
300+
.set_MODULE_MFG_ID(i_key.iv_module_mfg_id)
301+
.set_DIMM_HEIGHT(i_key.iv_dimm_height)
302+
.set_DIMM_SIZE(i_key.iv_dimm_size),
303+
"%s DDIMM has unrecognized key MFG_ID:0x%04X Height:%u Size:%u for minimum SPD rev",
304+
mss::c_str(i_target), i_key.iv_module_mfg_id, i_key.iv_dimm_height, i_key.iv_dimm_size );
305+
306+
FAPI_ASSERT( mss::find_value_from_key(LATEST_SPD_KEY_COMBINED_REV, i_key, o_latest_combined_rev),
307+
fapi2::MSS_UNKNOWN_DIMM_SPD_KEY()
308+
.set_DIMM_TARGET(i_target)
309+
.set_MODULE_MFG_ID(i_key.iv_module_mfg_id)
310+
.set_DIMM_HEIGHT(i_key.iv_dimm_height)
311+
.set_DIMM_SIZE(i_key.iv_dimm_size),
312+
"%s DDIMM has unrecognized key MFG_ID:0x%04X Height:%u Size:%u for latest SPD rev",
313+
mss::c_str(i_target), i_key.iv_module_mfg_id, i_key.iv_dimm_height, i_key.iv_dimm_size );
301314

302315
return fapi2::FAPI2_RC_SUCCESS;
303316

304317
fapi_try_exit:
305318
// Log the error as recovered - we want this error to be informational
306319
fapi2::logError(fapi2::current_err, fapi2::FAPI2_ERRL_SEV_RECOVERED);
307320
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
308-
return fapi2::RC_MSS_UNKNOWN_DIMM_MODULE_MFG_ID;
321+
return fapi2::RC_MSS_UNKNOWN_DIMM_SPD_KEY;
309322
}
310323

311324
///
312-
/// @brief Check DDIMM SPD revision and content revision versus latest supported
325+
/// @brief Check DDIMM SPD revision and content revision versus minimum supported
313326
/// @param[in] i_target dimm target
314-
/// @param[in] i_spd_rev SPD revision
315-
/// @param[in] i_spd_content_rev SPD content revision
316-
/// @param[in] i_latest_combined_rev latest SPD combined revision
327+
/// @param[in] i_spd_combined_revision the combined SPD revision and content
328+
/// @param[in] i_min_combined_rev SPD minimum combined revision information
317329
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
318330
/// @note The return code from this function is only used in unit tests.
319331
///
320-
fapi2::ReturnCode spd_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
321-
const uint8_t i_spd_rev,
322-
const uint8_t i_spd_content_rev,
323-
const uint16_t i_latest_combined_rev)
332+
fapi2::ReturnCode spd_minimum_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
333+
const uint16_t i_spd_combined_rev,
334+
const uint16_t i_min_combined_rev)
324335
{
325-
// Assemble the SPD combined revision
326-
// We simply put the SPD revision before the content revision
327-
fapi2::buffer<uint16_t> l_spd_combined_revision;
328-
l_spd_combined_revision.insertFromRight<0, BITS_PER_BYTE>(i_spd_rev)
329-
.insertFromRight<BITS_PER_BYTE, BITS_PER_BYTE>(i_spd_content_rev);
330336

331337
// Check the combined revision
332-
if(l_spd_combined_revision < i_latest_combined_rev)
338+
FAPI_ASSERT( i_spd_combined_rev >= i_min_combined_rev,
339+
fapi2::MSS_UNSUPPORTED_SPD_COMBINED_REVISION()
340+
.set_DIMM_TARGET(i_target)
341+
.set_SPD_COMBINED_REVISION(i_spd_combined_rev)
342+
.set_MINIMUM_FUNCTIONAL_SPD_COMBINED_REVISION(i_min_combined_rev),
343+
"%s DDIMM has an unsupported SPD combined revision and needs to be updated (0x%04X < 0x%04X)",
344+
mss::c_str(i_target), i_spd_combined_rev, i_min_combined_rev );
345+
346+
return fapi2::FAPI2_RC_SUCCESS;
347+
348+
fapi_try_exit:
349+
// Log the error as recovered - we want this error to be informational
350+
fapi2::logError(fapi2::current_err, fapi2::FAPI2_ERRL_SEV_RECOVERED);
351+
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;
352+
return fapi2::RC_MSS_UNSUPPORTED_SPD_COMBINED_REVISION;
353+
}
354+
355+
///
356+
/// @brief Check DDIMM SPD revision and content revision versus latest supported
357+
/// @param[in] i_target dimm target
358+
/// @param[in] i_spd_combined_revision the combined SPD revision and content
359+
/// @param[in] i_latest_combined_rev latest SPD combined revision information
360+
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
361+
/// @note The return code from this function is only used in unit tests.
362+
///
363+
fapi2::ReturnCode spd_latest_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
364+
const uint16_t i_spd_combined_rev,
365+
const uint16_t i_latest_combined_rev)
366+
{
367+
// Check the combined revision
368+
if(i_spd_combined_rev < i_latest_combined_rev)
333369
{
334370
// For the lab, we just want to log these as informational errors
335371
#ifndef __HOSTBOOT_MODULE
336372
FAPI_INF("%s DDIMM has non-current SPD combined revision and could be updated (0x%04X < 0x%04X)",
337-
mss::c_str(i_target), l_spd_combined_revision, i_latest_combined_rev );
373+
mss::c_str(i_target), i_spd_combined_rev, i_latest_combined_rev );
338374
// Return a bad RC here for unit test confirmation
339375
return fapi2::RC_MSS_NON_CURRENT_SPD_COMBINED_REVISION;
340376
#else
341377
// For hostboot, we want to generate an informational error log
342378
FAPI_ASSERT( false,
343379
fapi2::MSS_NON_CURRENT_SPD_COMBINED_REVISION()
344380
.set_DIMM_TARGET(i_target)
345-
.set_SPD_COMBINED_REVISION(l_spd_combined_revision)
381+
.set_SPD_COMBINED_REVISION(i_spd_combined_rev)
346382
.set_LATEST_SPD_COMBINED_REVISION(i_latest_combined_rev),
347383
"%s DDIMM has non-current SPD combined revision and could be updated (0x%04X < 0x%04X)",
348-
mss::c_str(i_target), l_spd_combined_revision, i_latest_combined_rev );
384+
mss::c_str(i_target), i_spd_combined_rev, i_latest_combined_rev );
349385
#endif
350386
}
351387

@@ -378,9 +414,11 @@ fapi2::ReturnCode ddimm_spd_revision(const fapi2::Target<fapi2::TARGET_TYPE_MEM_
378414

379415
for(const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target))
380416
{
381-
uint16_t l_latest_combined_rev = 0;
382417
uint8_t l_dimm_type = 0;
383-
uint16_t l_module_mfg_id = 0;
418+
uint16_t l_min_combined_rev = 0;
419+
uint16_t l_latest_combined_rev = 0;
420+
spd_lookup_key l_key(l_dimm, l_rc);
421+
FAPI_TRY(l_rc, "%s failed to build spd_lookup_key", mss::c_str(l_dimm));
384422

385423
FAPI_TRY( mss::attr::get_dimm_type(l_dimm, l_dimm_type) );
386424

@@ -391,32 +429,37 @@ fapi2::ReturnCode ddimm_spd_revision(const fapi2::Target<fapi2::TARGET_TYPE_MEM_
391429
continue;
392430
}
393431

394-
FAPI_TRY( mss::attr::get_module_mfg_id(l_dimm, l_module_mfg_id) );
395-
396-
// First make sure we can get the SPD content revision using the module manufacturing ID
432+
// First make sure we can get the SPD combined revision using the key
397433
// This is not necessarily a hard fail, so don't bomb out, but we have to skip the SPD revision checks.
398-
l_rc = check::module_mfg_id(l_dimm, l_module_mfg_id, l_latest_combined_rev);
434+
l_rc = check::spd_revision_key(l_dimm, l_key, l_min_combined_rev, l_latest_combined_rev);
399435

400436
if (l_rc != fapi2::FAPI2_RC_SUCCESS)
401437
{
402-
FAPI_INF("Skipping SPD revision plug rule check on %s because it has an unrecognized module manufacturing ID 0x%04X",
403-
mss::c_str(i_target), l_module_mfg_id);
438+
FAPI_INF("Skipping SPD revision plug rule check on %s because it has an unrecognized SPD key MFG_ID:0x%04X Height:%u Size:%u",
439+
mss::c_str(i_target), l_key.iv_module_mfg_id, l_key.iv_dimm_height, l_key.iv_dimm_size);
404440
continue;
405441
}
406442

407-
// Now check the base SPD revision
408-
FAPI_ASSERT( (MIN_FUNCTIONAL_SPD_REV <= l_spd_rev),
409-
fapi2::MSS_UNSUPPORTED_SPD_REVISION()
410-
.set_DIMM_TARGET(l_dimm)
411-
.set_SPD_REVISION(l_spd_rev)
412-
.set_MINIMUM_FUNCTIONAL_SPD_REVISION(MIN_FUNCTIONAL_SPD_REV),
413-
"%s DDIMM has unsupported SPD revision and needs to be updated (0x%02X < 0x%02X)",
414-
mss::c_str(l_dimm), l_spd_rev, MIN_FUNCTIONAL_SPD_REV );
415-
416-
// Finally check the SPD content revision
417-
// Don't bother checking the return code here because this check only produces informational logs
418-
// (and the RC is only used for unit tests)
419-
check::spd_combined_revision(l_dimm, l_spd_rev, l_spd_content_rev, l_latest_combined_rev);
443+
{
444+
// Assemble the SPD combined revision
445+
// We simply put the SPD revision before the content revision
446+
fapi2::buffer<uint16_t> l_spd_combined_revision;
447+
l_spd_combined_revision.insertFromRight<0, BITS_PER_BYTE>(l_spd_rev)
448+
.insertFromRight<BITS_PER_BYTE, BITS_PER_BYTE>(l_spd_content_rev);
449+
450+
// Now check the minimum SPD combined revision
451+
// Note: skipping target trace here as the 4th variable appears to cause issues w/ FAPI_TRY
452+
// The DIMM target should be called out in the combined revision code
453+
// We do want to callout the key here, so we know what type of DIMM failed
454+
FAPI_TRY( check::spd_minimum_combined_revision(l_dimm, l_spd_combined_revision, l_min_combined_rev),
455+
"SPD min rev check failed key MFG_ID:0x%04X Height:%u Size:%u",
456+
l_key.iv_module_mfg_id, l_key.iv_dimm_height, l_key.iv_dimm_size );
457+
458+
// Finally check the latest SPD combined revision
459+
// Don't bother checking the return code here because this check only produces informational logs
460+
// (and the RC is only used for unit tests)
461+
check::spd_latest_combined_revision(l_dimm, l_spd_combined_revision, l_latest_combined_rev);
462+
}
420463
}
421464

422465
fapi_try_exit:

src/import/chips/p9a/procedures/hwp/memory/lib/plug_rules/p9a_plug_rules.H

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,6 @@ struct spd_lookup_key
8888
bool operator!=(const spd_lookup_key& i_rhs) const;
8989
};
9090

91-
/// @note This is the oldest functional DDIMM SPD revision
92-
/// any DIMMs with older SPD will be called out
93-
static const uint8_t MIN_FUNCTIONAL_SPD_REV = 0x03;
94-
95-
/// @note These are the latest DDIMM SPD combined revisions
96-
/// combined revision is the SPD revision and the SPD content revision
97-
/// any DIMMs with older SPD will generate an error
98-
/// The first byte is the major revision
99-
/// any updates to this are usually new bytes and will require code updates
100-
/// The second byte is the content revision
101-
/// updates to this byte are most likely values and it's less likely that code will need to be updated
102-
/// @note When adding new vendors, THIS NEEDS TO BE IN SORTED ORDER BY VENDOR ID ENCODING
103-
static const std::vector<std::pair<uint16_t, uint16_t>> LATEST_SPD_COMBINED_REV =
104-
{
105-
{fapi2::ENUM_ATTR_MEM_EFF_MODULE_MFG_ID_SMART, 0x0400}, // 0x0194
106-
{fapi2::ENUM_ATTR_MEM_EFF_MODULE_MFG_ID_US_MODULAR, 0x0400}, // 0x04AB
107-
{fapi2::ENUM_ATTR_MEM_EFF_MODULE_MFG_ID_FUJITSU, 0x0400}, // 0x8004
108-
{fapi2::ENUM_ATTR_MEM_EFF_MODULE_MFG_ID_MICRON, 0x0400}, // 0x802C
109-
{fapi2::ENUM_ATTR_MEM_EFF_MODULE_MFG_ID_SAMSUNG, 0x0400}, // 0x80CE
110-
};
111-
11291
///
11392
/// @brief Enforce the plug-rules we can do before mss_freq
11493
/// @param[in] i_target FAPI2 target (proc chip)
@@ -149,29 +128,54 @@ namespace check
149128
{
150129

151130
///
152-
/// @brief Check that we recognize DDIMM module manufacturing ID
131+
/// @brief Check that we recognize SPD lookup key and return the SPD versions associated with the key
132+
/// @param[in] i_target dimm target
133+
/// @param[in] i_key the SPD lookup key to be used to grab the combined revisions
134+
/// @param[out] o_minimum_combined_rev minimum SPD combined revisions
135+
/// @param[out] o_latest_combined_rev latest SPD combined revisions
136+
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
137+
///
138+
fapi2::ReturnCode spd_revision_key(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
139+
const spd_lookup_key& i_key,
140+
uint16_t& o_minimum_combined_rev,
141+
uint16_t& o_latest_combined_rev);
142+
143+
///
144+
/// @brief Check DDIMM SPD revision and content revision versus minimum supported
153145
/// @param[in] i_target dimm target
154-
/// @param[in] i_module_mfg_id DIMM module manufacturing ID
155-
/// @param[out] o_latest_content_rev latest SPD content revision
146+
/// @param[in] i_spd_combined_revision the combined SPD revision and content
147+
/// @param[in] i_min_combined_rev SPD minimum combined revision information
156148
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
149+
/// @note The return code from this function is only used in unit tests.
157150
///
158-
fapi2::ReturnCode module_mfg_id(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
159-
const uint16_t i_module_mfg_id,
160-
uint16_t& o_latest_content_rev);
151+
fapi2::ReturnCode spd_minimum_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
152+
const uint16_t i_spd_combined_rev,
153+
const uint16_t i_min_combined_rev);
161154

162155
///
163156
/// @brief Check DDIMM SPD revision and content revision versus latest supported
164157
/// @param[in] i_target dimm target
165-
/// @param[in] i_spd_rev SPD revision
166-
/// @param[in] i_spd_content_rev SPD content revision
167-
/// @param[in] i_latest_combined_rev latest SPD combined revision
158+
/// @param[in] i_spd_combined_revision the combined SPD revision and content
159+
/// @param[in] i_latest_combined_rev latest SPD combined revision information
160+
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
161+
/// @note The return code from this function is only used in unit tests.
162+
///
163+
fapi2::ReturnCode spd_latest_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
164+
const uint16_t i_spd_combined_rev,
165+
const uint16_t i_latest_combined_rev);
166+
167+
///
168+
/// @brief Check DDIMM SPD revision and content revision versus minimum supported
169+
/// @param[in] i_target dimm target
170+
/// @param[in] i_spd_combined_revision the combined SPD revision and content
171+
/// @param[in] i_min_combined_rev SPD minimum combined revision information
168172
/// @return fapi2::FAPI2_RC_SUCCESS if okay. A non-SUCCESS return will also produce an informational log
169173
/// @note The return code from this function is only used in unit tests.
170174
///
171-
fapi2::ReturnCode spd_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
172-
const uint8_t i_spd_rev,
173-
const uint8_t i_spd_content_rev,
174-
const uint16_t i_latest_combined_rev);
175+
fapi2::ReturnCode spd_minimum_combined_revision(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
176+
const uint16_t i_spd_combined_rev,
177+
const uint16_t i_min_combined_rev);
178+
175179
} // namespace check
176180

177181
///

src/import/generic/memory/lib/utils/find.H

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,6 @@ bool find_value_from_key(const std::vector<std::pair<T, OT> >& i_vector_of_pairs
332332
// Did you find it? Let me know.
333333
if( (l_value_iterator == i_vector_of_pairs.end()) || (i_key != l_value_iterator->first) )
334334
{
335-
// Static cast ensures that the below print will not fail at compile time
336-
FAPI_INF("Did not find a mapping value to key: %d", static_cast<uint64_t>(i_key));
337335
return false;
338336
}
339337

src/import/generic/procedures/xml/error_info/generic_error.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,12 +1424,15 @@
14241424
</hwpError>
14251425

14261426
<hwpError>
1427-
<rc>RC_MSS_UNKNOWN_DIMM_MODULE_MFG_ID</rc>
1427+
<rc>RC_MSS_UNKNOWN_DIMM_SPD_KEY</rc>
14281428
<description>
1429-
Module manufacturing ID from DIMM SPD was not recognized in
1430-
plug rule enforcement function.
1429+
DIMM SPD key from DIMM SPD was not recognized in
1430+
plug rule enforcement function. The key is the manufacturing ID,
1431+
the DIMM height, and the DIMM size.
14311432
</description>
14321433
<ffdc>MODULE_MFG_ID</ffdc>
1434+
<ffdc>DIMM_HEIGHT</ffdc>
1435+
<ffdc>DIMM_SIZE</ffdc>
14331436
<callout>
14341437
<target>DIMM_TARGET</target>
14351438
<priority>HIGH</priority>
@@ -1470,12 +1473,12 @@
14701473
</hwpError>
14711474

14721475
<hwpError>
1473-
<rc>RC_MSS_UNSUPPORTED_SPD_CONTENT_REVISION</rc>
1476+
<rc>RC_MSS_UNSUPPORTED_SPD_COMBINED_REVISION</rc>
14741477
<description>
1475-
DIMM SPD content revision is older than least supported revision.
1478+
DIMM SPD combined revision is older than least supported revision.
14761479
</description>
1477-
<ffdc>SPD_CONTENT_REVISION</ffdc>
1478-
<ffdc>MINIMUM_FUNCTIONAL_SPD_CONTENT_REVISION</ffdc>
1480+
<ffdc>SPD_COMBINED_REVISION</ffdc>
1481+
<ffdc>MINIMUM_FUNCTIONAL_SPD_COMBINED_REVISION</ffdc>
14791482
<callout>
14801483
<procedure>MEMORY_PLUGGING_ERROR</procedure>
14811484
<priority>HIGH</priority>

0 commit comments

Comments
 (0)