summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/pnor/pnor_reasoncodes.H7
-rw-r--r--src/usr/errl/runtime/makefile3
-rw-r--r--src/usr/errl/runtime/rt_errlmanager.C23
-rw-r--r--src/usr/hwas/common/deconfigGard.C6
-rw-r--r--src/usr/hwas/hwasPlatDeconfigGard.C8
-rw-r--r--src/usr/pnor/runtime/rt_pnor.C54
-rw-r--r--src/usr/pnor/runtime/rt_pnor.H11
7 files changed, 107 insertions, 5 deletions
diff --git a/src/include/usr/pnor/pnor_reasoncodes.H b/src/include/usr/pnor/pnor_reasoncodes.H
index 5beb1a050..4133c8a0f 100644
--- a/src/include/usr/pnor/pnor_reasoncodes.H
+++ b/src/include/usr/pnor/pnor_reasoncodes.H
@@ -87,14 +87,15 @@ namespace PNOR
// nor_micron.C
MOD_NORMICRON_MICRONFLAGSTATUS = 0xA0, /**< micronFlagStatus */
- //rt_pnor.C
+ // rt_pnor.C
MOD_RTPNOR_GETSECTIONINFO = 0xB0, /**< RtPnor::getSectionInfo*/
MOD_RTPNOR_FLUSH = 0xB1, /**< RtPnor::flush */
MOD_RTPNOR_READFROMDEVICE = 0xB2, /**< RtPnor::readFromDevice */
MOD_RTPNOR_WRITETODEVICE = 0xB3, /**< RtPnor::writeToDevice */
+ MOD_RTPNOR_GETSIDEINFO = 0xB4, /**< RtPnor::getSideInfo */
- //pnor_common.C
- MOD_PNORCOMMON_PARSETOC = 0xC0, /**< PNOR::parseTOC */
+ // pnor_common.C
+ MOD_PNORCOMMON_PARSETOC = 0xC0, /**< PNOR::parseTOC */
};
enum PNORReasonCode
diff --git a/src/usr/errl/runtime/makefile b/src/usr/errl/runtime/makefile
index c80c9fdaa..ec449ea5d 100644
--- a/src/usr/errl/runtime/makefile
+++ b/src/usr/errl/runtime/makefile
@@ -30,10 +30,13 @@ MODULE = errl_rt
include ../errl.mk
VPATH += ${ROOTPATH}/src/usr/hwas/common
+VPATH += ${ROOTPATH}/src/usr/hwas
OBJS += rt_errlmanager.o
OBJS += rt_vfs.o
OBJS += hwasCallout.o
+OBJS += deconfigGard.o
+OBJS += hwasPlatDeconfigGard.o
SUBDIRS += test.d
diff --git a/src/usr/errl/runtime/rt_errlmanager.C b/src/usr/errl/runtime/rt_errlmanager.C
index 49d53b65f..981b4f117 100644
--- a/src/usr/errl/runtime/rt_errlmanager.C
+++ b/src/usr/errl/runtime/rt_errlmanager.C
@@ -34,6 +34,7 @@
#include <runtime/interface.h>
#include <targeting/common/targetservice.H>
#include <pnor/pnorif.H>
+#include <hwas/common/deconfigGard.H>
namespace ERRORLOG
{
@@ -301,6 +302,28 @@ bool rt_processCallout(errlHndl_t &io_errl,
}
}
+
+ if ((pCalloutUD->type == HWAS::HW_CALLOUT) &&
+ (pCalloutUD->gardErrorType != HWAS::GARD_NULL))
+ {
+ TARGETING::Target *pTarget = NULL;
+ uint8_t * l_uData = (uint8_t *)(pCalloutUD + 1);
+ bool l_err = HWAS::retrieveTarget(l_uData, pTarget, io_errl);
+
+ if (!l_err)
+ {
+ errlHndl_t errl = HWAS::theDeconfigGard().platCreateGardRecord(pTarget,
+ io_errl->eid(),
+ pCalloutUD->gardErrorType);
+ if (errl)
+ {
+ TRACFCOMP( g_trac_errl, ERR_MRK
+ "rt_processCallout: error from platCreateGardRecord");
+ errlCommit(errl, HWAS_COMP_ID);
+ }
+ }
+
+ }
return true;
}
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index ce4a174ec..fa266c881 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -58,6 +58,7 @@ namespace HWAS
using namespace HWAS::COMMON;
using namespace TARGETING;
+#ifndef __HOSTBOOT_RUNTIME
//******************************************************************************
errlHndl_t collectGard(const PredicateBase *i_pPredicate)
{
@@ -100,6 +101,7 @@ errlHndl_t collectGard(const PredicateBase *i_pPredicate)
}
return errl;
} // collectGard
+#endif
//******************************************************************************
DeconfigGard & theDeconfigGard()
@@ -123,6 +125,8 @@ DeconfigGard::~DeconfigGard()
HWAS_MUTEX_DESTROY(iv_mutex);
free(iv_platDeconfigGard);
}
+
+#ifndef __HOSTBOOT_RUNTIME
//******************************************************************************
errlHndl_t DeconfigGard::applyGardRecord(Target *i_pTarget,
GardRecord &i_gardRecord,
@@ -178,6 +182,7 @@ errlHndl_t DeconfigGard::applyGardRecord(Target *i_pTarget,
while(0);
return l_pErr;
}//applyGardRecord
+
//******************************************************************************
errlHndl_t DeconfigGard::clearGardRecordsForReplacedTargets()
{
@@ -2442,5 +2447,6 @@ void DeconfigGard::_clearFCODeconfigure(ConstTargetHandle_t i_nodeTarget)
}
}
}
+#endif
} // namespce HWAS
diff --git a/src/usr/hwas/hwasPlatDeconfigGard.C b/src/usr/hwas/hwasPlatDeconfigGard.C
index 36a05a6a0..0377cbd10 100644
--- a/src/usr/hwas/hwasPlatDeconfigGard.C
+++ b/src/usr/hwas/hwasPlatDeconfigGard.C
@@ -472,6 +472,7 @@ errlHndl_t _GardRecordIdSetup( void *&io_platDeconfigGard)
void _flush(void *i_addr)
{
+#ifndef __HOSTBOOT_RUNTIME
HWAS_DBG("flushing GARD in PNOR: addr=%p", i_addr);
int l_rc = mm_remove_pages(FLUSH, i_addr,
sizeof(DeconfigGard::GardRecord));
@@ -480,6 +481,10 @@ void _flush(void *i_addr)
HWAS_ERR("mm_remove_pages(FLUSH,%p,%d) returned %d",
i_addr, sizeof(DeconfigGard::GardRecord),l_rc);
}
+#else
+ HWAS_DBG("flushing all GARD in PNOR due to addr=%p", i_addr);
+ PNOR::flush(PNOR::GUARD_DATA);
+#endif
}
errlHndl_t getGardSectionInfo(PNOR::SectionInfo_t& o_sectionInfo)
@@ -510,8 +515,7 @@ errlHndl_t getGardSectionInfo(PNOR::SectionInfo_t& o_sectionInfo)
}
if (!l_sideInfo.isGuardPresent)
{
- HWAS_INF("getGardSectionInfo: No guard section disabling guard"
- " support");
+ HWAS_INF("getGardSectionInfo: No guard section; disabling guard support");
delete l_errl;
l_errl = NULL;
}
diff --git a/src/usr/pnor/runtime/rt_pnor.C b/src/usr/pnor/runtime/rt_pnor.C
index 2874d409c..28281f4b2 100644
--- a/src/usr/pnor/runtime/rt_pnor.C
+++ b/src/usr/pnor/runtime/rt_pnor.C
@@ -70,6 +70,15 @@ errlHndl_t PNOR::flush( PNOR::SectionId i_section)
return Singleton<RtPnor>::instance().flush(i_section);
}
+/**
+ * @brief Returns information about a given side of PNOR
+ */
+errlHndl_t PNOR::getSideInfo( PNOR::SideId i_side,
+ PNOR::SideInfo_t& o_info)
+{
+ return Singleton<RtPnor>::instance().getSideInfo(i_side,o_info);
+}
+
/****************Public Methods***************************/
/**
* STATIC
@@ -670,3 +679,48 @@ RtPnor& RtPnor::getInstance()
{
return Singleton<RtPnor>::instance();
}
+/***********************************************************/
+errlHndl_t RtPnor::getSideInfo( PNOR::SideId i_side,
+ PNOR::SideInfo_t& o_info)
+{
+ errlHndl_t l_err = NULL;
+
+ do {
+ // We only support the working side at runtime
+ if( i_side != PNOR::WORKING )
+ {
+ /*@
+ * @errortype
+ * @moduleid PNOR::MOD_RTPNOR_GETSIDEINFO
+ * @reasoncode PNOR::RC_INVALID_PNOR_SIDE
+ * @userdata1 Requested SIDE
+ * @userdata2 0
+ * @devdesc getSideInfo> Side not supported
+ * @custdesc A problem occurred while accessing the boot flash.
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ PNOR::MOD_RTPNOR_GETSIDEINFO,
+ PNOR::RC_INVALID_PNOR_SIDE,
+ TO_UINT64(i_side),
+ 0,true);
+ break;
+ }
+
+ o_info.id = PNOR::WORKING;
+ o_info.side = (ALIGN_DOWN_X(iv_TOC[PNOR::HB_BASE_CODE].flashAddr,32*MEGABYTE) == 0)
+ ? 'A':'B'; //@fixme TODO RTC:134436
+ //iv_side[i].isGolden = (ffsUserData->miscFlags & FFS_MISC_GOLDEN);
+ o_info.isGolden = false; //@fixme TODO RTC:134436
+ o_info.isGuardPresent = (iv_TOC[PNOR::GUARD_DATA].flashAddr == 0)
+ ? false : true;
+
+ o_info.hasOtherSide = false; //@fixme TODO RTC:134436
+ o_info.primaryTOC = iv_TOC[PNOR::TOC].flashAddr;
+ o_info.backupTOC = 0; //@fixme TODO RTC:134436
+ o_info.hbbAddress = iv_TOC[PNOR::HB_BASE_CODE].flashAddr;
+ o_info.hbbMmioOffset = 0; //@fixme TODO RTC:134436
+ } while(0);
+
+ return l_err;
+}
diff --git a/src/usr/pnor/runtime/rt_pnor.H b/src/usr/pnor/runtime/rt_pnor.H
index a888d046d..54c1ac9af 100644
--- a/src/usr/pnor/runtime/rt_pnor.H
+++ b/src/usr/pnor/runtime/rt_pnor.H
@@ -66,6 +66,17 @@ class RtPnor
*/
errlHndl_t flush (PNOR::SectionId i_section);
+ /**
+ * @brief Returns information about a given side of pnor
+ * (Called by an external interface PNOR::getSideInfo())
+ * @param[in] i_side PNOR side
+ * @param[out] o_info side information
+ *
+ * @return errlHndl_t Error log if request was invalid
+ */
+ errlHndl_t getSideInfo( PNOR::SideId i_side,
+ PNOR::SideInfo_t& o_info);
+
protected:
/**
* @brief Constructor
OpenPOWER on IntegriCloud