summaryrefslogtreecommitdiffstats
path: root/src/usr/hdat
diff options
context:
space:
mode:
authornagurram-in <nagendra.g@in.ibm.com>2018-04-10 12:25:24 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-24 10:55:42 -0400
commit180536724195550d34b50ba1a59ba3bb2ba5d701 (patch)
tree51375c43107ae3318e2876f015a870c7ea7e1ec8 /src/usr/hdat
parent17d4c2b7e8a76de71bd3bb9e86109400c4a7c179 (diff)
downloadtalos-hostboot-180536724195550d34b50ba1a59ba3bb2ba5d701.tar.gz
talos-hostboot-180536724195550d34b50ba1a59ba3bb2ba5d701.zip
HDAT:Added new fields( dimm id and dimm running freq) in RAM area
Change-Id: Id68e1033668c9eff615d67963aad1bbad0965e7d Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57018 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: VENKATESH SAINATH <venkatesh.sainath@in.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hdat')
-rwxr-xr-xsrc/usr/hdat/hdatmsvpd.C17
-rwxr-xr-xsrc/usr/hdat/hdatmsvpd.H11
-rw-r--r--src/usr/hdat/hdatpcia.C4
-rwxr-xr-xsrc/usr/hdat/hdatram.H4
-rw-r--r--src/usr/hdat/hdatutil.C71
-rwxr-xr-xsrc/usr/hdat/hdatutil.H22
6 files changed, 119 insertions, 10 deletions
diff --git a/src/usr/hdat/hdatmsvpd.C b/src/usr/hdat/hdatmsvpd.C
index 66564f271..faca545fa 100755
--- a/src/usr/hdat/hdatmsvpd.C
+++ b/src/usr/hdat/hdatmsvpd.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -680,7 +680,9 @@ errlHndl_t HdatMsVpd::addRamFru(uint16_t i_msAreaId,
uint32_t i_slcaIndex,
uint16_t i_ramId,
uint16_t i_status,
- uint32_t i_size)
+ uint32_t i_size,
+ uint32_t i_dimmId,
+ uint32_t i_RamCurFreq)
{
errlHndl_t l_errlHndl = NULL;
@@ -699,6 +701,8 @@ errlHndl_t HdatMsVpd::addRamFru(uint16_t i_msAreaId,
{
l_ram->iv_ramArea.hdatRamAreaId = i_ramId;
l_ram->iv_ramArea.hdatRamStatus = i_status;
+ l_ram->iv_ramArea.hdatRamDimmId = i_dimmId;
+ l_ram->iv_ramArea.hdatRamCurFreq = i_RamCurFreq;
l_ram->iv_ramSize.hdatRamTotalSize = i_size;
// Add the RAM object to the mainstore area object
@@ -1425,14 +1429,19 @@ errlHndl_t HdatMsVpd::hdatLoadMsData(uint32_t &o_size, uint32_t &o_count)
TARGETING::ATTR_SLCA_INDEX_type l_dimmSlcaIndex =
l_pDimmTarget->getAttr<TARGETING::ATTR_SLCA_INDEX>();
-
+
+ uint32_t l_dimmId =
+ 1 << (31 - (l_pDimmTarget->getAttr<TARGETING::ATTR_FAPI_POS>() % MAX_DIMMS_PER_MCBIST));
+ uint32_t l_memBusFreq = getMemBusFreq(l_pDimmTarget);
l_err = addRamFru(l_index,
l_pDimmTarget,
l_dimmRid,
l_dimmSlcaIndex,
l_ramId,
l_status,
- (l_area)->ivSize);
+ (l_area)->ivSize,
+ l_dimmId,
+ l_memBusFreq);
if (l_err) // Failed to add ram fru information
{
diff --git a/src/usr/hdat/hdatmsvpd.H b/src/usr/hdat/hdatmsvpd.H
index a10d5c0eb..a9dd8f79e 100755
--- a/src/usr/hdat/hdatmsvpd.H
+++ b/src/usr/hdat/hdatmsvpd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -61,7 +61,7 @@ const uint32_t HDAT_MB_PER_GB = 1024;
const uint32_t MAX_CHIP_EC_CNT_PER_MSAREA = 2;
const uint32_t HDAT_START_INSTANCE = 0;
const uint32_t HDAT_RHB_MAX_RANGE_ENTRIES = 15;
-
+const uint32_t MAX_DIMMS_PER_MCBIST = 8;
/** @brief Structure version number
*/
@@ -721,6 +721,9 @@ class HdatMsVpd : public HdatHdif
* values from hdatRamStatus defined above
* @param[in] i_size -the total size of configured mainstore in this
* RAM area
+ * @param[in] i_dimmId - Dimm ID with bit positions signifying the target
+ * positions in the affinity path
+ * @param[in] i_dimmCurFreq - Current operating dimm frequency
*
* @return A null error log handle if successful, else the return code
* pointed to by errlHndl_t contains one of:
@@ -734,7 +737,9 @@ class HdatMsVpd : public HdatHdif
uint32_t i_slcaIndex,
uint16_t i_ramId,
uint16_t i_status,
- uint32_t i_size);
+ uint32_t i_size,
+ uint32_t i_dimmId,
+ uint32_t i_dimmCurFreq);
/**
* @brief Initialization of HdatMsVpd object.
*
diff --git a/src/usr/hdat/hdatpcia.C b/src/usr/hdat/hdatpcia.C
index 0f89604b9..f192b5387 100644
--- a/src/usr/hdat/hdatpcia.C
+++ b/src/usr/hdat/hdatpcia.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -550,6 +550,8 @@ errlHndl_t HdatPcia::hdatSetCoreInfo(const uint32_t i_index,
//Set Time Base - units of microseconds * 2^32
iv_spPcia[i_index].hdatTime.pciaTimeBase =
i_pProcTarget->getAttr<TARGETING::ATTR_TIME_BASE>();
+ // set the memory bus frequency
+ iv_spPcia[i_index].hdatTime.pciaMemBusFreq = getMemBusFreq(i_pProcTarget);
//Set ICache Info
//Cache Size Structure
diff --git a/src/usr/hdat/hdatram.H b/src/usr/hdat/hdatram.H
index 4c8e2ec20..5df390100 100755
--- a/src/usr/hdat/hdatram.H
+++ b/src/usr/hdat/hdatram.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -58,6 +58,8 @@ struct hdatRamAreaId_t
{
uint16_t hdatRamAreaId; // 0x0000 Identifier for this RAM area
uint16_t hdatRamStatus; // 0x0002 Status of the RAM DIMM
+ uint32_t hdatRamDimmId; // 0x0004 Dimm ID
+ uint32_t hdatRamCurFreq; // 0x0008 Dimm current operating frequency
} __attribute__ ((packed));
diff --git a/src/usr/hdat/hdatutil.C b/src/usr/hdat/hdatutil.C
index b45b3dd9c..64cd9b490 100644
--- a/src/usr/hdat/hdatutil.C
+++ b/src/usr/hdat/hdatutil.C
@@ -2139,6 +2139,77 @@ errlHndl_t hdatUpdateSMPLinkInfoData(hdatHDIFDataArray_t * i_SMPInfoFullPcrdHdrP
std::copy(l_SMPLinkInfoCntr.begin(), l_SMPLinkInfoCntr.end(),io_SMPInfoFullPcrdDataPtr);
HDAT_EXIT();
return l_errl;
+
+}
+
+uint32_t getMemBusFreq(const TARGETING::Target* i_pTarget)
+{
+
+ HDAT_ENTER();
+ TARGETING::ATTR_MSS_FREQ_type l_MemBusFreqInMHz = 0;
+
+ TARGETING::ATTR_CLASS_type l_class = GETCLASS(i_pTarget);
+ TARGETING::ATTR_TYPE_type l_type = GETTYPE(i_pTarget);
+ if((l_class == TARGETING::CLASS_CHIP) && (l_type == TARGETING::TYPE_PROC))
+ {
+ TARGETING::PredicateCTM l_mcbistPredicate(TARGETING::CLASS_UNIT,
+ TARGETING::TYPE_MCBIST);
+ TARGETING::PredicateHwas l_predHwasFunc;
+ TARGETING::PredicatePostfixExpr l_presentMcbist;
+ l_presentMcbist.push(&l_mcbistPredicate).
+ push(&l_predHwasFunc).And();
+ TARGETING::TargetHandleList l_mcbistList;
+
+ // Find Associated MCBIST list
+ TARGETING::targetService().getAssociated(l_mcbistList,
+ i_pTarget,
+ TARGETING::TargetService::CHILD_BY_AFFINITY,
+ TARGETING::TargetService::ALL,
+ &l_presentMcbist);
+ if(l_mcbistList.size() == 0)
+ {
+ HDAT_ERR("Didn't find any mcbist for a proc with huid [0x%08X]",
+ i_pTarget->getAttr<TARGETING::ATTR_HUID>());
+ }
+ else
+ {
+ TARGETING::Target *l_pMcbistTarget = l_mcbistList[0];
+ if( l_pMcbistTarget->tryGetAttr<TARGETING::ATTR_MSS_FREQ>
+ (l_MemBusFreqInMHz) == false )
+ {
+ HDAT_ERR(" MSS_FREQ not present for MCBIST with huid [0x%08X]",
+ l_pMcbistTarget->getAttr<TARGETING::ATTR_HUID>());
+ }
+ }
+ }
+ else if((l_class == TARGETING::CLASS_UNIT) && (l_type == TARGETING::TYPE_MCBIST))
+ {
+ if(i_pTarget->tryGetAttr<TARGETING::ATTR_MSS_FREQ>
+ (l_MemBusFreqInMHz) == false )
+ {
+ HDAT_ERR(" MSS_FREQ not present for MCBIST with huid [0x%08X]",
+ i_pTarget->getAttr<TARGETING::ATTR_HUID>());
+ }
+ }
+ else if((l_class == TARGETING::CLASS_UNIT) && (l_type == TARGETING::TYPE_DIMM))
+ {
+ TARGETING::TYPE l_mcbistType = TARGETING::TYPE_MCBIST;
+ if(getParent(i_pTarget,l_mcbistType)
+ ->tryGetAttr<TARGETING::ATTR_MSS_FREQ>(l_MemBusFreqInMHz) == false )
+ {
+ HDAT_ERR(" MSS_FREQ not present for MCBIST with huid [0x%08X]",
+ getParent(i_pTarget,l_mcbistType)->getAttr<TARGETING::ATTR_HUID>());
+ }
+ }
+ else
+ {
+
+ HDAT_ERR(" Input target with HUID [0x%08X] is not of proc/mcbist/dimm target type",
+ i_pTarget->getAttr<TARGETING::ATTR_HUID>());
+ }
+
+ HDAT_EXIT();
+ return l_MemBusFreqInMHz;
}
} //namespace HDAT
diff --git a/src/usr/hdat/hdatutil.H b/src/usr/hdat/hdatutil.H
index 5472c5ab2..062eba441 100755
--- a/src/usr/hdat/hdatutil.H
+++ b/src/usr/hdat/hdatutil.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -99,6 +99,20 @@ const uint16_t HDAT_VERSION3 = 3;
#define HDAT_NV_KWD_MAGIC_WRD 0x4E563030 // "NV00"
#define NUM_BRICKS_PER_OBUS 3
+
+/**
+ * Retrieve the CLASS of the target, or return NA if the target is NULL
+ */
+#define GETCLASS(pTarget) (((pTarget) == NULL) ? (TARGETING::CLASS_NA) : \
+ ((pTarget)->getAttr<TARGETING::ATTR_CLASS>()))
+
+/**
+ * * Retrieve the TYPE of the target, or return NA if the target is NULL
+ * */
+#define GETTYPE(pTarget) (((pTarget) == NULL) ? (TARGETING::TYPE_NA) : \
+ ((pTarget)->getAttr<TARGETING::ATTR_TYPE>()))
+
+
namespace HDAT
{
@@ -595,6 +609,12 @@ errlHndl_t hdatUpdateSMPLinkInfoData(hdatHDIFDataArray_t * i_SMPInfoFullPcrdHdrP
TARGETING::Target* i_pProcTarget);
+/******************************************************************************
+ * @brief get Memory bus frequency of given proc target.
+ * @param[in] i_pTarget : input Proc target handle
+ * @return Memory bus frequency. upon any error conditions it returns 0.
+*******************************************************************************/
+uint32_t getMemBusFreq(const TARGETING::Target* i_pTarget);
};// end namespace
#endif // HDATUTILITY_H
OpenPOWER on IntegriCloud