summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2014-10-23 15:04:03 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-13 10:16:59 -0600
commit611d91a0295e17ea202f01e0143fc040820eadb8 (patch)
tree3c07fecbbdf0008f041a905733c43f32ca4df854 /src
parent61c9acc8fd01eab34b942a284ac851bbd990d9f7 (diff)
downloadtalos-hostboot-611d91a0295e17ea202f01e0143fc040820eadb8.tar.gz
talos-hostboot-611d91a0295e17ea202f01e0143fc040820eadb8.zip
HTMGT Pstate support
Change-Id: I68388d448afa027439c78f654c00ca2f9904d65e RTC: 114284 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14191 Reviewed-by: Christopher Cain <cjcain@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/isteps/istep21list.H2
-rw-r--r--src/usr/htmgt/genPstate.C105
-rw-r--r--src/usr/htmgt/genPstate.H44
-rw-r--r--src/usr/htmgt/htmgt.C37
-rw-r--r--src/usr/htmgt/htmgt_activate.H12
-rw-r--r--src/usr/htmgt/makefile5
-rw-r--r--src/usr/htmgt/runtime/makefile4
-rw-r--r--src/usr/htmgt/test/pstatetest.H55
8 files changed, 208 insertions, 56 deletions
diff --git a/src/include/usr/isteps/istep21list.H b/src/include/usr/isteps/istep21list.H
index 6959f079d..1186274d5 100644
--- a/src/include/usr/isteps/istep21list.H
+++ b/src/include/usr/isteps/istep21list.H
@@ -87,7 +87,7 @@ const DepModInfo g_istep21Dependancies = {
DEP_LIB(libstart_payload.so),
DEP_LIB(libruntime.so),
DEP_LIB(libdevtree.so),
-#ifdef CONFIG_SET_NOMINAL_PSTATE
+#if defined(CONFIG_SET_NOMINAL_PSTATE) || defined(CONFIG_HTMGT)
DEP_LIB(libpstates.so),
#endif
DEP_LIB(libocc.so),
diff --git a/src/usr/htmgt/genPstate.C b/src/usr/htmgt/genPstate.C
new file mode 100644
index 000000000..9eaae1747
--- /dev/null
+++ b/src/usr/htmgt/genPstate.C
@@ -0,0 +1,105 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/htmgt/genPstate.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 */
+#include "genPstate.H"
+#include "htmgt_utility.H"
+#include <htmgt/htmgt_reasoncodes.H>
+#include <assert.h>
+
+// Targeting support
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+#include <targeting/common/attributes.H>
+#include <targeting/common/targetservice.H>
+
+// occ hwp support
+#include <freqVoltageSvc.H>
+#include <pstates.h>
+
+using namespace TARGETING;
+
+namespace HTMGT
+{
+errlHndl_t genPstateTables()
+{
+ errlHndl_t err = NULL;
+
+ TargetHandleList processors;
+
+ getChipResources(processors,
+ TYPE_PROC,
+ UTIL_FILTER_FUNCTIONAL);
+
+ for(TargetHandleList::const_iterator
+ procItr = processors.begin();
+ procItr != processors.end();
+ ++procItr)
+ {
+ Target * procTarget = *procItr;
+
+ TargetHandleList occs;
+ getChildChiplets(occs,
+ procTarget,
+ TYPE_OCC,
+ true);
+
+ if(occs.size() > 0)
+ {
+ PstateSuperStructure pstate_data;
+ Target * occTarget = occs[0];
+ ATTR_HUID_type huid = occTarget->getAttr<ATTR_HUID>();
+
+ TMGT_INF("Building pstate table for huid 0x%x", huid);
+
+ err = FREQVOLTSVC::runP8BuildPstateDataBlock( procTarget,
+ &pstate_data);
+
+ if(err)
+ {
+ TMGT_ERR( "tmgtProcessAppGenPstateTable: Failed to"
+ " generate PSTATE data for OCC "
+ "(huid=%x).",
+ huid
+ );
+
+ // collectTrace is called by the calling routine (htmgt.C).
+ break;
+
+ }
+ else
+ {
+ ATTR_PSTATE_TABLE_type * pstateData =
+ reinterpret_cast<ATTR_PSTATE_TABLE_type*>
+ (&pstate_data);
+
+ CPPASSERT(sizeof(ATTR_PSTATE_TABLE_type) ==
+ sizeof(PstateSuperStructure));
+
+ occTarget->setAttr<ATTR_PSTATE_TABLE>(*pstateData);
+ }
+ }
+ }
+ return err;
+}
+}; // end namespace
diff --git a/src/usr/htmgt/genPstate.H b/src/usr/htmgt/genPstate.H
new file mode 100644
index 000000000..71106de27
--- /dev/null
+++ b/src/usr/htmgt/genPstate.H
@@ -0,0 +1,44 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/htmgt/genPstate.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 */
+#ifndef GENPSTATE_H
+#define GENPSTATE_H
+
+#include<errl/errlentry.H>
+
+namespace HTMGT
+{
+
+/**
+ * @brief Build the pstate tables
+ * @post Sets pstate table data into PSTATE_TABLE attribute for each OCC.
+ * @note Attributes will not be written if the corresponding pstate table
+ * could not be generated.
+ * @note this function is only available at IPL time
+ * @return error log handle on error, otherwise NULL
+ */
+errlHndl_t genPstateTables();
+
+};
+#endif
diff --git a/src/usr/htmgt/htmgt.C b/src/usr/htmgt/htmgt.C
index d693a52b0..5ed8be6c7 100644
--- a/src/usr/htmgt/htmgt.C
+++ b/src/usr/htmgt/htmgt.C
@@ -28,6 +28,9 @@
#include "htmgt_activate.H"
#include "htmgt_cfgdata.H"
#include "htmgt_utility.H"
+#ifndef __HOSTBOOT_RUNTIME
+#include "genPstate.H"
+#endif
// Targeting support
#include <targeting/common/commontargeting.H>
@@ -58,22 +61,34 @@ namespace HTMGT
// Query functional OCCs
if (occMgr::instance().buildOccs() > 0)
{
- // Build pstate tables
- // TODO RTC 114284
+ do
+ {
+ //Pstatetable only built once at boot time.
+#ifndef __HOSTBOOT_RUNTIME
+ l_err = genPstateTables();
+ if(l_err)
+ {
+ break;
+ }
+#endif
- // Calc memory throttles
- // TODO RTC 116306
+ // Calc memory throttles
+ // TODO RTC 116306
- // Send ALL config data
- sendOccConfigData();
+ // Send ALL config data
+ sendOccConfigData();
- // Wait for all OCCs to go active
- l_err = waitForOccsActive();
- if (NULL == l_err)
+ // Wait for all OCCs to go active
+ l_err = waitForOccsActive();
+ if( l_err )
{
- // Set active sensors for all OCCs so BMC can start comm
+ break;
+ }
+
+ //Set active sensors for all OCCs so BMC can start comm
l_err = setOccActiveSensors();
- }
+
+ } while(0);
}
else
{
diff --git a/src/usr/htmgt/htmgt_activate.H b/src/usr/htmgt/htmgt_activate.H
index 4c0bf9fd0..6e85dfd17 100644
--- a/src/usr/htmgt/htmgt_activate.H
+++ b/src/usr/htmgt/htmgt_activate.H
@@ -39,18 +39,6 @@ namespace HTMGT
{
/**
- * @brief Build the pstate tables
- */
- void buildPstateTables();
-
-
- /**
- * @brief Calculate memory throttles
- */
- void calculateMemoryThrottles();
-
-
- /**
* @brief Set the OCC state
*
* @param[in] i_state Desired OCC state
diff --git a/src/usr/htmgt/makefile b/src/usr/htmgt/makefile
index f49953fcb..174f207a1 100644
--- a/src/usr/htmgt/makefile
+++ b/src/usr/htmgt/makefile
@@ -31,12 +31,15 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp
EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include
EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mc_config/mss_eff_config
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates
# objects common to hostboot and hbrt
include htmgt_common.mk
-# objects unique to hostboot (none yet)
+# objects unique to hostboot
OBJS += htmgt_memthrottles.o
+OBJS += genPstate.o
SUBDIRS += test.d
SUBDIRS += runtime.d
diff --git a/src/usr/htmgt/runtime/makefile b/src/usr/htmgt/runtime/makefile
index 6312bab42..e996c938e 100644
--- a/src/usr/htmgt/runtime/makefile
+++ b/src/usr/htmgt/runtime/makefile
@@ -31,8 +31,8 @@ MODULE = htmgt_rt
#include common ojects between hostboot and runtime hostboot
include ../htmgt_common.mk
-#include unique object modules - currently none
-# OBJS +=
+#include unique object modules
+#OBJS +=
#SUBDIRS += test.d
diff --git a/src/usr/htmgt/test/pstatetest.H b/src/usr/htmgt/test/pstatetest.H
index 7e6d8a595..6559a841c 100644
--- a/src/usr/htmgt/test/pstatetest.H
+++ b/src/usr/htmgt/test/pstatetest.H
@@ -45,6 +45,7 @@
#include <mss_util_to_throttle.H>
#include <mss_throttle_to_power.H>
#include <mss_eff_config_thermal.H>
+#include "../genPstate.H"
using namespace TARGETING;
@@ -52,18 +53,13 @@ class pstateTest: public CxxTest::TestSuite
{
public:
- // Test function to build pstate table
- // TODO RCT 114284 fix testcase
- // Requires Hostboot functions that are not yet merged. Testcase should
- // eventually call hb function "runP8BuildPstateDataBlock" declaired in
- // freqVoltageSvc.H to build pstate table.
- // p8_build_pstate_datablock reads VPD from all existing cores, not
- // just functional cores. The current SIMICS standalone model does
- // not support MVDP for all existing cores.
+ // TODO RTC: 116310 VPD needs to be fixed in simics before a valid
+ // pstate table can be built in simics.
void DISABLE_test_verifyPstate( void )
{
errlHndl_t l_errl = NULL;
bool pstateLibLoadedLocally = false;
+ bool htmgtLibLoadedLocally = false;
if(!VFS::module_is_loaded( "libpstates.so" ) )
{
@@ -79,39 +75,40 @@ class pstateTest: public CxxTest::TestSuite
}
}
- PstateSuperStructure pstateData;
- TargetHandleList procChips;
- getAllChips(procChips, TYPE_PROC, true);
-
- for (TargetHandleList::iterator itr = procChips.begin();
- itr != procChips.end();
- ++itr)
+ if(!VFS::module_is_loaded("libhtmgt.so"))
{
- // cast OUR type of target to a FAPI type of target.
- const fapi::Target
- fapiTarg(fapi::TARGET_TYPE_PROC_CHIP,
- (const_cast<Target*>(*itr)));
-
-
- FAPI_INVOKE_HWP( l_errl,
- p8_build_pstate_datablock,
- fapiTarg,
- &pstateData
- );
-
+ l_errl = VFS::module_load("libhtmgt.so");
if( l_errl )
{
+ TS_FAIL("Could not load libhtmgt.so module");
errlCommit(l_errl,HTMGT_COMP_ID);
- TS_FAIL("verifyPstate failed for huid 0x%x",
- get_huid(*itr));
+ }
+ else
+ {
+ htmgtLibLoadedLocally = true;
}
}
+ l_errl = genPstateTables();
+
+ if( l_errl )
+ {
+ errlCommit(l_errl,HTMGT_COMP_ID);
+ TS_FAIL("verifyPstate failed");
+ }
+
+ // TODO RTC 116310 check eyecatcher in pstate table
+
if(pstateLibLoadedLocally)
{
VFS::module_unload( "libpstates.so" );
}
+ if(htmgtLibLoadedLocally)
+ {
+ VFS::module_unload( "libhtmgt.so" );
+ }
+
}
// test to call procedures HTMGT will need
OpenPOWER on IntegriCloud