diff options
author | nagurram-in <nagendra.g@in.ibm.com> | 2017-07-25 05:46:42 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-22 10:14:53 -0400 |
commit | 149582234aedac180b3ec210e773bdfb0867bad7 (patch) | |
tree | e5eeecf3312bd85b2bb541bc5904e1f8b2a5bb12 /src/usr/hdat | |
parent | 6a8caef78b3bd678fa9412c9734f23bc523ad37e (diff) | |
download | blackbird-hostboot-149582234aedac180b3ec210e773bdfb0867bad7.tar.gz blackbird-hostboot-149582234aedac180b3ec210e773bdfb0867bad7.zip |
Memory Controller ID addition in HDAT MSAREA structure
Change-Id: I007e3fe76b90d3ca714200cae246fb103bba5d25
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43590
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>
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-x | src/usr/hdat/hdatiplparms.C | 72 | ||||
-rwxr-xr-x | src/usr/hdat/hdatmsarea.C | 4 | ||||
-rwxr-xr-x | src/usr/hdat/hdatmsarea.H | 5 | ||||
-rwxr-xr-x | src/usr/hdat/hdatmsvpd.C | 21 | ||||
-rwxr-xr-x | src/usr/hdat/hdatmsvpd.H | 4 | ||||
-rw-r--r-- | src/usr/hdat/hdatutil.C | 2 |
6 files changed, 34 insertions, 74 deletions
diff --git a/src/usr/hdat/hdatiplparms.C b/src/usr/hdat/hdatiplparms.C index 4f8bcc77e..7e4bc6788 100755 --- a/src/usr/hdat/hdatiplparms.C +++ b/src/usr/hdat/hdatiplparms.C @@ -43,6 +43,7 @@ #include <vpd/mvpdenums.H> #include <pnor/pnorif.H> #include <util/align.H> +#include <arch/pvrformat.H> #include <devicefw/userif.H> #include <targeting/common/util.H> @@ -569,73 +570,12 @@ void HdatIplParms::hdatGetSystemParamters() // No Anchor Card in BMC systems this->iv_hdatIPLParams->iv_sysParms.hdatProcFeatCode = 0; - // Get system information - effective PVR - TARGETING::ATTR_EFFECTIVE_EC_type l_effectiveEc; - if(l_pSysTarget->tryGetAttr<TARGETING::ATTR_EFFECTIVE_EC>(l_effectiveEc)) - { - //Convert Ec format to PVR Ec format - uint32_t l_pvrEc = ( ((l_effectiveEc & 0xF0) << 4) | - (l_effectiveEc & 0xF) ); - - TARGETING::PredicateCTM l_procFilter(TARGETING::CLASS_CHIP, - TARGETING::TYPE_PROC); - - TARGETING::PredicateHwas l_predHwas; - l_predHwas.present(true); - - TARGETING::PredicatePostfixExpr l_presentProc; - l_presentProc.push(&l_procFilter).push(&l_predHwas).And(); - - TARGETING::TargetHandleList l_procList; + // Set the PVR + PVR_t l_pvr( mmio_pvr_read() & 0xFFFFFFFF ); + this->iv_hdatIPLParams->iv_sysParms.hdatEffectivePvr = l_pvr.word; - //Get all Procs in the system - TARGETING::targetService(). - getAssociated(l_procList, l_pSysTarget, - TARGETING::TargetService::CHILD, - TARGETING::TargetService::ALL, &l_presentProc); - - if(l_procList.size() > 0) - { - TARGETING::Target *l_procTarget = l_procList[0]; - ATTR_MODEL_type l_procModel; - - if(l_procTarget->tryGetAttr<ATTR_MODEL>(l_procModel)) - { - //Effective Processor Version Register (PVR) - // bits 0-15: Processor version number - // bits 16-19: Reserved - // bits 20-23: Full RIT - // bits 24-27: Reserved - // bits 28-31: Minor revision level - - if(l_procModel == MODEL_MURANO) - { - this->iv_hdatIPLParams->iv_sysParms.hdatEffectivePvr = - 0x004B0000 | l_pvrEc; - } - else if(l_procModel == MODEL_VENICE) - { - this->iv_hdatIPLParams->iv_sysParms.hdatEffectivePvr = - 0x004D0200 ; - } - HDAT_DBG(" Effective PVR :0X%x", - this->iv_hdatIPLParams->iv_sysParms.hdatEffectivePvr); - } - else - { - HDAT_ERR("Error reading attribute ATTR_MODEL"); - } - } - else - { - HDAT_ERR("No Processors found in the system"); - assert(l_procList.size() > 0); - } - } - else - { - HDAT_ERR(" Error in getting attribute EFFECTIVE_EC"); - } + HDAT_DBG(" Effective PVR :0X%x", + this->iv_hdatIPLParams->iv_sysParms.hdatEffectivePvr); // Get system type iv_hdatIPLParams->iv_sysParms.hdatSysType = diff --git a/src/usr/hdat/hdatmsarea.C b/src/usr/hdat/hdatmsarea.C index ceb469828..a4566e857 100755 --- a/src/usr/hdat/hdatmsarea.C +++ b/src/usr/hdat/hdatmsarea.C @@ -308,7 +308,8 @@ errlHndl_t HdatMsArea::addAddrRange(hdatMsAddr_t &i_start, uint32_t i_procChipId, bool i_rangeIsMirrorable, uint8_t i_mirroringAlgorithm, - hdatMsAddr_t &i_startMirrAddr) + hdatMsAddr_t &i_startMirrAddr, + uint32_t i_memcntlrId) { HDAT_ENTER(); errlHndl_t l_errlHndl = NULL; @@ -327,6 +328,7 @@ errlHndl_t HdatMsArea::addAddrRange(hdatMsAddr_t &i_start, i_rangeIsMirrorable ? 1 : 0; l_addr->hdatSMMAttributes.hdatMirroringAlgorithm = i_mirroringAlgorithm; l_addr->hdatStartMirrAddr = i_startMirrAddr; + l_addr->hdatMsAreaMemCntId = i_memcntlrId; iv_addrRngArrayHdr.hdatArrayCnt++; } else diff --git a/src/usr/hdat/hdatmsarea.H b/src/usr/hdat/hdatmsarea.H index 850adc0c2..c80c03677 100755 --- a/src/usr/hdat/hdatmsarea.H +++ b/src/usr/hdat/hdatmsarea.H @@ -137,6 +137,7 @@ struct hdatMsAreaAddrRange_t hdatSMMAttributes_t hdatSMMAttributes; // 0x0014 SMM Attributes hdatMsAddr_t hdatStartMirrAddr; // 0x0018 Starting Mirrorable Address // for range + uint32_t hdatMsAreaMemCntId; // 0x0020 Memory Controller ID } __attribute__ ((packed)); @@ -425,6 +426,7 @@ public: * algorithm to use * @param[in] i_startMirrAddr - Specifies the starting mirrorable * address for range + * @param[in] i_memcntlrId - Memory Controller ID * * @return A null error log handle if successful, else the return code pointed * to by o_errlHndl contains one of: @@ -436,7 +438,8 @@ public: uint32_t i_procChipId, bool i_rangeIsMirrorable, uint8_t i_mirroringAlgorithm, - hdatMsAddr_t &i_startMirrAddr); + hdatMsAddr_t &i_startMirrAddr, + uint32_t i_memcntlrId); /** diff --git a/src/usr/hdat/hdatmsvpd.C b/src/usr/hdat/hdatmsvpd.C index 9b1fd453d..9a488351c 100755 --- a/src/usr/hdat/hdatmsvpd.C +++ b/src/usr/hdat/hdatmsvpd.C @@ -604,7 +604,8 @@ errlHndl_t HdatMsVpd::addMsAreaAddr(uint16_t i_msAreaId, uint32_t i_procChipId, bool i_rangeIsMirrorable, uint8_t i_mirroringAlgorithm, - uint64_t i_startMirrAddr) + uint64_t i_startMirrAddr, + uint32_t i_hdatMemCntrlID) { errlHndl_t l_errlHndl = NULL; HdatMsArea *l_obj; @@ -616,7 +617,7 @@ errlHndl_t HdatMsVpd::addMsAreaAddr(uint16_t i_msAreaId, { l_obj = HDAT_MS_AREA(i_msAreaId); l_errlHndl = l_obj->addAddrRange(i_start, i_end, i_procChipId, - i_rangeIsMirrorable, i_mirroringAlgorithm, l_startMirrAddr); + i_rangeIsMirrorable, i_mirroringAlgorithm, l_startMirrAddr, i_hdatMemCntrlID); } else { @@ -1463,6 +1464,7 @@ errlHndl_t HdatMsVpd::hdatLoadMsData(uint32_t &o_size, uint32_t &o_count) uint64_t l_hdatMirrorAddr_x = 0x0ull; uint64_t l_hdatMirrorAddr = 0x0ull; + uint32_t l_hdatMemcntrlID = 0x0 ; uint8_t l_hdatMirrorAlogrithm = 0xFF; bool l_rangeIsMirrorable = false; @@ -1515,13 +1517,26 @@ errlHndl_t HdatMsVpd::hdatLoadMsData(uint32_t &o_size, uint32_t &o_count) } } } + if(l_pProcTarget->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_NIMBUS) + { + // Set the memory controller ID + l_hdatMemcntrlID |= 1 << (31 - l_pMcbistTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>()); + l_hdatMemcntrlID |= 1 << (31 - (l_pMcsTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>() + 4)); + l_hdatMemcntrlID |= 1 << (31 - (l_pMcaTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>() + 8)); + } + else if(l_pProcTarget->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_CUMULUS) + { + //TODO : MEmory controller ID for cumulus need to be defined. + HDAT_INF("Memory controller ID : 0 since this is Cumulus proc"); + } l_err = addMsAreaAddr(l_index, l_addr_range, l_end, l_procChipId, l_rangeIsMirrorable, l_hdatMirrorAlogrithm, - l_hdatMirrorAddr); + l_hdatMirrorAddr, + l_hdatMemcntrlID); if(NULL != l_err) { HDAT_ERR("Error in adding addMsAreaAddr" diff --git a/src/usr/hdat/hdatmsvpd.H b/src/usr/hdat/hdatmsvpd.H index 273de55d1..0f3b7924f 100755 --- a/src/usr/hdat/hdatmsvpd.H +++ b/src/usr/hdat/hdatmsvpd.H @@ -626,6 +626,7 @@ class HdatMsVpd : public HdatHdif * algorithm to use * @param[in] i_startMirrAddr - Specifies the starting mirrorable * address for range + * @param[in] i_hdatMemCntlID - Memory Controller ID * * @return A null error log handle if successful, else the return code * pointed to by errlHndl_t contains one of: @@ -638,7 +639,8 @@ class HdatMsVpd : public HdatHdif uint32_t i_procChipId, bool i_rangeIsMirrorable = false, uint8_t i_mirroringAlgorithm = 0, - uint64_t i_startMirrAddr = 0); + uint64_t i_startMirrAddr = 0, + uint32_t i_hdatMemCntlID = 0); /** diff --git a/src/usr/hdat/hdatutil.C b/src/usr/hdat/hdatutil.C index abfa1834a..1c013dd72 100644 --- a/src/usr/hdat/hdatutil.C +++ b/src/usr/hdat/hdatutil.C @@ -425,8 +425,6 @@ void hdatGetLocationCodePrefix(char *o_locCode) { strcat(o_locCode,"OPWR"); strcat(o_locCode,"."); - strcat(o_locCode,"BAR"); - strcat(o_locCode,"."); strcat(o_locCode,(const char*)l_serialNumber); } else |