summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/pnor/pnorif.H31
-rw-r--r--src/usr/pnor/pnorrp.C23
-rw-r--r--src/usr/pnor/test/pnorrptest.H34
3 files changed, 88 insertions, 0 deletions
diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H
index 1a18750b5..f5e4fc385 100644
--- a/src/include/usr/pnor/pnorif.H
+++ b/src/include/usr/pnor/pnorif.H
@@ -80,6 +80,37 @@ errlHndl_t getSideInfo (SideId i_side, SideInfo_t& o_info);
*/
errlHndl_t getSectionInfo( SectionId i_section,
SectionInfo_t& o_info );
+
+/**
+ * @brief Loads requested PNOR section to secure virtual address space
+ *
+ * @par Detailed Description:
+ * Loads requested PNOR section to secure virtual address space. If secure
+ * mode is enabled, the load will fully validate the section before
+ * placing it in the address space. Returns error if the requested
+ * section does not have secure space support.
+ *
+ * @param[in] i_section PNOR section to load. Section must not already be
+ * loaded.
+ *
+ * @return errlHndl_t Error log handle
+ * @retval NULL Successfully loaded PNOR section
+ * @retval !NULL Failed to load PNOR section
+ */
+errlHndl_t loadSecureSection(SectionId i_section);
+
+/**
+ * @brief Flushes any applicable pending writes and unloads requested PNOR
+ * section from secure virtual address space
+ *
+ * @param[in] i_section PNOR section to unload. No-op if already unloaded.
+ *
+ * @return errlHndl_t Error log handle
+ * @retval NULL Successfully unloaded PNOR section
+ * @retval !NULL Failed to unload PNOR section
+ */
+errlHndl_t unloadSecureSection(SectionId i_section);
+
/**
* @brief Write the data back from hostboot memory to PNOR of a given section
* of PNOR
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C
index 725fa88e9..8a7b5457b 100644
--- a/src/usr/pnor/pnorrp.C
+++ b/src/usr/pnor/pnorrp.C
@@ -90,6 +90,29 @@ errlHndl_t PNOR::getSectionInfo( PNOR::SectionId i_section,
}
/**
+ * @brief Loads requested PNOR section to secure virtual address space
+ */
+errlHndl_t PNOR::loadSecureSection(const SectionId i_section)
+{
+ //@TODO RTC 156118
+ // Replace with call to secure provider to load the section
+ errlHndl_t pError=NULL;
+ return pError;
+}
+
+/**
+ * @brief Flushes any applicable pending writes and unloads requested PNOR
+ * section from secure virtual address space
+ */
+errlHndl_t PNOR::unloadSecureSection(const SectionId i_section)
+{
+ //@TODO RTC 156118
+ // Replace with call to secure provider to load the section
+ errlHndl_t pError=NULL;
+ return pError;
+}
+
+/**
* @brief Clear pnor section
*/
errlHndl_t PNOR::clearSection(PNOR::SectionId i_section)
diff --git a/src/usr/pnor/test/pnorrptest.H b/src/usr/pnor/test/pnorrptest.H
index 92d82a397..4eee74072 100644
--- a/src/usr/pnor/test/pnorrptest.H
+++ b/src/usr/pnor/test/pnorrptest.H
@@ -803,6 +803,40 @@ class PnorRpTest : public CxxTest::TestSuite
delete [] l_goodData;
delete [] l_readData;
};
+
+ /**
+ * @brief Tests loading and unloading a secure section
+ */
+ void test_loadUnloadSecureSection()
+ {
+ // @RTC 156118 Right now these tests just ensure the
+ // APIs are callable; they should return success always
+ // until 156118 implements the real support. At that time
+ // this testcase should be updated.
+ errlHndl_t pError=NULL;
+
+ do {
+
+ pError = PNOR::loadSecureSection(PNOR::SBE_IPL);
+ if(pError != NULL)
+ {
+ TS_FAIL("PnorRpTest::test_loadUnloadSecureSection: "
+ "loadSecureSection returned an error");
+ ERRORLOG::errlCommit(pError,PNOR_COMP_ID);
+ break;
+ }
+
+ pError = PNOR::unloadSecureSection(PNOR::SBE_IPL);
+ if(pError != NULL)
+ {
+ TS_FAIL("PnorRpTest::test_loadUnloadSecureSection: "
+ "unloadSecureSection returned an error");
+ ERRORLOG::errlCommit(pError,PNOR_COMP_ID);
+ break;
+ }
+
+ } while (0);
+ }
};
OpenPOWER on IntegriCloud