diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2017-04-22 17:15:03 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2017-05-01 11:21:58 -0400 |
commit | ab73555da035ad1193d3490fcb7be86bdf91c43a (patch) | |
tree | 6572b6fbae0ebceaf8057aebda0e58104c64c553 | |
parent | 4dfeb42e05752fb81b699cb7022677d5511f664b (diff) | |
download | talos-hostboot-ab73555da035ad1193d3490fcb7be86bdf91c43a.tar.gz talos-hostboot-ab73555da035ad1193d3490fcb7be86bdf91c43a.zip |
Add option to additionally emit ECC-less content when building PNOR partitions
Change-Id: I27d5b0b90322f250f53f73ce0f62e4a2ee5a96ca
RTC: 170650
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39575
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
-rwxr-xr-x | src/build/buildpnor/genPnorImages.pl | 27 | ||||
-rwxr-xr-x | src/build/mkrules/hbfw/img/makefile | 4 |
2 files changed, 21 insertions, 10 deletions
diff --git a/src/build/buildpnor/genPnorImages.pl b/src/build/buildpnor/genPnorImages.pl index d343c50c9..3c8d4c973 100755 --- a/src/build/buildpnor/genPnorImages.pl +++ b/src/build/buildpnor/genPnorImages.pl @@ -113,6 +113,7 @@ my $testRun = 0; my $pnorLayoutFile = ""; my $system_target = ""; my $build_all = 0; +my $emitEccless = 0; my $install_all = 0; my $key_transition = ""; my $help = 0; @@ -142,6 +143,7 @@ GetOptions("binDir:s" => \$bin_dir, "hwKeyHashFile:s" => \$hwKeyHashFile, "hb-standalone" => \$hb_standalone, "lab-security-override!" => \$labSecurityOverride, + "emit-eccless" => \$emitEccless, "help" => \$help); if ($help) @@ -354,6 +356,8 @@ my %sb_hdrs = ( my $SETTINGS = "\n//============= Generate PNOR Image Settings ===========//\n"; $SETTINGS .= "PNOR Layout = ".$pnorLayoutFile."\n"; $SETTINGS .= $build_all ? "Build Phase = build_all\n" : ""; +$SETTINGS .= "Emit ECC-less versions of output files, when possible = "; +$SETTINGS .= $emitEccless ? "Yes\n" : "No\n"; $SETTINGS .= $install_all ? "Build Phase = install_all\n" : ""; $SETTINGS .= $testRun ? "Test Mode = Yes\n" : "Test Mode = No\n"; $SETTINGS .= $secureboot ? "Secureboot = Enabled\n" : "Secureboot = Disabled\n"; @@ -577,9 +581,10 @@ sub manipulateImages # Handle partitions that have an input binary. if (-e $bin_file) { - # FSP workaround to keep original bin names - my $fsp_file = $bin_file; - my $fsp_prefix = ""; + # Track original name and whether file has a header or not in order + # to emit eccless outputs, if requested + my $eccless_file = $bin_file; + my $eccless_prefix = ""; # HBBL + ROM combination if ($eyeCatch eq "HBBL") @@ -609,7 +614,7 @@ sub manipulateImages # Header Phase if($sectionHash{$layoutKey}{sha512Version} eq "yes") { - $fsp_prefix.=".header"; + $eccless_prefix.=".header"; # Add secure container header # @TODO RTC:155374 Remove when official signing supported if ($secureboot && $secureSupported) @@ -745,6 +750,8 @@ sub manipulateImages } elsif ($secureboot && $isNormalSecure) { + $eccless_prefix .=".header"; + $callerHwHdrFields{configure} = 1; if($openSigningTool) { @@ -783,11 +790,13 @@ sub manipulateImages run_command("dd if=$tempImages{HDR_PHASE} of=$tempImages{PAD_PHASE} ibs=$size conv=sync"); } - # Create .header.bin file for FSP - if ($build_all) + # If so instructed, retain pre-ECC versions of the output files + # using the appropriate naming convention + if ($emitEccless) { - $fsp_file =~ s/\.bin/$fsp_prefix.bin/; - run_command("cp $tempImages{PAD_PHASE} $fsp_file"); + my($file,$dirs,$suffix) = fileparse($eccless_file); + $file =~ s/(\.\w+)$/$eccless_prefix$1/; + run_command("cp $tempImages{PAD_PHASE} $bin_dir/$file"); } # Corrupt section if user specified to do so, before ECC injection. @@ -1218,6 +1227,8 @@ print <<"ENDUSAGE"; override checking is disabled, the only way to bypass security is by manipulating physical jumpers on the system planar. + --emit-eccless In addition to typical output, also emit + ECC-less versions of any input binaries Current Limitations: - Issues with dependency on ENGD build for certain files such as SBE. This is why [--build-all | --install-all ] are used. diff --git a/src/build/mkrules/hbfw/img/makefile b/src/build/mkrules/hbfw/img/makefile index fdc734f03..f900e45d8 100755 --- a/src/build/mkrules/hbfw/img/makefile +++ b/src/build/mkrules/hbfw/img/makefile @@ -120,7 +120,7 @@ PNOR_LAYOUT = ${pnorLayoutFSP.xml:P} .if(${FAKEPNOR} == "") # Parameters passed into GEN_PNOR_IMAGE_SCRIPT. GEN_DEFAULT_BIN_FILES = HBBL=${HBBL_IMG},HBB=${HBB_IMG},HBI=${HBI_IMG},HBRT=${HBRT_IMG},TEST=EMPTY,TESTRO=EMPTY,HBEL=EMPTY,GUARD=EMPTY,GLOBAL=EMPTY,PAYLOAD=EMPTY,CVPD=EMPTY,MVPD=EMPTY,DJVPD=EMPTY,RINGOVD=EMPTY,SBKT=EMPTY,WOFDATA=EMPTY - DEFAULT_PARAMS = --build-all ${TARGET_TEST:b--test} ${HB_STANDALONE:b--hb-standalone} \ + DEFAULT_PARAMS = --build-all --emit-eccless ${TARGET_TEST:b--test} ${HB_STANDALONE:b--hb-standalone} \ ${CONFIG_SECUREBOOT:b--secureboot} --systemBinFiles ${GEN_DEFAULT_BIN_FILES} \ --pnorLayout ${PNOR_LAYOUT} ${KEY_TRANSITION_PARAMS} ${CORRUPT_PARAMS} \ --hwKeyHashFile ${IMPRINT_HW_KEY_HASH} @@ -248,7 +248,7 @@ SBEC_FINAL_IMG = SBEC.bin # Paramemters passed into GEN_PNOR_IMAGE_SCRIPT. GEN_NIMBUS_BIN_FILES = ${NIMBUS}:SBE=${${NIMBUS_SBE_IMG}:P},HCODE=${${NIMBUS_HCODE_IMG}:P},OCC=${${NIMBUS_OCC_IMG}:P},HBD=${${NIMBUS_HBD_IMG}:P} #@TODO RTC:163810 - Put SBEC back "--systemBinFile SBEC=${${SBEC_IMG}:P}" - SYSTEM_SPECIFIC_PARAMS = --install-all ${TARGET_TEST:b--test} ${CONFIG_SECUREBOOT:b--secureboot} \ + SYSTEM_SPECIFIC_PARAMS = --install-all --emit-eccless ${TARGET_TEST:b--test} ${CONFIG_SECUREBOOT:b--secureboot} \ --pnorLayout ${PNOR_LAYOUT} ${CORRUPT_PARAMS} ${HB_STANDALONE:b--hb-standalone} \ --systemBinFiles ${GEN_NIMBUS_BIN_FILES} --hwKeyHashFile ${IMPRINT_HW_KEY_HASH} .else |