summaryrefslogtreecommitdiffstats
path: root/src/occ_405
diff options
context:
space:
mode:
authorAndres Lugo-Reyes <aalugore@us.ibm.com>2017-01-10 07:35:12 -0600
committerWilliam A. Bryan <wilbryan@us.ibm.com>2017-02-01 11:19:59 -0500
commit4d6a99902a2a377a12dbef720fea81873fb920cc (patch)
treec6fbf8303c5775bb423b8405cfe37a0566df5a43 /src/occ_405
parent009f439d2aa9df1944eb08b7f1fc30006abd8137 (diff)
downloadtalos-occ-4d6a99902a2a377a12dbef720fea81873fb920cc.tar.gz
talos-occ-4d6a99902a2a377a12dbef720fea81873fb920cc.zip
WOF: Function to calculate the Active Quad step number
Change-Id: I3acafe872623838fa2ad16e8c85288dddb275fb5 RTC: 130216 Depends-on: I2249777134608d9f79bdc85692a3acbf7907c3f5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34657 Reviewed-by: William A. Bryan <wilbryan@us.ibm.com> Tested-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src/occ_405')
-rwxr-xr-xsrc/occ_405/main.c38
-rw-r--r--src/occ_405/occ_service_codes.h4
-rw-r--r--src/occ_405/wof/wof.c19
-rw-r--r--src/occ_405/wof/wof.h13
4 files changed, 69 insertions, 5 deletions
diff --git a/src/occ_405/main.c b/src/occ_405/main.c
index e1ffd57..873e65d 100755
--- a/src/occ_405/main.c
+++ b/src/occ_405/main.c
@@ -555,6 +555,44 @@ void read_wof_header(void)
memcpy(&G_wof_header, &(l_temp_bce_buff.data[pad]), sizeof(wof_header_data_t));
+ // Make sure the header is reporting a valid number of quads i.e. 1 or 6
+ if( (G_wof_header.active_quads_size != ACTIVE_QUAD_SZ_MIN) &&
+ (G_wof_header.active_quads_size != ACTIVE_QUAD_SZ_MAX) )
+ {
+ CMDH_TRAC_ERR("read_wof_header: Invalid number of active quads!"
+ " Expected: 1 or 6, Actual %d",
+ G_wof_header.active_quads_size );
+
+ /*
+ * @errortype
+ * @moduleid READ_WOF_HEADER
+ * @reasoncode INVALID_ACTIVE_QUAD_COUNT
+ * @userdata1 Reported active quad count
+ * @devdesc Read an invalid number of active quads
+ */
+ l_reasonCode = INVALID_ACTIVE_QUAD_COUNT;
+ l_extReasonCode = ERC_WOF_QUAD_COUNT_FAILURE;
+ errlHndl_t l_errl = createErrl(READ_WOF_HEADER, //modId
+ INVALID_ACTIVE_QUAD_COUNT, //reasoncode
+ ERC_WOF_QUAD_COUNT_FAILURE, //Extended reason code
+ ERRL_SEV_UNRECOVERABLE, //Severity
+ NULL, //Trace Buf
+ 0, //Trace Size
+ G_wof_header.active_quads_size, //userdata1
+ 0); //userdata2
+
+ // Callout firmware
+ addCalloutToErrl(l_errl,
+ ERRL_CALLOUT_TYPE_COMPONENT_ID,
+ ERRL_COMPONENT_ID_FIRMWARE,
+ ERRL_CALLOUT_PRIORITY_HIGH);
+
+ // Commit error log
+ commitErrl(&l_errl);
+
+ // We were unable to get the active quad count. Do not run wof algo.
+ G_run_wof_main = false;
+ }
}while( 0 );
diff --git a/src/occ_405/occ_service_codes.h b/src/occ_405/occ_service_codes.h
index d101582..0750cf1 100644
--- a/src/occ_405/occ_service_codes.h
+++ b/src/occ_405/occ_service_codes.h
@@ -59,6 +59,8 @@ enum occReasonCode
SSX_GENERIC_FAILURE = 0x17,
/// Failure to handshake with an external fw entity (HB, FSP, PHYP, etc)
EXTERNAL_INTERFACE_FAILURE = 0x18,
+ /// Incorrect number of active quads reported
+ INVALID_ACTIVE_QUAD_COUNT = 0x19,
/// VRM reached error threshold (VR_HOT asserted)
VRM_ERROR_TEMP = 0x20,
/// VR_FAN - AVS Bus over-temperature reported
@@ -240,6 +242,8 @@ enum occExtReasonCode
ERC_PGPE_SUSPEND_FAILURE = 0x00B6,
ERC_PGPE_CLIP_FAILURE = 0x00B7,
ERC_PGPE_PPMR_OPPB_SIZE_MISMATCH = 0x00B8,
+
+ ERC_WOF_QUAD_COUNT_FAILURE = 0x00C0,
};
// Error log Module Ids
diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c
index f222359..bad31b6 100644
--- a/src/occ_405/wof/wof.c
+++ b/src/occ_405/wof/wof.c
@@ -88,7 +88,7 @@ void wof_main(void)
/**
- * calculate_step
+ * calculate_step_from_start
*
* Description: Calculates the step number for the current VDN/VDD
*
@@ -135,3 +135,20 @@ uint16_t calculate_step_from_start(uint16_t i_ceff_vdx,
return l_current_step;
}
+
+
+/**
+ * calc_quad_step_from_start
+ *
+ * Description: Calculates the step number for the current number
+ * of active quads
+ *
+ * Param[in]: i_num_active_quads - The current number of active quads.
+ *
+ * Return: The calculated step for current active quads
+ */
+uint8_t calc_quad_step_from_start( uint8_t i_num_active_quads )
+{
+ return (G_wof_header.active_quads_size == ACTIVE_QUAD_SZ_MIN) ? 0 :
+ (i_num_active_quads - 1);
+}
diff --git a/src/occ_405/wof/wof.h b/src/occ_405/wof/wof.h
index 6d3948d..52a5ff0 100644
--- a/src/occ_405/wof/wof.h
+++ b/src/occ_405/wof/wof.h
@@ -31,7 +31,8 @@
// Define
//******************************************************************************
#define MIN_BCE_REQ_SIZE 256
-
+#define ACTIVE_QUAD_SZ_MIN 1
+#define ACTIVE_QUAD_SZ_MAX 6
typedef struct __attribute__ ((packed))
{
@@ -67,8 +68,12 @@ typedef struct
void wof_main( void );
uint16_t calculate_step_from_start( uint16_t i_ceff_vdx,
- uint8_t i_step_size,
- uint8_t i_min_step,
- uint8_t i_max_step );
+ uint8_t i_step_size,
+ uint8_t i_min_step,
+ uint8_t i_max_step );
+
+uint8_t calc_quad_step_from_start( uint8_t i_num_active_quads );
+
+
#endif
OpenPOWER on IntegriCloud