summaryrefslogtreecommitdiffstats
path: root/src/include/usr/diag
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2015-02-23 21:30:04 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-27 23:46:15 -0600
commitb6ec5b042850fd80517dfdbb1226624b98cf617d (patch)
treed9edd14d8f2a2601e7cea519bb337f90f2f165bd /src/include/usr/diag
parentb640d9b9361402f45b5c88a6bb2384ab2995accc (diff)
downloadtalos-hostboot-b6ec5b042850fd80517dfdbb1226624b98cf617d.tar.gz
talos-hostboot-b6ec5b042850fd80517dfdbb1226624b98cf617d.zip
PRD: Support scom operations from PNOR FIRDATA section
Change-Id: I77bf6f4b361dd18ae6d68f07a95e631509974f3b RTC: 119623 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15040 Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Bilicon Patil <bilpatil@in.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/diag')
-rwxr-xr-xsrc/include/usr/diag/prdf/common/prdf_service_codes.H6
-rw-r--r--src/include/usr/diag/prdf/prdfPnorFirDataReader.H103
-rw-r--r--src/include/usr/diag/prdf/prdfReadPnorFirData.H83
3 files changed, 191 insertions, 1 deletions
diff --git a/src/include/usr/diag/prdf/common/prdf_service_codes.H b/src/include/usr/diag/prdf/common/prdf_service_codes.H
index 83f7080d4..14c3386ba 100755
--- a/src/include/usr/diag/prdf/common/prdf_service_codes.H
+++ b/src/include/usr/diag/prdf/common/prdf_service_codes.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2003,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -63,6 +65,7 @@ enum ModuleId
PRDF_MNFG_IPL_CE_ANALYSIS = 0x0D,
PRDF_START_SCRUB = 0x0E,
PRDF_SYNC_SVC = 0x0F,
+ PRDF_CS_FIRDATA_READ = 0x10,
};
/******************************************************************************/
@@ -118,6 +121,7 @@ enum ReasonCode
// general code for user error or unsupported configuration
PRDF_INVALID_CONFIG = PRDF_COMP_ID | 0x82,
+ PRDF_NULL_VALUE_RETURNED = PRDF_COMP_ID | 0x81,
PRDF_LAST_REASONCODE = PRDF_COMP_ID | 0xFF,
};
diff --git a/src/include/usr/diag/prdf/prdfPnorFirDataReader.H b/src/include/usr/diag/prdf/prdfPnorFirDataReader.H
new file mode 100644
index 000000000..1dc112682
--- /dev/null
+++ b/src/include/usr/diag/prdf/prdfPnorFirDataReader.H
@@ -0,0 +1,103 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/occ_firdata/prdfPnorFirDataReader.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#ifndef __prdfPnorFirDataReader_H
+#define __prdfPnorFirDataReader_H
+
+#include <diag/prdf/prdfReadPnorFirData.H>
+
+#include <errl/errlentry.H>
+
+namespace PRDF
+{
+
+/**
+ * @brief Container class to read FIR data information from PNOR.
+ */
+class PnorFirDataReader
+{
+ public:
+
+ /**
+ * @brief Returns reference to singleton instance of the PnorFirDataReader.
+ * @return The singleton reference.
+ */
+ static PnorFirDataReader & getPnorFirDataReader();
+
+ /**
+ * @brief Reads the FIR data from PNOR and stores the register data.
+ * @note This must be called at the beginning of analysis. Otherwise,
+ * there will be no data for analysis.
+ * @param o_validData True, if the FIR data is valid and ready for
+ * analysis. False, if there is nothing to analyze.
+ * @return An error log if something failed. Otherwise, NULL.
+ */
+ errlHndl_t readPnor( bool & o_validData );
+
+ /**
+ * @brief Clears any FIR data information out of the PNOR.
+ * @note This must be called at the end of analysis so that analysis is
+ * not repeated on subsequent IPLs.
+ * @return An error log if something failed. Otherwise, NULL.
+ */
+ errlHndl_t clearPnor() const;
+
+ /**
+ * @brief Does a getScom operation based on the data stored in PNOR.
+ * @param i_trgt SCOM target.
+ * @param i_addr SCOM address.
+ * @param o_val Returned value for this target and address.
+ */
+ void getScom( TARGETING::TargetHandle_t i_trgt,
+ uint64_t i_addr, uint64_t & o_val ) const;
+
+ /**
+ * @brief Does a putScom operation based on the data stored in PNOR.
+ * @param i_trgt SCOM target.
+ * @param i_addr SCOM address.
+ * @param i_val Value to write to this target and address.
+ */
+ void putScom( TARGETING::TargetHandle_t i_trgt,
+ uint64_t i_addr, uint64_t i_val );
+
+ /**
+ * @brief Adds FFDC to the given error log.
+ */
+ void addFfdc( errlHndl_t io_errl ) const;
+
+ private:
+
+ PnorTrgtMap iv_trgtRegMap; ///< Register data for each target/address.
+ PnorFfdc iv_ffdc; ///< High level FIR data FFDC.
+ PnorTrgtFfdcMap iv_trgtFfdcMap; ///< FFDC for each FIR data target.
+
+};
+
+typedef Singleton<PnorFirDataReader> PnorFirData;
+
+} // end namespace PRDF
+
+#endif // __prdfPnorFirDataReader_H
+
diff --git a/src/include/usr/diag/prdf/prdfReadPnorFirData.H b/src/include/usr/diag/prdf/prdfReadPnorFirData.H
new file mode 100644
index 000000000..00e1e9ff0
--- /dev/null
+++ b/src/include/usr/diag/prdf/prdfReadPnorFirData.H
@@ -0,0 +1,83 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/occ_firdata/prdfReadPnorFirData.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#ifndef __prdfReadPnorFirData_H
+#define __prdfReadPnorFirData_H
+
+#include <map>
+
+#include <errl/errlentry.H>
+#include <targeting/common/target.H>
+
+namespace PRDF
+{
+
+typedef std::map<uint64_t, uint64_t> PnorRegMap;
+
+typedef std::map<TARGETING::TargetHandle_t, PnorRegMap> PnorTrgtMap;
+
+struct PnorFfdc
+{
+ uint8_t trgts; ///< Total number of target in the PNOR data.
+ bool full; ///< True if the PNOR data was unable to capture all regs.
+
+ PnorFfdc() : trgts(0), full(false) {}
+ PnorFfdc( uint8_t t, bool f ) : trgts(t), full(f) {}
+};
+
+struct PnorTrgtFfdc
+{
+ uint16_t scomErrs; ///< Total number of SCOM error detected on this target
+
+ PnorTrgtFfdc() : scomErrs(0) {}
+ PnorTrgtFfdc(uint16_t s) : scomErrs(s) {}
+};
+
+typedef std::map<TARGETING::TargetHandle_t, PnorTrgtFfdc> PnorTrgtFfdcMap;
+
+/** @brief Read register data captured by the OCC in the event of a system
+ * checkstop.
+ * @param o_validData True, if there the was a system checkstop and the OCC
+ * stored valid data in the PNOR. False otherwise.
+ * @param o_trgtMap If the data if valid, a map containing the register
+ * values for each target and address.
+ * @param o_ffdc PNOR FFDC data for debug.
+ * @param o_trgtFfdc PNOR target FFDC data for debug.
+ * @return An error log if something failed. Otherwise, NULL.
+ */
+errlHndl_t readPnorFirData( bool & o_validData, PnorTrgtMap & o_trgtMap,
+ PnorFfdc & o_ffdc, PnorTrgtFfdcMap & o_trgtFfdc );
+
+/** @brief Clears the OCC FIR data from the PNOR. This must be done after the
+ * checkstop analysis is complete so that analysis is not repeated on
+ * subsequent IPLs.
+ * @return An error log if something failed. Otherwise, NULL.
+ */
+errlHndl_t clearPnorFirData();
+
+}; // end namespace PRDF
+
+#endif // __prdfReadPnorFirData_H
+
OpenPOWER on IntegriCloud