Skip to content

Commit

Permalink
WOF: Initial WOF soft reset support
Browse files Browse the repository at this point in the history
Change-Id: I04b29c5c9b6acc1fb230c51b86eeda8c679130d5
RTC:174965
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45168
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
  • Loading branch information
aalugore committed Sep 13, 2017
1 parent a43395b commit 852ad09
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 15 deletions.
42 changes: 34 additions & 8 deletions src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
Expand Up @@ -329,15 +329,41 @@ errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
l_freq = G_proc_fmax_mhz;
}

// If Ultra Turbo is 0, disable WOF, else enable
if( l_freq == 0 )
// Check if (H)TMGT will let WOF run, else clear flags
switch( l_freq )
{
set_clear_wof_disabled( SET, WOF_RC_UTURBO_IS_ZERO );
}
else
{
set_clear_wof_disabled( CLEAR, WOF_RC_UTURBO_IS_ZERO );
set_clear_wof_disabled( CLEAR, WOF_RC_OCC_WOF_DISABLED );
case WOF_MISSING_ULTRA_TURBO:
CMDH_TRAC_INFO("WOF Disabled due to 0 UT value.");
set_clear_wof_disabled( SET, WOF_RC_UTURBO_IS_ZERO );
l_freq = 0;
break;

case WOF_SYSTEM_DISABLED:
CMDH_TRAC_INFO("WOF Disabled due to SYSTEM_WOF_DISABLE");
set_clear_wof_disabled( SET, WOF_RC_SYSTEM_WOF_DISABLE );
l_freq = 0;
break;

case WOF_RESET_LIMIT_REACHED:
CMDH_TRAC_INFO("WOF Disabled due to reset limit");
set_clear_wof_disabled( SET, WOF_RC_RESET_LIMIT_REACHED );
l_freq = 0;
break;

case WOF_UNSUPPORTED_FREQ:
CMDH_TRAC_INFO("WOF Disabled due to unsupported frequency");
set_clear_wof_disabled( SET, WOF_RC_UNSUPPORTED_FREQUENCIES );
l_freq = 0;
break;

default:
CMDH_TRAC_INFO("WOF is Enabled! so far...");
set_clear_wof_disabled( CLEAR, WOF_RC_UTURBO_IS_ZERO );
set_clear_wof_disabled( CLEAR, WOF_RC_SYSTEM_WOF_DISABLE );
set_clear_wof_disabled( CLEAR, WOF_RC_RESET_LIMIT_REACHED );
set_clear_wof_disabled( CLEAR, WOF_RC_UNSUPPORTED_FREQUENCIES );
set_clear_wof_disabled( CLEAR, WOF_RC_OCC_WOF_DISABLED );
break;
}

l_table[OCC_MODE_UTURBO] = l_freq;
Expand Down
3 changes: 2 additions & 1 deletion src/occ_405/errl/errl.h
Expand Up @@ -87,6 +87,7 @@ typedef enum
{
ERRL_ACTIONS_CONSOLIDATE_ERRORS = 0x01, //ignored by tmgt at this time
ERRL_ACTIONS_MANUFACTURING_ERROR = 0x08, //tmgt will set severity to predictive while in mfg mode
ERRL_ACTIONS_WOF_RESET_REQUIRED = 0x20, //Soft reset without incrementing permanent safe mode count
ERRL_ACTIONS_SAFE_MODE_REQUIRED = 0x40, //immediate permanent safe mode without any recovery (checkstop)
ERRL_ACTIONS_RESET_REQUIRED = 0x80, //permanent safe mode after 3 recovery attempts
} ERRL_ACTIONS_MASK;
Expand Down Expand Up @@ -236,7 +237,7 @@ struct ErrlEntry
{
uint8_t reset_required : 1; // Error is critical and requires OCC reset
uint8_t safe_mode_required : 1; // immediate permanent safe mode (used for checkstops)
uint8_t reserved5 : 1;
uint8_t wof_reset_required : 1;
uint8_t reserved4 : 1;
uint8_t mfg_error : 1; // Fan go to max,oversubscription,core above warning,Throttled.
uint8_t reserved2 : 1;
Expand Down
1 change: 0 additions & 1 deletion src/occ_405/occ_service_codes.h
Expand Up @@ -139,7 +139,6 @@ enum occReasonCode
WOF_DISABLED_RC = 0xDA,
WOF_VFRT_ALIGNMENT_ERROR = 0xDB,
INVALID_MAGIC_NUMBER = 0xDC,
DIVIDE_BY_ZERO_ERROR = 0xDD,
INVALID_FREQUENCY = 0xDE,
WOF_RE_ENABLED = 0xDF,

Expand Down
10 changes: 5 additions & 5 deletions src/occ_405/reset.c
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ/reset.c $ */
/* $Source: src/occ_405/reset.c $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -91,7 +91,7 @@ void reset_state_request(uint8_t i_request)

// If we have TMGT comm, and we aren't already in reset, set the reset
// state to reset to enter the reset state machine.
if(G_reset_state < RESET_REQUESTED_DUE_TO_ERROR)
if( G_reset_state < RESET_REQUESTED_DUE_TO_ERROR )
{
TRAC_IMP("Activating reset required state.");

Expand All @@ -108,7 +108,7 @@ void reset_state_request(uint8_t i_request)
break;

case NOMINAL_REQUESTED_DUE_TO_ERROR:
if(G_reset_state < NOMINAL_REQUESTED_DUE_TO_ERROR)
if( G_reset_state < NOMINAL_REQUESTED_DUE_TO_ERROR )
{
TRAC_ERR("Going to Nominal because of error");

Expand All @@ -119,7 +119,7 @@ void reset_state_request(uint8_t i_request)
break;

case RESET_NOT_REQUESTED:
if(G_reset_state == NOMINAL_REQUESTED_DUE_TO_ERROR)
if( G_reset_state == NOMINAL_REQUESTED_DUE_TO_ERROR )
{
TRAC_IMP("Clearing Nominal Reset State because of error");

Expand Down
6 changes: 6 additions & 0 deletions src/occ_405/state.h
Expand Up @@ -125,6 +125,12 @@ typedef enum
commitErrl(&error_log);\
}

#define REQUEST_WOF_RESET(error_log) \
{\
reset_state_request(RESET_REQUESTED_DUE_TO_ERROR);\
setErrlActions(error_log, ERRL_ACTIONS_WOF_RESET_REQUIRED);\
commitErrl(&error_log);\
}

// Used by OCC FW to request that OCC go to Nominal because of an error
#define REQUEST_NOMINAL() reset_state_request(NOMINAL_REQUESTED_DUE_TO_ERROR);
Expand Down
8 changes: 8 additions & 0 deletions src/occ_405/wof/wof.c
Expand Up @@ -1076,7 +1076,15 @@ void calculate_ceff_ratio_vdd( void )
// Prevent divide by zero
if( g_wof->ceff_tdp_vdd == 0 )
{
// Print debug info to help isolate offending variable
INTR_TRAC_ERR("WOF Disabled! Ceff VDD divide by 0");
INTR_TRAC_ERR("iac_tdp_vdd = %d", G_oppb.lac_tdp_vdd_turbo_10ma );
INTR_TRAC_ERR("v_ratio = %d", g_wof->v_ratio );
INTR_TRAC_ERR("f_ratio = %d", g_wof->f_ratio );
INTR_TRAC_ERR("vdd_mv = %d", G_oppb.operating_points[TURBO].vdd_mv);
INTR_TRAC_ERR("freq_mhz = %d", G_oppb.operating_points[TURBO].frequency_mhz);
INTR_TRAC_ERR("v_clip_mv = %d", g_wof->v_clip);
INTR_TRAC_ERR("f_clip_PS = 0x%x", g_wof->f_clip_ps);

// Return 0
g_wof->ceff_ratio_vdd = 0;
Expand Down
13 changes: 13 additions & 0 deletions src/occ_405/wof/wof.h
Expand Up @@ -65,6 +65,9 @@
#define WOF_RC_UTURBO_IS_ZERO 0x00010000
#define WOF_RC_OCC_WOF_DISABLED 0x00020000
#define WOF_RC_OPPB_WOF_DISABLED 0x00040000
#define WOF_RC_SYSTEM_WOF_DISABLE 0x00080000
#define WOF_RC_RESET_LIMIT_REACHED 0x00100000
#define WOF_RC_UNSUPPORTED_FREQUENCIES 0x00200000

//***************************************************************************
// Temp space used to save hard coded addresses
Expand All @@ -87,6 +90,16 @@ enum wof_init_states
WOF_ENABLED, //5
};

// Enumeration to define reasons (H)TMGT is disabling WOF
enum wof_disabled_htmgt_rc
{
WOF_MISSING_ULTRA_TURBO = 0x0000,
WOF_SYSTEM_DISABLED = 0x0001,
WOF_RESET_LIMIT_REACHED = 0x0002,
WOF_UNSUPPORTED_FREQ = 0x0003,
};


// Enumeration
enum wof_disabled_actions
{
Expand Down
1 change: 1 addition & 0 deletions src/occ_405/wof/wof_service_codes.h
Expand Up @@ -42,6 +42,7 @@ enum wofModuleId
ENABLE_WOF = WOF_COMP_ID | 0x0B,
SEND_INIT_VFRT = WOF_COMP_ID | 0x0C,
SET_CLEAR_WOF_DISABLED = WOF_COMP_ID | 0x0D,
CALL_WOF_MAIN = WOF_COMP_ID | 0x0E,
};


Expand Down

0 comments on commit 852ad09

Please sign in to comment.