Skip to content

Commit

Permalink
Honor DDIMM EFD metadata to choose OMI frequencies
Browse files Browse the repository at this point in the history
There are two places where the list of supported frequencies are
listed.  First, there are a couple of bytes that list the overall
support.  Second, there are the EFD buckets themselves.  The
previous code walked all the buckets but ignored the summary bytes.
In order to avoid drastically unique SPD images for Gemini, we are
adding support to honor the summary bytes so we can choose specific
speeds to run at.

Change-Id: I82477468eca06d9c23fd8cdc70fa583d49f7d4bf
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81385
Reviewed-by: ANDRE A MARIN <aamarin@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81447
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
dcrowell77 authored and crgeddes committed Aug 6, 2019
1 parent af4454c commit 0606bb7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/import/chips/p9/procedures/hwp/accessors/ddimm_get_efd.C 100644 → 100755
Expand Up @@ -82,6 +82,8 @@ const uint16_t SPD_EFD_COUNT_MASK = 0x003F;
// Offset to the EFD meta data within the SPD.
// size is 128 bytes; address 288 to 415; 32 EFD meta data's sized 4 bytes each
const size_t SPD_EFD_META_DATA_ADDR = 288;
// Offset to Host Interface Speed Supported within the SPD.
const size_t SPD_SUPPORTED_HOST_SPEEDS_ADDR = 205;

/// SPD - EFD meta data constants
// Size of the EFD meta data's within the SPD
Expand Down Expand Up @@ -448,6 +450,8 @@ extern "C"
const uint8_t* l_efdMetaDataNptr(nullptr);
// Pointer to an individual EFD
const uint8_t* l_efdDataNptr(nullptr);
// Host Interface Supported Speeds field
uint16_t l_supportedSpeeds(0);

// Fill in a data buffer for FFDC purposes that contains
// the first 8 bytes from the SPD (freq,rank,channel,dimms)
Expand Down Expand Up @@ -683,7 +687,7 @@ extern "C"
// No need to swap endian, already in host format
l_freqMask = ddrFrequencyToBitMask(io_vpdInfo.iv_omi_freq_mhz);

FAPI_DBG ( "ddr4_get_efd: Caller supplied frquency = %d",
FAPI_DBG ( "ddr4_get_efd: Caller supplied frequency = %d",
io_vpdInfo.iv_omi_freq_mhz );

// Confirm that mapping the frequency succeeded
Expand Down Expand Up @@ -719,7 +723,7 @@ extern "C"
FAPI_TRY(fapi2::FAPI2_RC_FALSE);
}

FAPI_DBG ("ddr4_get_efd: Caller supplied frquency = %d, "
FAPI_DBG ("ddr4_get_efd: Caller supplied frequency = %d, "
"converted to frequency bit value mask = 0x%.4X",
io_vpdInfo.iv_omi_freq_mhz, l_freqMask);

Expand Down Expand Up @@ -767,6 +771,24 @@ extern "C"
//// Fourthly, find the EFD that matches the given frequency
//// and master rank

// Check the master list of supported frequencies before walking
// through the EFDs
l_supportedSpeeds = *reinterpret_cast<const uint16_t*>
(i_spdBuffer + SPD_SUPPORTED_HOST_SPEEDS_ADDR);
l_supportedSpeeds = le16toh(l_supportedSpeeds);
FAPI_ASSERT( l_freqMask & l_supportedSpeeds,
fapi2::DDIMM_UNSUPPORTED_FREQUENCY().
set_UNSUPPORTED_FREQ(static_cast<uint32_t>
(io_vpdInfo.iv_omi_freq_mhz)).
set_SUPPORTED_FREQS(l_supportedSpeeds).
set_OCMB_CHIP_TARGET(i_ocmbFapi2Target).
set_VPD_TYPE(io_vpdInfo.iv_vpd_type).
set_DDR_TYPE(static_cast<uint32_t>
(i_spdBuffer[SPD_MEM_TYPE_ADDR])),
"Invalid frequency for this DIMM - request=%d, supported mask=%.4X",
io_vpdInfo.iv_omi_freq_mhz, l_supportedSpeeds );


// Point to the beginning of the EFD meta data, AKA EFD[0] meta data.
l_efdMetaDataPtr = i_spdBuffer + SPD_EFD_META_DATA_ADDR;

Expand Down
23 changes: 23 additions & 0 deletions src/import/chips/p9/procedures/xml/error_info/ddimm_get_efd.xml 100644 → 100755
Expand Up @@ -219,6 +219,29 @@
</callout>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_DDIMM_UNSUPPORTED_FREQUENCY</rc>
<description>Chosen frequency not supported by this DDIMM</description>
<ffdc>UNSUPPORTED_FREQ</ffdc>
<ffdc>SUPPORTED_FREQS</ffdc>
<ffdc>OCMB_CHIP_TARGET</ffdc>
<ffdc>VPD_TYPE</ffdc>
<ffdc>DDR_TYPE</ffdc>
<!-- This is always a code bug. -->
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
<!-- It could also be bogus SPD content -->
<callout>
<hw>
<hwid>VPD_PART</hwid>
<refTarget>OCMB_CHIP_TARGET</refTarget>
</hw>
<priority>LOW</priority>
</callout>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_DDIMM_GET_EFD_UNSUPPORTED_FREQUENCY</rc>
<description>Invalid Frequency. Valid values are 12800, 14930, 17060,
Expand Down

0 comments on commit 0606bb7

Please sign in to comment.