Skip to content

Commit 877a032

Browse files
aamarincrgeddes
authored andcommitted
Fix SPD cas latency assert bug
Change-Id: Ic38888f6db211e16385f5223ff267fd7044c6758 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72250 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> 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: Louis Stermole <stermole@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Dev-Ready: ANDRE A. MARIN <aamarin@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72316 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>
1 parent dadbba5 commit 877a032

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,19 @@ class decoder<DDR4, BASE_CNFG, R> : public base_cnfg_decoder
11891189
right_aligned_insert(l_buffer, l_fourth_raw_byte, l_third_raw_byte, l_sec_raw_byte, l_first_raw_byte);
11901190

11911191
// According to the JEDEC spec:
1192-
// Byte 22 (Bits 7~0) and Byte 23 are reserved and thus not supported
1193-
// Check for a valid value
1194-
constexpr size_t MAX_VALID_VAL = 0x3FFFF;
1192+
// Byte 22 (Bits 7~0) and Byte 23 are reserved in the base revision SPD general section
1193+
// Only bit 6 (right-aligned) for Byte 23 is reserved for subsequent SPD revisions
1194+
// Check for a valid value, and that reserved bit is not set
1195+
// We return Byte 23 arbitrarily as the failed byte, but any byte (20 - 23) would work
1196+
constexpr size_t MAX_VALID_VAL = (R == rev::V1_0) ? 0x0003FFFF : 0xBFFFFFFF;
1197+
1198+
constexpr uint64_t DATA_START_OFFSET = 32;
1199+
constexpr uint64_t RESERVED_BIT = DATA_START_OFFSET + 1;
1200+
// Bit 6 of byte 23 must be 0 (reserved for future use)
1201+
const bool RESERVED_BIT_VALUE = l_buffer.getBit<RESERVED_BIT>();
1202+
11951203
FAPI_TRY( mss::check::invalid_value(iv_target,
1196-
l_buffer <= MAX_VALID_VAL,
1204+
l_buffer <= MAX_VALID_VAL && !RESERVED_BIT_VALUE,
11971205
23,
11981206
l_buffer,
11991207
mss::BAD_SPD_DATA,

0 commit comments

Comments
 (0)