summaryrefslogtreecommitdiffstats
path: root/src/sbefw/sbescom.C
diff options
context:
space:
mode:
authorShakeeb <shakeebbk@in.ibm.com>2016-09-22 02:02:41 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2016-10-04 07:11:47 -0400
commitfcf2fc04cfa705d3beb138edfe379ab0c228aad6 (patch)
tree465e4c7bddc76b7d5b5d05e3139182565f89633f /src/sbefw/sbescom.C
parent7c87046da09c051b8a6b5084b227b05d4ca80a16 (diff)
downloadtalos-sbe-fcf2fc04cfa705d3beb138edfe379ab0c228aad6.tar.gz
talos-sbe-fcf2fc04cfa705d3beb138edfe379ab0c228aad6.zip
SBE plat scom error handling
Change-Id: Iffc9686fa745040a0d0f1c3a6b5f0dacc89a1c66 RTC:158016 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30078 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw/sbescom.C')
-rw-r--r--src/sbefw/sbescom.C28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/sbefw/sbescom.C b/src/sbefw/sbescom.C
index b76f51a4..634c8868 100644
--- a/src/sbefw/sbescom.C
+++ b/src/sbefw/sbescom.C
@@ -28,6 +28,7 @@
#include "sbetrace.H"
#include "plat_hw_access.H"
#include "plat_target.H"
+#include "sbescom.H"
using namespace fapi2;
/**
@@ -68,7 +69,7 @@ enum sbeScomType
uint32_t checkIndirectAndDoScom( const bool i_isRead,
const uint64_t i_addr,
uint64_t & io_data,
- uint32_t & o_pcbPibStatus )
+ sbeResponseFfdc_t *const o_ffdc)
{
#define SBE_FUNC " checkIndirectAndDoScom "
@@ -76,6 +77,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead,
uint32_t elapsedIndScomTimeNs = 0;
uint64_t tempBuffer = io_data;
sbeScomType scomType = SBE_SCOM_TYPE_DIRECT;
+ ReturnCode fapiRc = FAPI2_RC_SUCCESS;
do
{
// If the indirect scom bit is 0, then doing a regular scom
@@ -85,12 +87,12 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead,
SBE_INFO(SBE_FUNC "Performing Direct scom.");
if( i_isRead )
{
- o_pcbPibStatus = getscom_abs_wrap (&l_hndl, (uint32_t)i_addr,
+ fapiRc = getscom_abs_wrap (&l_hndl, (uint32_t)i_addr,
& io_data);
}
else
{
- o_pcbPibStatus = putscom_abs_wrap (&l_hndl, (uint32_t)i_addr,
+ fapiRc = putscom_abs_wrap (&l_hndl, (uint32_t)i_addr,
io_data);
}
break;
@@ -148,9 +150,10 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead,
// perform write before the read with the new
// IO_buffer with the imbedded indirect scom addr.
- o_pcbPibStatus = putscom_abs_wrap (&l_hndl, tempAddr, tempBuffer);
+ fapiRc = putscom_abs_wrap (&l_hndl, tempAddr, tempBuffer);
- if( ( o_pcbPibStatus ) || ( scomType == SBE_SCOM_TYPE_INDIRECT_2 ))
+ if( ( fapiRc != FAPI2_RC_SUCCESS ) ||
+ ( scomType == SBE_SCOM_TYPE_INDIRECT_2 ))
{
break;
}
@@ -162,16 +165,15 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead,
{
// Now perform the op requested using the passed in
// IO_Buffer to pass the read data back to caller.
- o_pcbPibStatus = getscom_abs_wrap (&l_hndl, tempAddr, &(scomout.data64));
+ fapiRc = getscom_abs_wrap (&l_hndl, tempAddr, &(scomout.data64));
- if( o_pcbPibStatus ) break;
+ if( fapiRc != FAPI2_RC_SUCCESS) break;
// if bit 32 is on indicating a complete bit
// or we saw an error, then we're done
if (scomout.piberr)
{
SBE_ERROR(SBE_FUNC "pib error reading status register");
- o_pcbPibStatus = scomout.piberr;
break;
}
if (scomout.done )
@@ -185,7 +187,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead,
}while ( elapsedIndScomTimeNs <= MAX_INDSCOM_TIMEOUT_NS);
- if( o_pcbPibStatus ) break;
+ if( fapiRc != FAPI2_RC_SUCCESS ) break;
if( ! scomout.done)
{
SBE_ERROR(SBE_FUNC "Indirect scom timeout.");
@@ -195,9 +197,13 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead,
}while(0);
- if (o_pcbPibStatus ) l_rc = SBE_SEC_PCB_PIB_ERR;
+ if (fapiRc != FAPI2_RC_SUCCESS)
+ {
+ l_rc = SBE_SEC_PCB_PIB_ERR;
+ if(o_ffdc) o_ffdc->setRc(fapiRc);
+ }
- SBE_DEBUG(SBE_FUNC "o_pcbPibStatus:%u l_rc:0x%08X", o_pcbPibStatus, l_rc);
+ SBE_DEBUG(SBE_FUNC "fapiRc:%u l_rc:0x%08X", fapiRc, l_rc);
return l_rc;
}
OpenPOWER on IntegriCloud