diff options
author | Bill Schwartz <whs@us.ibm.com> | 2013-11-15 17:23:29 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-12-09 12:07:20 -0600 |
commit | 5ec9d6332a0b9c91b133690ab356dc4052a5e291 (patch) | |
tree | 19e95ce95b075f371bbbdc79abca6571351fa962 /src/usr/hwpf/hwp/mvpd_accessors | |
parent | 8419ba440403c1b02b74ad89a91fccd85fa45ea9 (diff) | |
download | talos-hostboot-5ec9d6332a0b9c91b133690ab356dc4052a5e291.tar.gz talos-hostboot-5ec9d6332a0b9c91b133690ab356dc4052a5e291.zip |
Route ATTR_L4_BANK_DELETE_VPD to C-VPD
Create MBvpd accessor to access cvpd record VSPD keyword MX for get and set
for attribute ATTR_L4_BANK_DELETE_VPD.
Split and rename fapiwinkle test since its all hwp mvpd & mbvpd accessor tests
Change-Id: I3bae2e89b2ef7fd30a88c269d42223c00333bb72
RTC: 91431
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7278
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/mvpd_accessors')
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.C | 125 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk | 3 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml | 8 |
3 files changed, 135 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.C b/src/usr/hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.C new file mode 100644 index 000000000..cb2ade3ee --- /dev/null +++ b/src/usr/hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.C @@ -0,0 +1,125 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $Id: accessMBvpdL4BankDelete.C,v 1.2 2013/11/21 17:17:59 whs Exp $ +/** + * @file accessMBvpdL4BankDelete.C + * + * @brief get the L4 Bank Delete data from MBvpd record VSPD keyword MX + * + */ + +#include <stdint.h> + +// fapi support +#include <fapi.H> +#include <fapiUtil.H> +#include <accessMBvpdL4BankDelete.H> + +extern "C" +{ +using namespace fapi; + +fapi::ReturnCode accessMBvpdL4BankDelete( + const fapi::Target &i_mbTarget, + uint32_t & io_val, + const fapi::MBvpdL4BankDeleteMode i_mode ) +{ + fapi::ReturnCode l_fapirc; + uint16_t l_l4BankDelete = 0; + uint32_t l_bufSize = sizeof(l_l4BankDelete); + + FAPI_DBG("accessMBvpdL4BankDelete: entry "); + + do { + // check for get/set mode + if (GET_L4_BANK_DELETE_MODE == i_mode) // retrieve value from vpd + { + // get vpd version from record VSPD keyword MX + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_MX, + i_mbTarget, + reinterpret_cast<uint8_t *>(&l_l4BankDelete), + l_bufSize); + if (l_fapirc) + { + FAPI_ERR("accessMBvpdL4BankDelete: Read of MX keyword failed"); + break; // break out with fapirc + } + + // Check that sufficient size was returned. + if (l_bufSize < sizeof(l_l4BankDelete) ) + { + FAPI_ERR("accessMBvpdL4BankDelete:" + " less keyword data returned than expected %d < %d", + l_bufSize, sizeof(l_l4BankDelete)); + const uint32_t & KEYWORD = sizeof(l_l4BankDelete); + const uint32_t & RETURNED_SIZE = l_bufSize; + FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED); + break; // break out with fapirc + } + // return value + io_val = static_cast<uint32_t>(FAPI_BE16TOH(l_l4BankDelete)); + + FAPI_DBG("accessMBvpdL4BankDelete: get L4 Bank Delete = 0x%08x", + io_val); + } + else if (SET_L4_BANK_DELETE_MODE == i_mode) // update vpd value + { + + uint16_t l_val = static_cast<uint16_t>(io_val); + l_l4BankDelete = FAPI_HTOBE16(l_val); + + // update vpd record VSPD keyword MX + l_fapirc = fapiSetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_MX, + i_mbTarget, + reinterpret_cast<uint8_t *>(&l_l4BankDelete), + l_bufSize); + if (l_fapirc) + { + FAPI_ERR("accessMBvpdL4BankDelete: Set of MX keyword failed"); + break; // break out with fapirc + } + + FAPI_DBG("accessMBvpdL4BankDelete: set L4 Bank Delete = 0x%04x", + l_l4BankDelete); + + } + else // unlikely invalid mode + { + FAPI_ERR("accessMBvpdL4BankDelete:" + " invalid mode = 0x%02x", i_mode); + const uint32_t & MODE = i_mode; + FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INVALID_MODE_PARAMETER); + break; // break out with fapirc + } + + } while (0); + + FAPI_DBG("accessMBvpdL4BankDelete: exit rc=0x%08x)", + static_cast<uint32_t>(l_fapirc)); + + return l_fapirc; +} + +} // extern "C" diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk index 767090c12..bd53bd88c 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk @@ -37,5 +37,6 @@ OBJS += getMvpdRing.o \ getMBvpdSpareDramData.o \ getMBvpdVersion.o \ getMBvpdDram2NModeEnabled.o \ - getMBvpdSensorMap.o + getMBvpdSensorMap.o \ + accessMBvpdL4BankDelete.o diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml index d8f4ea9ea..b827400b9 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml @@ -143,6 +143,14 @@ </hwpError> <!-- ********************************************************************* --> <hwpError> + <rc>RC_MBVPD_INVALID_MODE_PARAMETER</rc> + <description> + Mode must be Get or Set. + </description> + <ffdc>MODE</ffdc> + </hwpError> + <!-- ********************************************************************* --> + <hwpError> <rc>RC_MBVPD_UNEXPECTED_MEM_TYPE</rc> <description> Memory type in VSPD keyword #I not DDR3 or DDR4 |