summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/mvpd_accessors
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2015-03-22 23:03:57 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-04-02 17:47:36 -0500
commit94a57132d0db82ce9ad4d952d4ea02550aea84f2 (patch)
tree2e8038aabf617edc7e9dd56652ea33b4b99b3d57 /src/usr/hwpf/hwp/mvpd_accessors
parent314970fb0227e563a9d5a380cbb5da9c6669988d (diff)
downloadtalos-hostboot-94a57132d0db82ce9ad4d952d4ea02550aea84f2.tar.gz
talos-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')
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C54
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttr.C16
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttrData.C3
3 files changed, 46 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;
}
}
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttr.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttr.C
index b13e4f9af..7be8ed20b 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttr.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttr.C
@@ -976,6 +976,22 @@ fapi::ReturnCode returnValue (const MBvpdAttrDef* i_pAttrDef,
(*(UINT64_t*)o_pVal) = l_value;
break ;
}
+ case UINT8: // uint8_t
+ {
+ // make sure return value size is correct
+ if (sizeof(UINT8_t) != i_valSize)
+ {
+ l_fapirc = sizeMismatch(sizeof(UINT8_t),
+ i_valSize,
+ i_pAttrDef->iv_attrId);
+ break; //return with error
+ }
+
+ // only 1 value is present, it isn't stored per mba/port
+ uint8_t l_value = (reinterpret_cast<uint8_t*>(i_pBuffer))[l_attrOffset];
+ (*(UINT8_t*)o_pVal) = l_value;
+ break ;
+ }
default: // Hard to do, but needs to be caught
FAPI_ERR("returnValue: invalid output type 0x%04x for"
" attribute ID 0x%08x",
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttrData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttrData.C
index c7fa33526..958d7c9e4 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttrData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAttrData.C
@@ -178,6 +178,9 @@ const MBvpdAttrDef g_MBVPD_ATTR_DEF_array [] =
{ATTR_VPD_DRAM_2N_MODE_ENABLED,ALL_DIMM,ALL_VER,MBVPD_KEYWORD_MR,48,UINT8_BY2,0},
{ATTR_VPD_TSYS_ADR,ALL_DIMM,ALL_VER,MBVPD_KEYWORD_MR,49,UINT8_BY2|PORT00,0},
{ATTR_VPD_TSYS_DP18,ALL_DIMM,ALL_VER,MBVPD_KEYWORD_MR,49,UINT8_BY2|PORT11,0},
+
+// Membuf-level data that is stored within MR
+ {ATTR_VPD_POWER_CONTROL_CAPABLE,ALL_DIMM,ALL_VER,MBVPD_KEYWORD_MR,253,UINT8,0},
};
const uint32_t g_MBVPD_ATTR_DEF_array_size =
OpenPOWER on IntegriCloud