summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2013-09-24 12:13:52 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-03 12:54:50 -0500
commit6083a3beed6e0428b3114d7d165b5ab75aefd0a0 (patch)
treedaeb010da5532a6900a8169524f8cb6d01e8657d /src/include/usr
parent49b90d0e63e55cc0bed64a5c6962d82391a3c3c9 (diff)
downloadtalos-hostboot-6083a3beed6e0428b3114d7d165b5ab75aefd0a0.tar.gz
talos-hostboot-6083a3beed6e0428b3114d7d165b5ab75aefd0a0.zip
Merge DDR3/DDR4 attributes with different raw data into common attributes
There are 4 SPD FAPI Attributes where there are separate FAPI Attributes for DDR3 and DDR4 because the raw data is interpreted differently and the FAPI enumeration matches the raw data. I agreed with Ken Wright that for these, there should be a common FAPI attribute that is handled by an Accessor HWP, the Accessor converts the data appropriately to the common enumeration. Right now the common enumeration matches DDR3 where possible to facilitate Cronus switchover from SPD Driver to Accessor, but eventually this could change. This change helps HWP code to not need to know the different between DDR3 and DDR4 DIMMs. Change-Id: I108937ab0bdfc534d9ffc1e391675f4c87875048 RTC: 82631 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6326 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/hwpf/hwp/spd_accessors/getSpdAttrAccessor.H89
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatAttributeService.H69
2 files changed, 134 insertions, 24 deletions
diff --git a/src/include/usr/hwpf/hwp/spd_accessors/getSpdAttrAccessor.H b/src/include/usr/hwpf/hwp/spd_accessors/getSpdAttrAccessor.H
new file mode 100644
index 000000000..c61fbc31a
--- /dev/null
+++ b/src/include/usr/hwpf/hwp/spd_accessors/getSpdAttrAccessor.H
@@ -0,0 +1,89 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/hwp/spd_accessors/getSpdAttrAccessor.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file getSpdAttrAccessor.H
+ *
+ * @brief Accessor HWP that gets DDR neutral DIMM SPD FAPI Attributes
+ *
+ * Handles DDR neutral attributes where raw SPD data cannot be returned,
+ * either:
+ * - The raw data has a different meaning between DDR3 and DDR4.
+ * - The raw data has a different size between DDR3 and DDR4.
+ * - The attribute does not map to a single field in both DDR3 and DDR4.
+ *
+ * This Accessor HWP reads the DDR specific attribute and figures out the
+ * data to return for the DDR neutral attribute.
+ */
+
+#ifndef _GETSPDDATAACCESSOR_
+#define _GETSPDDATAACCESSOR_
+
+#include <fapi.H>
+
+namespace fapi
+{
+ // Attributes supported
+ namespace getSpdAttr
+ {
+ enum Attr
+ {
+ SPD_SDRAM_BANKS = 0x01,
+ SPD_MODULE_NOMINAL_VOLTAGE = 0x02,
+ SPD_CAS_LATENCIES_SUPPORTED = 0x03,
+ SPD_MODULE_REVISION_CODE = 0x04,
+ };
+ }
+}
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*getSpdAttrAccessor_FP_t) (
+ const fapi::Target &,
+ const fapi::getSpdAttr::Attr,
+ void *,
+ const size_t);
+
+extern "C"
+{
+/**
+ * @brief Accessor HWP that gets DDR neutral DIMM SPD FAPI Attribute data
+ *
+ * FAPI_ATTR_GET checks at compile time that the user's attribute is the correct
+ * type. Assuming that the platform routes the access of the attribute to the
+ * corresponding attribute enum defined in this file (e.g. ATTR_SPD_SDRAM_BANKS
+ * -> SPD_SDRAM_BANKS) then the size of o_pVal will be correct, in the unlikely
+ * event of a misroute where the buffer is too small, an error will be returned.
+ *
+ * @param[in] i_dimm Reference to DIMM fapi target
+ * @param[in] i_attr The Attribute to get
+ * @param[out] o_pVal Pointer to data buffer filled in with attribute data
+ * @param[in] i_len Size of o_pVal
+ *
+ * @return fapi::ReturnCode Indicating success or error
+ */
+fapi::ReturnCode getSpdAttrAccessor(const fapi::Target & i_dimm,
+ const fapi::getSpdAttr::Attr i_attr,
+ void * o_pVal,
+ const size_t i_len);
+}
+
+#endif
diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
index 5e49540dc..31d654190 100644
--- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
+++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
@@ -29,18 +29,6 @@
* Note that platform code must provide the code.
*/
-/*
- * Change Log ******************************************************************
- * Flag Defect/Feature User Date Description
- * ------ -------------- ---------- ----------- ----------------------------
- * mjjones 06/27/2011 Created.
- * bofferdn 09/13/2011 Support fapi->hb mapping
- * thi 01/28/2013 Add SPD CUSTOM attr
- * dedahle 06/20/2013 Add Bad DIMM DQ Bitmap attr
- * whs 08/15/2013 79615 Clock Mapping,
- * DIMM timing and TSYS
- */
-
#ifndef FAPIPLATATTRIBUTESERVICE_H_
#define FAPIPLATATTRIBUTESERVICE_H_
@@ -61,6 +49,7 @@
#include <hwpf/hwp/mvpd_accessors/getMBvpdTermData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.H>
+#include <hwpf/hwp/spd_accessors/getSpdAttrAccessor.H>
#include <vpd/spdenums.H>
#include <dimmConsts.H>
#include <util/singleton.H>
@@ -581,6 +570,23 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
const fapi::Target * const i_pChipTarget,
uint32_t (&o_pllRingLength));
+/**
+ * @brief This function is called by the FAPI_ATTR_GET macro when getting
+ * DIMM SPD Attributes that are handled by an Accessor HWP
+ * It should not be called directly.
+ *
+ * @param[in] i_pDimm DIMM target pointer
+ * @param[in] i_attr Attribute ID
+ * @param[out] o_pVal Pointer to output variable
+ * @param[in] i_len Size of o_pVal
+ * @return ReturnCode. Zero on success, else error
+ */
+fapi::ReturnCode fapiPlatGetSpdAttrAccessor (
+ const fapi::Target * i_pDimm,
+ const fapi::getSpdAttr::Attr i_attr,
+ void * o_pVal,
+ size_t i_len);
+
} // namespace platAttrSvc
} // namespace fapi
@@ -628,9 +634,6 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
#define ATTR_SPD_MODULE_TYPE_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_TYPE, &(VAL), sizeof(VAL) )
-#define ATTR_SPD_SDRAM_BANKS_GETMACRO(ID, PTARGET, VAL) \
- fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
- fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::BANK_ADDRESS_BITS, &(VAL), sizeof(VAL) )
#define ATTR_SPD_SDRAM_DENSITY_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::DENSITY, &(VAL), sizeof(VAL) )
@@ -640,9 +643,6 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
#define ATTR_SPD_SDRAM_COLUMNS_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::COL_ADDRESS, &(VAL), sizeof(VAL) )
-#define ATTR_SPD_MODULE_NOMINAL_VOLTAGE_GETMACRO(ID, PTARGET, VAL) \
- fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
- fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_NOMINAL_VOLTAGE, &(VAL), sizeof(VAL) )
#define ATTR_SPD_NUM_RANKS_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_RANKS, &(VAL), sizeof(VAL) )
@@ -667,9 +667,6 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
#define ATTR_SPD_TCKMIN_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::TCK_MIN, &(VAL), sizeof(VAL) )
-#define ATTR_SPD_CAS_LATENCIES_SUPPORTED_GETMACRO(ID, PTARGET, VAL) \
- fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
- fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::CAS_LATENCIES_SUPPORTED, &(VAL), sizeof(VAL) )
#define ATTR_SPD_TAAMIN_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MIN_CAS_LATENCY, &(VAL), sizeof(VAL) )
@@ -763,9 +760,6 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
#define ATTR_SPD_MODULE_PART_NUMBER_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_PART_NUMBER, &(VAL), sizeof(VAL) )
-#define ATTR_SPD_MODULE_REVISION_CODE_GETMACRO(ID, PTARGET, VAL) \
- fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
- fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_REVISION_CODE, &(VAL), sizeof(VAL) )
#define ATTR_SPD_DRAM_MANUFACTURER_JEDEC_ID_CODE_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::DRAM_MANUFACTURER_ID, &(VAL), sizeof(VAL) )
@@ -847,6 +841,18 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
#define ATTR_SPD_LR_MR12_FOR_1866_2133_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::LRMM_MR12_FOR_1866_2133, &(VAL), sizeof(VAL) )
+#define ATTR_SPD_SDRAM_BANKS_DDR3_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::BANK_ADDRESS_BITS, &(VAL), sizeof(VAL) )
+#define ATTR_SPD_CAS_LATENCIES_SUPPORTED_DDR3_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::CAS_LATENCIES_SUPPORTED, &(VAL), sizeof(VAL) )
+#define ATTR_SPD_MODULE_REVISION_CODE_DDR3_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_REVISION_CODE, &(VAL), sizeof(VAL) )
+#define ATTR_SPD_MODULE_NOMINAL_VOLTAGE_DDR3_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::MODULE_NOMINAL_VOLTAGE, &(VAL), sizeof(VAL) )
#define ATTR_SPD_SDRAM_BANKGROUPS_DDR4_GETMACRO(ID, PTARGET, VAL) \
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::BANK_GROUP_BITS, &(VAL), sizeof(VAL) )
@@ -1773,4 +1779,19 @@ fapi::ReturnCode fapiPlatGetPllAttr(const fapi::AttributeId i_attrId,
( fapi::platAttrSvc::fapiPlatGetPllAttr( \
ATTR_MEMB_TP_BNDY_PLL_NEST4800_MEM1866_LENGTH, PTARGET, VAL ))
+//------------------------------------------------------------------------------
+// MACROs to support DIMM SPD Attributes that are handled by an Accessor HWP
+//------------------------------------------------------------------------------
+#define ATTR_SPD_SDRAM_BANKS_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttrAccessor(PTARGET, fapi::getSpdAttr::SPD_SDRAM_BANKS, &VAL, sizeof(VAL))
+#define ATTR_SPD_MODULE_NOMINAL_VOLTAGE_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttrAccessor(PTARGET, fapi::getSpdAttr::SPD_MODULE_NOMINAL_VOLTAGE, &VAL, sizeof(VAL))
+#define ATTR_SPD_CAS_LATENCIES_SUPPORTED_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttrAccessor(PTARGET, fapi::getSpdAttr::SPD_CAS_LATENCIES_SUPPORTED, &VAL, sizeof(VAL))
+#define ATTR_SPD_MODULE_REVISION_CODE_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetSpdAttrAccessor(PTARGET, fapi::getSpdAttr::SPD_MODULE_REVISION_CODE, &VAL, sizeof(VAL))
#endif // FAPIPLATATTRIBUTESERVICE_H_
OpenPOWER on IntegriCloud