diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2017-06-29 11:20:53 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-04 10:39:00 -0400 |
commit | 02970aadead4f3d0e4bf02b3efe803f391904946 (patch) | |
tree | 384ba9535c507230e2ba8a227155b027732f9ec0 | |
parent | c5d471ae1421449c450c3bafa77beac5363b869c (diff) | |
download | talos-hostboot-02970aadead4f3d0e4bf02b3efe803f391904946.tar.gz talos-hostboot-02970aadead4f3d0e4bf02b3efe803f391904946.zip |
parseAttributeInfo: Support inverted EC features
There are several EC feature attributes where matching the chip
specification actually indicates the _absence_ of a feature.
So far we had to either match on every other chip, adding new chips
as projects are added, or define the attribute as a negative attribute
and invert its value in procedure code (sometimes without indicating
in the attribute name that it's a negative attribute). Both approaches
are prone to causing mistakes down the road.
To fix this, introduce a new <falseIfMatch/> tag that indicates that
an EC feature is absent if the chip spec is matched, so the procedure
code will not have to remember to invert the attribute value.
Change-Id: I33dcf127b8f81729c9638d6648faf2c5adbcb470
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42607
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43834
Reviewed-by: Hostboot Team <hostboot@us.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: Daniel M. Crowell <dcrowell@us.ibm.com>
-rwxr-xr-x | src/import/hwpf/fapi2/tools/parseAttributeInfo.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl b/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl index 5037d7ddf..061bd11d4 100755 --- a/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl +++ b/src/import/hwpf/fapi2/tools/parseAttributeInfo.pl @@ -622,12 +622,16 @@ foreach my $argnum ( 0 .. $#ARGV ) # hasFeature with the attribute specific logic if ( exists $attr->{chipEcFeature} ) { - my $chipCount = 0; + my $chipCount = 0; + my $falseIfMatch = exists $attr->{chipEcFeature}->{falseIfMatch}; + my $noMatchValue = $falseIfMatch ? 1 : 0; + my $yesMatchValue = $falseIfMatch ? 0 : 1; + print ECHFILE " inline uint8_t hasFeature(int2Type<$attr->{id}>,\n"; print ECHFILE " fapi2::ATTR_NAME_Type i_name,\n"; print ECHFILE " fapi2::ATTR_EC_Type i_ec)\n"; print ECHFILE " {\n"; - print ECHFILE " uint8_t hasFeature = 0;\n\n"; + print ECHFILE " uint8_t hasFeature = $noMatchValue;\n\n"; print ECHFILE " if("; foreach my $chip ( @{ $attr->{chipEcFeature}->{chip} } ) @@ -694,7 +698,7 @@ foreach my $argnum ( 0 .. $#ARGV ) } print ECHFILE ")\n"; print ECHFILE " {\n"; - print ECHFILE " hasFeature = 1;\n"; + print ECHFILE " hasFeature = $yesMatchValue;\n"; print ECHFILE " }\n"; print ECHFILE " return hasFeature;\n"; print ECHFILE " };\n"; |