summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorBill Hoffa <wghoffa@us.ibm.com>2018-06-06 13:29:17 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-06-28 22:43:13 -0400
commit7bd4032abfb75ca6a9a4eb9c44ab9443c81a6198 (patch)
tree87766c021712bbca5466c117ea0ac86c8cf238dc /src/include/usr
parent8a1a0c7e98a9091c62e715b1b9c44a7f3de90b39 (diff)
downloadtalos-hostboot-7bd4032abfb75ca6a9a4eb9c44ab9443c81a6198.tar.gz
talos-hostboot-7bd4032abfb75ca6a9a4eb9c44ab9443c81a6198.zip
Leverage INTRP fully for SBE PSU Interrupt Handling
- Remove PSU Handling from INTRP code and instead treat PSU interrupts like any other interrupt type - Add msg_handler to SBE PSU Code to handle interrupts - Add better interrupt handling to timeout path so the interrupt condition will be cleared instead of represented continuously - Handle shutdown message from INTRP Change-Id: I5eafea806e147c22be235ae1c54a5ce4706aa012 RTC: 149698 CQ: SW418168 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60049 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/sbeio/sbe_psudd.H53
-rw-r--r--src/include/usr/sbeio/sbeioreasoncodes.H4
2 files changed, 55 insertions, 2 deletions
diff --git a/src/include/usr/sbeio/sbe_psudd.H b/src/include/usr/sbeio/sbe_psudd.H
index aee071949..ae72375ba 100644
--- a/src/include/usr/sbeio/sbe_psudd.H
+++ b/src/include/usr/sbeio/sbe_psudd.H
@@ -38,6 +38,7 @@
#include <util/singleton.H>
#include "sbe_sp_intf.H"
#include <map>
+#include <arch/pirformat.H>
namespace SBEIO
{
@@ -46,6 +47,11 @@ namespace SBEIO
// within this component.
//-----------------------------------------------------------------------------
+enum msgq_msg_t
+{
+ MSG_INTR,
+};
+
/** @class SbePsu
* @brief Class for SBE/PSU communication
*/
@@ -650,6 +656,14 @@ class SbePsu
~SbePsu();
+ /**
+ * Start message handler
+ *
+ * @note This function is used to spawn a new task.
+ * The args and return value are not used.
+ */
+ static void* msg_handler(void * unused);
+
private:
//---------------------------------------------------------------------
// Local definitions for the device driver
@@ -667,6 +681,31 @@ class SbePsu
const uint8_t ffdcPackageSize = 2;
/**
+ * @brief Response buffer from SBE
+ */
+ psuResponse * iv_psuResponse;
+
+ /**
+ * @brief Indicator that PSU response is fully populated
+ */
+ bool iv_responseReady;
+
+ /**
+ * @brief SBE PSU Message Queue
+ */
+ msg_q_t iv_msgQ;
+
+ /**
+ * @brief Indicator if HB is shutting down
+ */
+ bool iv_shutdownInProgress;
+
+ /**
+ * The sbe psu message handler.
+ */
+ void msgHandler();
+
+ /**
* @brief allocate an ffdc buffer for the proc target
* @param[in] i_target proc to have ffdc buffer allocated
*/
@@ -691,7 +730,7 @@ class SbePsu
psuCommand * i_pPsuRequest,
uint8_t i_reqMsgs);
/**
- * @brief Read response from PSU
+ * @brief Check response from PSU
*
* @param[in] i_target Master proc to use for scoms
* @param[in] i_pPsuRequest Pointer to PSU request commands
@@ -701,7 +740,7 @@ class SbePsu
*
* @return errlHndl_t Error log handle on failure.
*/
- errlHndl_t readResponse(TARGETING::Target * i_target,
+ errlHndl_t checkResponse(TARGETING::Target * i_target,
psuCommand * i_pPsuRequest,
psuResponse * o_pPsuResponse,
const uint64_t i_timeout,
@@ -749,6 +788,16 @@ class SbePsu
uint64_t * i_pData);
/**
+ * @brief Handle PSU Interrupt
+ *
+ * @param[in] i_pir The PIR value of the proc that
+ * has the interrupt condition
+ *
+ * @return errlHndl_t Error log handle on failure
+ */
+ errlHndl_t handleInterrupt(PIR_t i_pir);
+
+ /**
* @brief SBE PSU register addresses
*/
enum psuRegs
diff --git a/src/include/usr/sbeio/sbeioreasoncodes.H b/src/include/usr/sbeio/sbeioreasoncodes.H
index ff82aca13..0a911f151 100644
--- a/src/include/usr/sbeio/sbeioreasoncodes.H
+++ b/src/include/usr/sbeio/sbeioreasoncodes.H
@@ -74,6 +74,7 @@ enum sbeioReasonCode
SBEIO_PSU_RESPONSE_ERROR = SBEIO_COMP_ID | 0x02,
SBEIO_PSU_NOT_READY = SBEIO_COMP_ID | 0x03,
SBEIO_PSU_FFDC_MISSING = SBEIO_COMP_ID | 0x04,
+ SBEIO_PSU_SEND = SBEIO_COMP_ID | 0x05,
// SBE FIFO error codes
SBEIO_FIFO_UPSTREAM_TIMEOUT = SBEIO_COMP_ID | 0x10,
@@ -132,6 +133,9 @@ enum sbeioReasonCode
// SBE Vital Attention error codes
SBEIO_SBE_RC_VALUE_INFO = SBEIO_COMP_ID | 0x60,
+ // Init error codes
+ SBEIO_RC_KERNEL_REG_FAILED = SBEIO_COMP_ID | 0x61,
+
// Remove once we collect the FFDC ourselves - @todo-RTC:144313
//termination_rc
SBEIO_HWSV_COLLECT_SBE_RC = SBEIO_COMP_ID | 0xFF,
OpenPOWER on IntegriCloud