diff options
| author | Dan Crowell <dcrowell@us.ibm.com> | 2015-03-22 23:03:57 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-04-02 17:47:36 -0500 |
| commit | 94a57132d0db82ce9ad4d952d4ea02550aea84f2 (patch) | |
| tree | 2e8038aabf617edc7e9dd56652ea33b4b99b3d57 /src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C | |
| parent | 314970fb0227e563a9d5a380cbb5da9c6669988d (diff) | |
| download | blackbird-hostboot-94a57132d0db82ce9ad4d952d4ea02550aea84f2.tar.gz blackbird-hostboot-94a57132d0db82ce9ad4d952d4ea02550aea84f2.zip | |
Add support for POWER_CONTROL_CAPABLE to ISDIMMs
Change-Id: If9de980385cac7706b321a9fefc1158dc540b7e0
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16527
Tested-by: Jenkins Server
Reviewed-by: William H. Schwartz <whs@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C')
| -rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C b/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C index 4e4fe0291..491e0c19c 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C +++ b/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014 */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -40,38 +40,38 @@ fapi::ReturnCode getControlCapableData( const fapi::Target &i_mbTarget, uint8_t & o_val) { - //Record:VSPD, Keyword:MR, offset: 253, 1 byte. - const uint32_t MR_KEYWORD_SIZE = 255; + fapi::ReturnCode l_rc; - struct mr_keyword - { - uint8_t filler[253]; - uint8_t position; //offset 253 - uint8_t extraFiller[MR_KEYWORD_SIZE-sizeof(filler)-sizeof(position)]; - }; - - fapi::ReturnCode l_fapirc; - mr_keyword * l_pMrBuffer = new mr_keyword; - uint32_t l_MrBufsize = MR_KEYWORD_SIZE; - do{ - - l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, - fapi::MBVPD_KEYWORD_MR, - i_mbTarget, - reinterpret_cast<uint8_t *>(l_pMrBuffer), - l_MrBufsize); - if(l_fapirc) + FAPI_DBG("getControlCapableData: start"); + do { + // ATTR_VPD_POWER_CONTROL_CAPABLE is at the membuf level, but the + // getMBvpdAttr() function takes a mba, so need to do a + // conversion + std::vector<fapi::Target> l_mbas; + l_rc = fapiGetChildChiplets( i_mbTarget, + fapi::TARGET_TYPE_MBA_CHIPLET, + l_mbas ); + if( l_rc ) { - FAPI_ERR("getControlCapableData: Read of MR Keyword failed"); + FAPI_ERR("getControlCapableData: fapiGetChildChiplets failed"); break; } - o_val = l_pMrBuffer->position; - }while(0); + // If we don't have any functional MBAs then we will fail in + // the other function so just return a default value here + if( l_mbas.empty() ) + { + o_val = fapi::ENUM_ATTR_VPD_POWER_CONTROL_CAPABLE_NONE; + break; + } - delete l_pMrBuffer; - l_pMrBuffer = NULL; + // Call a VPD Accessor HWP to get the data + FAPI_EXEC_HWP(l_rc, getMBvpdAttr, + l_mbas[0], ATTR_VPD_POWER_CONTROL_CAPABLE, + &o_val, sizeof(ATTR_VPD_POWER_CONTROL_CAPABLE_Type)); + } while(0); + FAPI_DBG("getControlCapableData: end"); - return l_fapirc; + return l_rc; } } |

