Skip to content

Commit

Permalink
WOF Reset debug command
Browse files Browse the repository at this point in the history
Change-Id: I353dadd063b021312ed276ac59221efc9e9738f3
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58730
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@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 May 31, 2018
1 parent 074010f commit 63a59b2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/occ_405/cmdh/cmdh_fsp_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,16 @@ void cmdh_dbug_dump_wof_data( const cmdh_fsp_cmd_t * i_cmd_ptr,
return;
}

void cmdh_dbug_force_wof_reset( const cmdh_fsp_cmd_t * i_cmd_ptr,
cmdh_fsp_rsp_t * o_rsp_ptr)
{
TRAC_INFO("DEBUG - Forcing WOF Reset");
set_clear_wof_disabled( SET, WOF_RC_RESET_DEBUG_CMD );
G_rsp_status = ERRL_RC_SUCCESS;
}



// Function Specification
//
// Name: cmdh_dbug_allow_trace
Expand Down Expand Up @@ -1688,6 +1698,10 @@ void cmdh_dbug_cmd (const cmdh_fsp_cmd_t * i_cmd_ptr,
cmdh_dbug_dump_wof_data(i_cmd_ptr, o_rsp_ptr);
break;

case DBUG_FORCE_WOF_RESET:
cmdh_dbug_force_wof_reset(i_cmd_ptr, o_rsp_ptr);
break;

case DBUG_ALLOW_TRACE:
cmdh_dbug_allow_trace( i_cmd_ptr, o_rsp_ptr );
break;
Expand Down
2 changes: 1 addition & 1 deletion src/occ_405/cmdh/cmdh_fsp_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ typedef struct __attribute__ ((packed)) cmdh_reset_prep
typedef enum
{
DBUG_DUMP_WOF_DATA = 0x01,
// free = 0x02
DBUG_FORCE_WOF_RESET = 0x02,
DBUG_GET_TRACE = 0x03,
DBUG_CLEAR_TRACE = 0x04,
DBUG_ALLOW_TRACE = 0x05,
Expand Down
5 changes: 3 additions & 2 deletions src/occ_405/cmdh/cmdh_service_codes.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/occ/cmdh/cmdh_service_codes.h $ */
/* $Source: src/occ_405/cmdh/cmdh_service_codes.h $ */
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2015 */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -33,6 +33,7 @@ enum occCmdhModuleId
DATA_STORE_GENERIC_DATA = CMDH_COMP_ID | 0x00,
DATA_STORE_FREQ_DATA = CMDH_COMP_ID | 0x01,
DATA_STORE_PCAP_DATA = CMDH_COMP_ID | 0x02,
// 0x03 free
CMDH_GENERIC_CMD_FAILURE = CMDH_COMP_ID | 0x04,
DATA_STORE_SYS_DATA = CMDH_COMP_ID | 0x05,
DATA_STORE_APSS_DATA = CMDH_COMP_ID | 0x06,
Expand Down
21 changes: 17 additions & 4 deletions src/occ_405/wof/wof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,10 +1103,10 @@ void calculate_ceff_ratio_vdn( void )
if( g_wof->ceff_tdp_vdn == 0 )
{
INTR_TRAC_ERR("WOF Disabled! Ceff VDN divide by 0");

print_oppb();
// Return 0
g_wof->ceff_ratio_vdn = 0;
set_clear_wof_disabled(SET, WOF_RC_DIVIDE_BY_ZERO);
set_clear_wof_disabled(SET, WOF_RC_DIVIDE_BY_ZERO_VDN);
}
else
{
Expand Down Expand Up @@ -1176,9 +1176,10 @@ void calculate_ceff_ratio_vdd( void )
INTR_TRAC_ERR("v_clip_mv = %d", g_wof->v_clip);
INTR_TRAC_ERR("f_clip_PS = 0x%x", g_wof->f_clip_ps);

print_oppb();
// Return 0
g_wof->ceff_ratio_vdd = 0;
set_clear_wof_disabled(SET, WOF_RC_DIVIDE_BY_ZERO);
set_clear_wof_disabled(SET, WOF_RC_DIVIDE_BY_ZERO_VDD);
}
else
{
Expand Down Expand Up @@ -1374,6 +1375,17 @@ void set_clear_wof_disabled( uint8_t i_action,
// Set the bit
g_wof->wof_disabled |= i_bit_mask;


// If user is trying to force a reset even though WOF is disabled,
// Skip straight to error log creation
if( (g_wof->wof_disabled) &&
(i_bit_mask == WOF_RC_RESET_DEBUG_CMD) )
{
INTR_TRAC_INFO("User Requested WOF reset!");
l_logError = true;
break;
}

// If OCC has not yet been enabled through TMGT/HTMGT/OPPB, skip
// error log
if( (g_wof->wof_disabled & WOF_RC_OCC_WOF_DISABLED) ||
Expand Down Expand Up @@ -1497,7 +1509,8 @@ void set_clear_wof_disabled( uint8_t i_action,
// Check for error
if( l_logError )
{
if( g_wof->wof_disabled & (~(ERRL_RETURN_CODES)) )
if( (g_wof->wof_disabled & (~(ERRL_RETURN_CODES))) &&
(i_bit_mask != WOF_RC_RESET_DEBUG_CMD) )
{
INTR_TRAC_ERR("Encountered an error, but WOF is off. RC: 0x%08x",
i_bit_mask);
Expand Down
4 changes: 3 additions & 1 deletion src/occ_405/wof/wof.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#define WOF_RC_STATE_CHANGE 0x00000100
#define WOF_RC_MODE_CHANGE 0x00000200
#define WOF_RC_MODE_NO_SUPPORT_MASK 0x00000400
#define WOF_RC_DIVIDE_BY_ZERO 0x00000800
#define WOF_RC_DIVIDE_BY_ZERO_VDD 0x00000800
#define WOF_RC_VFRT_REQ_FAILURE 0x00001000
#define WOF_RC_CONTROL_REQ_FAILURE 0x00002000
#define WOF_RC_VFRT_ALIGNMENT_ERROR 0x00004000
Expand All @@ -74,6 +74,8 @@
#define WOF_RC_NO_CONFIGURED_CORES 0x00400000
#define WOF_RC_IPC_FAILURE 0x00800000
#define WOF_RC_USER_DISABLED_WOF 0x01000000
#define WOF_RC_RESET_DEBUG_CMD 0x02000000
#define WOF_RC_DIVIDE_BY_ZERO_VDN 0x04000000

//***************************************************************************
// Temp space used to save hard coded addresses
Expand Down

0 comments on commit 63a59b2

Please sign in to comment.