summaryrefslogtreecommitdiffstats
path: root/src/sbefw
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2018-01-10 04:31:50 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2018-02-14 00:12:43 -0500
commitfb9f9e8bc9402a3e03e6731dd824d3887d196ebd (patch)
tree8cbd9f13f1e68ee58d36886aa706919fab14e279 /src/sbefw
parentd770b5600d9177a06108ddf3ca2827d55c89b153 (diff)
downloadtalos-sbe-fb9f9e8bc9402a3e03e6731dd824d3887d196ebd.tar.gz
talos-sbe-fb9f9e8bc9402a3e03e6731dd824d3887d196ebd.zip
Checkstop detection during IPL SBE steps
Check for system checkstop on failure of IPL SBE steps Change-Id: I8b10e2d21a2cf3ea0c53974cd4cc98fa88bb4912 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51708 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r--src/sbefw/app/power/istep.C18
-rw-r--r--src/sbefw/app/power/sbecmdmpipl.C12
-rw-r--r--src/sbefw/core/ipl.C31
-rw-r--r--src/sbefw/core/ipl.H9
-rw-r--r--src/sbefw/core/sbe_sp_intf.H1
5 files changed, 59 insertions, 12 deletions
diff --git a/src/sbefw/app/power/istep.C b/src/sbefw/app/power/istep.C
index 29622d8d..ce038c4a 100644
--- a/src/sbefw/app/power/istep.C
+++ b/src/sbefw/app/power/istep.C
@@ -167,15 +167,25 @@ uint32_t sbeHandleIstep (uint8_t *i_pArg)
}
fapiRc = sbeExecuteIstep( req.major, req.minor );
- if( fapiRc != FAPI2_RC_SUCCESS )
+ bool checkstop = isSystemCheckstop();
+ if(( fapiRc != FAPI2_RC_SUCCESS ) || (checkstop))
{
SBE_ERROR(SBE_FUNC" sbeExecuteIstep() Failed. major:0x%08x"
" minor:0x%08x",
(uint32_t)req.major,
(uint32_t)req.minor);
- respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
- SBE_SEC_GENERIC_FAILURE_IN_EXECUTION);
- ffdc.setRc(fapiRc);
+ if(checkstop)
+ {
+ respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_SYSTEM_CHECKSTOP );
+ }
+ else
+ {
+ respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE,
+ SBE_SEC_GENERIC_FAILURE_IN_EXECUTION );
+ ffdc.setRc(fapiRc);
+ }
+
break;
}
diff --git a/src/sbefw/app/power/sbecmdmpipl.C b/src/sbefw/app/power/sbecmdmpipl.C
index fd8c5084..23b6360f 100644
--- a/src/sbefw/app/power/sbecmdmpipl.C
+++ b/src/sbefw/app/power/sbecmdmpipl.C
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -74,6 +75,11 @@ static const uint32_t SBE_ISTEP_MPIPL_START = 96;
static const uint32_t MPIPL_START_MAX_SUBSTEPS = 8;
static const uint32_t SBE_ISTEP_MPIPL_CONTINUE = 97;
static const uint32_t MPIPL_CONTINUE_MAX_SUBSTEPS = 7;
+static const uint32_t SBE_ISTEP4 = 4;
+static const uint32_t SBE_ISTEP5 = 5;
+static const uint32_t ISTEP_MINOR_START = 1;
+static const uint32_t ISTEP4_MAX_SUBSTEPS = 34;
+static const uint32_t ISTEP5_MAX_SUBSTEPS = 2;
///////////////////////////////////////////////////////////////////////
// @brief sbeEnterMpipl Sbe enter MPIPL function
@@ -163,9 +169,9 @@ uint32_t sbeContinueMpipl(uint8_t *i_pArg)
// Run isteps
const uint8_t isteps[][3] = {
// Major Num, Minor Start, Minor End
- {SBE_ISTEP_MPIPL_CONTINUE, 1, MPIPL_CONTINUE_MAX_SUBSTEPS},
- {4, 1, 34},
- {5, 1, 2}};
+ {SBE_ISTEP_MPIPL_CONTINUE, ISTEP_MINOR_START, MPIPL_CONTINUE_MAX_SUBSTEPS},
+ {SBE_ISTEP4, ISTEP_MINOR_START, ISTEP4_MAX_SUBSTEPS},
+ {SBE_ISTEP5, ISTEP_MINOR_START, ISTEP5_MAX_SUBSTEPS}};
// Loop through isteps
for( auto istep : isteps)
{
diff --git a/src/sbefw/core/ipl.C b/src/sbefw/core/ipl.C
index 02e2b2f3..d817be60 100644
--- a/src/sbefw/core/ipl.C
+++ b/src/sbefw/core/ipl.C
@@ -28,6 +28,9 @@
#include "sbeFFDC.H"
#include "ipl.H"
+#include "sbeglobals.H"
+
+#include "p9n2_perv_scom_addresses.H"
using namespace fapi2;
@@ -40,12 +43,26 @@ uint64_t G_ring_save[8] = {0, 0, 0, 0, 0, 0, 0, 0};
// SBE FFDC.
fapi2::ReturnCode g_iplFailRc = FAPI2_RC_SUCCESS;
+bool isSystemCheckstop()
+{
+ bool checkstop = false;
+ fapi2::buffer<uint64_t> attnReg = 0;
+ ReturnCode fapiRc = FAPI2_RC_SUCCESS;
+ plat_target_handle_t hndl;
+ fapiRc = getscom_abs_wrap(&hndl,
+ P9N2_PERV_ATTN_INTERRUPT_REG,
+ attnReg.pointer());
+ if( fapiRc == FAPI2_RC_SUCCESS )
+ {
+ checkstop = attnReg.getBit<2>();
+ }
+ return checkstop;
+}
+
//----------------------------------------------------------------------------
// @note This is the responsibilty of caller to verify major/minor
// number before calling this function
-// @TODO via RTC 129077.
-// This function should check for system checkstop as well.
ReturnCode sbeExecuteIstep (const uint8_t i_major, const uint8_t i_minor)
{
#define SBE_FUNC "sbeExecuteIstep "
@@ -78,7 +95,7 @@ ReturnCode sbeExecuteIstep (const uint8_t i_major, const uint8_t i_minor)
else
{
(void)SbeRegAccess::theSbeRegAccess().updateSbeStep(i_major, i_minor);
- }
+ }
return rc;
#undef SBE_FUNC
@@ -106,14 +123,18 @@ void sbeDoContinuousIpl()
{
rc = istepMap->istepWrapper(istepMap->istepHwp);
}
- if(rc != FAPI2_RC_SUCCESS)
+ bool checkstop = isSystemCheckstop();
+ if((rc != FAPI2_RC_SUCCESS) || checkstop )
{
SBE_ERROR(SBE_FUNC"Failed istep execution in plck mode: "
"Major: %d, Minor: %d",
istepTableEntry->istepMajorNum, step);
+ uint32_t secRc = checkstop ? SBE_SEC_SYSTEM_CHECKSTOP:
+ SBE_SEC_GENERIC_FAILURE_IN_EXECUTION;
+
captureAsyncFFDC(SBE_PRI_GENERIC_EXECUTION_FAILURE,
- SBE_SEC_GENERIC_FAILURE_IN_EXECUTION);
+ secRc);
// exit outer loop as well
entry = istepTable.len;
break;
diff --git a/src/sbefw/core/ipl.H b/src/sbefw/core/ipl.H
index 3a2b1395..f56c3dc9 100644
--- a/src/sbefw/core/ipl.H
+++ b/src/sbefw/core/ipl.H
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -48,6 +49,14 @@ fapi2::ReturnCode sbeExecuteIstep (uint8_t i_major, uint8_t i_minor);
*/
void sbeDoContinuousIpl();
+/*
+ * @brief Check for the system checkstop based on
+ * P9N2_PERV_ATTN_INTERRUPT_REG bit 3
+ *
+ * @return if the system is checkstop or not
+ */
+bool isSystemCheckstop();
+
using voidfuncptr_t = void (*)(void);
using iStep_t = fapi2::ReturnCode (*)( voidfuncptr_t );
diff --git a/src/sbefw/core/sbe_sp_intf.H b/src/sbefw/core/sbe_sp_intf.H
index 45c293d7..4b6c7704 100644
--- a/src/sbefw/core/sbe_sp_intf.H
+++ b/src/sbefw/core/sbe_sp_intf.H
@@ -220,6 +220,7 @@ enum sbeSecondaryResponse
SBE_SEC_INVALID_PARAMS = 0x19,
SBE_SEC_BLACKLISTED_CHIPOP_ACCESS = 0x20,
SBE_SEC_DMT_TIMEOUT = 0x21,
+ SBE_SEC_SYSTEM_CHECKSTOP = 0x22,
};
/**
OpenPOWER on IntegriCloud