summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.H51
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatAttributeService.H21
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.C77
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk5
-rw-r--r--src/usr/hwpf/plat/fapiPlatAttributeService.C13
-rw-r--r--src/usr/hwpf/test/hwpMBvpdAccessorTest.H58
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml25
-rw-r--r--src/usr/targeting/common/xmltohb/target_types.xml2
8 files changed, 223 insertions, 29 deletions
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.H
new file mode 100644
index 000000000..91912b6d3
--- /dev/null
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.H
@@ -0,0 +1,51 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getControlCapableData.H $ */
+/* */
+/* 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.H, v 1.1 2014/9/4 09:05:00 eliner Exp $
+/**
+ * @file getControlCapable.H
+ *
+ * @brief MBvpd accessor for the ATTR_MSS_POWER_CONTROL_CAPABLE attributes
+ */
+
+#ifndef _HWP_MVPDCONTROLCAPABLEDATA_
+#define _HWP_MVPDCONTROLCAPABLEDATA_
+
+extern "C"
+{
+/**
+ * @brief MBvpd accessor for the ATTR_MSS_POWER_CONTROL_CAPABLE attribute
+ *
+ * Access Power control capable value in MBvpd record VSPD keyword MR
+ *
+ * @param[in] i_mbTarget - Reference to mb Target
+ * @param[out] o_val - retrieved MR value
+ *
+ * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code
+ */
+fapi::ReturnCode getControlCapableData(const fapi::Target &i_mbTarget,
+ uint8_t & o_val);
+}
+
+#endif
diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
index 92a32e119..15ead58f5 100644
--- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
+++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
@@ -55,6 +55,7 @@
#include <hwpf/hwp/mvpd_accessors/getMBvpdVersion.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.H>
+#include <hwpf/hwp/mvpd_accessors/getControlCapableData.H>
#include <hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.H>
#include <hwpf/hwp/spd_accessors/getSpdAttrAccessor.H>
#include <hwpf/hwp/pll_accessors/getPllRingInfoAttr.H>
@@ -721,6 +722,19 @@ fapi::ReturnCode fapiPlatGetOscswitchCtl
void * o_pVal,
const size_t i_len);
+/**
+ * @brief This function supports a new memory attribute. Called by the
+ * FAPI_ATTR_GET macro when getting the ATTR_MSS_POWER_CONTROL_CAPABLE
+ * attribute.
+ * It should not be called directly.
+ *
+ * @param[in] i_pTarget Mem Buf Target pointer
+ * @param[out] o_val Pointer to output variable
+ *
+ */
+fapi::ReturnCode fapiPlatGetControlCapable(const fapi::Target * i_pTarget,
+ uint8_t & o_val);
+
} // namespace platAttrSvc
} // namespace fapi
@@ -760,6 +774,13 @@ fapi::ReturnCode fapiPlatGetOscswitchCtl
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL)
//------------------------------------------------------------------------------
+// MACRO to support the power control capable memory attribute
+//------------------------------------------------------------------------------
+#define ATTR_MSS_POWER_CONTROL_CAPABLE_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetControlCapable(PTARGET,VAL)
+
+//------------------------------------------------------------------------------
// MACROs to route each ATTR_SPD access to the Hostboot SPD function
//------------------------------------------------------------------------------
#define ATTR_SPD_DRAM_DEVICE_TYPE_GETMACRO(ID, PTARGET, VAL) \
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 <stdint.h>
+#include <fapi.H>
+#include <getControlCapableData.H>
+
+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<uint8_t *>(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
diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C
index bf0a4b192..05fbc9413 100644
--- a/src/usr/hwpf/plat/fapiPlatAttributeService.C
+++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,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. */
@@ -1572,6 +1574,15 @@ fapi::ReturnCode fapiPlatGetOscswitchCtl
return l_rc;
}
+//-----------------------------------------------------------------------------
+fapi::ReturnCode fapiPlatGetControlCapable(const fapi::Target * i_pTarget,
+ uint8_t & o_val)
+{
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc,getControlCapableData,*i_pTarget,o_val);
+ return l_rc;
+}
+
} // End platAttrSvc namespace
diff --git a/src/usr/hwpf/test/hwpMBvpdAccessorTest.H b/src/usr/hwpf/test/hwpMBvpdAccessorTest.H
index 383c47928..7b686a2f9 100644
--- a/src/usr/hwpf/test/hwpMBvpdAccessorTest.H
+++ b/src/usr/hwpf/test/hwpMBvpdAccessorTest.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,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. */
@@ -56,6 +58,7 @@
#include <mvpd_accessors/getMBvpdVersion.H>
#include <mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <mvpd_accessors/getMBvpdSensorMap.H>
+#include <mvpd_accessors/getControlCapableData.H>
#include <mvpd_accessors/accessMBvpdL4BankDelete.H>
#include <errl/errlmanager.H>
@@ -203,6 +206,59 @@ public:
}
/**
+ * @brief call getControlCapableData to ensure that it's getting the MR
+ * keyword correctly, and getting the right data
+ *
+ */
+ void testGetControlCapableData()
+ {
+ fapi::ReturnCode l_fapirc;
+
+ TS_TRACE( "getControlCapableData entry" );
+
+ TARGETING::TargetHandleList l_memBufList;
+ getAllChips(l_memBufList, TYPE_MEMBUF);
+
+#if HWPMBVPDACCESSORTEST_UT0
+ uint8_t l_mbNum = 0; //check them all in unit test
+#else
+ uint8_t l_mbNum = (l_memBufList.size() > 0) ? l_memBufList.size()-1 : 0;
+#endif
+ for (; l_mbNum < l_memBufList.size(); l_mbNum++ )
+ {
+ // make a local copy of the memory buffer target
+ TARGETING::Target* l_mb_target = l_memBufList[l_mbNum];
+
+ // dump physical path to target
+ EntityPath l_path;
+ l_path = l_mb_target->getAttr<ATTR_PHYS_PATH>();
+ l_path.dump();
+
+ // cast OUR type of target to a FAPI type of target.
+ fapi::Target l_fapi_mb_target(
+ TARGET_TYPE_MEMBUF_CHIP,
+ (const_cast<TARGETING::Target*>(l_mb_target)) );
+
+
+ uint8_t l_val = 5;
+ l_fapirc = FAPI_ATTR_GET(ATTR_MSS_POWER_CONTROL_CAPABLE,
+ &l_fapi_mb_target,l_val);
+
+ if(l_fapirc) break;
+ TS_TRACE( "Power Control Capable Accessor "
+ "POWER_CONTROL_CAPABLE=0x%02x", l_val);
+ }
+ if (l_fapirc)
+ {
+ TS_FAIL( "getControlCapableData: FAPI_ATTR_GET fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+
+ TS_TRACE( "testGetControlCapableData exit" );
+
+ }
+ /**
* @brief call getMBvpdSlopeInterceptData to fetch power slope and intercept
* attributes from the MW and MV keywords
*
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index d2f230889..c887a25b8 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -14122,31 +14122,6 @@ firmware notes: Platforms should initialize this attribute to AUTO (0)</descript
</attribute>
<attribute>
- <id>MSS_POWER_CONTROL_CAPABLE</id>
- <description>
- Supported memory power control types
-
- 0x00 = NONE
- 0x01 = SLOWEXIT_CAPABLE
- 0x02 = FASTEXIT_CAPABLE
- 0x03 = FASTSLOW_CAPABLE
-
- </description>
- <simpleType>
- <uint8_t>
- <default>0x00</default>
- </uint8_t>
- </simpleType>
- <persistency>volatile</persistency>
- <readable/>
- <writeable/>
- <hwpfToHbAttrMap>
- <id>ATTR_MSS_POWER_CONTROL_CAPABLE</id>
- <macro>DIRECT</macro>
- </hwpfToHbAttrMap>
-</attribute>
-
-<attribute>
<id>PM_PFET_WORKAROUND_RUN_FLAG</id>
<description>
Flag to store that the work-around for HW250017 as been run so that during any resets it is skipped.
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index 0737c992e..6c488d7f9 100644
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -1360,7 +1360,6 @@
<attribute><id>MSS_DERIVED_MBA_ADDR_INTERLEAVE_BIT</id></attribute>
<attribute><id>MSS_DERIVED_MBA_CACHELINE_INTERLEAVE_MODE</id></attribute>
<attribute><id>MSS_VOLT_OVERRIDE</id></attribute>
- <attribute><id>MSS_POWER_CONTROL_CAPABLE</id></attribute>
<attribute>
<id>I2C_SWITCHES</id>
<default>
@@ -1371,6 +1370,7 @@
</attribute>
<attribute><id>VPD_ISDIMMTOC4DQ</id></attribute>
<attribute><id>VPD_ISDIMMTOC4DQS</id></attribute>
+ <attribute><id>MSS_POWER_CONTROL_REQUESTED</id></attribute>
</targetType>
<!-- Centaur L4 -->
OpenPOWER on IntegriCloud