summaryrefslogtreecommitdiffstats
path: root/src/include/usr/sio
diff options
context:
space:
mode:
authorAndrew Jeffery <andrewrj@au1.ibm.com>2018-10-15 15:35:07 +1030
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-10-15 16:11:08 -0500
commit55ff29accb8313232e5a1a6cf5d7a54681579073 (patch)
treef8c20018033b639d1864df3f7a5d33bb3512977b /src/include/usr/sio
parent95165ec1e1116f5675c8410f230ecce95af86c6d (diff)
downloadtalos-hostboot-55ff29accb8313232e5a1a6cf5d7a54681579073.tar.gz
talos-hostboot-55ff29accb8313232e5a1a6cf5d7a54681579073.zip
sio: Add test for availability
Some components can continue to operate in the face of the SuperIO controller being unavailable on the LPC bus (specifically, the UART and boot flag processing). Other components require it present (AST-based SFC implementations and the AST mailbox). Components in the latter category can just fail with an errl when they attempt to access the controller, but for those in the former category we add an isAvailable() function in the SIO namespace to sidestep dealing with errors. Specifically, isAvailable() tests for the expected error when the SuperIO controller is disabled, and returns an errlHndl_t if any other error occurs. This way true LPC errors are propagated to the caller to commit as desired. For the moment *all* errors produced by the SIO::isAvailable() LPC bus access will result in the SIO code assuming the device is absent. We should be more precise about this, but the hardware behaviour seen under hostboot currently prevents us from being more specific. This problem is highlighted by a FIXME block in the implementation of SIO::isAvailable(). Change-Id: Id30a09b48586d2054e0cdae625ee23df68ac2aa3 Signed-off-by: Andrew Jeffery <andrewrj@au1.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67460 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: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/sio')
-rw-r--r--src/include/usr/sio/sio.H14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/usr/sio/sio.H b/src/include/usr/sio/sio.H
index 52f752da7..ec422d8b7 100644
--- a/src/include/usr/sio/sio.H
+++ b/src/include/usr/sio/sio.H
@@ -25,6 +25,8 @@
#ifndef __SIO_SIO_H
#define __SIO_SIO_H
+#include <errl/errlentry.H>
+
namespace SIO
{
/**
@@ -47,5 +49,17 @@ namespace SIO
SIO_SCRATCH_REG1 = 0x21, /**< Scratch Reg */
SIO_SCRATCH_REG2 = 0x22, /**< Scratch Reg */
};
+
+ /**
+ * @brief Test if SuperIO is accessible on the LPC bus
+ *
+ * @param[out] o_available Set true if the SuperIO controller is available,
+ * false if it explicitly detected as unavailable,
+ * and unchanged if an unexpected error occurs.
+ *
+ * @return NULL if the test did not fail unexpectedly, otherwise a pointer
+ * to an errorlog associated with the error.
+ */
+ errlHndl_t isAvailable(bool& o_available);
}
#endif
OpenPOWER on IntegriCloud