summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCamVan Nguyen <ctnguyen@us.ibm.com>2012-09-04 16:02:18 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-09-05 14:48:14 -0500
commit53643b771cfa77708539de18b5fc9a2a4b19a141 (patch)
tree1c8d8335aa80d8cbbed43b45bb7a4f36fda0b1d3 /src
parentd94559078015ade8301370c54ccd8773f666fec1 (diff)
downloadtalos-hostboot-53643b771cfa77708539de18b5fc9a2a4b19a141.tar.gz
talos-hostboot-53643b771cfa77708539de18b5fc9a2a4b19a141.zip
Remove common code dependency on FAPI in FSP.
This is the 1st part of a 2-step code drop: 1. Hostboot change: Change perl script to skip validation against FAPI attributes if no fapi attribute xml file is passed in. 2. FSP change: Change makefile to not pass in a fapi attribute xml file. Change-Id: I4806310a7e10409d3685bb6e32f6930235f37e73 RTC: 45563 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1676 Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/xmltohb.pl138
1 files changed, 85 insertions, 53 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl
index a5458a8c7..1128e4f65 100755
--- a/src/usr/targeting/common/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/common/xmltohb/xmltohb.pl
@@ -121,8 +121,12 @@ my $xml = new XML::Simple (KeyAttr=>[]);
# Aborts application if file name not found.
my $attributes = $xml->XMLin($cfgHbXmlFile,
forcearray => ['enumerationType','attribute','hwpfToHbAttrMap']);
-my $fapiAttributes = $xml->XMLin($cfgFapiAttributesXmlFile,
- forcearray => ['attribute']);
+my $fapiAttributes = {};
+if ($cfgFapiAttributesXmlFile ne "")
+{
+ $fapiAttributes = $xml->XMLin($cfgFapiAttributesXmlFile,
+ forcearray => ['attribute']);
+}
# save attributes defined as Target_t type
my %Target_t = ();
@@ -525,47 +529,9 @@ sub writeFapiPlatAttrMacrosHeaderFileContent {
my $fapiWriteable = 0;
my $instantiated = 0;
- foreach my $fapiAttr (@{$fapiAttributes->{attribute}})
- {
- if( (exists $fapiAttr->{id})
- && ($fapiAttr->{id} eq $hwpfToHbAttrMap->{id}) )
- {
- # Check that non-platInit attributes are in the
- # volatile-zeroed section and have a direct mapping
- if (! exists $fapiAttr->{platInit})
- {
- if ($hwpfToHbAttrMap->{macro} ne "DIRECT")
- {
- fatal("FAPI non-platInit attr " .
- "'$hwpfToHbAttrMap->{id}' is " .
- "'$hwpfToHbAttrMap->{macro}', " .
- "it must be DIRECT");
- }
-
- if ($attribute->{persistency} ne "volatile-zeroed")
- {
- fatal("FAPI non-platInit attr " .
- "'$hwpfToHbAttrMap->{id}' is " .
- "'$attribute->{persistency}', " .
- "it must be volatile-zeroed");
- }
-
- }
-
- # All FAPI attributes are readable
- $fapiReadable = 1;
-
- if(exists $fapiAttr->{writeable})
- {
- $fapiWriteable = 1;
- }
-
- last;
- }
- }
-
- if($fapiReadable)
+ if ($cfgFapiAttributesXmlFile eq "")
{
+ #No FAPI attributes xml file specified
if(exists $attribute->{readable})
{
$macroSection .= ' #define ' . $hwpfToHbAttrMap->{id} .
@@ -574,27 +540,93 @@ sub writeFapiPlatAttrMacrosHeaderFileContent {
$hwpfToHbAttrMap->{macro} . "(ID,PTARGET,VAL)\n";
$instantiated = 1;
}
- else
- {
- fatal("FAPI attribute $hwpfToHbAttrMap->{id} requires " .
- "platform supply readable attribute.");
- }
- }
- if($fapiWriteable)
- {
if(exists $attribute->{writeable})
{
+ $macroSection .= ' #ifndef ' . $hwpfToHbAttrMap->{id} .
+ "_SETMACRO\n";
$macroSection .= ' #define ' . $hwpfToHbAttrMap->{id} .
"_SETMACRO(ID,PTARGET,VAL) \\\n" .
" FAPI_PLAT_ATTR_SVC_SETMACRO_" .
$hwpfToHbAttrMap->{macro} . "(ID,PTARGET,VAL)\n";
+ $macroSection .= " #endif\n";
$instantiated = 1;
}
- else
+ }
+ else
+ {
+ #FAPI attribute xml file specified - validate against FAPI attrs
+ foreach my $fapiAttr (@{$fapiAttributes->{attribute}})
+ {
+ if( (exists $fapiAttr->{id})
+ && ($fapiAttr->{id} eq $hwpfToHbAttrMap->{id}) )
+ {
+ # Check that non-platInit attributes are in the
+ # volatile-zeroed section and have a direct mapping
+ if (! exists $fapiAttr->{platInit})
+ {
+ if ($hwpfToHbAttrMap->{macro} ne "DIRECT")
+ {
+ fatal("FAPI non-platInit attr " .
+ "'$hwpfToHbAttrMap->{id}' is " .
+ "'$hwpfToHbAttrMap->{macro}', " .
+ "it must be DIRECT");
+ }
+
+ if ($attribute->{persistency} ne "volatile-zeroed")
+ {
+ fatal("FAPI non-platInit attr " .
+ "'$hwpfToHbAttrMap->{id}' is " .
+ "'$attribute->{persistency}', " .
+ "it must be volatile-zeroed");
+ }
+
+ }
+
+ # All FAPI attributes are readable
+ $fapiReadable = 1;
+
+ if(exists $fapiAttr->{writeable})
+ {
+ $fapiWriteable = 1;
+ }
+
+ last;
+ }
+ }
+
+ if($fapiReadable)
+ {
+ if(exists $attribute->{readable})
+ {
+ $macroSection .= ' #define ' . $hwpfToHbAttrMap->{id} .
+ "_GETMACRO(ID,PTARGET,VAL) \\\n" .
+ " FAPI_PLAT_ATTR_SVC_GETMACRO_" .
+ $hwpfToHbAttrMap->{macro} . "(ID,PTARGET,VAL)\n";
+ $instantiated = 1;
+ }
+ else
+ {
+ fatal("FAPI attribute $hwpfToHbAttrMap->{id} requires " .
+ "platform supply readable attribute.");
+ }
+ }
+
+ if($fapiWriteable)
{
- fatal("FAPI attribute $hwpfToHbAttrMap->{id} requires "
- . "platform supply writeable attribute.");
+ if(exists $attribute->{writeable})
+ {
+ $macroSection .= ' #define ' . $hwpfToHbAttrMap->{id} .
+ "_SETMACRO(ID,PTARGET,VAL) \\\n" .
+ " FAPI_PLAT_ATTR_SVC_SETMACRO_" .
+ $hwpfToHbAttrMap->{macro} . "(ID,PTARGET,VAL)\n";
+ $instantiated = 1;
+ }
+ else
+ {
+ fatal("FAPI attribute $hwpfToHbAttrMap->{id} requires "
+ . "platform supply writeable attribute.");
+ }
}
}
OpenPOWER on IntegriCloud