Skip to content

Commit

Permalink
Fix dmb_revision size in ddimm_get_efd
Browse files Browse the repository at this point in the history
Change-Id: I159682143e4c8f65d9a154fc3ebc6e0cedbf34b4
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84131
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Dev-Ready: Mark Pizzutillo <mark.pizzutillo@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>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84147
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
markypizz authored and crgeddes committed Sep 27, 2019
1 parent 7148b00 commit d80f7fc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/import/chips/p9/procedures/hwp/accessors/ddimm_get_efd.C
Expand Up @@ -222,7 +222,7 @@ bool check_valid_mfg_id(const uint16_t i_mfg_id)
/// @param[in] i_dmb_revision DMB revision
/// @return expected DMB revision for ID
///
uint16_t check_valid_dmb_revision(const uint16_t i_mfg_id, const uint16_t i_dmb_revision)
bool check_valid_dmb_revision(const uint16_t i_mfg_id, const uint8_t i_dmb_revision)
{
if (i_mfg_id == SPD_DDR4_DMB_MFG_ID_IBM)
{
Expand Down Expand Up @@ -459,7 +459,7 @@ extern "C"
uint16_t l_efdCount{0}; // The number of EFDs
size_t l_efdSize{0}; // The size of an EFD, not EFD meta data
uint16_t l_dmbMfgId{0}; // The DMB manufacture ID
uint16_t l_dmb_revision{0};
uint8_t l_dmb_revision{0};
uint16_t l_freqMask{0}; // The frequency mask as found in EFD
uint8_t l_rankMask{0}; // The rank mask as found in EFD
size_t ii{0}; // A loop index
Expand Down Expand Up @@ -670,9 +670,7 @@ extern "C"
FAPI_DBG ( "ddr4_get_efd: SPD DMB manufacturer ID = 0x%.4X",
io_vpdInfo.iv_dmb_mfg_id);

l_dmb_revision = *reinterpret_cast<const uint16_t*>(&i_spdBuffer[SPD_DMB_REVISION_ADDR]);
// Swap endianess to host format.
l_dmb_revision = le16toh(l_dmb_revision);
l_dmb_revision = *reinterpret_cast<const uint8_t*>(&i_spdBuffer[SPD_DMB_REVISION_ADDR]);

// Confirm that the DMB revision is what is expected
FAPI_ASSERT( check_valid_dmb_revision(l_dmbMfgId, l_dmb_revision),
Expand Down

0 comments on commit d80f7fc

Please sign in to comment.