diff options
author | Mike Jones <mjjones@us.ibm.com> | 2013-05-17 13:46:41 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-06-06 10:21:40 -0500 |
commit | 66474f4f93fd10ad3b35ed89cecc3d6b11e99eed (patch) | |
tree | d4eead386bbfce426e554bd35a105410689d5b9a /src/usr/hwpf/plat | |
parent | 3d8ff73f2435dda59135776a751d692779b045bb (diff) | |
download | talos-hostboot-66474f4f93fd10ad3b35ed89cecc3d6b11e99eed.tar.gz talos-hostboot-66474f4f93fd10ad3b35ed89cecc3d6b11e99eed.zip |
Retrieve attributes from VSPD AM Centaur VPD fields
Create a HWP accessor to retrieve Address Mirroring Data attributes from cvpd
record VSPD keyword AM.
Change-Id: I1b994814407d0747021c869515d8e08a6d02f7e5
RTC: 50574
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4781
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/plat')
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatAttributeService.C | 74 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatMBvpdAccess.C | 1 |
2 files changed, 75 insertions, 0 deletions
diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C index f98043756..13392988d 100644 --- a/src/usr/hwpf/plat/fapiPlatAttributeService.C +++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C @@ -34,6 +34,7 @@ #include <hwpf/fapi/fapiTarget.H> #include <hwpf/fapi/fapiHwpExecutor.H> #include <targeting/common/targetservice.H> +#include <targeting/common/predicates/predicatectm.H> #include <targeting/common/utilFilter.H> #include <errl/errlentry.H> #include <hwpf/plat/fapiPlatAttributeService.H> @@ -42,6 +43,7 @@ #include <devicefw/driverif.H> #include <hwpf/hwp/mvpd_accessors/getMvpdExL2SingleMemberEnable.H> #include <hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H> +#include <hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H> // The following file checks at compile time that all HWPF attributes are // handled by Hostboot. This is done to ensure that the HTML file listing @@ -1217,6 +1219,78 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData ( return l_rc; } +fapi::ReturnCode fapiPlatGetAddrMirrorData ( + const fapi::Target * i_pFapiTarget, + uint8_t &o_val ) +{ + fapi::ReturnCode l_rc; + TARGETING::Target * l_pTarget = NULL; + TARGETING::TargetHandleList l_mbaList; + uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}}; + + do { + // Get the Targeting Target + l_rc = getTargetingTarget(i_pFapiTarget, l_pTarget); + if (l_rc) + { + FAPI_ERR("fapiPlatGetAddrMirrorData:Error from getTargetingTarget"); + break; + } + + // Find the port and DIMM position + TARGETING::ATTR_MBA_PORT_type l_portPos = + l_pTarget->getAttr<TARGETING::ATTR_MBA_PORT>(); + TARGETING::ATTR_MBA_DIMM_type l_dimmPos = + l_pTarget->getAttr<TARGETING::ATTR_MBA_DIMM>(); + + // Find MBA target from DIMM target + getParentAffinityTargets (l_mbaList, l_pTarget, TARGETING::CLASS_UNIT, + TARGETING::TYPE_MBA, false); + + if (l_mbaList.size () != 1 ) + { + FAPI_ERR("fapiPlatGetAddrMirrorData: expect 1 mba %d ", + l_mbaList.size()); + + /*@ + * @errortype + * @moduleid fapi::MOD_PLAT_ATTR_SVC_GET_TARG_ATTR + * @reasoncode fapi::RC_NO_SINGLE_MBA + * @userdata1 Number of MBAs + * @devdesc fapiPlatGetAddrMirrorData could not find the + * expected 1 mba from the passed dimm target + */ + errlHndl_t l_pError = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi::MOD_PLAT_ATTR_SVC_GET_TARG_ATTR, + fapi::RC_NO_SINGLE_MBA, + l_mbaList.size()); + + // Attach the error log to the fapi::ReturnCode + l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); + break; + } + + // Get the Fapi Target + fapi::Target l_fapiTarget(TARGET_TYPE_MBA_CHIPLET, + static_cast<void *>(l_mbaList[0])); + + // Get the data using the HWP accessor + FAPI_EXEC_HWP(l_rc, getMBvpdAddrMirrorData, l_fapiTarget, l_val); + if (l_rc) + { + FAPI_ERR("fapiPlatGetAddrMirrorData:" + " Error from getMBvpdAddrMirrorData"); + break; + } + + // return the address mirroring data for the passed DIMM + o_val = l_val[l_portPos][l_dimmPos]; + + } while (0); + return l_rc; +} + fapi::ReturnCode fapiPlatGetEnableAttr ( fapi::AttributeId i_id, const fapi::Target * i_pFapiTarget, uint8_t & o_enable ) { diff --git a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C index 5ddf458de..c5efb2d96 100644 --- a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C +++ b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C @@ -117,6 +117,7 @@ fapi::ReturnCode MBvpdKeywordXlate(const fapi::MBvpdKeyword i_fapiKeyword, CVPD::LM, CVPD::MW, CVPD::MV, + CVPD::AM, }; const uint8_t NUM_MBVPD_KEYWORDS = sizeof(mbvpdFapiKeywordToHbKeyword)/sizeof(mbvpdFapiKeywordToHbKeyword[0]); |