summaryrefslogtreecommitdiffstats
path: root/src/usr/pnor/pnor_utils.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/pnor/pnor_utils.C')
-rw-r--r--src/usr/pnor/pnor_utils.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/usr/pnor/pnor_utils.C b/src/usr/pnor/pnor_utils.C
index 4fcad21c6..324548740 100644
--- a/src/usr/pnor/pnor_utils.C
+++ b/src/usr/pnor/pnor_utils.C
@@ -328,6 +328,28 @@ PNOR::parseEntries (ffs_hdr* i_ffs_hdr,
#else
io_TOC[secId].secure = false;
#endif
+
+ // If secureboot is compiled in, skip header if not a secure section
+ // Otherwise always skip header as the secure flag is always false and
+ // SpnorRp will not handle skipping the header if one is indicated in PNOR
+ if ( (io_TOC[secId].version & FFS_VERS_SHA512)
+ && !io_TOC[secId].secure)
+ {
+ //increment flash addr for sha header
+ if (io_TOC[secId].integrity == FFS_INTEG_ECC_PROTECT)
+ {
+ io_TOC[secId].flashAddr += PAGESIZE_PLUS_ECC ;
+ }
+ else
+ {
+ io_TOC[secId].flashAddr += PAGESIZE ;
+ }
+
+ // now that we've skipped the header
+ // adjust the size to reflect that
+ io_TOC[secId].size -= PAGESIZE;
+ }
+
} // For TOC Entries
#ifndef BOOTLOADER
OpenPOWER on IntegriCloud