summaryrefslogtreecommitdiffstats
path: root/src/build/buildpnor/PnorUtils.pm
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2019-12-10 16:40:44 -0600
committerNicholas E Bofferding <bofferdn@us.ibm.com>2020-01-10 15:18:32 -0600
commitc6aaded090e34c4da293d118205f7de18421b161 (patch)
treef7bd15e88d61fc9b66434401f34b9f8ba00ce141 /src/build/buildpnor/PnorUtils.pm
parent45cb275198bbb6bd2bbd25ec9eaa4a40dbdfeb86 (diff)
downloadtalos-hostboot-c6aaded090e34c4da293d118205f7de18421b161.tar.gz
talos-hostboot-c6aaded090e34c4da293d118205f7de18421b161.zip
Support for ATTR_TMP and GUARD in standalone simics
If a file called ATTR_TMP or GUARD exists in the simics search path, they will be automatically loaded into pnor when simics starts. The offset is computed when the pnor is built by way of a generated python file that we then load into simics. Change-Id: I4d68215a589dcbdaefb2a67e65d1f6928ce639fa Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/88398 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Luis P Fernandez <luis.fernandez@ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/build/buildpnor/PnorUtils.pm')
-rw-r--r--src/build/buildpnor/PnorUtils.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/build/buildpnor/PnorUtils.pm b/src/build/buildpnor/PnorUtils.pm
index c889893e2..e5ecbb150 100644
--- a/src/build/buildpnor/PnorUtils.pm
+++ b/src/build/buildpnor/PnorUtils.pm
@@ -274,6 +274,22 @@ sub loadPnorLayout
my $err = $@;
die "ERROR: $this_func: Failed to create new XML file with corrected offsets, error = $err";
};
+
+ # Write out a helper file for our simics scripts
+ print "\nlocation = " . ${i_outputLayoutLocation} . "\n";
+ my $simfilename = "${i_outputLayoutLocation}/simpnor.py";
+ open(SIM_FILE,'>',$simfilename) or die("($simfilename) could not be opened.");
+ print SIM_FILE "def hb_get_pnor_offset(partname):\n";
+ print SIM_FILE " toc_dict={}\n";
+ #Iterate over the <section> elements.
+ foreach my $sectionEl (@{$xml->{section}})
+ {
+ my $eyeCatch = $sectionEl->{eyeCatch}[0];
+ my $physicalOffset = $sectionEl->{physicalOffset}[0];
+ print SIM_FILE " toc_dict[\"$eyeCatch\"]=$physicalOffset\n";
+ }
+ print SIM_FILE " return toc_dict[partname]\n";
+ close SIM_FILE;
}
return 0;
OpenPOWER on IntegriCloud