diff options
author | crgeddes <crgeddes@us.ibm.com> | 2016-03-28 14:22:47 -0500 |
---|---|---|
committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-04-21 13:51:25 -0500 |
commit | 377b2e9e9315f1a4a90a879c652f4300d7f389d4 (patch) | |
tree | 78161ec90242fc9077ebd8c4119fc8beed3de53c | |
parent | 9f1deb3f591bb2010cf0ab320dfa23a1e4bec43d (diff) | |
download | talos-hostboot-377b2e9e9315f1a4a90a879c652f4300d7f389d4.tar.gz talos-hostboot-377b2e9e9315f1a4a90a879c652f4300d7f389d4.zip |
Use generated attribute CSV files in hbDistTargets
Change-Id: Id783767251213db7f155e7fd67e7d47af05f25ce
RTC: 142088
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22543
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
-rwxr-xr-x | src/build/debug/Hostboot/HwpfAttrOverride.pm | 22 | ||||
-rw-r--r-- | src/build/mkrules/dist.targets.mk | 16 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 225 |
3 files changed, 18 insertions, 245 deletions
diff --git a/src/build/debug/Hostboot/HwpfAttrOverride.pm b/src/build/debug/Hostboot/HwpfAttrOverride.pm index 904bdff25..5c6127e12 100755 --- a/src/build/debug/Hostboot/HwpfAttrOverride.pm +++ b/src/build/debug/Hostboot/HwpfAttrOverride.pm @@ -82,8 +82,8 @@ my $overrideSymbol = 'fapi2::g_attrOverride'; my $overrideFapiTankSymbol = 'fapi2::g_attrOverrideFapiTank'; # Expected filenames -my $fapiAttrInfoFileName = 'fapiAttrInfo.csv'; -my $fapiAttrEnumInfoFileName = 'fapiAttrEnumInfo.csv'; +my $fapiAttrInfoFileName = 'attrInfo.csv'; +my $fapiAttrEnumInfoFileName = 'attrEnumInfo.csv'; my $targAttrInfoFileName = 'targAttrInfo.csv'; my $overrideFileName = 'OverrideAttrs.txt'; @@ -118,16 +118,16 @@ sub main #-------------------------------------------------------------------------- my $overrideSymAddr = (::findSymbolAddress("$overrideSymbol"))[0]; - + if (not defined $overrideSymAddr) { ::userDisplay "Cannot find Hostboot symbol '$overrideSymbol'\n"; die; } - + my $overrideAddr = Hostboot::_DebugFrameworkVMM::getPhysicalAddr( $overrideSymAddr, $debug, 0); - + if ($overrideAddr eq Hostboot::_DebugFrameworkVMM::NotFound) { ::userDisplay "Cannot translate '$overrideSymbol' to a phys addr\n"; @@ -136,16 +136,16 @@ sub main #-------------------------------------------------------------------------- my $overrideFapiTankSymAddr = (::findSymbolAddress("$overrideFapiTankSymbol"))[0]; - + if (not defined $overrideFapiTankSymAddr) { ::userDisplay "Cannot find Hostboot symbol '$overrideFapiTankSymbol'\n"; die; } - + my $overrideFapiTankAddr = Hostboot::_DebugFrameworkVMM::getPhysicalAddr( $overrideFapiTankSymAddr, $debug, 0); - + if ($overrideFapiTankAddr eq Hostboot::_DebugFrameworkVMM::NotFound) { ::userDisplay "Cannot translate '$overrideFapiTankSymbol' to a phys addr\n"; @@ -276,10 +276,10 @@ sub main my $numOverrides = 0; my $attrString = ""; my @attrLines; - + #-------------------------------------------------------------------------- # Iterate over all lines in the Attribute Overrides file - #-------------------------------------------------------------------------- + #-------------------------------------------------------------------------- open(OVFILE, "< $overrideFile") or die "Cannot open file '$overrideFile'"; my $line = <OVFILE>; while ($line ne "") @@ -397,7 +397,7 @@ sub main else { ::userDisplay "Cannot find '$attrIdStr' in attribute info files\n"; - die; + die; } # Figure out the attribute element size diff --git a/src/build/mkrules/dist.targets.mk b/src/build/mkrules/dist.targets.mk index 8b8ace2d4..8bf53fc70 100644 --- a/src/build/mkrules/dist.targets.mk +++ b/src/build/mkrules/dist.targets.mk @@ -66,8 +66,8 @@ COPY_FILES = \ img/procmvpd.dat:vpo \ img/cvpd.dat:vpo \ img/dvpd.dat:vpo \ - obj/genfiles/fapiAttrInfo.csv:vpo \ - obj/genfiles/fapiAttrEnumInfo.csv:vpo \ + obj/genfiles/attrInfo.csv:vpo \ + obj/genfiles/attrEnumInfo.csv:vpo \ obj/genfiles/targAttrInfo.csv:vpo \ obj/genfiles/target_types_merged.xml:openpower \ obj/genfiles/fapiattrs.xml:openpower \ @@ -196,9 +196,8 @@ simics.tar_CONTENTS = \ img/procmvpd_p9n.dat \ img/cvpd.dat \ img/dvpd.dat \ -#@TODO RTC:142088 -# obj/genfiles/fapiAttrInfo.csv \ - obj/genfiles/fapiAttrEnumInfo.csv \ + obj/genfiles/attrInfo.csv \ + obj/genfiles/attrEnumInfo.csv \ obj/genfiles/targAttrInfo.csv # @@ -249,11 +248,10 @@ fsp.tar_CONTENTS = \ src/build/debug/fsp-memdump.sh:src/build/debug/ \ obj/genfiles/hbfw_term_rc.H \ obj/genfiles/srcListing \ -#@TODO RTC:142088 -# obj/genfiles/fapiAttrInfo.csv \ - obj/genfiles/fapiAttrEnumInfo.csv \ + obj/genfiles/attrInfo.csv \ + obj/genfiles/attrEnumInfo.csv \ obj/genfiles/targAttrInfo.csv\ - obj/genfiles/plugins/fapiPlatHwpErrParser.H:plugins/ + obj/genfiles/plugins/platHwpErrParser.H:plugins # # Portions of the FSP sandbox which must be rebuilt based on file changes. diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 597517af6..5dae19052 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -314,16 +314,6 @@ if( !($cfgSrcOutputDir =~ "none") ) 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(FAPI2_PLAT_ATTR_MACROS_FILE,">$cfgSrcOutputDir"."fapi2platattrmacros.H") or fatal ("FAPI2 platform attribute macro header file: \"$cfgSrcOutputDir" . "fapi2platattrmacros.H\" could not be opened."); @@ -738,221 +728,6 @@ sub getPeerHuid sub SOURCE_FILE_GENERATION_FUNCTIONS { } -################################################################################ -# Writes the plat attribute macros header file header -################################################################################ - -sub writeFapiPlatAttrMacrosHeaderFileHeader { - my($outFile) = @_; - - print $outFile <<VERBATIM; - -#ifndef FAPI_FAPIPLATATTRMACROS_H -#define FAPI_FAPIPLATATTRMACROS_H - -/** - * \@file fapiplatattrmacros.H - * - * \@brief FAPI -> HB attribute mappings. This file is autogenerated and - * should not be altered. - */ - -//****************************************************************************** -// Includes -//****************************************************************************** - -// STD -#include <stdint.h> - -//****************************************************************************** -// Macros -//****************************************************************************** - -namespace fapi -{ - -namespace platAttrSvc -{ -VERBATIM -} - -################################################################################ -# Writes the plat attribute macros -################################################################################ - -sub writeFapiPlatAttrMacrosHeaderFileContent { - my($attributes,$fapiAttributes,$outFile) = @_; - - my $macroSection = ""; - my $attrSection = ""; - - foreach my $attribute (@{$attributes->{attribute}}) - { - foreach my $hwpfToHbAttrMap (@{$attribute->{hwpfToHbAttrMap}}) - { - if( !exists $hwpfToHbAttrMap->{id} - || !exists $hwpfToHbAttrMap->{macro}) - { - fatal("id,macro fields required\n"); - } - - my $fapiReadable = 0; - my $fapiWriteable = 0; - my $instantiated = 0; - - if ($cfgFapiAttributesXmlFile eq "") - { - #No FAPI attributes xml file specified - 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; - } - - 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 - { - #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 ( (exists $fapiAttr->{persistent})) - { - if ($attribute->{persistency} ne "non-volatile") - { - fatal("FAPI non-platInit attr " . - "'$hwpfToHbAttrMap->{id}' is " . - "'$attribute->{persistency}', " . - "it must be non-volatile"); - } - } - else - { - # Check that platInit attributes - # have a non-volatile persistency - 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) - { - 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."); - } - } - } - - if($instantiated) - { - $attrSection .= ' #define FAPI_PLAT_ATTR_SVC_MACRO_' . - $hwpfToHbAttrMap->{macro} . "_FAPI_" . - $hwpfToHbAttrMap->{id} . " \\\n" . - " TARGETING::ATTR_" . - $attribute->{id} . "\n"; - } - } - } - - print $outFile $attrSection; - print $outFile "\n"; - print $outFile $macroSection; - print $outFile "\n"; -} - -################################################################################ -# Writes the plat attribute macros header file footer -################################################################################ - -sub writeFapiPlatAttrMacrosHeaderFileFooter { - my($outFile) = @_; - -print $outFile <<VERBATIM; -} // End namespace platAttrSvc - -} // End namespace fapi - -#endif // FAPI_FAPIPLATATTRMACROS_H - -VERBATIM - -} # FAPI2 ATTRIBUTE SUPPORT ################################################################################ |