summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/start_payload
diff options
context:
space:
mode:
authorRobert Lippert <rlippert@google.com>2013-12-04 11:39:19 -0800
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-09-25 15:40:25 -0500
commit1300dc02979646be65a39097f86a559cf68bcfb7 (patch)
tree3534a1faea1271391446accc5a8502dfa109e852 /src/usr/hwpf/hwp/start_payload
parent1605c532b9d3abfad74be513be8975b66cef3525 (diff)
downloadtalos-hostboot-1300dc02979646be65a39097f86a559cf68bcfb7.tar.gz
talos-hostboot-1300dc02979646be65a39097f86a559cf68bcfb7.zip
pstate: set all cores to nominal freq/volt during boot.
As last step of boot process determine the nominal pstate for each core and set it as the current operating value. Change-Id: Ifc452977d89971e84f73177885306aa3259408f4 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13350 Tested-by: Jenkins Server 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/start_payload')
-rw-r--r--src/usr/hwpf/hwp/start_payload/HBconfig4
-rw-r--r--src/usr/hwpf/hwp/start_payload/makefile6
-rw-r--r--src/usr/hwpf/hwp/start_payload/start_payload.C65
3 files changed, 74 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/start_payload/HBconfig b/src/usr/hwpf/hwp/start_payload/HBconfig
new file mode 100644
index 000000000..3ab9e3e8d
--- /dev/null
+++ b/src/usr/hwpf/hwp/start_payload/HBconfig
@@ -0,0 +1,4 @@
+config SET_NOMINAL_PSTATE
+ default n
+ help
+ Set the PState to Nominal just before starting the payload.
diff --git a/src/usr/hwpf/hwp/start_payload/makefile b/src/usr/hwpf/hwp/start_payload/makefile
index 3656cf203..adde9ce6d 100644
--- a/src/usr/hwpf/hwp/start_payload/makefile
+++ b/src/usr/hwpf/hwp/start_payload/makefile
@@ -5,7 +5,10 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2012,2014
+# Contributors Listed Below - COPYRIGHT 2012,2014
+# [+] International Business Machines Corp.
+# [+] Google Inc.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -44,6 +47,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/start_payload
EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures
EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates
## NOTE: add new object files when you add a new HWP
OBJS += start_payload.o
diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C
index 9080628fa..19fb2dcec 100644
--- a/src/usr/hwpf/hwp/start_payload/start_payload.C
+++ b/src/usr/hwpf/hwp/start_payload/start_payload.C
@@ -73,6 +73,7 @@
#include "p8_cpu_special_wakeup.H"
#include "p8_pore_table_gen_api.H"
#include <p8_scom_addresses.H>
+#include "proc_set_max_pstate.H"
#include "start_payload.H"
#include <runtime/runtime.H>
@@ -84,6 +85,7 @@
#include <pnor/pnorif.H>
#include <sys/mm.h>
#include <algorithm>
+#include <config.h>
// Uncomment these files as they become available:
// #include "host_start_payload/host_start_payload.H"
@@ -216,6 +218,59 @@ errlHndl_t clearPoreBars ( void )
return l_errl;
}
+#ifdef CONFIG_SET_NOMINAL_PSTATE
+errlHndl_t setMaxPstate ( void )
+{
+ errlHndl_t l_errl = NULL;
+
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "Speed up to max P-state" );
+
+ TARGETING::TargetHandleList l_procTargetList;
+ getAllChips(l_procTargetList, TYPE_PROC);
+
+ // loop thru all the cpus
+ for (TargetHandleList::const_iterator
+ l_proc_iter = l_procTargetList.begin();
+ l_proc_iter != l_procTargetList.end();
+ ++l_proc_iter)
+ {
+ // make a local copy of the CPU target
+ const TARGETING::Target* l_proc_target = *l_proc_iter;
+
+ // trace HUID
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "target HUID %.8X", TARGETING::get_huid(l_proc_target));
+
+ // cast OUR type of target to a FAPI type of target.
+ fapi::Target l_fapi_proc_target( TARGET_TYPE_PROC_CHIP,
+ (const_cast<TARGETING::Target*>(
+ l_proc_target)) );
+
+ // call the HWP with each fapi::Target
+ FAPI_INVOKE_HWP( l_errl,
+ proc_set_max_pstate,
+ l_fapi_proc_target);
+ if ( l_errl )
+ {
+ // capture the target data in the elog
+ ERRORLOG::ErrlUserDetailsTarget(l_proc_target).addToLog( l_errl );
+
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR : setMaxPstate, PLID=0x%x",
+ l_errl->plid() );
+ break;
+ }
+ else
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "SUCCESS : setMaxPstate" );
+ }
+ } // end for
+
+ return l_errl;
+}
+#endif
//
// Wrapper function to call host_runtime_setup
@@ -314,6 +369,16 @@ void* call_host_runtime_setup( void *io_pArgs )
}
}
+#ifdef CONFIG_SET_NOMINAL_PSTATE
+ // Speed up processors.
+ l_err = setMaxPstate();
+ if (l_err)
+ {
+ l_err->setSev(ERRORLOG::ERRL_SEV_PREDICTIVE);
+ ERRORLOG::errlCommit(l_err, ISTEP_COMP_ID);
+ }
+#endif
+
if( is_sapphire_load() && (!INITSERVICE::spBaseServicesEnabled()) )
{
// Write the devtree out in Sapphire mode when SP Base Services not
OpenPOWER on IntegriCloud