diff options
author | Andres Lugo-Reyes <aalugore@us.ibm.com> | 2018-01-12 11:10:09 -0600 |
---|---|---|
committer | Andres A. Lugo-Reyes <aalugore@us.ibm.com> | 2018-01-19 17:13:09 -0500 |
commit | c04d58bd549c17bece70aff18e6cb01af26feb26 (patch) | |
tree | 3a097e0e50154b0a98e5e91f9ad83e98e963c770 /src/occ_405/wof | |
parent | 00123c66a1d23b3a4fca98528989d4e35550fd3d (diff) | |
download | talos-occ-c04d58bd549c17bece70aff18e6cb01af26feb26.tar.gz talos-occ-c04d58bd549c17bece70aff18e6cb01af26feb26.zip |
WOF Phase 2: Use Vratio from PGPE
-Also enable WOF resets to be sent to ZZ platforms
Change-Id: I7054c69fc1f287ea5184f7bf8576d198735481f6
RTC:184983
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52272
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Diffstat (limited to 'src/occ_405/wof')
-rw-r--r-- | src/occ_405/wof/wof.c | 70 | ||||
-rw-r--r-- | src/occ_405/wof/wof.h | 5 |
2 files changed, 50 insertions, 25 deletions
diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c index 9d58239..68b2f5c 100644 --- a/src/occ_405/wof/wof.c +++ b/src/occ_405/wof/wof.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -739,10 +739,9 @@ void read_shared_sram( void ) g_wof->f_clip_freq = (proc_pstate2freq(g_wof->f_clip_ps))/1000; g_wof->v_clip = l_wofstate.fields.vclip_mv; -// g_wof->f_ratio = l_wofstate.fields.fratio; -// g_wof->v_ratio = l_wofstate.fields.vratio; + + g_wof->v_ratio = l_wofstate.fields.vratio; g_wof->f_ratio = 1; - g_wof->v_ratio = 1; // Get the requested active quad update read_req_active_quads(); @@ -1117,11 +1116,17 @@ void calculate_ceff_ratio_vdd( void ) // Get Vturbo and convert to 100uV (mV -> 100uV) = mV*10 // Multiply by Vratio g_wof->c_ratio_vdd_volt = - (G_oppb.operating_points[TURBO].vdd_mv*10) * g_wof->v_ratio; + multiply_ratio( (G_oppb.operating_points[TURBO].vdd_mv*10), + g_wof->v_ratio ); // Get Fturbo and multiply by Fratio g_wof->c_ratio_vdd_freq = G_oppb.operating_points[TURBO].frequency_mhz * g_wof->f_ratio; + /* TODO Uncomment once we use f_ratio from PGPE + g_wof->c_ratio_vdd_freq = + multiply_ratio( G_oppb.operating_points[TURBO].frequency_mhz, + g_wof->f_ratio ); + */ // Calculate ceff_tdp_vdd // iac_tdp_vdd / ((Vturbo*Vratio)^1.3 * (Fturbo*Fratio)) @@ -1191,6 +1196,25 @@ inline uint32_t core_powered_on(uint8_t i_core_num) return ( g_wof->core_pwr_on & (0x80000000 >> i_core_num)); } +/** multiply_ratio + * + * Description: Helper function to multiply V/F Ratio's by their + * operating point preserving the correct granularity + * + * Param[in]: i_operating_point - Operating point taken from the OPPB + * Param[in]: i_ratio - the V/F ratio taken from shared OCC-PGPE SRAM + * + * Return: Operating point * ratio + */ +inline uint32_t multiply_ratio( uint32_t i_operating_point, + uint32_t i_ratio ) +{ + // We get i_ratio from the PGPE ranging from 0x0000 to 0xffff + // These hex values conceptually translate from 0.0 to 1.0 + // Extra math is used to convert units to avoid floating point math. + return ((((i_ratio*10000)/0xFFFF) * i_operating_point) / 10000); +} + /** * num_cores_on_in_quad * @@ -1485,28 +1509,26 @@ void set_clear_wof_disabled( uint8_t i_action, g_wof->wof_disabled, i_bit_mask ); - // Reset if on OpenPower - if( G_occ_interrupt_type != FSP_SUPPORTED_OCC ) + // Reset if on Reason Code requires it. + if(i_bit_mask & ~(IGNORE_WOF_RESET) ) { - if(i_bit_mask & ~(IGNORE_WOF_RESET) ) - { - //Callout firmware - addCalloutToErrl(l_errl, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_COMPONENT_ID_FIRMWARE, - ERRL_CALLOUT_PRIORITY_HIGH); - - //Callout processor - addCalloutToErrl(l_errl, - ERRL_CALLOUT_TYPE_HUID, - G_sysConfigData.proc_huid, - ERRL_CALLOUT_PRIORITY_MED); - - REQUEST_WOF_RESET( l_errl ); - } + //Callout firmware + addCalloutToErrl(l_errl, + ERRL_CALLOUT_TYPE_COMPONENT_ID, + ERRL_COMPONENT_ID_FIRMWARE, + ERRL_CALLOUT_PRIORITY_HIGH); + + //Callout processor + addCalloutToErrl(l_errl, + ERRL_CALLOUT_TYPE_HUID, + G_sysConfigData.proc_huid, + ERRL_CALLOUT_PRIORITY_MED); + + REQUEST_WOF_RESET( l_errl ); } - else // Otherwise, just commit + else { + // Just commit the error log commitErrl( &l_errl ); } diff --git a/src/occ_405/wof/wof.h b/src/occ_405/wof/wof.h index 6d86e44..7d75bf1 100644 --- a/src/occ_405/wof/wof.h +++ b/src/occ_405/wof/wof.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -458,4 +458,7 @@ void print_oppb( void ); uint32_t prevent_over_current( uint32_t i_ceff_ratio ); void schedule_vfrt_request( void ); + +inline uint32_t multiply_ratio( uint32_t i_operating_point, + uint32_t i_ratio ); #endif |