summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2015-09-23 12:49:36 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-09-29 13:35:16 -0500
commitab89379aa0c4e7ceeae91f6c729cd7d120379dd5 (patch)
treeca4efeb539023a621aab7f93d031369e9ffc8cd2 /src
parent4fab389f133585edd833edd0aeb31f6957432f47 (diff)
downloadblackbird-hostboot-ab89379aa0c4e7ceeae91f6c729cd7d120379dd5.tar.gz
blackbird-hostboot-ab89379aa0c4e7ceeae91f6c729cd7d120379dd5.zip
Allow dynamic sizing of HBI when test cases are run
Change-Id: I30947cb19125e616c57af89434acd8a9811b1a74 RTC:135217 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20735 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Reviewed-by: Thi N. Tran <thi@us.ibm.com> Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Christopher J. Engel <cjengel@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/build/buildpnor/buildpnor.pl62
-rwxr-xr-xsrc/build/citest/autocitest6
-rwxr-xr-xsrc/build/citest/setup-env2
-rwxr-xr-xsrc/build/mkrules/hbfw/img/makefile27
-rw-r--r--src/makefile6
5 files changed, 76 insertions, 27 deletions
diff --git a/src/build/buildpnor/buildpnor.pl b/src/build/buildpnor/buildpnor.pl
index 1a18f2dfd..722080aa6 100755
--- a/src/build/buildpnor/buildpnor.pl
+++ b/src/build/buildpnor/buildpnor.pl
@@ -67,7 +67,7 @@ my $pnorLayoutFile;
my $pnorBinName = "";
my $tocVersion = 0x1;
my $g_TOCEyeCatch = "part";
-my $emitTestSections = 0;
+my $testRun = 0;
my $g_fpartCmd = "";
my $g_fcpCmd = "";
my %sidelessSecFilled = ();
@@ -76,6 +76,7 @@ my %SideOptions = (
B => "B",
sideless => "sideless",
);
+use constant PAGE_SIZE => 4096;
if ($#ARGV < 0) {
usage();
@@ -113,7 +114,7 @@ for (my $i=0; $i < $#ARGV + 1; $i++)
$g_fcpCmd = $ARGV[++$i];
}
elsif($ARGV[$i] =~ /--test/) {
- $emitTestSections = 1;
+ $testRun = 1;
}
else {
traceErr("Unrecognized Input: $ARGV[$i]");
@@ -254,7 +255,7 @@ sub loadPnorLayout
my $sha512perEC = (exists $sectionEl->{sha512perEC} ? "yes" : "no");
my $preserved = (exists $sectionEl->{preserved} ? "yes" : "no");
my $readOnly = (exists $sectionEl->{readOnly} ? "yes" : "no");
- if (($emitTestSections == 0) && ($sectionEl->{testonly}[0] eq "yes"))
+ if (($testRun == 0) && ($sectionEl->{testonly}[0] eq "yes"))
{
next;
}
@@ -784,8 +785,19 @@ sub checkSpaceConstraints
if($filesize > $physicalRegionSize)
{
- trace(0, "$this_func: Image provided ($$i_binFiles{$eyeCatch}) has size ($filesize) which is greater than allocated space ($physicalRegionSize) for section=$eyeCatch. Aborting!");
- $rc = 1;
+ # If this is a test run increase HBI size by PAGE_SIZE until all test
+ # cases fit
+ if ($testRun && $eyeCatch eq "HBI")
+ {
+ print "Adjusting HBI size - ran out of space for test cases\n";
+ my $hbbKey = findLayoutKeyByEyeCatch("HBB", \%$i_pnorLayoutRef);
+ adjustHbiPhysSize(\%sectionHash, $layoutKey, $filesize, $hbbKey);
+ }
+ else
+ {
+ trace(0, "$this_func: Image provided ($$i_binFiles{$eyeCatch}) has size ($filesize) which is greater than allocated space ($physicalRegionSize) for section=$eyeCatch. Aborting!");
+ $rc = 1;
+ }
}
}
@@ -793,6 +805,46 @@ sub checkSpaceConstraints
return $rc;
}
+###############################################################################
+# adjustHbiPhysSize - Adjust HBI physical size when running test cases and fix
+# up physical offsets of partitions between HBI and HBB
+################################################################################
+sub adjustHbiPhysSize
+{
+ my ($i_sectionHashRef, $i_hbiKey, $i_filesize, $i_hbbKey) = @_;
+
+ my %sectionHash = %$i_sectionHashRef;
+
+ # Increment HBI physical size by PAGE_SIZE until the HBI file can fit
+ my $hbi_old = $sectionHash{$i_hbiKey}{physicalRegionSize};
+ while ($i_filesize > $sectionHash{$i_hbiKey}{physicalRegionSize})
+ {
+ $sectionHash{$i_hbiKey}{physicalRegionSize} += PAGE_SIZE;
+ }
+ my $hbi_move = $sectionHash{$i_hbiKey}{physicalRegionSize} - $hbi_old;
+ my $hbi_end = $sectionHash{$i_hbiKey}{physicalRegionSize} + $hbi_move;
+
+ # Fix up physical offset affected by HBI size change
+ foreach my $section (keys %sectionHash)
+ {
+ # Only fix partitions after HBI and before HBB
+ if ( ( $sectionHash{$section}{physicalOffset} >
+ $sectionHash{$i_hbiKey}{physicalOffset} ) &&
+ ( $sectionHash{$section}{physicalOffset} <
+ $sectionHash{$i_hbbKey}{physicalOffset} )
+ )
+ {
+ $sectionHash{$section}{physicalOffset} += $hbi_move;
+ # Ensure section adjustment does not cause an overlap with HBB
+ if ($sectionHash{$section}{physicalOffset} >
+ $sectionHash{$i_hbbKey}{physicalOffset})
+ {
+ die "Error detected $sectionHash{$section}{eyeCatch}'s adjusted size overlaps HBB";
+ }
+ }
+ }
+}
+
###############################################################################
# fillPnorImage - Load actual PNOR image with data using the provided input images
diff --git a/src/build/citest/autocitest b/src/build/citest/autocitest
index 922bd9627..f4b804ad0 100755
--- a/src/build/citest/autocitest
+++ b/src/build/citest/autocitest
@@ -270,7 +270,7 @@ modsstarted=0
modscompleted=0
loopcount=0
while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ]; do
- sleep 5
+ sleep 10
((loopcount++)) # increment loopcount
autosim $NOWIN --simcmd "print ((system_cmp0.phys_mem).read 0x$mods_completed_addr 0x08)" 1> $SBXHOME/modscompleted.log 2> /dev/null
modscompleted=`cat $SBXHOME/modscompleted.log | awk '/0x/ {print strtonum($1)}'`
@@ -279,8 +279,8 @@ while [ $(($modsstarted)) -lt 1 -o $(($modsstarted)) -ne $(($modscompleted)) ];
echo "ModulesStarted:ModulesCompleted => $modsstarted:$modscompleted"
- if [ "$loopcount" -gt 120 ]; then
- echo "ERROR: timed out after 10 minutes"
+ if [ "$loopcount" -gt 90 ]; then
+ echo "ERROR: timed out after 15 minutes"
autosim $NOWIN --simcmd "hb-Ps"
timeout=$(($modsstarted - $modscompleted))
break
diff --git a/src/build/citest/setup-env b/src/build/citest/setup-env
index f93eca19a..ddb46c241 100755
--- a/src/build/citest/setup-env
+++ b/src/build/citest/setup-env
@@ -29,6 +29,8 @@ export PATH=${CITESTPATH}:${PATH}
# Determine backing build.
export BACKING_BUILD=`cat ${CITESTPATH}/etc/bbuild`
+# Limit pnor image to be built to murano for standalone simics
+export PNOR=murano.pnor
# If we are running under Jenkins we need to pick a random-ish sandbox name
# so that the autoipl tools do not have a /tmp name collision.
diff --git a/src/build/mkrules/hbfw/img/makefile b/src/build/mkrules/hbfw/img/makefile
index 4598b3a27..6c4370b47 100755
--- a/src/build/mkrules/hbfw/img/makefile
+++ b/src/build/mkrules/hbfw/img/makefile
@@ -122,7 +122,14 @@ cp_hbfiles: .SPECTARG
dd if=${EXT_SHA_IMAGE} of=${TEMP_IMAGE} ibs=4k conv=sync
cat ${EXT_IMAGE} >> ${TEMP_IMAGE}
# HBI partition size w/o ECC = 5MB (5120K)
- dd if=${TEMP_IMAGE} of=${EXT_HEADER_IMAGE} ibs=5120k conv=sync
+ # If "--test" flag set do not pad to ibs=5120k, as the test HBI images is
+ # possibly larger than parition size and does not need to be fully padded.
+ # Size adjustments made in buildpnor.pl
+ .if($TARGET_TEST)
+ dd if=${TEMP_IMAGE} of=${EXT_HEADER_IMAGE} ibs=4k conv=sync
+ .else
+ dd if=${TEMP_IMAGE} of=${EXT_HEADER_IMAGE} ibs=5120k conv=sync
+ .endif
ecc --inject ${EXT_HEADER_IMAGE} --output ${EXT_ECC_HEADER_IMAGE} --p8
# create data for a test partition in pnor
dd if=/dev/urandom of=${TESTDATA} count=1 bs=32K
@@ -314,23 +321,13 @@ BUILD_SPECIFIC_IMAGE: .SPECTARG ${IMAGE_TARGET}
#@echo BINARIES ${IMAGE_BINS}
#@echo BIN_OPTION ${IMAGE_BIN_OPTION}
-FFSCMD = ${DUMMY:!which ffs 2>/dev/null!i}
${IMAGE_TARGET}: ${IMAGE_LAYOUT} ${IMAGE_BINS} ${PNOR_BUILD_SCRIPT}
- .if empty(FFSCMD)
- .if(${PNOR} == ${IMAGE_TARGET} || ${PNOR} == "")
- ${PNOR_BUILD_SCRIPT} --pnorOutBin ${IMAGE_TARGET} \
- ${TARGET_TEST:b--test} --pnorLayout ${IMAGE_LAYOUT} \
- ${IMAGE_BIN_OPTION} --fpartCmd "fpart" --fcpCmd "fcp"
- .endif
- .else
- .if(${PNOR} == ${IMAGE_TARGET})
- ${PNOR_BUILD_SCRIPT} --pnorOutBin ${IMAGE_TARGET} \
- ${TARGET_TEST:b--test} --pnorLayout ${IMAGE_LAYOUT} \
- ${IMAGE_BIN_OPTION} --ffsCmd "ffs"
- .endif
+ .if(${PNOR} == ${IMAGE_TARGET} || ${PNOR} == "")
+ ${PNOR_BUILD_SCRIPT} --pnorOutBin ${IMAGE_TARGET} \
+ ${TARGET_TEST:b--test} --pnorLayout ${IMAGE_LAYOUT} \
+ ${IMAGE_BIN_OPTION} --fpartCmd "fpart" --fcpCmd "fcp"
.endif
-
.endif
build_pnor_images:.SPECTARG ${PNOR_IMG_INFO:S/^/__IMAGE_BUILD\//g}
diff --git a/src/makefile b/src/makefile
index 3f5609455..87c20d06b 100644
--- a/src/makefile
+++ b/src/makefile
@@ -194,11 +194,9 @@ TESTCASE_MODULES += testvpd
TESTCASE_MODULES += testpore
TESTCASE_MODULES += testutil
TESTCASE_MODULES += testmbox
-#TODO: Need to re-enable testmdia (RTC 135217)
-#TESTCASE_MODULES += $(if $(CONFIG_VPO_COMPILE),,testmdia)
+TESTCASE_MODULES += $(if $(CONFIG_VPO_COMPILE),,testmdia)
TESTCASE_MODULES += testprdf
-#TODO: Need to re-enable testattn (RTC 135217)
-#TESTCASE_MODULES += testattn
+TESTCASE_MODULES += testattn
TESTCASE_MODULES += testscan
TESTCASE_MODULES += $(if $(CONFIG_VPO_COMPILE),,testruntime)
TESTCASE_MODULES += testibscom
OpenPOWER on IntegriCloud