From bb22513902f6917359c18c79502bd2aff604f6e0 Mon Sep 17 00:00:00 2001 From: Dean Sanner Date: Mon, 12 Jun 2017 10:10:59 -0500 Subject: Add HB_VOLATILE PNOR section flag Change-Id: I8431edec1178cc062fdda943e5cade08acc5014c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41687 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Reviewed-by: Stephen M. Cprek Reviewed-by: Christian R. Geddes Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/build/buildpnor/buildpnor.pl | 4 ++++ src/include/usr/pnor/pnor_const.H | 1 + src/usr/pnor/common/ffs_hb.H | 3 ++- src/usr/pnor/pnorrp.C | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/build/buildpnor/buildpnor.pl b/src/build/buildpnor/buildpnor.pl index 28930dc47..93d43e94a 100755 --- a/src/build/buildpnor/buildpnor.pl +++ b/src/build/buildpnor/buildpnor.pl @@ -241,6 +241,10 @@ sub addUserData { $miscFlags |= 0x10; } + if( ($i_sectionHash{$i_key}{volatile} eq "yes") ) + { + $miscFlags |= 0x08; + } #First User Data Word #[1:chip][1:compressType][2:dataInteg] diff --git a/src/include/usr/pnor/pnor_const.H b/src/include/usr/pnor/pnor_const.H index 9f435681d..e65faffdb 100644 --- a/src/include/usr/pnor/pnor_const.H +++ b/src/include/usr/pnor/pnor_const.H @@ -105,6 +105,7 @@ struct SectionInfo_t bool sha512perEC; /**< Version Checking perEC */ bool readOnly; /**< Section is read only */ bool reprovision; /**< Erase this section during a reprovision */ + bool Volatile; /**< Section loses contents on non HB reboots */ bool secure; /**< Indicates if a section is secure */ #ifdef CONFIG_SECUREBOOT size_t secureProtectedPayloadSize; /**< Cache the secure payload size so diff --git a/src/usr/pnor/common/ffs_hb.H b/src/usr/pnor/common/ffs_hb.H index 7203880c9..12d6689b7 100644 --- a/src/usr/pnor/common/ffs_hb.H +++ b/src/usr/pnor/common/ffs_hb.H @@ -68,8 +68,9 @@ enum FFS_MISC_READ_ONLY = 0x40, /**< Read only section */ FFS_MISC_PSEUDO = 0x20, /**< Pseudo partition */ FFS_MISC_REPROVISION = 0x10, /**< Erased during reprovision */ + FFS_MISC_VOLATILE = 0x08, /**< Loses contents based on boot types*/ FFS_MISC_GOLDEN = 0x01, /**< Golden side of PNOR */ - FFS_MISC_UNUSED = 0x0E, /**< Unused MISC Flags */ + FFS_MISC_UNUSED = 0x06, /**< Unused MISC Flags */ }; /** diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C index bd8609416..42082aab7 100644 --- a/src/usr/pnor/pnorrp.C +++ b/src/usr/pnor/pnorrp.C @@ -647,6 +647,8 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, != 0) ? true : false; o_info.reprovision = ((iv_TOC[id].misc & FFS_MISC_REPROVISION) != 0) ? true : false; + o_info.Volatile = ((iv_TOC[id].misc & FFS_MISC_VOLATILE) + != 0) ? true : false; } } while(0); -- cgit v1.2.1