From 5e8d612185ddcaf6af1c66c9ce4d2a98eebdb1ef Mon Sep 17 00:00:00 2001 From: Elizabeth Liner Date: Tue, 2 Sep 2014 15:46:56 -0500 Subject: add support for ATTR_MSS_POWER_CONTROL_CAPABLE RTC:112608 Change-Id: If3cdeda8d8cd4a25f6ea4823c8f4cc8de05450cc Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13107 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- .../hwp/mvpd_accessors/getControlCapableData.C | 77 ++++++++++++++++++++++ src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk | 5 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C (limited to 'src/usr/hwpf/hwp/mvpd_accessors') diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C b/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C new file mode 100644 index 000000000..b52512a31 --- /dev/null +++ b/src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C @@ -0,0 +1,77 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $ID: getControlCapableData.C, v 1.1 2014/9/4 09:05:00 eliner Exp $ +/** + * @file getControlCapable.C + * + * @brief MBvpd accessor for the ATTR_MSS_POWER_CONTROL_CAPABLE attributes + */ + +#include +#include +#include + +extern "C" +{ +using namespace fapi; +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; + + 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(l_pMrBuffer), + l_MrBufsize); + if(l_fapirc) + { + FAPI_ERR("getControlCapableData: Read of MR Keyword failed"); + break; + } + o_val = l_pMrBuffer->position; + + }while(0); + + delete l_pMrBuffer; + l_pMrBuffer = NULL; + + return l_fapirc; +} +} diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk index e2769a606..73e2281fd 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2012,2014 +# Contributors Listed Below - COPYRIGHT 2012,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,5 +40,6 @@ OBJS += getMBvpdSpareDramData.o OBJS += getMBvpdVersion.o OBJS += getMBvpdDram2NModeEnabled.o OBJS += getMBvpdSensorMap.o +OBJS += getControlCapableData.o OBJS += accessMBvpdL4BankDelete.o -- cgit v1.2.1