summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2018-02-26 09:16:08 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-03-07 12:54:24 -0500
commit843b9e02e55dbb39a2573e83efac9f412d30469a (patch)
tree41d09dd0c1b9ab39fef706feb0f862025d1af1a4 /src
parent5ca1d497141ad56ed8510d621b1e522c1c9fe7dd (diff)
downloadtalos-hostboot-843b9e02e55dbb39a2573e83efac9f412d30469a.tar.gz
talos-hostboot-843b9e02e55dbb39a2573e83efac9f412d30469a.zip
Initialize FIRDATA section and ErrlManager just incase BMC resets
PRD needs to read the PNOR to tell OCC where to write in the pnor. This will cache the PNOR section so PRD will not fail the read call. If an error is created with pnor inaccessible, errl manager could get stuck unless it was initialized first. Change-Id: Ia7212bf99e947a1016423b37aff6f13ddfc7190a CQ:SW412798 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54990 Reviewed-by: Martin Gloff <mgloff@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> Reviewed-by: Roland Veloz <rveloz@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> CI-Ready: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/runtime/interface.h13
-rw-r--r--src/runtime/rt_main.C7
-rw-r--r--src/usr/errl/runtime/rt_errlmanager.C25
-rw-r--r--src/usr/pnor/runtime/rt_pnor.C95
4 files changed, 109 insertions, 31 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 850ec0956..d7ad1beba 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -956,6 +956,19 @@ struct postInitCalls_t
void (*callApplyTempOverrides)();
/**
+ * @brief Calls RtPnor::init() which loads section(s) into memory
+ * so PRD can access when PNOR is not accessible
+ */
+ void (*callInitPnor)();
+
+
+ /**
+ * @brief Sets up ErrlManager so it is ready for errors
+ *
+ */
+ void (*callInitErrlManager)();
+
+ /**
* @brief Clear pending SBE messages
*
*/
diff --git a/src/runtime/rt_main.C b/src/runtime/rt_main.C
index bb0d43d70..19a15e518 100644
--- a/src/runtime/rt_main.C
+++ b/src/runtime/rt_main.C
@@ -132,6 +132,13 @@ runtimeInterfaces_t* rt_start(hostInterfaces_t* intf)
postInitCalls_t* rtPost = getPostInitCalls();
rtPost->callApplyTempOverrides();
+ // load FIRDATA section into memory so PRD can access
+ // when PNOR is no longer accessible (ie SBE reboot)
+ rtPost->callInitPnor();
+
+ // Make sure errlmanager is ready
+ rtPost->callInitErrlManager();
+
// check for possible missed in-flight messages/interrupts
rtPost->callClearPendingSbeMsgs();
diff --git a/src/usr/errl/runtime/rt_errlmanager.C b/src/usr/errl/runtime/rt_errlmanager.C
index 10b521a32..62eabc263 100644
--- a/src/usr/errl/runtime/rt_errlmanager.C
+++ b/src/usr/errl/runtime/rt_errlmanager.C
@@ -46,6 +46,8 @@ uint8_t ErrlManager::iv_hiddenErrLogsEnable =
extern trace_desc_t* g_trac_errl;
+
+
//////////////////////////////////////////////////////////////////////////////
// Local functions
//////////////////////////////////////////////////////////////////////////////
@@ -380,3 +382,26 @@ bool rt_processCallout(errlHndl_t &io_errl,
}
} // End namespace
+
+
+//------------------------------------------------------------------------
+void initErrlManager(void)
+{
+ // Note: rtPnor needs to be setup before this is called
+ // call errlManager ctor so that we're ready and waiting for errors.
+ ERRORLOG::theErrlManager::instance();
+}
+
+
+struct registerInitErrlManager
+{
+ registerInitErrlManager()
+ {
+ // Register interface for Host to call
+ postInitCalls_t * rt_post = getPostInitCalls();
+ rt_post->callInitErrlManager = &initErrlManager;
+ }
+};
+
+registerInitErrlManager g_registerInitErrlManager;
+
diff --git a/src/usr/pnor/runtime/rt_pnor.C b/src/usr/pnor/runtime/rt_pnor.C
index 276691003..47accc8d0 100644
--- a/src/usr/pnor/runtime/rt_pnor.C
+++ b/src/usr/pnor/runtime/rt_pnor.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2017 */
+/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -24,11 +24,12 @@
/* IBM_PROLOG_END_TAG */
#include <stdlib.h>
+#include <stdio.h>
#include <targeting/common/targetservice.H>
#include <initservice/taskargs.H>
#include <runtime/rt_targeting.H>
-#include <runtime/interface.h>
+#include <runtime/interface.h> // g_hostInterfaces, postInitCalls_t
#include <pnor/pnorif.H>
#include <pnor/ecc.H>
@@ -48,11 +49,6 @@
extern trace_desc_t* g_trac_pnor;
/**
- * @brief set up _start() task entry procedure for PNOR daemon
- */
-TASK_ENTRY_MACRO( RtPnor::init );
-
-/**
* @brief Return the size and address of a given section of PNOR data
*/
errlHndl_t PNOR::getSectionInfo( PNOR::SectionId i_section,
@@ -116,26 +112,29 @@ uint64_t RtPnor::iv_masterProcId = RUNTIME::HBRT_HYP_ID_UNKNOWN;
*/
void RtPnor::init(errlHndl_t &io_taskRetErrl)
{
- TRACFCOMP(g_trac_pnor, "RtPnor::init> " );
- do {
- io_taskRetErrl = Singleton<RtPnor>::instance().getMasterProcId();
- if (io_taskRetErrl)
- {
- break;
- }
- io_taskRetErrl = Singleton<RtPnor>::instance().readTOC();
+ TRACFCOMP(g_trac_pnor, ENTER_MRK"RtPnor::init()");
+
+ PNOR::SectionInfo_t l_sectionInfo;
+
+ // Now find FIRDATA section for PRD
+ // PRD can't tell OCC where to put FIRDATA if it can't read PNOR
+ // unless we cache that info here first
+ // Note: Singleton<RtPnor>::instance() will force RtPnor constructor first
+ io_taskRetErrl = Singleton<RtPnor>::instance().getSectionInfo(
+ PNOR::FIRDATA, l_sectionInfo);
if (io_taskRetErrl)
{
- break;
+ TRACFCOMP(g_trac_pnor, "Rtnor: failed to read FIRDATA section" );
}
- }while (0);
- TRACFCOMP(g_trac_pnor, "<RtPnor::init" );
+
+ TRACFCOMP(g_trac_pnor, EXIT_MRK"RtPnor::init()");
}
+
/**************************************************************/
errlHndl_t RtPnor::getSectionInfo(PNOR::SectionId i_section,
PNOR::SectionInfo_t& o_info)
{
- TRACFCOMP(g_trac_pnor, ENTER_MRK"RtPnor::getSectionInfo");
+ TRACFCOMP(g_trac_pnor, ENTER_MRK"RtPnor::getSectionInfo %d", i_section);
errlHndl_t l_err = nullptr;
do
{
@@ -193,6 +192,7 @@ errlHndl_t RtPnor::getSectionInfo(PNOR::SectionId i_section,
//size of the section
uint64_t l_sizeBytes = iv_TOC[i_section].size;
+
if (l_sizeBytes == 0)
{
TRACFCOMP(g_trac_pnor,"RtPnor::getSectionInfo: Section %d"
@@ -263,7 +263,7 @@ errlHndl_t RtPnor::getSectionInfo(PNOR::SectionId i_section,
o_info.secure = iv_TOC[i_section].secure;
} while (0);
- TRACFCOMP(g_trac_pnor, EXIT_MRK"RtPnor::getSectionInfo");
+ TRACFCOMP(g_trac_pnor, EXIT_MRK"RtPnor::getSectionInfo %d", i_section);
return l_err;
}
@@ -365,18 +365,18 @@ errlHndl_t RtPnor::flush( PNOR::SectionId i_section)
RtPnor::RtPnor()
{
do {
- errlHndl_t l_err = getMasterProcId();
- if (l_err)
- {
- errlCommit(l_err, PNOR_COMP_ID);
- break;
- }
- l_err = readTOC();
- if (l_err)
- {
- errlCommit(l_err, PNOR_COMP_ID);
+ errlHndl_t l_err = getMasterProcId();
+ if (l_err)
+ {
+ errlCommit(l_err, PNOR_COMP_ID);
break;
- }
+ }
+ l_err = readTOC();
+ if (l_err)
+ {
+ errlCommit(l_err, PNOR_COMP_ID);
+ break;
+ }
} while (0);
}
@@ -689,6 +689,7 @@ errlHndl_t RtPnor::writeToDevice( uint64_t i_procId,
errlHndl_t RtPnor::readTOC ()
{
TRACFCOMP(g_trac_pnor, ENTER_MRK"RtPnor::readTOC" );
+
errlHndl_t l_err = nullptr;
uint8_t* l_toc0Buffer = new uint8_t[PNOR::TOC_SIZE];
do {
@@ -890,4 +891,36 @@ errlHndl_t RtPnor::getMasterProcId()
return l_err;
}
+void initPnor()
+{
+ TRACFCOMP(g_trac_pnor, ENTER_MRK"initPnor");
+ errlHndl_t l_errl = nullptr;
+
+ // call static init() function to save PNOR section into memory
+ RtPnor::init(l_errl);
+ if (l_errl)
+ {
+ TRACFCOMP(g_trac_pnor,ERR_MRK"initPnor: "
+ "Failed RtPnor::init() with EID %.8X:%.4X",
+ ERRL_GETEID_SAFE(l_errl),
+ ERRL_GETRC_SAFE(l_errl) );
+ errlCommit (l_errl, PNOR_COMP_ID);
+ }
+
+
+ TRACFCOMP(g_trac_pnor, EXIT_MRK"initPnor");
+}
+
+//------------------------------------------------------------------------
+
+struct registerinitPnor
+{
+ registerinitPnor()
+ {
+ // Register interface for Host to call
+ postInitCalls_t * rt_post = getPostInitCalls();
+ rt_post->callInitPnor = &initPnor;
+ }
+};
+registerinitPnor g_registerInitPnor;
OpenPOWER on IntegriCloud