summaryrefslogtreecommitdiffstats
path: root/src/import/generic/memory/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/generic/memory/lib')
-rw-r--r--src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
index f4e97a7c7..12821c76f 100644
--- a/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
+++ b/src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
@@ -1189,11 +1189,19 @@ class decoder<DDR4, BASE_CNFG, R> : public base_cnfg_decoder
right_aligned_insert(l_buffer, l_fourth_raw_byte, l_third_raw_byte, l_sec_raw_byte, l_first_raw_byte);
// According to the JEDEC spec:
- // Byte 22 (Bits 7~0) and Byte 23 are reserved and thus not supported
- // Check for a valid value
- constexpr size_t MAX_VALID_VAL = 0x3FFFF;
+ // Byte 22 (Bits 7~0) and Byte 23 are reserved in the base revision SPD general section
+ // Only bit 6 (right-aligned) for Byte 23 is reserved for subsequent SPD revisions
+ // Check for a valid value, and that reserved bit is not set
+ // We return Byte 23 arbitrarily as the failed byte, but any byte (20 - 23) would work
+ constexpr size_t MAX_VALID_VAL = (R == rev::V1_0) ? 0x0003FFFF : 0xBFFFFFFF;
+
+ constexpr uint64_t DATA_START_OFFSET = 32;
+ constexpr uint64_t RESERVED_BIT = DATA_START_OFFSET + 1;
+ // Bit 6 of byte 23 must be 0 (reserved for future use)
+ const bool RESERVED_BIT_VALUE = l_buffer.getBit<RESERVED_BIT>();
+
FAPI_TRY( mss::check::invalid_value(iv_target,
- l_buffer <= MAX_VALID_VAL,
+ l_buffer <= MAX_VALID_VAL && !RESERVED_BIT_VALUE,
23,
l_buffer,
mss::BAD_SPD_DATA,
OpenPOWER on IntegriCloud