summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/xmltohb/xmltohb.pl
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2011-09-27 09:51:50 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2011-10-14 13:33:32 -0500
commitd6ce3b30395982623494ad75c50e75c56fadcaca (patch)
tree82a38e66e28e7f824f597875f994c6b60efa6281 /src/usr/targeting/xmltohb/xmltohb.pl
parent17f630f5c2fabea998708dc2b2cb33120c388079 (diff)
downloadtalos-hostboot-d6ce3b30395982623494ad75c50e75c56fadcaca.tar.gz
talos-hostboot-d6ce3b30395982623494ad75c50e75c56fadcaca.zip
Pull FSI data from real attributes (Task 3909).
There are a group of attributes defined for FSI now. -ATTR_FSI_MASTER_CHIP -ATTR_FSI_MASTER_TYPE -ATTR_FSI_MASTER_PORT -ATTR_FSI_SLAVE_CASCADE -ATTR_FSI_OPTION_FLAGS Also includes work for Story 3996. The attributes are now broken into 3 distinct pieces: - attribute_types.xml : defines hostboot attributes - target_types.xml : defines different types of targets - XXX.system.xml : system-specific information, equivalent to what we'll get from system workbook These are then used to generic system-specific binaries, currently for 3 platforms: - simics_SALERNO_targeting.bin - simics_VENICE_targeting.bin - vbu_targeting.bin Change-Id: I2bf920cc62cceb761ab44a07df433da44249d0e0 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/426 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/xmltohb/xmltohb.pl')
-rwxr-xr-xsrc/usr/targeting/xmltohb/xmltohb.pl146
1 files changed, 77 insertions, 69 deletions
diff --git a/src/usr/targeting/xmltohb/xmltohb.pl b/src/usr/targeting/xmltohb/xmltohb.pl
index 37902a007..db866fbb3 100755
--- a/src/usr/targeting/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/xmltohb/xmltohb.pl
@@ -55,6 +55,7 @@ my $cfgSrcOutputDir = ".";
my $cfgImgOutputDir = ".";
my $cfgHbXmlFile = "./hb.xml";
my $cfgFapiAttributesXmlFile = "../../hwpf/hwp/fapiHwpAttributeInfo.xml";
+my $cfgImgOutputFile = "./targeting.bin";
my $cfgHelp = 0;
my $cfgMan = 0;
my $cfgVerbose = 0;
@@ -63,6 +64,7 @@ GetOptions("hb-xml-file:s" => \$cfgHbXmlFile,
"src-output-dir:s" => \$cfgSrcOutputDir,
"img-output-dir:s" => \$cfgImgOutputDir,
"fapi-attributes-xml-file:s" => \$cfgFapiAttributesXmlFile,
+ "img-output-file:s" => \$cfgImgOutputFile,
"help" => \$cfgHelp,
"man" => \$cfgMan,
"verbose" => \$cfgVerbose ) || pod2usage(-verbose => 0);
@@ -107,74 +109,80 @@ validateTargetInstances($attributes);
validateTargetTypes($attributes);
# Open the output files and write them
-open(TRAIT_FILE,">$cfgSrcOutputDir"."attributetraits.H")
- or fatal ("Trait file: \"$cfgSrcOutputDir"
- . "attributetraits.H\" could not be opened.");
-my $traitFile = *TRAIT_FILE;
-writeTraitFileHeader($traitFile);
-writeTraitFileTraits($attributes,$traitFile);
-writeTraitFileFooter($traitFile);
-close $traitFile;
-
-open(ATTR_FILE,">$cfgSrcOutputDir"."attributeenums.H")
- or fatal ("Attribute enum file: \"$cfgSrcOutputDir"
- . "attributeenums.H\" could not be opened.");
-my $enumFile = *ATTR_FILE;
-writeEnumFileHeader($enumFile);
-writeEnumFileAttrIdEnum($attributes,$enumFile);
-writeEnumFileAttrEnums($attributes,$enumFile);
-writeEnumFileFooter($enumFile);
-close $enumFile;
-
-open(STRING_HEADER_FILE,">$cfgSrcOutputDir"."attributestrings.H")
- or fatal ("Attribute string header file: \"$cfgSrcOutputDir"
- . "attributestrings.H\" could not be opened.");
-my $stringHeaderFile = *STRING_HEADER_FILE;
-writeStringHeaderFileHeader($stringHeaderFile);
-writeStringHeaderFileStrings($attributes,$stringHeaderFile);
-writeStringHeaderFileFooter($stringHeaderFile);
-close $stringHeaderFile;
-
-open(STRING_IMPLEMENTATION_FILE,">$cfgSrcOutputDir"."attributestrings.C")
- or fatal ("Attribute string source file: \"$cfgSrcOutputDir"
- . "attributestrings.C\" could not be opened.");
-my $stringImplementationFile = *STRING_IMPLEMENTATION_FILE;
-writeStringImplementationFileHeader($stringImplementationFile);
-writeStringImplementationFileStrings($attributes,$stringImplementationFile);
-writeStringImplementationFileFooter($stringImplementationFile);
-close $stringImplementationFile;
-
-open(STRUCTS_HEADER_FILE,">$cfgSrcOutputDir"."attributestructs.H")
- or fatal ("Attribute struct file: \"$cfgSrcOutputDir"
- . "attributestructs.H\" could not be opened.");
-my $structFile = *STRUCTS_HEADER_FILE;
-writeStructFileHeader($structFile);
-writeStructFileStructs($attributes,$structFile);
-writeStructFileFooter($structFile);
-close $structFile;
-
-open(PNOR_HEADER_DEF_FILE,">$cfgSrcOutputDir"."pnortargeting.H")
- or fatal ("Targeting header definition header file: \"$cfgSrcOutputDir"
- . "pnortargeting.H\" could not be opened.");
-my $pnorHeaderDefFile = *PNOR_HEADER_DEF_FILE;
-writeHeaderFormatHeaderFile($pnorHeaderDefFile);
-close $pnorHeaderDefFile;
-
-open(FAPI_PLAT_ATTR_MACROS_FILE,">$cfgSrcOutputDir"."fapiplatattrmacros.H")
- or fatal ("FAPI platform attribute macro header file: \"$cfgSrcOutputDir"
- . "fapiplatattrmacros.H\" could not be opened.");
-my $fapiPlatAttrMacrosHeaderFile = *FAPI_PLAT_ATTR_MACROS_FILE;
-writeFapiPlatAttrMacrosHeaderFileHeader ($fapiPlatAttrMacrosHeaderFile);
-writeFapiPlatAttrMacrosHeaderFileContent($attributes,$fapiAttributes,$fapiPlatAttrMacrosHeaderFile);
-writeFapiPlatAttrMacrosHeaderFileFooter ($fapiPlatAttrMacrosHeaderFile);
-close $fapiPlatAttrMacrosHeaderFile;
-
-open(PNOR_TARGETING_FILE,">$cfgImgOutputDir"."targeting.bin")
- or fatal ("Targeting image file: \"$cfgSrcOutputDir"
- . "targeting.bin\" could not be opened.");
-my $pnorFile = *PNOR_TARGETING_FILE;
-writeTargetingImage($pnorFile,$attributes);
-close $pnorFile;
+if( !($cfgSrcOutputDir =~ "none") )
+{
+ open(TRAIT_FILE,">$cfgSrcOutputDir"."attributetraits.H")
+ or fatal ("Trait file: \"$cfgSrcOutputDir"
+ . "attributetraits.H\" could not be opened.");
+ my $traitFile = *TRAIT_FILE;
+ writeTraitFileHeader($traitFile);
+ writeTraitFileTraits($attributes,$traitFile);
+ writeTraitFileFooter($traitFile);
+ close $traitFile;
+
+ open(ATTR_FILE,">$cfgSrcOutputDir"."attributeenums.H")
+ or fatal ("Attribute enum file: \"$cfgSrcOutputDir"
+ . "attributeenums.H\" could not be opened.");
+ my $enumFile = *ATTR_FILE;
+ writeEnumFileHeader($enumFile);
+ writeEnumFileAttrIdEnum($attributes,$enumFile);
+ writeEnumFileAttrEnums($attributes,$enumFile);
+ writeEnumFileFooter($enumFile);
+ close $enumFile;
+
+ open(STRING_HEADER_FILE,">$cfgSrcOutputDir"."attributestrings.H")
+ or fatal ("Attribute string header file: \"$cfgSrcOutputDir"
+ . "attributestrings.H\" could not be opened.");
+ my $stringHeaderFile = *STRING_HEADER_FILE;
+ writeStringHeaderFileHeader($stringHeaderFile);
+ writeStringHeaderFileStrings($attributes,$stringHeaderFile);
+ writeStringHeaderFileFooter($stringHeaderFile);
+ close $stringHeaderFile;
+
+ open(STRING_IMPLEMENTATION_FILE,">$cfgSrcOutputDir"."attributestrings.C")
+ or fatal ("Attribute string source file: \"$cfgSrcOutputDir"
+ . "attributestrings.C\" could not be opened.");
+ my $stringImplementationFile = *STRING_IMPLEMENTATION_FILE;
+ writeStringImplementationFileHeader($stringImplementationFile);
+ writeStringImplementationFileStrings($attributes,$stringImplementationFile);
+ writeStringImplementationFileFooter($stringImplementationFile);
+ close $stringImplementationFile;
+
+ open(STRUCTS_HEADER_FILE,">$cfgSrcOutputDir"."attributestructs.H")
+ or fatal ("Attribute struct file: \"$cfgSrcOutputDir"
+ . "attributestructs.H\" could not be opened.");
+ my $structFile = *STRUCTS_HEADER_FILE;
+ writeStructFileHeader($structFile);
+ writeStructFileStructs($attributes,$structFile);
+ writeStructFileFooter($structFile);
+ close $structFile;
+
+ open(PNOR_HEADER_DEF_FILE,">$cfgSrcOutputDir"."pnortargeting.H")
+ or fatal ("Targeting header definition header file: \"$cfgSrcOutputDir"
+ . "pnortargeting.H\" could not be opened.");
+ my $pnorHeaderDefFile = *PNOR_HEADER_DEF_FILE;
+ writeHeaderFormatHeaderFile($pnorHeaderDefFile);
+ close $pnorHeaderDefFile;
+
+ open(FAPI_PLAT_ATTR_MACROS_FILE,">$cfgSrcOutputDir"."fapiplatattrmacros.H")
+ or fatal ("FAPI platform attribute macro header file: \"$cfgSrcOutputDir"
+ . "fapiplatattrmacros.H\" could not be opened.");
+ my $fapiPlatAttrMacrosHeaderFile = *FAPI_PLAT_ATTR_MACROS_FILE;
+ writeFapiPlatAttrMacrosHeaderFileHeader ($fapiPlatAttrMacrosHeaderFile);
+ writeFapiPlatAttrMacrosHeaderFileContent($attributes,$fapiAttributes,$fapiPlatAttrMacrosHeaderFile);
+ writeFapiPlatAttrMacrosHeaderFileFooter ($fapiPlatAttrMacrosHeaderFile);
+ close $fapiPlatAttrMacrosHeaderFile;
+}
+
+if( !($cfgImgOutputDir =~ "none") )
+{
+ open(PNOR_TARGETING_FILE,">$cfgImgOutputDir".$cfgImgOutputFile)
+ or fatal ("Targeting image file: \"$cfgImgOutputDir"
+ . "$cfgImgOutputFile\" could not be opened.");
+ my $pnorFile = *PNOR_TARGETING_FILE;
+ writeTargetingImage($pnorFile,$attributes);
+ close $pnorFile;
+}
exit(0);
@@ -1396,7 +1404,7 @@ sub simpleTypeProperties {
# Intentionally didn't wrap these to 80 columns to keep them lined up and
# more readable/editable
$typesHoH{"uint8_t"} = { supportsArray => 1, canBeHex => 1, complexTypeSupport => 1, typeName => "uint8_t" , bytes => 1, bits => 8 , packfmt => "C" };
- $typesHoH{"uint16_t"} = { supportsArray => 1, canBeHex => 1, complexTypeSupport => 1, typeName => "uint16t" , bytes => 2, bits => 16, packfmt => "S" };
+ $typesHoH{"uint16_t"} = { supportsArray => 1, canBeHex => 1, complexTypeSupport => 1, typeName => "uint16_t" , bytes => 2, bits => 16, packfmt => "S" };
$typesHoH{"uint32_t"} = { supportsArray => 1, canBeHex => 1, complexTypeSupport => 1, typeName => "uint32_t" , bytes => 4, bits => 32, packfmt => "L" };
$typesHoH{"uint64_t"} = { supportsArray => 1, canBeHex => 1, complexTypeSupport => 1, typeName => "uint64_t" , bytes => 8, bits => 64, packfmt =>\&packQuad };
$typesHoH{"enumeration"} = { supportsArray => 1, canBeHex => 1, complexTypeSupport => 0, typeName => "XMLTOHB_USE_PARENT_ATTR_ID" , bytes => 0, bits => 0 , packfmt => "packEnumeration" };
OpenPOWER on IntegriCloud