diff options
author | Ben Gass <bgass@us.ibm.com> | 2017-02-14 03:06:01 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-02-23 10:54:39 -0500 |
commit | 067163534e2acd38d47bf45378bb90c875f5dc43 (patch) | |
tree | b8d4c0ed5d0caaf64837e4bb9a338d51979dc3f9 /src/usr/scom | |
parent | 9a631c770d3252b2309eba5cf6b5a07a6067dd97 (diff) | |
download | talos-hostboot-067163534e2acd38d47bf45378bb90c875f5dc43.tar.gz talos-hostboot-067163534e2acd38d47bf45378bb90c875f5dc43.zip |
Updating NV scom address xlate for dd2.
Change-Id: I7d6dea78895807554b692f3ca9696a3de2ba8986
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36411
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Dev-Ready: Brent Wieman <bwieman@us.ibm.com>
Reviewed-by: Brent Wieman <bwieman@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36428
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr/scom')
-rw-r--r-- | src/usr/scom/scomtrans.C | 83 | ||||
-rw-r--r-- | src/usr/scom/scomtrans.H | 9 |
2 files changed, 91 insertions, 1 deletions
diff --git a/src/usr/scom/scomtrans.C b/src/usr/scom/scomtrans.C index 089b74ec2..518585f7f 100644 --- a/src/usr/scom/scomtrans.C +++ b/src/usr/scom/scomtrans.C @@ -304,6 +304,10 @@ errlHndl_t p9_translation (TARGETING::Target * &i_target, p9ChipUnits_t l_chipUnit = NONE; std::vector<p9_chipUnitPairing_t> l_scomPairings; + //Need to pass the chip/ec level into the translate function + uint32_t l_chipLevel = getChipLevel(i_target); + l_chip_mode |= l_chipLevel; + //Make sure that scom addr is related to a chip unit uint32_t isChipUnitScomRC = p9_scominfo_isChipUnitScom(io_addr, @@ -552,8 +556,10 @@ errlHndl_t p9_translation (TARGETING::Target * &i_target, return l_err; } +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// bool getChipUnit (TARGETING::TYPE i_type, - p9ChipUnits_t &o_chipUnit) + p9ChipUnits_t &o_chipUnit) { bool l_isError = false; switch(i_type) @@ -656,6 +662,81 @@ bool getChipUnit (TARGETING::TYPE i_type, } +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +/** + * @brief Computes the chip/ddlevel value to be passed into translator + */ +uint32_t getChipLevel (TARGETING::Target* i_target) +{ + TARGETING::Target* l_chip = i_target; + + TARGETING::Target* l_parentChip = const_cast<TARGETING::Target *> + (TARGETING::getParentChip(i_target)); + if( l_parentChip ) + { + l_chip = l_parentChip; + } + + TARGETING::ATTR_MODEL_type l_model = + l_chip->getAttr<TARGETING::ATTR_MODEL>(); + TARGETING::ATTR_EC_type l_ec = + l_chip->getAttr<TARGETING::ATTR_EC>(); + + // convert to scominfo types + uint32_t l_chipLevel = 0; + switch( l_model ) + { + case(TARGETING::MODEL_NIMBUS): + switch(l_ec) + { + case(0x10): + l_chipLevel = P9N_DD1_SI_MODE; + break; + case(0x20): + l_chipLevel = P9N_DD2_SI_MODE; + break; + + case(0x00): + // before ATTR_EC is set, default to newest level + l_chipLevel = P9N_DD2_SI_MODE; + break; + default: + TRACFCOMP( g_trac_scom, + "Unsupported Nimbus EC 0x%X", l_ec ); + assert(false,"Unsupported Nimbus EC"); + } + break; + case(TARGETING::MODEL_CUMULUS): + switch(l_ec) + { + case(0x10): + l_chipLevel = P9C_DD1_SI_MODE; + break; + case(0x20): + l_chipLevel = P9C_DD2_SI_MODE; + break; + + case(0x00): + // before ATTR_EC is set, default to newest level + l_chipLevel = P9C_DD2_SI_MODE; + break; + default: + TRACFCOMP( g_trac_scom, + "Unsupported Cumulus EC 0x%X", l_ec ); + assert(false,"Unsupported Cumulus EC"); + } + break; + default: + TRACFCOMP( g_trac_scom, + "Unsupported Chip Type %d", l_model ); + assert(false,"Unsupported Chip Type"); + } + + return l_chipLevel; +} + + } // end namespace //@TODO RTC: 139953 //Need to support centaur chip translations diff --git a/src/usr/scom/scomtrans.H b/src/usr/scom/scomtrans.H index 5b1d8e90b..f78249daf 100644 --- a/src/usr/scom/scomtrans.H +++ b/src/usr/scom/scomtrans.H @@ -89,6 +89,15 @@ errlHndl_t p9_translation (TARGETING::Target * &i_target, bool getChipUnit (TARGETING::TYPE i_type, p9ChipUnits_t &o_chipUnit); +/** + * @brief Computes the chip/ddlevel value to be passed into translator + * + * @param[in] i_target SCom target is passed in + * @return uint32_t Chip/ddlevel mode value for target, + * see p9_scominfo.H for values + */ +uint32_t getChipLevel (TARGETING::Target* i_target); + }; // End namespace |