diff options
author | Wael El-Essawy <welessa@us.ibm.com> | 2015-09-01 23:58:49 -0500 |
---|---|---|
committer | Wael Elessawy <welessa@us.ibm.com> | 2015-09-08 16:43:14 -0500 |
commit | ace8bb1eec1517158116caa635287532a909315f (patch) | |
tree | d89418fb71d9b166a597a7b8f7b3287bbe2416f0 /src/occ_gpe0/apss_init.c | |
parent | 970de5b7c235898fbac1ca4db6a8336db3469399 (diff) | |
download | talos-occ-ace8bb1eec1517158116caa635287532a909315f.tar.gz talos-occ-ace8bb1eec1517158116caa635287532a909315f.zip |
GPE0 error and ffdc codes, and remove most pk_halts
modified the wait_spi_completion function to make it args_t independent
eliminated all scom/spi related pk_halts, left only ipc related pk_halt
using new APSS_RC_XXX rc codes
used apss_set_ffdc to set rc, ffdc, and address fields
cleaned some comments
added four PK traces to mark the start and completion of init routines
removed gpe0 from PK traces, and added register address and scom operation
added description for all functions
deleted all assembly files
Change-Id: I5a265c14b917b7c5d87647dad537725ee7f47001
RTC: 131177
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20277
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Reviewed-by: Fadi Kassem <fmkassem@us.ibm.com>
Reviewed-by: Wael Elessawy <welessa@us.ibm.com>
Tested-by: Wael Elessawy <welessa@us.ibm.com>
Diffstat (limited to 'src/occ_gpe0/apss_init.c')
-rw-r--r-- | src/occ_gpe0/apss_init.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/src/occ_gpe0/apss_init.c b/src/occ_gpe0/apss_init.c index ca58404..ea40cbf 100644 --- a/src/occ_gpe0/apss_init.c +++ b/src/occ_gpe0/apss_init.c @@ -36,7 +36,7 @@ uint32_t apss_start_spi_command(initGpioArgs_t * args, uint8_t i_noWait) if (!i_noWait)
{
- rc = wait_spi_completion(args, SPIPSS_P2S_STATUS_REG, 10);
+ rc = wait_spi_completion(&(args->error), SPIPSS_P2S_STATUS_REG, 10);
if (rc)
{
PK_TRACE("apss_start_spi_command: Timed out waiting for ops to complete. rc = 0x%08x",
@@ -63,14 +63,17 @@ void apss_init_gpio(ipc_msg_t* cmd, void* arg) //Note: arg was set to 0 in ipc func table (ipc_func_tables.c), so don't use it
uint32_t rc;
+ uint32_t ipc_send_rc;
ipc_async_cmd_t *async_cmd = (ipc_async_cmd_t*)cmd;
initGpioArgs_t *args = (initGpioArgs_t*)async_cmd->cmd_data;
uint64_t regValue = 0;
+ PK_TRACE("apss_init_gpio: started.");
+
do
{
// Wait for SPI operations to be complete (up to 10usec timeout)
- rc = wait_spi_completion(args, SPIPSS_P2S_STATUS_REG, 10);
+ rc = wait_spi_completion(&(args->error), SPIPSS_P2S_STATUS_REG, 10);
if (rc)
{
PK_TRACE("apss_init_gpio: Timed out waiting for ops to complete. rc = 0x%08x", rc);
@@ -197,14 +200,21 @@ void apss_init_gpio(ipc_msg_t* cmd, void* arg) }while(0);
// send back a successful response. OCC will check rc and ffdc
- rc = ipc_send_rsp(cmd, IPC_RC_SUCCESS);
+ ipc_send_rc = ipc_send_rsp(cmd, IPC_RC_SUCCESS);
- if(rc)
+ if(ipc_send_rc)
{
- PK_TRACE("apss_init_gpio: Failed to send response back. Halting GPE0", rc);
- apss_set_ffdc(&(args->error), 0x00, rc, regValue);
+ PK_TRACE("apss_init_gpio: Failed to send response back. rc = 0x%08x. Halting GPE0",
+ ipc_send_rc);
+ apss_set_ffdc(&(args->error), 0x00, ipc_send_rc, regValue);
pk_halt();
}
+
+ if(rc == 0) // if ipc_send_rc is 0, wont reach this instruction (pk_halt)
+ {
+ PK_TRACE("apss_init_gpio: completed successfully.");
+ }
+
}
/*
@@ -222,14 +232,17 @@ void apss_init_mode(ipc_msg_t* cmd, void* arg) uint32_t rc = APSS_RC_SUCCESS;
uint32_t ipc_rc = IPC_RC_SUCCESS;
+ uint32_t ipc_send_rc;
ipc_async_cmd_t *async_cmd = (ipc_async_cmd_t*)cmd;
setApssModeArgs_t *args = (setApssModeArgs_t*)async_cmd->cmd_data;
uint64_t regValue = 0;
+ PK_TRACE("apss_init_mode: started.");
+
do
{
// Wait for SPI operations to be complete (up to 10usec timeout)
- rc = wait_spi_completion(args, SPIPSS_P2S_STATUS_REG, 10);
+ rc = wait_spi_completion(&(args->error), SPIPSS_P2S_STATUS_REG, 10);
if (rc)
{
PK_TRACE("apss_init_mode: Timed out waiting for ops to complete. rc = 0x%08x", rc);
@@ -318,16 +331,22 @@ void apss_init_mode(ipc_msg_t* cmd, void* arg) }while(0);
// send back a response
- PK_TRACE("apss_init_mode: Sending APSS response ReturnCode:0x%X. APSSrc:0x%X (0 = Success)",
+ PK_TRACE("apss_init_mode: Sending APSS response ReturnCode:0x%X. APSSrc:0x%X (0 = Success)",
ipc_rc, rc);
- rc = ipc_send_rsp(cmd, ipc_rc);
+ ipc_send_rc = ipc_send_rsp(cmd, ipc_rc);
//If we fail to send ipc response, then this error takes prescedence over any other error.
//TODO: See if there's another space to write the error out to.
- if(rc)
+ if(ipc_send_rc)
{
- PK_TRACE("apss_init_mode: Failed to send response back to mode initialization. Halting GPE0", ipc_rc);
- apss_set_ffdc(&(args->error), 0x00, ipc_rc, regValue);
+ PK_TRACE("apss_init_mode: Failed to send response back to mode initialization. Halting GPE0",
+ ipc_send_rc);
+ apss_set_ffdc(&(args->error), 0x00, ipc_send_rc, regValue);
pk_halt();
}
+
+ if(rc == 0 && ipc_rc == IPC_RC_SUCCESS) // if ipc_send_rc, wont reach this instruction (pk_halt)
+ {
+ PK_TRACE("apss_init_mode: completed successfully.");
+ }
}
|