summaryrefslogtreecommitdiffstats
path: root/src/occ_405/amec/amec_data.c
diff options
context:
space:
mode:
authorWael El-Essawy <welessa@us.ibm.com>2016-12-09 18:28:26 -0600
committerWael El-Essawy <welessa@us.ibm.com>2017-01-27 12:00:02 -0500
commit360934dea9355e488206267d7f9fd9b1c753cf16 (patch)
treed5fb9e4ae46b9b9afe9adca7b1e0ac72e5d7219a /src/occ_405/amec/amec_data.c
parentc35e73bb81af40e6cca73b35ea8db61a8f17f5a8 (diff)
downloadtalos-occ-360934dea9355e488206267d7f9fd9b1c753cf16.tar.gz
talos-occ-360934dea9355e488206267d7f9fd9b1c753cf16.zip
Pstates Support in OCC
1. Initialize Pstates global parameters (G_proc_fmax, G_proc_fmin, G_khz_per_pstate and G_proc_pmin from the OCC Pstate Parameter Block) 2. When frequency config data packet is received and OCC is NOT already in Active state: Send IPC command to PGPE to set pState clips to be wide open from min frequency to turbo First verify min/max frequency from TMGT is within what PGPE allows saved in G_proc_fmax and G_proc_fmin if not within bounds trace and clip to G_proc_fmax/fmin) 3. Transition to active state: Send IPC command to PGPE to start pState protocol (give correct data for OCC vs OPAL in control of Pstates) and if OPAL system update OPAL shared memory with Pstate information. 4. amec_slv_freq_smh(): Send IPC command to PGPE to set requested pState (PowerVM) or set clips (OPAL). 5. Address all the TODO/TEMP/#if 0 in amec_freq.c either remove or add RTC# for when it will be addressed Change-Id: Ic323321b8c66945732a6b7345ad85d6f41a62edd RTC: 130201 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/33704 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
Diffstat (limited to 'src/occ_405/amec/amec_data.c')
-rwxr-xr-xsrc/occ_405/amec/amec_data.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/occ_405/amec/amec_data.c b/src/occ_405/amec/amec_data.c
index 6663cdc..05d60b9 100755
--- a/src/occ_405/amec/amec_data.c
+++ b/src/occ_405/amec/amec_data.c
@@ -47,6 +47,8 @@
#include <amec_sensors_fw.h>
#include <amec_data.h>
#include <amec_freq.h>
+#include <pgpe_interface.h>
+#include <p9_pstates_occ.h>
//*************************************************************************
// Externs
@@ -64,8 +66,9 @@
// Globals
//*************************************************************************
extern uint8_t G_occ_interrupt_type;
-extern uint32_t G_proc_fmin;
-extern uint32_t G_proc_fmax;
+
+//max(fturbo,futurbo)
+extern uint16_t G_proc_fmax_mhz;
//*************************************************************************
// Function Prototypes
@@ -98,16 +101,13 @@ errlHndl_t AMEC_data_write_fcurr(const OCC_MODE i_mode)
/* Code */
/*------------------------------------------------------------------------*/
- // If we're active we need to load this new range into DVFS MIN/MAX
- if(CURRENT_STATE() == OCC_STATE_ACTIVE)
- {
- // Use i_mode here since this function understands turbo
- l_err = amec_set_freq_range(i_mode);
+ // Load new range into DVFS MIN/MAX,
+ // Use i_mode here since this function understands turbo
+ l_err = amec_set_freq_range(i_mode);
- if(l_err)
- {
- //break;
- }
+ if(l_err)
+ {
+ //break;
}
// If we are in OpenPower environment with OPAL, load this new range into DVFS
@@ -115,14 +115,25 @@ errlHndl_t AMEC_data_write_fcurr(const OCC_MODE i_mode)
// in amec_set_freq_range() based on mode
if((G_occ_interrupt_type != FSP_SUPPORTED_OCC) && (G_sysConfigData.system_type.kvm))
{
- g_amec->sys.fmax = G_proc_fmax;
- g_amec->sys.fmin = G_proc_fmin; // = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY]
+ g_amec->sys.fmax = G_proc_fmax_mhz;
+ g_amec->sys.fmin = G_sysConfigData.sys_mode_freq.table[OCC_MODE_MIN_FREQUENCY];
TRAC_INFO("AMEC_data_write_fcurr: New frequency range Fmin[%u] Fmax[%u]",
g_amec->sys.fmin,
g_amec->sys.fmax);
}
+ if(!l_err)
+ {
+ // set the clip bounds wide open (if not in active state)
+ // if not already in active mode, send IPC command to PGPE to set
+ // pStates clips wide open (pmin - pmax)
+ if(!IS_OCC_STATE_ACTIVE())
+ {
+ l_err = pgpe_widen_clip_ranges();
+ }
+ }
+
return l_err;
}
OpenPOWER on IntegriCloud