summaryrefslogtreecommitdiffstats
path: root/src/build/buildpnor
diff options
context:
space:
mode:
authorAdam Muhle <armuhle@us.ibm.com>2012-07-10 15:33:12 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-11 16:52:40 -0500
commitf02a3cb65a7a4ddab5d05f868672d429113feca8 (patch)
tree71bf14a0668407988be006b032d12952fcf3ff47 /src/build/buildpnor
parent9398c435a50ee505c6d09dcc64a76641bbca1342 (diff)
downloadtalos-hostboot-f02a3cb65a7a4ddab5d05f868672d429113feca8.tar.gz
talos-hostboot-f02a3cb65a7a4ddab5d05f868672d429113feca8.zip
Change PNORDD test cases to use test section of PNOR
Updated the PNOR Device Driver test cases to use a specially created test section of PNOR. The test cases will only run if the TEST section exists. Disabled the fake-pnor related test cases as the test section offset does not exist in the fake-pnor address space. Opened a story to fix this later. Change-Id: I1b5fd4989ee775c14034430226d9ffe844995f96 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1335 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/buildpnor')
-rwxr-xr-xsrc/build/buildpnor/buildpnor.pl38
-rw-r--r--src/build/buildpnor/makefile16
-rw-r--r--src/build/buildpnor/pnorLayout.xml14
3 files changed, 47 insertions, 21 deletions
diff --git a/src/build/buildpnor/buildpnor.pl b/src/build/buildpnor/buildpnor.pl
index b582822ba..94c0036d0 100755
--- a/src/build/buildpnor/buildpnor.pl
+++ b/src/build/buildpnor/buildpnor.pl
@@ -43,7 +43,7 @@ $XML::Simple::PREFERRED_PARSER = 'XML::Parser';
my $TRAC_ERR = 0;
# 0=errors, >0 for more traces, leaving at 1 to keep key milestone traces.
-my $g_trace = 1;
+my $g_trace = 1;
my $programName = File::Basename::basename $0;
my %tocLayout;
@@ -56,6 +56,7 @@ my $pnorBinName = "";
my $tocVersion = 0x1;
my $genTocFlag = 0;
my $g_TOCEyeCatch = "part";
+my $emitTestSections = 0;
if ($#ARGV < 0) {
usage();
@@ -90,6 +91,9 @@ for (my $i=0; $i < $#ARGV + 1; $i++)
my $argVal = $ARGV[++$i];
saveInputFile("--binFile", $argName, $argVal, \%binFiles);
}
+ elsif($ARGV[$i] =~ /--test/) {
+ $emitTestSections = 1;
+ }
else {
traceErr("Unrecognized Input: $ARGV[$i]");
exit 1;
@@ -188,7 +192,7 @@ sub loadPnorLayout
{
traceErr("$this_func: File not found: $i_pnorFile");
return -1;
- }
+ }
#parse the input XML file
my $xs = new XML::Simple(keyattr=>[], forcearray => 1);
@@ -226,6 +230,11 @@ sub loadPnorLayout
my $source = $sectionEl->{source}[0];
my $sideless = $sectionEl->{sideless}[0];
+ if (($emitTestSections == 0) && ($sectionEl->{testonly}[0] eq "yes"))
+ {
+ next;
+ }
+
my $actualRegionSize = 0;
if(exists($sectionEl->{actualRegionSize}[0]))
{
@@ -272,8 +281,8 @@ sub genToc
#Insert FFS Header data
#HEADER WORD 1: Magic Number - "PART" in ASCII
- my @charArray = split //, 'PART';
- my $curChar;
+ my @charArray = split //, 'PART';
+ my $curChar;
foreach $curChar (@charArray)
{
print $FILEHANDLE pack('C', ord($curChar));
@@ -433,7 +442,7 @@ sub genToc
{
insertPadBytes($FILEHANDLE, 4);
}
-
+
#FFS User Word 2-3: Miscellaneous information.
#User Word 2, bit 18 indicates sideless.
my $miscInfo = 0x00000000;
@@ -451,7 +460,7 @@ sub genToc
#FFS Entry Word 31: Checksum - not currently implemented
insertPadBytes($FILEHANDLE, 4);
-
+
}
return 0;
@@ -486,7 +495,7 @@ sub fillTocActSize
{
$size=$size*(9/8);
}
-
+
trace(2, "$this_func: PNOR FFS contains $recordCount records, total Size=$size");
$$i_pnorLayoutRef{sections}{$tocLayoutKey}{actualRegionSize}=$size;
@@ -557,7 +566,7 @@ sub findLayoutKeyByEyeCatch
last;
}
}
-
+
return $layoutKey;
}
@@ -694,8 +703,8 @@ sub assemblePnorImage
trace(1, "$this_func: populating section $eyeCatch, filename=$if");
# my $ddCmd = `dd if=$if ibs=8c of=$i_pnorBinName obs=8c seek=$physicalOffset`;
my $ddCmd = `dd if=$if ibs=1b of=$i_pnorBinName obs=1b seek=$blockSeek conv=notrunc`;
-
-
+
+
}
@@ -722,7 +731,7 @@ sub saveInputFile
#no return code expected
}
-
+
#################################################
# getFFSEntrySize: Returns number of bytes in an ffs_entry based on specified version
#################################################
@@ -735,7 +744,7 @@ sub getFFSEntrySize
if($i_tocVersion == 0x1)
{
#16 char name + 12 fixed words + 16 user data words
- $ffsEntrySize = 16+(12*4)+(16*4);
+ $ffsEntrySize = 16+(12*4)+(16*4);
}
else
{
@@ -747,7 +756,7 @@ sub getFFSEntrySize
#################################################
# Insert specifed number of pad bytes into file
-#
+#
#################################################
sub insertPadBytes
{
@@ -822,7 +831,7 @@ print <<"ENDUSAGE";
-h Print this help text
--pnorlayout <file> PNOR Layout XML file
--pnorOutBin <file> Name of output file for PNOR Binary
- --genToc Indicates you wish to generate a table of contents. It will
+ --genToc Indicates you wish to generate a table of contents. It will
write the file indicated by --binFile_TOC.
--binFile_<Section> <file> This is a special paramater. It is used to specify
@@ -833,6 +842,7 @@ print <<"ENDUSAGE";
--binFile_TOC murano.toc
A section declared as Blank in the XML does not need to have a
binFile specified
+ --test Output test-only sections.
Current Limitations:
--TOC Records must be 4 or 8 bytes in length
diff --git a/src/build/buildpnor/makefile b/src/build/buildpnor/makefile
index 2696a417a..0c8a94a09 100644
--- a/src/build/buildpnor/makefile
+++ b/src/build/buildpnor/makefile
@@ -34,6 +34,7 @@ ROOTPATH = ../../..
PNOR_TARGETS = simics_MURANO simics_VENICE TULETA
PNOR_VBU_TARGETS = vbu
+#Murano/Venice IPL PNOR images
define PNOR_template
$${IMGDIR}/$(1).pnor: $${IMGDIR}/hbicore_extended.bin $${IMGDIR}/$(1)_targeting.bin
./buildpnor.pl --pnorLayout ./pnorLayout.xml \
@@ -44,12 +45,14 @@ $${IMGDIR}/$(1).pnor: $${IMGDIR}/hbicore_extended.bin $${IMGDIR}/$(1)_targeting.
--binFile_HBD $${IMGDIR}/$(1)_targeting.bin \
--binFile_HBB $${IMGDIR}/hbicore.bin
endef
+
+#Murano/Venice Test case Pnor Image
define PNOR_test_template
$${IMGDIR}/$(1)_test.pnor: $${IMGDIR}/hbicore_extended.bin $${IMGDIR}/$(1)_targeting.bin
- ./buildpnor.pl --pnorLayout ./pnorLayout.xml \
+ ./buildpnor.pl --pnorLayout ./pnorLayout.xml --test \
--genToc \
--pnorOutBin $${IMGDIR}/$(1)_test.pnor \
- --binFile_part $${IMGDIR}/$(1)_pnor.toc \
+ --binFile_part $${IMGDIR}/$(1)_test_pnor.toc \
--binFile_HBI $${IMGDIR}/hbicore_test_extended.bin \
--binFile_HBD $${IMGDIR}/$(1)_targeting.bin \
--binFile_HBB $${IMGDIR}/hbicore_test.bin
@@ -66,10 +69,10 @@ $${IMGDIR}/$(1).pnor: $${IMGDIR}/hbicore_extended.bin $${IMGDIR}/$(1)_targeting.
endef
define PNOR_vbu_test_template
$${IMGDIR}/$(1)_test.pnor: $${IMGDIR}/hbicore_extended.bin $${IMGDIR}/$(1)_targeting.bin
- ./buildpnor.pl --pnorLayout ./pnorLayoutVpo.xml \
+ ./buildpnor.pl --pnorLayout ./pnorLayoutVpo.xml --test \
--genToc \
--pnorOutBin $${IMGDIR}/$(1)_test.pnor \
- --binFile_part $${IMGDIR}/$(1)_pnor.toc \
+ --binFile_part $${IMGDIR}/$(1)_test_pnor.toc \
--binFile_HBI $${IMGDIR}/hbicore_test_extended.bin \
--binFile_HBD $${IMGDIR}/$(1)_targeting.bin
endef
@@ -78,13 +81,14 @@ PNOR_IMAGES = $(addsuffix .pnor, $(addprefix $(IMGDIR)/, ${PNOR_TARGETS})) \
$(addsuffix _test.pnor, $(addprefix $(IMGDIR)/, ${PNOR_TARGETS}))
PNOR_VBU_IMAGES = $(addsuffix .pnor, $(addprefix $(IMGDIR)/, ${PNOR_VBU_TARGETS})) \
- $(addsuffix .pnor, $(addprefix $(IMGDIR)/, ${PNOR_VBU_TARGETS})) \
+ $(addsuffix _test.pnor, $(addprefix $(IMGDIR)/, ${PNOR_VBU_TARGETS})) \
EXTRA_CLEAN = ${PNOR_IMAGES} ${PNOR_IMAGES:.pnor=_pnor.toc} ${PNOR_VBU_IMAGES} ${PNOR_VBU_IMAGES:.pnor=_pnor.toc}
include ${ROOTPATH}/config.mk
-buildpnor: ${PNOR_IMAGES}
+.PHONY: buildpnor
+buildpnor: ${PNOR_IMAGES} ${PNOR_VBU_IMAGES}
#Standard Images
$(foreach pnor,$(PNOR_TARGETS),$(eval $(call PNOR_template,$(pnor))))
diff --git a/src/build/buildpnor/pnorLayout.xml b/src/build/buildpnor/pnorLayout.xml
index 6fba782b4..f3bd5e59b 100644
--- a/src/build/buildpnor/pnorLayout.xml
+++ b/src/build/buildpnor/pnorLayout.xml
@@ -72,7 +72,7 @@
<ecc>no</ecc>
<source>File</source>
<sideless>no</sideless>
- </section>
+ </section>
<section>
<description>Hostboot Base (512K)</description>
<eyeCatch>HBB</eyeCatch>
@@ -83,4 +83,16 @@
<source>File</source>
<sideless>no</sideless>
</section>
+ <section>
+ <description>Special PNOR Test Space (32K)</description>
+ <eyeCatch>TEST</eyeCatch>
+ <physicalOffset>0x441000</physicalOffset>
+ <physicalRegionSize>0x8000</physicalRegionSize>
+ <actualRegionSize>0x8000</actualRegionSize>
+ <ecc>no</ecc>
+ <source>Blank</source>
+ <sideless>no</sideless>
+ <testonly>yes</testonly>
+ </section>
+
</pnor>
OpenPOWER on IntegriCloud