summaryrefslogtreecommitdiffstats
path: root/src/occ_405/pss
diff options
context:
space:
mode:
authorWilliam Bryan <wilbryan@us.ibm.com>2017-03-29 12:59:12 -0500
committerWilliam A. Bryan <wilbryan@us.ibm.com>2017-04-04 12:12:37 -0400
commitd859b57d6b37ba8c4b04521928ca5ce61a9416b6 (patch)
tree2e4df99a38bd30bdce8b438a00fa325ad87528f6 /src/occ_405/pss
parent3b1b654a2e720ceb2709412ac2c5e091fcf2e76a (diff)
downloadtalos-occ-d859b57d6b37ba8c4b04521928ca5ce61a9416b6.tar.gz
talos-occ-d859b57d6b37ba8c4b04521928ca5ce61a9416b6.zip
Update PK GPE code and APSS Recovery
Change-Id: I00f53bdb76d5e6a82bf4dcd580875210f4c1cae8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38590 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> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src/occ_405/pss')
-rwxr-xr-xsrc/occ_405/pss/apss.c200
1 files changed, 53 insertions, 147 deletions
diff --git a/src/occ_405/pss/apss.c b/src/occ_405/pss/apss.c
index 76d813c..71d98ef 100755
--- a/src/occ_405/pss/apss.c
+++ b/src/occ_405/pss/apss.c
@@ -141,17 +141,6 @@ void dumpHexString(const void *i_data, const unsigned int len, const char *strin
// End Function Specification
void do_apss_recovery(void)
{
-#define PSS_START_COMMAND 0x8000000000000000ull
-#define PSS_RESET_COMMAND 0x4000000000000000ull
- int l_scom_rc = 0;
- uint32_t l_scom_addr;
- uint64_t l_spi_adc_ctrl0;
- uint64_t l_spi_adc_ctrl1;
- uint64_t l_spi_adc_ctrl2;
- uint64_t l_spi_adc_status;
- uint64_t l_spi_adc_reset;
- uint64_t l_spi_adc_wdata;
-
if (!G_apss_data_traced)
{
INTR_TRAC_ERR("detected invalid power data[%08x%08x]",
@@ -160,147 +149,65 @@ void do_apss_recovery(void)
G_apss_data_traced = TRUE;
}
- do
+ // Special error handling on OCC backup. Keep an up/down counter of
+ // fail/success and log predictive error when we reach the limit.
+ if(G_occ_role == OCC_SLAVE)
{
- // Collect SPI ADC FFDC data
- l_scom_addr = SPIPSS_ADC_RESET_REG;
- l_scom_rc = _getscom(l_scom_addr, &l_spi_adc_reset, SCOM_TIMEOUT);
- if(l_scom_rc)
+ if(G_backup_fail_count < MAX_BACKUP_FAILURES)
{
- break;
- }
- l_scom_addr = SPIPSS_ADC_CTRL_REG0;
- l_scom_rc = _getscom(l_scom_addr, &l_spi_adc_ctrl0, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
- }
- l_scom_addr = SPIPSS_ADC_CTRL_REG1;
- l_scom_rc = _getscom(l_scom_addr, &l_spi_adc_ctrl1, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
- }
- l_scom_addr = SPIPSS_ADC_CTRL_REG2;
- l_scom_rc = _getscom(l_scom_addr, &l_spi_adc_ctrl2, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
- }
- l_scom_addr = SPIPSS_ADC_STATUS_REG;
- l_scom_rc = _getscom(l_scom_addr, &l_spi_adc_status, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
- }
- l_scom_addr = SPIPSS_ADC_WDATA_REG;
- l_scom_rc = _getscom(l_scom_addr, &l_spi_adc_wdata, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
- }
-
- INTR_TRAC_ERR("70000[%08x] 70001[%08x] 70002[%08x] 70003|70005[%08x] 70010[%08x]",
- (uint32_t)(l_spi_adc_ctrl0 >> 32),
- (uint32_t)(l_spi_adc_ctrl1 >> 32),
- (uint32_t)(l_spi_adc_ctrl2 >> 32),
- (uint32_t)((l_spi_adc_status >> 32) | (l_spi_adc_reset >> 48)), // Stuff reset register in lower 16 bits
- (uint32_t)(l_spi_adc_wdata >> 32));
-
- // Special error handling on OCC backup. Keep an up/down counter of
- // fail/success and log predictive error when we reach the limit.
- if(G_occ_role == OCC_SLAVE)
- {
- if(G_backup_fail_count < MAX_BACKUP_FAILURES)
- {
- // Increment the up/down counter
- G_backup_fail_count++;
- }
- else
- {
- //We're logging the error so stop running apss tasks
- rtl_stop_task(TASK_ID_APSS_START);
- rtl_stop_task(TASK_ID_APSS_CONT);
- rtl_stop_task(TASK_ID_APSS_DONE);
-
- INTR_TRAC_INFO("Redundant APSS has exceeded failure threshold. Logging Error");
-
- /*
- * @errortype
- * @moduleid PSS_MID_DO_APSS_RECOVERY
- * @reasoncode REDUNDANT_APSS_GPE_FAILURE
- * @userdata1 0
- * @userdata2 0
- * @userdata4 OCC_NO_EXTENDED_RC
- * @devdesc Redundant APSS failure. Power Management Redundancy Lost.
- */
- errlHndl_t l_err = createErrl(PSS_MID_DO_APSS_RECOVERY,
- REDUNDANT_APSS_GPE_FAILURE,
- OCC_NO_EXTENDED_RC,
- ERRL_SEV_PREDICTIVE,
- NULL,
- DEFAULT_TRACE_SIZE,
- 0,
- 0);
-
- // APSS callout
- addCalloutToErrl(l_err,
- ERRL_CALLOUT_TYPE_HUID,
- G_sysConfigData.apss_huid,
- ERRL_CALLOUT_PRIORITY_HIGH);
- // Processor callout
- addCalloutToErrl(l_err,
- ERRL_CALLOUT_TYPE_HUID,
- G_sysConfigData.proc_huid,
- ERRL_CALLOUT_PRIORITY_LOW);
- // Backplane callout
- addCalloutToErrl(l_err,
- ERRL_CALLOUT_TYPE_HUID,
- G_sysConfigData.backplane_huid,
- ERRL_CALLOUT_PRIORITY_LOW);
- // Firmware callout
- addCalloutToErrl(l_err,
- ERRL_CALLOUT_TYPE_COMPONENT_ID,
- ERRL_COMPONENT_ID_FIRMWARE,
- ERRL_CALLOUT_PRIORITY_MED);
-
- commitErrl(&l_err);
-
- break;
- }
+ // Increment the up/down counter
+ G_backup_fail_count++;
}
-
- INTR_TRAC_INFO("Starting APSS recovery. fail_count=%d", G_backup_fail_count);
-
- // Reset the ADC engine
- l_scom_addr = SPIPSS_ADC_RESET_REG;
- l_scom_rc = _putscom(l_scom_addr, PSS_RESET_COMMAND, SCOM_TIMEOUT);
- if(l_scom_rc)
+ else
{
- break;
- }
+ //We're logging the error so stop running apss tasks
+ rtl_stop_task(TASK_ID_APSS_START);
+ rtl_stop_task(TASK_ID_APSS_CONT);
+ rtl_stop_task(TASK_ID_APSS_DONE);
- // Zero out the reset register
- l_scom_rc = _putscom(l_scom_addr, 0, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
- }
+ INTR_TRAC_INFO("Redundant APSS has exceeded failure threshold. Logging Error");
- // Attempt recovery by sending the apss
- // command that was set up earlier by initialization GPE
- l_scom_addr = SPIPSS_P2S_COMMAND_REG;
- l_scom_rc = _putscom(l_scom_addr, PSS_START_COMMAND, SCOM_TIMEOUT);
- if(l_scom_rc)
- {
- break;
+ /*
+ * @errortype
+ * @moduleid PSS_MID_DO_APSS_RECOVERY
+ * @reasoncode REDUNDANT_APSS_GPE_FAILURE
+ * @userdata1 0
+ * @userdata2 0
+ * @userdata4 OCC_NO_EXTENDED_RC
+ * @devdesc Redundant APSS failure. Power Management Redundancy Lost.
+ */
+ errlHndl_t l_err = createErrl(PSS_MID_DO_APSS_RECOVERY,
+ REDUNDANT_APSS_GPE_FAILURE,
+ OCC_NO_EXTENDED_RC,
+ ERRL_SEV_PREDICTIVE,
+ NULL,
+ DEFAULT_TRACE_SIZE,
+ 0,
+ 0);
+
+ // APSS callout
+ addCalloutToErrl(l_err,
+ ERRL_CALLOUT_TYPE_HUID,
+ G_sysConfigData.apss_huid,
+ ERRL_CALLOUT_PRIORITY_HIGH);
+ // Processor callout
+ addCalloutToErrl(l_err,
+ ERRL_CALLOUT_TYPE_HUID,
+ G_sysConfigData.proc_huid,
+ ERRL_CALLOUT_PRIORITY_LOW);
+ // Backplane callout
+ addCalloutToErrl(l_err,
+ ERRL_CALLOUT_TYPE_HUID,
+ G_sysConfigData.backplane_huid,
+ ERRL_CALLOUT_PRIORITY_LOW);
+ // Firmware callout
+ addCalloutToErrl(l_err,
+ ERRL_CALLOUT_TYPE_COMPONENT_ID,
+ ERRL_COMPONENT_ID_FIRMWARE,
+ ERRL_CALLOUT_PRIORITY_MED);
+
+ commitErrl(&l_err);
}
- }while(0);
-
- // Just trace it if we get a scom failure trying to collect FFDC
- if(l_scom_rc)
- {
- INTR_TRAC_ERR("apss recovery scom failure. addr=0x%08x, rc=0x%08x", l_scom_addr, l_scom_rc);
}
}
@@ -347,8 +254,7 @@ void task_apss_start_pwr_meas(struct task *i_self)
if(G_apss_recovery_requested)
{
// Do recovery then wait until next tick to do anything more.
-// TODO: RTC: 163275 Cannot SCOM from the 405. Move to GPE.
-// do_apss_recovery();
+ do_apss_recovery();
break;
}
OpenPOWER on IntegriCloud