summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-06-28 13:15:54 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-07-28 10:33:08 -0400
commitc03003723f00e8d9200b4a03bf55495c48cb0d77 (patch)
tree05b0e0b6f4f1ad00a7e3dd401e4e0c8bce0cbc18 /src/include
parent1cf86502a50785bed28c15f47d24f452e83b0892 (diff)
downloadtalos-hostboot-c03003723f00e8d9200b4a03bf55495c48cb0d77.tar.gz
talos-hostboot-c03003723f00e8d9200b4a03bf55495c48cb0d77.zip
Refactor fapi2 scom interface to use pib_err_mask
Up to this point we have been ignoring pib err mask. This commit adds the pib_err_mask support to to platform RTC: 144507 Change-Id: Ie810f0915d6ba8091ea4740e705ba550dbad6eae Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26382 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/errl/errlentry.H13
-rw-r--r--src/include/usr/errl/errlsctn.H52
-rw-r--r--src/include/usr/fapi2/hw_access.H16
-rw-r--r--src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H2
-rw-r--r--src/include/usr/fapi2/plat_hw_access.H23
-rw-r--r--src/include/usr/fapi2/plat_hwp_invoker.H2
-rw-r--r--src/include/usr/scom/errlud_pib.H2
7 files changed, 101 insertions, 9 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index 891300b23..f8e0a32e8 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -582,6 +582,17 @@ public:
*/
uint64_t unflatten( const void * i_buffer, uint64_t i_len);
+ /**
+ * @brief Return the list of User Detail sections
+ *
+ * @param[in] i_compId Component id associated with the sections to return
+ *
+ * NOTE: You can pass COMP_ID 0 into this function for wildcard
+ *
+ * @return vector of user details sections of specific component id
+ */
+ std::vector<ErrlUD*> getUDSections(compId_t i_compId);
+
private:
/**
diff --git a/src/include/usr/errl/errlsctn.H b/src/include/usr/errl/errlsctn.H
index 19cc1b7a6..bb532e6b8 100644
--- a/src/include/usr/errl/errlsctn.H
+++ b/src/include/usr/errl/errlsctn.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -62,6 +62,31 @@ class ErrlSctn
friend class ERRORLOGDISPLAY::ErrLogDisplay;
friend class ErrlTest;
+public:
+ /**
+ * @brief Get section's version
+ *
+ * @return Section version (uint8_t)
+ *
+ */
+ uint8_t sctnVer() const;
+
+ /**
+ * @brief Get section's subsection type
+ *
+ * @return Subsection type (uint8_t)
+ *
+ */
+ uint8_t subSect() const;
+
+ /**
+ * @brief Get section's component Id
+ *
+ * @return Component Id of the section creator
+ *
+ */
+ compId_t compId() const;
+
protected:
/**
@@ -105,6 +130,31 @@ protected:
};
+//-----------------------------------------------------------------------
+// In-line functions
+//-----------------------------------------------------------------------
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+inline uint8_t ErrlSctn::sctnVer() const
+{
+ return iv_header.iv_ver;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+inline uint8_t ErrlSctn::subSect() const
+{
+ return iv_header.iv_sst;
+}
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+inline compId_t ErrlSctn::compId() const
+{
+ return iv_header.iv_compId;
+}
+
} // End namespace
diff --git a/src/include/usr/fapi2/hw_access.H b/src/include/usr/fapi2/hw_access.H
index 93413dd7b..2d4444eb3 100644
--- a/src/include/usr/fapi2/hw_access.H
+++ b/src/include/usr/fapi2/hw_access.H
@@ -39,17 +39,20 @@ namespace fapi2
//--------------------------------------------------------------------------
// PIB Error Functions
+//
+// The pib err mask can be set in order
+// to ignore specific pib errors returned by a scom. The mask
+// is a thread local variable and will be reset to 0 during every
+// FAPI_INVOKE call before the function is executed, therefore
+// it will reset on HWP calls.
//--------------------------------------------------------------------------
/// @brief Sets the PIB error mask - platform dependant
/// @param[in] i_mask The new error mask
// note: this can be moved to a C file if desired
-inline void setPIBErrorMask(uint8_t i_mask)
+inline void setPIBErrorMask(const uint8_t i_mask)
{
- // Keeps the compiler from complaining about the unused i_mask
- static_cast<void>(i_mask);
- //TODO: RTC 124195 FAPI2 - PIB error mask and Operation mode supports
- return;
+ return platSetPIBErrorMask(i_mask);
}
/// @brief Gets the PIB error mask - platform dependant
@@ -57,8 +60,7 @@ inline void setPIBErrorMask(uint8_t i_mask)
// note: this can be moved to a C file if desired
inline uint8_t getPIBErrorMask(void)
{
- //TODO: RTC 124195 FAPI2 - PIB error mask and Operation mode supports
- return 0;
+ return platGetPIBErrorMask();
}
//--------------------------------------------------------------------------
diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
index a6ffce5ba..e095e126b 100644
--- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
+++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
@@ -55,6 +55,7 @@ namespace fapi2
MOD_FAPI2_GET_TARGETING_ATTR = 0x0C,
MOD_FAPI2_SET_TARGETING_ATTR = 0x0D,
MOD_FAPI2_PLAT_GET_VPD = 0x0E,
+ MOD_FAPI2_PIB_ERR_MASK = 0x0F,
};
/**
@@ -71,6 +72,7 @@ namespace fapi2
RC_NULL_FAPI_TARGET = HWPF_COMP_ID | 0x0A,
RC_LOOKING_FOR_TYPE_NA = HWPF_COMP_ID | 0x0B,
RC_INCORRECT_TARGET = HWPF_COMP_ID | 0x0C,
+ RC_FAILED_MASKING_ERROR = HWPF_COMP_ID | 0x12,
// MVPD generated errors
RC_INVALID_RECORD = HWPF_COMP_ID | 0x0D,
diff --git a/src/include/usr/fapi2/plat_hw_access.H b/src/include/usr/fapi2/plat_hw_access.H
index 7d8e36e3b..5a8d20fea 100644
--- a/src/include/usr/fapi2/plat_hw_access.H
+++ b/src/include/usr/fapi2/plat_hw_access.H
@@ -192,6 +192,29 @@ OpModes platGetOpMode(void);
extern OpModes opMode;
+//--------------------------------------------------------------------------
+// PIB Error Mask Functions
+//--------------------------------------------------------------------------
+//
+// See hw_access.H for more detail on pib error mask
+
+/// @brief Sets the pib error mask
+/// @param[in] i_mask The new mask
+void platSetPIBErrorMask(const uint8_t i_mask);
+
+/// @brief Gets the pib error mask
+/// @return the pib error mask
+uint8_t platGetPIBErrorMask(void);
+
+/// @brief takes in an error log and looks for user details sections
+/// with a compId of COMP_SCOM_ID. If one of those is found and
+/// the pib err attatched to it matches the pib_err_mask, then
+/// we delete the err.
+/// @param[in/out] io_errLog Error log that we would like the check the piberr
+/// mask against
+/// @return void
+void checkPibMask(errlHndl_t& io_errLog );
+
// --------------------------------------------------------------------------
// NOTE:
// No spy access interface as HB doesn't allow spy access.
diff --git a/src/include/usr/fapi2/plat_hwp_invoker.H b/src/include/usr/fapi2/plat_hwp_invoker.H
index 92d8d7990..37fc49d16 100644
--- a/src/include/usr/fapi2/plat_hwp_invoker.H
+++ b/src/include/usr/fapi2/plat_hwp_invoker.H
@@ -44,6 +44,7 @@
#include <return_code.H>
#include <hw_access_def.H>
#include <plat_utils.H>
+#include <xscom/piberror.H>
/**
* @brief HWP Invoker macro
@@ -63,6 +64,7 @@
fapi2::ReturnCode l_rc; \
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;\
fapi2::opMode = fapi2::NORMAL;\
+ fapi2::setPIBErrorMask(0);\
FAPI_EXEC_HWP(l_rc, FUNC, ##_args_); \
ERRHNDL = fapi2::rcToErrl(l_rc);\
if( ERRHNDL ) {\
diff --git a/src/include/usr/scom/errlud_pib.H b/src/include/usr/scom/errlud_pib.H
index 1f18fe76f..d56cd2fbf 100644
--- a/src/include/usr/scom/errlud_pib.H
+++ b/src/include/usr/scom/errlud_pib.H
@@ -56,6 +56,8 @@ class UdPibInfo : public ERRORLOG::ErrlUserDetails
*/
virtual ~UdPibInfo();
+ uint8_t iv_pib_err;
+
UdPibInfo(UdPibInfo &) = delete;
UdPibInfo & operator=(UdPibInfo &) = delete;
};
OpenPOWER on IntegriCloud