summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndres Lugo-Reyes <aalugore@us.ibm.com>2017-07-05 13:35:44 -0500
committerWilliam A. Bryan <wilbryan@us.ibm.com>2017-07-06 10:52:59 -0400
commit1647d535c760269c2d9909e430d929b4a18bceab (patch)
tree5ddb6d863e619e7f538bfd0ca06b36442c8c18d9 /src
parent82156a8c51a11cf1173c5c4064cad903339b07ed (diff)
downloadtalos-occ-1647d535c760269c2d9909e430d929b4a18bceab.tar.gz
talos-occ-1647d535c760269c2d9909e430d929b4a18bceab.zip
Prevent WOF error logs unless wof is formally enabled by (H)TMGT
Change-Id: Id6fdb25c8d290ed3452c17536a9c43ca0c0ef0f4 CQ:SW394106 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42768 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/occ_405/amec/amec_init.c2
-rwxr-xr-xsrc/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c3
-rwxr-xr-xsrc/occ_405/main.c1
-rw-r--r--src/occ_405/wof/wof.c76
-rw-r--r--src/occ_405/wof/wof.h1
5 files changed, 56 insertions, 27 deletions
diff --git a/src/occ_405/amec/amec_init.c b/src/occ_405/amec/amec_init.c
index 656edc6..5ca4e66 100644
--- a/src/occ_405/amec/amec_init.c
+++ b/src/occ_405/amec/amec_init.c
@@ -331,7 +331,7 @@ void amec_init_gamec_struct(void)
g_amec->sys.current_mem_pwr_ctl = MEM_PWR_CTL_NO_SUPPORT;
// Initialize wof_disabled
- g_amec->wof.wof_disabled = 0x00000000;
+ g_amec->wof.wof_disabled = WOF_RC_OCC_WOF_DISABLED;
}
diff --git a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
index 37f66c9..d9b69f3 100755
--- a/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
+++ b/src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
@@ -328,7 +328,7 @@ 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
+ // If Ultra Turbo is 0, disable WOF, else enable
if( l_freq == 0 )
{
set_clear_wof_disabled( SET, WOF_RC_UTURBO_IS_ZERO );
@@ -336,6 +336,7 @@ errlHndl_t data_store_freq_data(const cmdh_fsp_cmd_t * i_cmd_ptr,
else
{
set_clear_wof_disabled( CLEAR, WOF_RC_UTURBO_IS_ZERO );
+ set_clear_wof_disabled( CLEAR, WOF_RC_OCC_WOF_DISABLED );
}
l_table[OCC_MODE_UTURBO] = l_freq;
diff --git a/src/occ_405/main.c b/src/occ_405/main.c
index f8f88ca..61f9f99 100755
--- a/src/occ_405/main.c
+++ b/src/occ_405/main.c
@@ -548,7 +548,6 @@ void read_wof_header(void)
int l_ssxrc = SSX_OK;
bool l_error = false;
- MAIN_TRAC_INFO("read_wof_header() 0x%08X", G_pgpe_header.wof_tables_addr);
// Get OCCPstateParmBlock out to Amester
externalize_oppb();
diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c
index ec49242..8bffd1c 100644
--- a/src/occ_405/wof/wof.c
+++ b/src/occ_405/wof/wof.c
@@ -1293,9 +1293,8 @@ void set_clear_wof_disabled( uint8_t i_action,
{
// Keep track of whether an error has already been logged
static bool L_errorLogged = false;
-
+ bool l_logError = false;
errlHndl_t l_errl = NULL;
-
uint32_t prev_wof_disabled = g_wof->wof_disabled;
do
@@ -1304,6 +1303,18 @@ void set_clear_wof_disabled( uint8_t i_action,
{
// Set the bit
g_wof->wof_disabled |= i_bit_mask;
+
+
+ // If OCC has not yet been enabled through TMGT/HTMGT, skip
+ // error log
+ if( g_wof->wof_disabled & WOF_RC_OCC_WOF_DISABLED )
+ {
+ INTR_TRAC_ERR("OCC encountered a WOF error before TMGT/HTMGT"
+ " enabled it. wof_disabled = 0x%08x",
+ g_wof->wof_disabled);
+ break;
+ }
+
// If error has already been logged, trace and skip
if( L_errorLogged )
{
@@ -1330,28 +1341,7 @@ void set_clear_wof_disabled( uint8_t i_action,
// Make sure the reason requires an error log
if( g_wof->wof_disabled & ERRL_RETURN_CODES )
{
- // Create error log
- /** @errortype
- * @moduleid SET_CLEAR_WOF_DISABLED
- * @reasoncode WOF_DISABLED_RC
- * @userdata1 current wof_disabled
- * @userdata2 Bit requested to be set
- * @userdata4 OCC_NO_EXTENDED_RC
- * @devdesc WOF has been disabled due to an error
- */
- l_errl = createErrl(
- SET_CLEAR_WOF_DISABLED,
- WOF_DISABLED_RC,
- OCC_NO_EXTENDED_RC,
- ERRL_SEV_UNRECOVERABLE,
- NULL,
- DEFAULT_TRACE_SIZE,
- g_wof->wof_disabled,
- i_bit_mask );
-
- // commit the error log
- commitErrl( &l_errl );
- L_errorLogged = true;
+ l_logError = true;
}
// if the previous wof_disabled was all zeros,
// send IPC command to PGPE to disable wof
@@ -1372,6 +1362,18 @@ void set_clear_wof_disabled( uint8_t i_action,
{
// Clear the bit
g_wof->wof_disabled &= ~i_bit_mask;
+
+ // If TMGT/HTMGT is enabling WOF, check for any previous
+ // errors and log if they exist.
+ if( i_bit_mask == WOF_RC_OCC_WOF_DISABLED )
+ {
+ if( g_wof->wof_disabled )
+ {
+ l_logError = true;
+ }
+ break;
+ }
+
// If clearing the bit put wof_disabled at all 0's AND
// wof_disabled was not already all 0's, wof is being
// re-enabled. Log informational error.
@@ -1413,6 +1415,32 @@ void set_clear_wof_disabled( uint8_t i_action,
}
}while( 0 );
+ // Check for error
+ if( l_logError )
+ {
+ // Create error log
+ /** @errortype
+ * @moduleid SET_CLEAR_WOF_DISABLED
+ * @reasoncode WOF_DISABLED_RC
+ * @userdata1 current wof_disabled
+ * @userdata2 Bit requested to be set
+ * @userdata4 OCC_NO_EXTENDED_RC
+ * @devdesc WOF has been disabled due to an error
+ */
+ l_errl = createErrl(
+ SET_CLEAR_WOF_DISABLED,
+ WOF_DISABLED_RC,
+ OCC_NO_EXTENDED_RC,
+ ERRL_SEV_UNRECOVERABLE,
+ NULL,
+ DEFAULT_TRACE_SIZE,
+ g_wof->wof_disabled,
+ i_bit_mask );
+
+ // commit the error log
+ commitErrl( &l_errl );
+ L_errorLogged = true;
+ }
}
/**
diff --git a/src/occ_405/wof/wof.h b/src/occ_405/wof/wof.h
index 91ea563..cc719e1 100644
--- a/src/occ_405/wof/wof.h
+++ b/src/occ_405/wof/wof.h
@@ -63,6 +63,7 @@
#define WOF_RC_VFRT_ALIGNMENT_ERROR 0x00004000
#define WOF_RC_DRIVER_WOF_DISABLED 0x00008000
#define WOF_RC_UTURBO_IS_ZERO 0x00010000
+#define WOF_RC_OCC_WOF_DISABLED 0x00020000
//***************************************************************************
// Temp space used to save hard coded addresses
OpenPOWER on IntegriCloud