diff options
Diffstat (limited to 'src/usr/pnor/pnorrp.C')
-rw-r--r-- | src/usr/pnor/pnorrp.C | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C index af6ccf3fa..fa35be627 100644 --- a/src/usr/pnor/pnorrp.C +++ b/src/usr/pnor/pnorrp.C @@ -44,7 +44,6 @@ #include <kernel/console.H> #include <endian.h> #include <util/align.H> -#include <config.h> #include <pnor/pnorif.H> #include "pnor_common.H" #include <hwas/common/hwasCallout.H> @@ -214,6 +213,13 @@ void PnorRP::init( errlHndl_t &io_rtaskRetErrl ) #ifdef CONFIG_SECUREBOOT // Extend the base image to the TPM, regardless of how it was obtained l_errl = TRUSTEDBOOT::extendBaseImage(); + + // Cache the VERSION partition data for future use by the errl commit + // code. + if(!l_errl) + { + l_errl = ERRORLOG::cacheVersionPartition(); + } #endif #endif } @@ -522,6 +528,7 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, #ifdef CONFIG_SECUREBOOT o_info.secure = iv_TOC[id].secure; + o_info.size = iv_TOC[id].size; o_info.secureProtectedPayloadSize = 0; // for non secure sections // the protected payload size // defaults to zero @@ -591,6 +598,17 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, // was done previously in pnor_common.C o_info.size -= PAGESIZE; + // Need to change size to accommodate for hash table + if (l_conHdr.sb_flags()->sw_hash) + { + o_info.vaddr += payloadTextSize; + // Hash page table needs to use containerSize as the base + // and subtract off header and hash table size + o_info.size = l_conHdr.totalContainerSize() - PAGE_SIZE - + payloadTextSize; + o_info.hasHashTable = true; + } + // cache the value in SectionInfo struct so that we can // parse the container header less often o_info.secureProtectedPayloadSize = payloadTextSize; @@ -598,11 +616,11 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, else #endif { + o_info.size = iv_TOC[id].size; o_info.vaddr = iv_TOC[id].virtAddr; } o_info.flashAddr = iv_TOC[id].flashAddr; - o_info.size = iv_TOC[id].size; o_info.eccProtected = ((iv_TOC[id].integrity & FFS_INTEG_ECC_PROTECT) != 0) ? true : false; o_info.sha512Version = ((iv_TOC[id].version & FFS_VERS_SHA512) |