Skip to content

Commit

Permalink
handle pibrc correctly from sbe fifo
Browse files Browse the repository at this point in the history
Change-Id: I3f0ba875a47fdd00758c65b7982f300f0e05cd14
RTC: 170433
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41847
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-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>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
  • Loading branch information
Prachi Gupta authored and ploetzma committed Jun 30, 2017
1 parent d0a8f18 commit d25c0aa
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/include/usr/sbeio/sbe_ffdc_parser.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#ifndef __SBEFFDC_H
#define __SBEFFDC_H

#include <xscom/piberror.H>

/**
* @file sbe_ffdc_parser.H
* @brief SBE FFDC package parser
Expand Down Expand Up @@ -94,6 +96,11 @@ class SbeFFDCParser
*/
uint32_t getPackageLength(uint8_t i_index);

/**
* @brief: converts fapi2 rc to pib rc
* @param[in]: i_index index in the ffdc package
*/
PIB::PibError getPibRc (uint8_t i_index);
private:

/**
Expand Down
6 changes: 4 additions & 2 deletions src/include/usr/xscom/piberror.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
Expand All @@ -31,7 +33,7 @@ namespace PIB
/**
* @brief Enumerations for the each PIB error possbility
*/
enum
enum PibError
{
PIB_NO_ERROR = 0,//0b000,
PIB_RESOURCE_OCCUPIED = 1,//0b001,
Expand Down
2 changes: 1 addition & 1 deletion src/usr/fsiscom/fsiscom.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down
46 changes: 46 additions & 0 deletions src/usr/sbeio/sbe_ffdc_parser.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <errl/errlmanager.H>
#include <util/utilbyte.H>
#include <sbeio/sbe_ffdc_parser.H>
#include <fapi2.H>

/**
* @file sbe_ffdc_pader.C
Expand Down Expand Up @@ -257,4 +258,49 @@ void SbeFFDCParser::addFFDCPackage(void * i_ffdcPackage,
iv_ffdcPackages.push_back(l_ffdcPkg);
}

PIB::PibError SbeFFDCParser::getPibRc(uint8_t i_index)
{
//get the rc for this ffdc package
auto l_fapiRc = getPackageRC(i_index);
PIB::PibError l_pibRc = PIB::PIB_NO_ERROR;

//check if it is a fapi2::PIBRC
//if yes, convert to PIBERROR value
switch(l_fapiRc)
{
case fapi2::RC_SBE_PIB_XSCOM_ERROR:
l_pibRc = PIB::PIB_RESOURCE_OCCUPIED;
break;

case fapi2::RC_SBE_PIB_OFFLINE_ERROR:
l_pibRc = PIB::PIB_CHIPLET_OFFLINE;
break;

case fapi2::RC_SBE_PIB_PARTIAL_ERROR:
l_pibRc = PIB::PIB_PARTIAL_GOOD;
break;

case fapi2::RC_SBE_PIB_ADDRESS_ERROR:
l_pibRc = PIB::PIB_INVALID_ADDRESS;
break;

case fapi2::RC_SBE_PIB_CLOCK_ERROR:
l_pibRc = PIB::PIB_CLOCK_ERROR;
break;

case fapi2::RC_SBE_PIB_PARITY_ERROR:
l_pibRc = PIB::PIB_PARITY_ERROR;
break;

case fapi2::RC_SBE_PIB_TIMEOUT_ERROR:
l_pibRc = PIB::PIB_TIMEOUT;
break;

case fapi2::FAPI2_RC_SUCCESS:
l_pibRc = PIB::PIB_NO_ERROR;
break;
}
SBE_TRACF("getPibRc for index=%d, fapiRc=0x%x pibRc:%0x", i_index, l_fapiRc, l_pibRc);
return l_pibRc;
}
}
18 changes: 17 additions & 1 deletion src/usr/sbeio/sbe_fifodd.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <kernel/pagemgr.H>
#include <fapi2.H>
#include <sbeio/sbe_sp_intf.H>
#include <xscom/piberror.H>

extern trace_desc_t* g_trac_sbeio;

Expand Down Expand Up @@ -346,6 +347,11 @@ errlHndl_t SbeFifo::readResponse(TARGETING::Target * i_target,
// has been sent. If not EOT, then data ready to receive.
uint32_t l_status = 0;
errl = waitDnFifoReady(i_target,l_status);
if (errl)
{
SBE_TRACF("readResponse: waitDnFifoReady returned an error");
break;
}

if (l_status & DNFIFO_STATUS_DEQUEUED_EOT_FLAG)
{
Expand Down Expand Up @@ -582,6 +588,15 @@ errlHndl_t SbeFifo::readResponse(TARGETING::Target * i_target,
ERRORLOG::errlCommit( sbe_errl, SBEIO_COMP_ID );
}
}
PIB::PibError l_pibRc = l_ffdc_parser->getPibRc(i);
if (l_pibRc != PIB::PIB_NO_ERROR)
{
//this is pibrc, call addFruCallouts to log the error
auto l_fifoReq =
(SbeFifo::fifoGetScomRequest*)i_pFifoRequest;
PIB::addFruCallouts
(i_target, l_pibRc, l_fifoReq->address, errl);
}
}

errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
Expand Down Expand Up @@ -650,6 +665,7 @@ errlHndl_t SbeFifo::waitDnFifoReady(TARGETING::Target * i_target,
* @moduleid SBEIO_FIFO
* @reasoncode SBEIO_FIFO_DOWNSTREAM_TIMEOUT
* @userdata1 Timeout in NS
* @userdata2 FIFO Status
* @devdesc Timeout waiting for downstream FIFO to have
* data to receive
*/
Expand All @@ -658,7 +674,7 @@ errlHndl_t SbeFifo::waitDnFifoReady(TARGETING::Target * i_target,
SBEIO_FIFO,
SBEIO_FIFO_DOWNSTREAM_TIMEOUT,
MAX_UP_FIFO_TIMEOUT_NS,
0);
o_status);

errl->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);
Expand Down

0 comments on commit d25c0aa

Please sign in to comment.