summaryrefslogtreecommitdiffstats
path: root/src/usr/expaccess/plugins
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2019-08-16 16:24:06 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-09-25 14:30:06 -0500
commit8e6285e72a3b0f3b35da6700467954b3e125e49f (patch)
treef0eb643fe0b8fa03df0b8349cdec9eccf7ada3b8 /src/usr/expaccess/plugins
parent56574b602999b7f4e31c8b19bb3b72fbde152700 (diff)
downloadtalos-hostboot-8e6285e72a3b0f3b35da6700467954b3e125e49f.tar.gz
talos-hostboot-8e6285e72a3b0f3b35da6700467954b3e125e49f.zip
Support EXP_FW_LOG command to get Explorer Firmware logs
Includes framework to add explorer error logs to an error. Tests the ekb RC path and the hostboot way to add these logs. Tests are disabled until simics supports the new command. Change-Id: I03b735342251b6c9e078a3e5b412e5a9f88e1e6b RTC:205128 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82362 Reviewed-by: Christian R Geddes <crgeddes@us.ibm.com> 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: Glenn Miles <milesg@ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/expaccess/plugins')
-rw-r--r--src/usr/expaccess/plugins/EXPSCOM_COMP_ID_Parse.C32
-rw-r--r--src/usr/expaccess/plugins/errludP_expscom.H168
-rw-r--r--src/usr/expaccess/plugins/expscomUdParserFactory.H58
3 files changed, 258 insertions, 0 deletions
diff --git a/src/usr/expaccess/plugins/EXPSCOM_COMP_ID_Parse.C b/src/usr/expaccess/plugins/EXPSCOM_COMP_ID_Parse.C
new file mode 100644
index 000000000..54bf595b6
--- /dev/null
+++ b/src/usr/expaccess/plugins/EXPSCOM_COMP_ID_Parse.C
@@ -0,0 +1,32 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/expaccess/plugins/EXPSCOM_COMP_ID_Parse.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+/**
+ * @file EXPSCOM_COMP_ID_Parse.C
+ * @brief Build the Explorer User Details parser factory
+ */
+#include "errludparser.H"
+#include "expscomUdParserFactory.H"
+
+ERRL_MAKE_UD_PARSER(EXPSCOM::UserDetailsParserFactory, hbfw::EXPSCOM_COMP_ID)
diff --git a/src/usr/expaccess/plugins/errludP_expscom.H b/src/usr/expaccess/plugins/errludP_expscom.H
new file mode 100644
index 000000000..73d449ba4
--- /dev/null
+++ b/src/usr/expaccess/plugins/errludP_expscom.H
@@ -0,0 +1,168 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/expaccess/plugins/errludP_expscom.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 ERRL_UDP_EXPSCOM_H
+#define ERRL_UDP_EXPSCOM_H
+
+/**
+ * @file errludP_expscom.H
+ * Defines the ErrlUserDetailsParser classes that parse EXPSCOM FFDC
+ */
+
+#include "errluserdetails.H"
+#include <string.h>
+
+#define TO_UINT16(ptr) (ntohs(*(reinterpret_cast<uint16_t*>(ptr))))
+#define TO_UINT32(ptr) (ntohl(*(reinterpret_cast<uint32_t*>(ptr))))
+
+namespace EXPSCOM
+{
+
+/**
+ * @brief Header data of every explorer error log section
+ */
+typedef struct __attribute__((packed))
+{
+ uint16_t packet_num; // ordering byte (0 = first packet)
+ uint32_t offset_exp_log; // offset where data portion started in full explorer log
+ uint16_t error_data_size; // size of data portion following header
+} explog_section_header_t;
+
+/**
+ * @class UdParserExpActiveErrorLog
+ *
+ * Parses user-data sections for Explorer's Active logs
+ */
+class UdParserExpActiveLog : public ERRORLOG::ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ UdParserExpActiveLog() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdParserExpActiveLog() {}
+
+ /**
+ * @brief Parses string user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing detail data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ explog_section_header_t * pHeader = reinterpret_cast<explog_section_header_t *>(i_pBuffer);
+ i_parser.PrintHeading("Explorer Active (RAM) Log Data");
+ i_parser.PrintNumber("Order packet", "%d", TO_UINT16(&(pHeader->packet_num)));
+ i_parser.PrintNumber("Data starting offset", "0x%.8lX", TO_UINT32(&(pHeader->offset_exp_log)));
+ i_parser.PrintNumber("Size of data section", "0x%.4lX", TO_UINT16(&(pHeader->error_data_size)));
+ i_parser.PrintBlank();
+ uint16_t errorDataSize = TO_UINT16(&(pHeader->error_data_size));
+ if (errorDataSize <= (i_buflen - sizeof(explog_section_header_t)))
+ {
+ char * l_trace_error_data = static_cast<char*>(i_pBuffer) + sizeof(explog_section_header_t);
+ i_parser.PrintHexDump(l_trace_error_data, errorDataSize);
+ }
+ else
+ {
+ i_parser.PrintHeading("ERROR DATA MISSING -- printing entire section in hex");
+ i_parser.PrintNumber("Expected data size", "0x%.4lX", i_buflen - sizeof(explog_section_header_t));
+ i_parser.PrintHexDump(i_pBuffer, i_buflen);
+ }
+
+ }
+
+ // Disabled
+ UdParserExpActiveLog(const UdParserExpActiveLog&) = delete;
+ UdParserExpActiveLog & operator=(const UdParserExpActiveLog&) = delete;
+};
+
+/**
+ * @class UdParserExpSavedErrorLog
+ *
+ * Parses user-data sections for Explorer's Saved logs
+ */
+class UdParserExpSavedLog : public ERRORLOG::ErrlUserDetailsParser
+{
+public:
+ /**
+ * @brief Constructor
+ */
+ UdParserExpSavedLog() {}
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~UdParserExpSavedLog() {}
+
+ /**
+ * @brief Parses string user detail data from an error log
+ *
+ * @param i_version Version of the data
+ * @param i_parse ErrlUsrParser object for outputting information
+ * @param i_pBuffer Pointer to buffer containing detail data
+ * @param i_buflen Length of the buffer
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ void * i_pBuffer,
+ const uint32_t i_buflen) const
+ {
+ explog_section_header_t * pHeader = reinterpret_cast<explog_section_header_t *>(i_pBuffer);
+ i_parser.PrintHeading("Explorer Saved (SPI flash) Log Data");
+ i_parser.PrintNumber("Order packet", "%d", TO_UINT16(&(pHeader->packet_num)));
+ i_parser.PrintNumber("Data starting offset", "0x%.8lX", TO_UINT32(&(pHeader->offset_exp_log)));
+ i_parser.PrintNumber("Size of data section", "0x%.4lX", TO_UINT16(&(pHeader->error_data_size)));
+ i_parser.PrintBlank();
+ uint16_t errorDataSize = TO_UINT16(&pHeader->error_data_size);
+ if (errorDataSize <= (i_buflen - sizeof(explog_section_header_t)))
+ {
+ char * l_trace_error_data = static_cast<char*>(i_pBuffer) + sizeof(explog_section_header_t);
+ i_parser.PrintHexDump(l_trace_error_data, errorDataSize);
+ }
+ else
+ {
+ i_parser.PrintHeading("ERROR DATA MISSING -- printing entire section in hex");
+ i_parser.PrintNumber("Expected data size", "0x%.4lX", i_buflen - sizeof(explog_section_header_t));
+ i_parser.PrintHexDump(i_pBuffer, i_buflen);
+ }
+
+ }
+
+ // Disabled
+ UdParserExpSavedLog(const UdParserExpSavedLog&) = delete;
+ UdParserExpSavedLog & operator=(const UdParserExpSavedLog&) = delete;
+};
+
+} // end EXPSCOM namespace
+
+#endif
diff --git a/src/usr/expaccess/plugins/expscomUdParserFactory.H b/src/usr/expaccess/plugins/expscomUdParserFactory.H
new file mode 100644
index 000000000..6a006e308
--- /dev/null
+++ b/src/usr/expaccess/plugins/expscomUdParserFactory.H
@@ -0,0 +1,58 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/expaccess/plugins/expscomUdParserFactory.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] 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 */
+/**
+ * @file expscomUdParserFactory.H
+ * @brief Registers Explorer User Detail parsers
+ */
+#if !defined(_EXPSCOMUDPARSERFACTORY_H)
+#define _EXPSCOMUDPARSERFACTORY_H
+
+#include "errludparserfactory.H"
+#include "errludP_expscom.H"
+
+namespace EXPSCOM
+{
+ class UserDetailsParserFactory
+ : public ERRORLOG::ErrlUserDetailsParserFactory
+ {
+ public:
+ UserDetailsParserFactory()
+ {
+ registerParser<UdParserExpActiveLog>
+ (EXPSCOM_UDT_ACTIVE_LOG);
+
+ registerParser<UdParserExpSavedLog>
+ (EXPSCOM_UDT_SAVED_LOG);
+ }
+
+ private:
+
+ UserDetailsParserFactory(const UserDetailsParserFactory &);
+ UserDetailsParserFactory & operator=
+ (const UserDetailsParserFactory &);
+ };
+};
+
+#endif
OpenPOWER on IntegriCloud