diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2018-03-23 10:49:35 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-04-02 13:44:41 -0400 |
commit | b51298075aee402dbcef485088cfa71a6ca61725 (patch) | |
tree | 21bd59df20830b108f6b3f6dd835915c28691ec7 /src/usr/xscom | |
parent | 55f0053bc34e10d118e383f782b7be5cb14f59d2 (diff) | |
download | talos-hostboot-b51298075aee402dbcef485088cfa71a6ca61725.tar.gz talos-hostboot-b51298075aee402dbcef485088cfa71a6ca61725.zip |
Add ibscom runtime support
- Add ibscom runtime files
- Make ibscom multicast workaround common
- Call from ibscom rt_ibscom
- Make scom sanity check common
- Call from xscom rt_xscom ibscom rt_ibscom
RTC:190144
Change-Id: Ia52feac596ff6b6c8fb9f0db4493f35e4ee837af
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56215
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: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/xscom')
-rw-r--r-- | src/usr/xscom/runtime/rt_xscom.C | 101 | ||||
-rw-r--r-- | src/usr/xscom/xscom.C | 83 |
2 files changed, 19 insertions, 165 deletions
diff --git a/src/usr/xscom/runtime/rt_xscom.C b/src/usr/xscom/runtime/rt_xscom.C index 93e011864..cf7d40052 100644 --- a/src/usr/xscom/runtime/rt_xscom.C +++ b/src/usr/xscom/runtime/rt_xscom.C @@ -28,6 +28,7 @@ #include <errl/errlmanager.H> #include <xscom/xscomreasoncodes.H> #include "../xscom.H" +#include <scom/scomif.H> #include <scom/runtime/rt_scomif.H> // Trace definition @@ -42,7 +43,7 @@ DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD, TARGETING::TYPE_PROC, xscomPerformOp); -// Direct all scom calls though this interface at runtime +// Also direct fsi scom calls though this interface at runtime DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD, DeviceFW::FSISCOM, TARGETING::TYPE_PROC, @@ -53,86 +54,6 @@ DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD, TARGETING::TYPE_MEMBUF, xscomPerformOp); -DEVICE_REGISTER_ROUTE(DeviceFW::WILDCARD, - DeviceFW::IBSCOM, - TARGETING::TYPE_MEMBUF, - xscomPerformOp); - -/** - * @brief Internal routine that verifies the validity of input parameters - * for an XSCOM access. - * - * @param[in] i_opType Operation type, see DeviceFW::OperationType - * in driverif.H - * @param[in] i_target XSCom target - * @param[in/out] i_buffer Read: Pointer to output data storage - * Write: Pointer to input data storage - * @param[in/out] i_buflen Input: size of io_buffer (in bytes) - * Output: - * Read: Size of output data - * Write: Size of data written - * @param[in] i_args This is an argument list for DD framework. - * In this function, there's only one argument, - * which is the MMIO XSCom address - * @return errlHndl_t - */ -errlHndl_t xscomOpSanityCheck(const DeviceFW::OperationType i_opType, - const TARGETING::Target* i_target, - const void* i_buffer, - const size_t& i_buflen, - const va_list i_args){ - errlHndl_t l_err = NULL; - - do - { - // Verify data buffer - if ( (i_buflen < XSCOM_BUFFER_SIZE) || - (i_buffer == NULL) ) - { - /*@ - * @errortype - * @moduleid XSCOM_RT_SANITY_CHECK - * @reasoncode XSCOM_INVALID_DATA_BUFFER - * @userdata1 Buffer size - * @userdata2 XSCom address - * @devdesc XSCOM buffer size < 8 bytes or NULL data buff - */ - l_err = - new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - XSCOM_RT_SANITY_CHECK, - XSCOM_INVALID_DATA_BUFFER, - i_buflen, - va_arg(i_args,uint64_t)); - break; - } - - // Verify OP type - if ( (i_opType != DeviceFW::READ) && - (i_opType != DeviceFW::WRITE) ) - { - /*@ - * @errortype - * @moduleid XSCOM_RT_SANITY_CHECK - * @reasoncode XSCOM_INVALID_OP_TYPE - * @userdata1 Operation type - * @userdata2 XSCom address - * @devdesc XSCOM invalid operation type - */ - l_err = - new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - XSCOM_RT_SANITY_CHECK, - XSCOM_INVALID_OP_TYPE, - i_opType, - va_arg(i_args,uint64_t)); - break; - } - - - } while(0); - - return l_err; -} - /** * @brief Complete the xscom op @@ -161,13 +82,19 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType, errlHndl_t l_err = NULL; uint64_t l_addr = va_arg(i_args,uint64_t); - l_err = xscomOpSanityCheck(i_opType, - i_target, - io_buffer, - io_buflen, - i_args); + l_err = SCOM::scomOpSanityCheck(i_opType, + i_target, + io_buffer, + io_buflen, + l_addr, + XSCOM_BUFFER_SIZE); - if (!l_err) + if (l_err) + { + // Trace here - sanity check does not know scom type + TRACFCOMP(g_trac_xscom,"Runtime XScom sanity check failed"); + } + else { l_err = SCOM::sendScomToHyp(i_opType, i_target, l_addr, io_buffer); } diff --git a/src/usr/xscom/xscom.C b/src/usr/xscom/xscom.C index a28897f8b..18594d7cd 100644 --- a/src/usr/xscom/xscom.C +++ b/src/usr/xscom/xscom.C @@ -46,6 +46,7 @@ #include <assert.h> #include <errl/errludlogregister.H> #include <xscom/piberror.H> +#include <scom/scomif.H> #include <arch/pirformat.H> #include <lpc/lpcif.H> #include <sys/mm.h> @@ -113,82 +114,6 @@ HMER waitForHMERStatus() /** - * @brief Internal routine that verifies the validity of input parameters - * for an XSCOM access. - * - * @param[in] i_opType Operation type, see DeviceFW::OperationType - * in driverif.H - * @param[in] i_target XSCom target - * @param[in/out] i_buffer Read: Pointer to output data storage - * Write: Pointer to input data storage - * @param[in/out] i_buflen Input: size of io_buffer (in bytes) - * Output: - * Read: Size of output data - * Write: Size of data written - * @param[in] i_args This is an argument list for DD framework. - * In this function, there's only one argument, - * which is the MMIO XSCom address - * @return errlHndl_t - */ -errlHndl_t xscomOpSanityCheck(const DeviceFW::OperationType i_opType, - const TARGETING::Target* i_target, - const void* i_buffer, - const size_t& i_buflen, - const va_list i_args) -{ - errlHndl_t l_err = NULL; - - do - { - // Verify data buffer - if ( (i_buflen < XSCOM_BUFFER_SIZE) || - (i_buffer == NULL) ) - { - /*@ - * @errortype - * @moduleid XSCOM_SANITY_CHECK - * @reasoncode XSCOM_INVALID_DATA_BUFFER - * @userdata1 Buffer size - * @userdata2 XSCom address - * @devdesc XSCOM buffer size < 8 bytes or NULL data buffer - */ - l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - XSCOM_SANITY_CHECK, - XSCOM_INVALID_DATA_BUFFER, - i_buflen, - va_arg(i_args,uint64_t), - true /*Add HB Software Callout*/); - break; - } - - // Verify OP type - if ( (i_opType != DeviceFW::READ) && - (i_opType != DeviceFW::WRITE) ) - { - /*@ - * @errortype - * @moduleid XSCOM_SANITY_CHECK - * @reasoncode XSCOM_INVALID_OP_TYPE - * @userdata1 Operation type - * @userdata2 XSCom address - * @devdesc XSCOM invalid operation type - */ - l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - XSCOM_SANITY_CHECK, - XSCOM_INVALID_OP_TYPE, - i_opType, - va_arg(i_args,uint64_t), - true /*Add HB Software Callout*/); - break; - } - - - } while(0); - - return l_err; -} - -/** * @brief Get the virtual address of the input target * for an XSCOM access. * @@ -752,10 +677,12 @@ errlHndl_t xscomPerformOp(DeviceFW::OperationType i_opType, do { // XSCOM operation sanity check - l_err = xscomOpSanityCheck(i_opType, i_target, io_buffer, - io_buflen, i_args); + l_err = SCOM::scomOpSanityCheck(i_opType, i_target, io_buffer, + io_buflen, l_addr, XSCOM_BUFFER_SIZE); if (l_err) { + // Trace here - sanity check does not know scom type + TRACFCOMP(g_trac_xscom,"XScom sanity check failed"); break; } |