summaryrefslogtreecommitdiffstats
path: root/sbe/sbefw/sbeHostUtils.C
diff options
context:
space:
mode:
authorRaja Das <rajadas2@in.ibm.com>2016-02-18 03:36:27 -0600
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2016-03-23 04:40:35 -0400
commit19139d2eb05f1211bd21e5ee3689ae9a215cf0fc (patch)
tree959c0a2015f7c4094567491d6db37d91cde6a3f1 /sbe/sbefw/sbeHostUtils.C
parent911cc624014689c649651764ba784237c58c815a (diff)
downloadtalos-sbe-19139d2eb05f1211bd21e5ee3689ae9a215cf0fc.tar.gz
talos-sbe-19139d2eb05f1211bd21e5ee3689ae9a215cf0fc.zip
Control DeadMan Loop Support
Change-Id: Icee15457cd7abb8779e1134fc88063b2437e3281 RTC:134270 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21038 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'sbe/sbefw/sbeHostUtils.C')
-rw-r--r--sbe/sbefw/sbeHostUtils.C65
1 files changed, 36 insertions, 29 deletions
diff --git a/sbe/sbefw/sbeHostUtils.C b/sbe/sbefw/sbeHostUtils.C
index f8622566..028245c1 100644
--- a/sbe/sbefw/sbeHostUtils.C
+++ b/sbe/sbefw/sbeHostUtils.C
@@ -22,20 +22,20 @@
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
uint32_t sbeReadPsu2SbeMbxReg (uint32_t i_addr,
- uint8_t &io_count,
+ const uint8_t i_count,
uint64_t *o_pData)
{
#define SBE_FUNC " sbeReadPsu2SbeMbxReg "
- SBE_DEBUG(SBE_FUNC"io_count[0x%02X], i_addr=[0x%08X]", io_count, i_addr);
+ SBE_DEBUG(SBE_FUNC"i_count[0x%02X], i_addr=[0x%08X]", i_count, i_addr);
uint32_t l_rc = SBE_SEC_OPERATION_SUCCESSFUL;
uint8_t l_count = 0;
- assert((io_count >0 ) && (NULL != o_pData))
+ assert((i_count >0 ) && (NULL != o_pData))
assert( (SBE_HOST_PSU_MBOX_REG0 <= i_addr) &&
- (SBE_HOST_PSU_MBOX_REG3 >= (i_addr + io_count - 1)) )
+ (SBE_HOST_PSU_MBOX_REG3 >= (i_addr + i_count - 1)) )
- while (l_count < io_count)
+ while (l_count < i_count)
{
l_rc = getscom_abs ( i_addr,
reinterpret_cast<uint64_t*>(&o_pData[l_count]) );
@@ -53,9 +53,6 @@ uint32_t sbeReadPsu2SbeMbxReg (uint32_t i_addr,
++l_count;
++i_addr;
}
-
- // Indicate the number of Mbx registers read off
- io_count = l_count;
return l_rc;
#undef SBE_FUNC
@@ -99,39 +96,49 @@ uint32_t sbeAcknowledgeHost ()
///////////////////////////////////////////////////////////////////
uint32_t sbeWriteSbe2PsuMbxReg (uint32_t i_addr,
const uint64_t *i_pData,
- uint8_t &io_count)
+ const uint8_t i_count,
+ bool i_setBit0ToIntrHB)
{
#define SBE_FUNC " sbeWriteSbe2PsuMbxReg "
- SBE_DEBUG(SBE_FUNC"io_count[0x%02X], i_addr=[0x%08X]", io_count, i_addr);
+ SBE_DEBUG(SBE_FUNC"i_count[0x%02X], i_addr=[0x%08X]", i_count, i_addr);
uint32_t l_rc = SBE_SEC_OPERATION_SUCCESSFUL;
uint8_t l_count = 0;
- assert( ((io_count >0 ) && (NULL != i_pData)) || (io_count = 0) )
+ assert( (i_count >0 ) && (NULL != i_pData) )
assert( (SBE_HOST_PSU_MBOX_REG4 <= i_addr) &&
- (SBE_HOST_PSU_MBOX_REG7 >= (i_addr + io_count - 1)) )
+ (SBE_HOST_PSU_MBOX_REG7 >= (i_addr + i_count - 1)) )
- while ( (g_sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_RESP_REQUIRED) &&
- (l_count < io_count) )
+ if( g_sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_RESP_REQUIRED )
{
- SBE_DEBUG(SBE_FUNC"l_data=[0x%016X]", *(i_pData+l_count));
-
- l_rc = putscom_abs ( i_addr, *(i_pData+l_count) );
-
- if (l_rc)
+ while (l_count < i_count)
{
- // Error while reading from PSU->SBE mbx register
- SBE_ERROR(SBE_FUNC"putscom_abs failed,"
- "l_rc=[0x%08X], i_addr=[0x%08X]",
- l_rc, i_addr);
- break;
+ SBE_DEBUG(SBE_FUNC"l_data=[0x%016X]", *(i_pData+l_count));
+
+ l_rc = putscom_abs ( i_addr, *(i_pData+l_count) );
+ if (l_rc)
+ {
+ // Error while reading from PSU->SBE mbx register
+ SBE_ERROR(SBE_FUNC"putscom_abs failed,"
+ "l_rc=[0x%08X], i_addr=[0x%08X]",
+ l_rc, i_addr);
+ break;
+ }
+
+ ++l_count;
+ ++i_addr;
}
- ++l_count;
- ++i_addr;
+ if( (i_setBit0ToIntrHB) && (SBE_SEC_OPERATION_SUCCESSFUL == l_rc) )
+ {
+ // indicate the Host via Bit SBE_SBE2PSU_DOORBELL_SET_BIT0
+ l_rc = sbeSetSbe2PsuDbBitX(SBE_SBE2PSU_DOORBELL_SET_BIT0);
+ if(l_rc)
+ {
+ SBE_ERROR(SBE_FUNC " Failed to Sent Ack to Host over "
+ "SBE_SBE2PSU_DOORBELL_SET_BIT0");
+ }
+ }
}
-
- // Indicate the number of Mbx registers written into
- io_count = l_count;
return l_rc;
#undef SBE_FUNC
OpenPOWER on IntegriCloud