Skip to content

Commit

Permalink
Fix SPD cas latency assert bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aamarin authored and crgeddes committed Mar 1, 2019
1 parent dadbba5 commit 877a032
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/import/generic/memory/lib/spd/common/ddr4/spd_decoder_ddr4.H
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 877a032

Please sign in to comment.