diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/build/buildpnor/buildpnor.pl | 14 | ||||
-rw-r--r-- | src/build/buildpnor/defaultPnorLayout.xml | 2 | ||||
-rwxr-xr-x | src/build/mkrules/hbfw/img/makefile | 12 | ||||
-rw-r--r-- | src/include/usr/pnor/pnorif.H | 18 | ||||
-rw-r--r-- | src/usr/pnor/pnorrp.C | 9 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.C | 15 |
6 files changed, 37 insertions, 33 deletions
diff --git a/src/build/buildpnor/buildpnor.pl b/src/build/buildpnor/buildpnor.pl index 0f89bc2c5..6b2ed6727 100755 --- a/src/build/buildpnor/buildpnor.pl +++ b/src/build/buildpnor/buildpnor.pl @@ -241,6 +241,7 @@ sub loadPnorLayout my $testonly = $sectionEl->{testonly}[0]; my $ecc = (exists $sectionEl->{ecc} ? "yes" : "no"); my $sha512Version = (exists $sectionEl->{sha512Version} ? "yes" : "no"); + my $sha512perEC = (exists $sectionEl->{sha512perEC} ? "yes" : "no"); if (($emitTestSections == 0) && ($sectionEl->{testonly}[0] eq "yes")) { @@ -261,6 +262,7 @@ sub loadPnorLayout $$i_pnorLayoutRef{sections}{$physicalOffset}{side} = $side; $$i_pnorLayoutRef{sections}{$physicalOffset}{ecc} = $ecc; $$i_pnorLayoutRef{sections}{$physicalOffset}{sha512Version} = $sha512Version; + $$i_pnorLayoutRef{sections}{$physicalOffset}{sha512perEC} = $sha512perEC; } @@ -364,7 +366,7 @@ sub createPnorImage my $chip = 0; my $compress = 0; my $ecc = 0; - my $sha512Version = 0; + my $version = 0; if( ($sectionHash{$key}{ecc} eq "yes") ) { @@ -372,7 +374,11 @@ sub createPnorImage } if( ($sectionHash{$key}{sha512Version} eq "yes") ) { - $sha512Version = 0x80; + $version = 0x80; + } + elsif( ($sectionHash{$key}{sha512perEC} eq "yes") ) + { + $version = 0x40; } #First User Data Word @@ -382,8 +388,8 @@ sub createPnorImage | $ecc; #Second User Data Word - #[1:sha512Version] - my $userflags1 = ($sha512Version << 24); + #[1:sha512Version/sha512perEC] + my $userflags1 = ($version << 24); trace(1,"userflags0 = $userflags0"); trace(1,"userflags1 = $userflags1"); diff --git a/src/build/buildpnor/defaultPnorLayout.xml b/src/build/buildpnor/defaultPnorLayout.xml index 4fcc42a51..972471d61 100644 --- a/src/build/buildpnor/defaultPnorLayout.xml +++ b/src/build/buildpnor/defaultPnorLayout.xml @@ -117,6 +117,7 @@ Layout Description <eyeCatch>SBEC</eyeCatch> <physicalOffset>0x83D000</physicalOffset> <physicalRegionSize>0x90000</physicalRegionSize> + <sha512perEC/> <ecc/> </section> <section> @@ -132,6 +133,7 @@ Layout Description <eyeCatch>WINK</eyeCatch> <physicalOffset>0x915000</physicalOffset> <physicalRegionSize>0x120000</physicalRegionSize> + <sha512Version/> <ecc/> </section> <section> diff --git a/src/build/mkrules/hbfw/img/makefile b/src/build/mkrules/hbfw/img/makefile index a680cf4cf..63c940d5f 100755 --- a/src/build/mkrules/hbfw/img/makefile +++ b/src/build/mkrules/hbfw/img/makefile @@ -233,12 +233,12 @@ MURANO_TARG_IMG = simics_MURANO_targeting.bin VENICE_TARG_IMG = simics_VENICE_targeting.bin MURANO_TARG_IMG_ECC = simics_MURANO_targeting.bin.ecc VENICE_TARG_IMG_ECC = simics_VENICE_targeting.bin.ecc -MURANO_SLW_IMG = ${ENGD_OBJPATH:Fs1.ref_image.bin} -VENICE_SLW_IMG = ${ENGD_OBJPATH:Fp8.ref_image.bin} -MURANO_LOCAL_SLW_IMG = s1.ref_image.bin -VENICE_LOCAL_SLW_IMG = p8.ref_image.bin -MURANO_LOCAL_SLW_IMG_ECC = s1.ref_image.bin.ecc -VENICE_LOCAL_SLW_IMG_ECC = p8.ref_image.bin.ecc +MURANO_SLW_IMG = ${ENGD_OBJPATH:Fs1.ref_image.hdr.bin} +VENICE_SLW_IMG = ${ENGD_OBJPATH:Fp8.ref_image.hdr.bin} +MURANO_LOCAL_SLW_IMG = s1.ref_image.hdr.bin +VENICE_LOCAL_SLW_IMG = p8.ref_image.hdr.bin +MURANO_LOCAL_SLW_IMG_ECC = s1.ref_image.hdr.bin.ecc +VENICE_LOCAL_SLW_IMG_ECC = p8.ref_image.hdr.bin.ecc MURANO_SBE_IMG = s1SbePartition.bin VENICE_SBE_IMG = p8SbePartition.bin MURANO_SBE_IMG_ECC = s1SbePartition.bin.ecc diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H index 58b0108d6..d178d7018 100644 --- a/src/include/usr/pnor/pnorif.H +++ b/src/include/usr/pnor/pnorif.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2013 */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ /* */ /* p1 */ /* */ @@ -60,33 +60,21 @@ enum SectionId }; /** - * Select a side of flash to access - */ -enum SideSelect -{ - SIDE_A, /**< A-side of flash */ - SIDE_B, /**< B-side of flash */ - CURRENT_SIDE, /**< Use the currently selected side */ -}; - -/** * Information about a section of PNOR */ // Size and layout of this structure must be maintained for debug framework. struct SectionInfo_t { SectionId id; /**< Identifier for this section */ - SideSelect side; /**< Identifier for the side of flash */ const char* name; /**< Name of the section */ uint64_t vaddr; /**< Virtual address for the start of the section */ uint64_t size; /**< Actual size of content in bytes */ bool eccProtected; /**< Section is ECC protected */ + bool sha512Version; /**< Version Checking */ + bool sha512perEC; /**< Version Checking perEC */ }; - - - /** * @brief Return the size and address of a given section of PNOR data * diff --git a/src/usr/pnor/pnorrp.C b/src/usr/pnor/pnorrp.C index 5c526ce85..e31499c7c 100644 --- a/src/usr/pnor/pnorrp.C +++ b/src/usr/pnor/pnorrp.C @@ -339,7 +339,6 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, } } while(0); - if (PNOR::INVALID_SECTION != id) { TRACDCOMP( g_trac_pnor, "PnorRP::getSectionInfo: i_section=%d, id=%d", i_section, iv_TOC[i_section].id ); @@ -349,8 +348,12 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section, o_info.name = cv_EYECATCHER[id]; o_info.vaddr = iv_TOC[id].virtAddr; o_info.size = iv_TOC[id].size; - o_info.eccProtected = (bool)(iv_TOC[id].integrity & - FFS_INTEG_ECC_PROTECT); + o_info.eccProtected = ((iv_TOC[id].integrity & FFS_INTEG_ECC_PROTECT) + != 0) ? true : false; + o_info.sha512Version = ((iv_TOC[id].version & FFS_VERS_SHA512) + != 0) ? true : false; + o_info.sha512perEC = ((iv_TOC[id].version & FFS_VERS_SHA512_PER_EC) + != 0) ? true : false; } return l_errhdl; diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index d1952bc65..84bd69b7d 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -445,10 +445,10 @@ namespace SBE break; } - // Get SBE PNOR section info from PNOR RP err = PNOR::getSectionInfo( pnorSectionId, pnorInfo ); + if(err) { TRACFCOMP( g_trac_sbe, ERR_MRK"findSBEInPnor: Error calling " @@ -584,11 +584,16 @@ namespace SBE break; } - // The SBE Image for the corresponding EC was found and includes a - // SBE Header, so advance PNOR pointer 4k to move it past header - // page to the start of the non-customized SBE image - o_imgPtr = reinterpret_cast<void*> + // The SBE Image for the corresponding EC was found, check if + // it includes a SBE Header + if (pnorInfo.sha512perEC) + { + TRACFCOMP(g_trac_sbe,INFO_MRK"findSBEInPnor: sha512perEC Found in %s", pnorInfo.name); + // Advance PNOR pointer 4k to move it past header page to the + // start of the non-customized SBE image + o_imgPtr = reinterpret_cast<void*> (reinterpret_cast<char*>(hdr_Ptr)+0x1000); + } if(NULL != o_version) |