summaryrefslogtreecommitdiffstats
path: root/src/usr/pnor
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2017-08-28 11:39:53 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-09-08 15:55:03 -0400
commit513299a5b565b066816fe31b1ba224f8d195ca27 (patch)
treef54948083ef5a77eed53229160f2c842f4d4d46c /src/usr/pnor
parent948bff49730d59eb2c84c545b5fcec157b08bfbb (diff)
downloadtalos-hostboot-513299a5b565b066816fe31b1ba224f8d195ca27.tar.gz
talos-hostboot-513299a5b565b066816fe31b1ba224f8d195ca27.zip
Re-enable OCC parition in pnor
Additional Changes - Created isEmpty check for pnor sections to handle lack of FSP support when loading Lids - Removed not needed PNOR partitions from FSP layout Change-Id: I326831a1b389ef25b6f5f557d332c74f3b5e77d8 RTC:178164 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45251 Reviewed-by: Michael Baiocchi <mbaiocch@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: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/pnor')
-rw-r--r--src/usr/pnor/pnor_common.C33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/usr/pnor/pnor_common.C b/src/usr/pnor/pnor_common.C
index 20d6bd760..3b0195756 100644
--- a/src/usr/pnor/pnor_common.C
+++ b/src/usr/pnor/pnor_common.C
@@ -533,3 +533,36 @@ errlHndl_t PNOR::hasKnownHeader(
return pError;
}
+// @TODO CQ:SW400352 remove function
+bool PNOR::isSectionEmpty(const PNOR::SectionId i_section)
+{
+ errlHndl_t l_errhdl = nullptr;
+ bool l_result = true;
+
+ PNOR::SectionInfo_t l_sectionInfo;
+ l_errhdl = PNOR::getSectionInfo( i_section, l_sectionInfo );
+ if (l_errhdl)
+ {
+ // If section is not in PNOR, just delete error and return false
+ delete l_errhdl;
+ l_errhdl = nullptr;
+ }
+ else
+ {
+ std::array<uint8_t,PAGESIZE> empty_buffer{};
+ // Empty ECC sections are filled with 0xFF's to ensure good ECC
+ if (l_sectionInfo.eccProtected)
+ {
+ empty_buffer.fill(0xFF);
+ }
+
+ l_result = memcmp(&empty_buffer,
+ reinterpret_cast<uint8_t*>(l_sectionInfo.vaddr),
+ sizeof(empty_buffer)) ==0;
+ }
+
+ TRACFCOMP(g_trac_pnor, "PNOR::isSectionEmpty: i_section=%s isSectionEmpty=%d",
+ PNOR::SectionIdToString(i_section), l_result);
+
+ return l_result;
+}
OpenPOWER on IntegriCloud