summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-01-26 07:47:34 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-02-07 12:00:08 -0500
commiteb217e512338e8d2182762cbe97f55d4759e799e (patch)
treed550bb52cec837d26e172237c8082fd099ec2373 /src/usr/sbeio
parent606659144d3bf5d397bc24a54c6a5538e34cc5c5 (diff)
downloadblackbird-hostboot-eb217e512338e8d2182762cbe97f55d4759e799e.tar.gz
blackbird-hostboot-eb217e512338e8d2182762cbe97f55d4759e799e.zip
Ensure sbefifo is clean on slave chips before starting
Change-Id: I440d6f5bd6aa1c3c72b3d8df581262b01765214c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35447 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio')
-rw-r--r--src/usr/sbeio/sbe_fifodd.C26
-rw-r--r--src/usr/sbeio/sbe_fifodd.H13
-rw-r--r--src/usr/sbeio/sbe_scomAccess.C24
3 files changed, 60 insertions, 3 deletions
diff --git a/src/usr/sbeio/sbe_fifodd.C b/src/usr/sbeio/sbe_fifodd.C
index fae31ec5d..03d2cfba3 100644
--- a/src/usr/sbeio/sbe_fifodd.C
+++ b/src/usr/sbeio/sbe_fifodd.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -158,6 +158,30 @@ errlHndl_t SbeFifo::performFifoChipOp(TARGETING::Target * i_target,
/**
+ * @brief perform SBE FIFO Reset
+ */
+errlHndl_t SbeFifo::performFifoReset(TARGETING::Target * i_target)
+{
+ errlHndl_t errl = NULL;
+ static mutex_t l_fifoOpMux = MUTEX_INITIALIZER;
+
+ SBE_TRACF(ENTER_MRK "sending FSI SBEFIFO Reset to HUID 0x%x",
+ TARGETING::get_huid(i_target));
+
+ //Serialize access to the FIFO
+ mutex_lock(&l_fifoOpMux);
+
+ // Perform a write to the DNFIFO Reset to cleanup the fifo
+ uint32_t l_dummy = 0xDEAD;
+ errl = writeFsi(i_target,SBE_FIFO_DNFIFO_RESET,&l_dummy);
+
+ mutex_unlock(&l_fifoOpMux);
+
+ return errl;
+}
+
+
+/**
* @brief write FIFO request message
*/
errlHndl_t SbeFifo::writeRequest(TARGETING::Target * i_target,
diff --git a/src/usr/sbeio/sbe_fifodd.H b/src/usr/sbeio/sbe_fifodd.H
index ee4b8e30f..b328107e6 100644
--- a/src/usr/sbeio/sbe_fifodd.H
+++ b/src/usr/sbeio/sbe_fifodd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -250,6 +250,17 @@ class SbeFifo
uint32_t * i_pFifoResponse,
uint32_t i_responseSize);
+ /**
+ * @Brief perform SBE FIFO reset
+ *
+ * NOT to be used on running SBE -- only for IPL
+ *
+ * @param[in] i_target Target to access
+ *
+ * @return errlHndl_t Error log handle on failure.
+ */
+ errlHndl_t performFifoReset(TARGETING::Target * i_target);
+
protected:
diff --git a/src/usr/sbeio/sbe_scomAccess.C b/src/usr/sbeio/sbe_scomAccess.C
index 8d013799c..36705ae0c 100644
--- a/src/usr/sbeio/sbe_scomAccess.C
+++ b/src/usr/sbeio/sbe_scomAccess.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -254,5 +254,27 @@ errlHndl_t putFifoScomUnderMask(TARGETING::Target * i_target,
return errl;
};
+// Reset FSI SBE FIFO
+errlHndl_t sendFifoReset(TARGETING::Target * i_target)
+{
+ errlHndl_t errl = NULL;
+
+ SBE_TRACD(ENTER_MRK "sendFifoReset");
+
+ do
+ {
+ // error check input parameters
+ errl = fifoScomInterfaceChecks(i_target, 0x0);
+ if (errl) break;
+
+ errl = SbeFifo::getTheInstance().performFifoReset(i_target);
+ }
+ while (0);
+
+ SBE_TRACD(EXIT_MRK "sendFifoReset");
+
+ return errl;
+};
+
} //end namespace SBEIO
OpenPOWER on IntegriCloud