summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2012-06-12 10:32:07 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-18 16:22:58 -0500
commitd2b63c0d6e57e5c3676b312c25298aaed637fa07 (patch)
treef6bf6604411df4e2d96143d4ddc1c283663c5dd3 /src
parent590ecd811e0520a17d4bcd61328bcb67f23f123e (diff)
downloadtalos-hostboot-d2b63c0d6e57e5c3676b312c25298aaed637fa07.tar.gz
talos-hostboot-d2b63c0d6e57e5c3676b312c25298aaed637fa07.zip
HWPF: Minor FAPI updates for Cronus
John Farrugia reported some Cronus build breaks when building HWPF::FAPI I fixed the FAPI files to work for all platforms Change-Id: I2bd1e5d52c02efe05bdf7cb2347f922e5e81ded7 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1188 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwpf/fapi/fapiChipEcFeature.H47
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiCreateIfAttrService.pl19
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseAttributeInfo.pl11
-rw-r--r--src/usr/hwpf/hwp/chip_ec_attributes.xml8
4 files changed, 50 insertions, 35 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiChipEcFeature.H b/src/include/usr/hwpf/fapi/fapiChipEcFeature.H
index 66b611e1a..d20b300d9 100644
--- a/src/include/usr/hwpf/fapi/fapiChipEcFeature.H
+++ b/src/include/usr/hwpf/fapi/fapiChipEcFeature.H
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwpf/fapi/fapiChipEcFeature.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwpf/fapi/fapiChipEcFeature.H $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
/**
* @file fapiChipEcFeature.H
*
@@ -62,7 +63,7 @@ class Target;
* @return ReturnCode. Zero on success, else platform specified error
*/
fapi::ReturnCode fapiQueryChipEcFeature(fapi::AttributeId i_id,
- fapi::Target * i_pTarget,
+ const fapi::Target * i_pTarget,
uint8_t & o_hasFeature);
}
diff --git a/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl b/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl
index 53005cab9..912ba98a0 100755
--- a/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl
+++ b/src/usr/hwpf/fapi/fapiCreateIfAttrService.pl
@@ -6,7 +6,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -20,7 +20,7 @@
#
# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
#
# Purpose: This perl script will parse HWP Attribute XML files and
# initfile attr files and create the fapiGetInitFileAttr() function
@@ -37,6 +37,7 @@
# files specified (for Cronus)
# mjjones 01/13/12 Use new ReturnCode interfaces
# mjjones 02/08/12 Handle attribute files with 1 entry
+# mjjones 06/12/12 Handle privileged attributes
#
# End Change Log ******************************************************
@@ -83,7 +84,9 @@ open(ASFILE, ">", $asFile);
#------------------------------------------------------------------------------
print ASFILE "// fapiAttributeService.C\n";
print ASFILE "// This file is generated by perl script fapiCreateIfAttrService.pl\n\n";
-print ASFILE "#include <fapiAttributeService.H>\n\n";
+print ASFILE "#include <fapiAttributeService.H>\n";
+print ASFILE "#include <fapiChipEcFeature.H>\n";
+print ASFILE "#include <fapiPlatTrace.H>\n\n";
print ASFILE "namespace fapi\n";
print ASFILE "{\n\n";
print ASFILE "ReturnCode fapiGetInitFileAttr(const AttributeId i_id,\n";
@@ -237,7 +240,15 @@ foreach my $argnum (1 .. $#ARGV)
print ASFILE "if (i_id == $attr->{id})\n";
print ASFILE " {\n";
print ASFILE " $attr->{id}_Type l_attr;\n";
- print ASFILE " l_rc = FAPI_ATTR_GET($attr->{id}, i_pTarget, l_attr);\n";
+
+ if (exists $attr->{privileged})
+ {
+ print ASFILE " l_rc = FAPI_ATTR_GET_PRIVILEGED($attr->{id}, i_pTarget, l_attr);\n";
+ }
+ else
+ {
+ print ASFILE " l_rc = FAPI_ATTR_GET($attr->{id}, i_pTarget, l_attr);\n";
+ }
print ASFILE " o_val = l_attr";
if ($numArrayDimensions >= 5)
diff --git a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
index 29fad38c2..1ee4119e9 100755
--- a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
@@ -6,7 +6,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -20,7 +20,7 @@
#
# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
#
# Purpose: This perl script will parse HWP Attribute XML files
# and add attribute information to a file called fapiAttributeIds.H
@@ -59,6 +59,7 @@
# mjjones 05/21/12 Detect duplicate ids/hashes across files
# mjjones 05/21/12 Ignore newlines and whitespace when
# parsing enumerations
+# mjjones 06/12/12 Add new include file to fapiChipEcFeature.C
#
# End Change Log ******************************************************
@@ -73,6 +74,7 @@ if ($numArgs < 2)
print ("Usage: fapiParseAttributeInfo.pl <output dir> <attr-xml-file1> [<attr-xml-file2> ...]\n");
print (" This perl script will parse attribute XML files and create the following files:\n");
print (" - fapiAttributeIds.H. Contains IDs, type, value enums and other information\n");
+ print (" - fapiChipEcFeature.C. Contains a function to query chip EC features\n");
print (" - fapiAttributePlatCheck.H. Contains compile time checks that all attributes are\n");
print (" handled by the platform\n");
print (" - fapiAttributesSupported.html Contains the HWPF attributes supported\n");
@@ -140,11 +142,12 @@ print ECFILE "// fapiChipEcFeature.C\n";
print ECFILE "// This file is generated by perl script fapiParseAttributeInfo.pl\n";
print ECFILE "// It implements the fapiQueryChipEcFeature function\n\n";
print ECFILE "#include <fapiChipEcFeature.H>\n";
-print ECFILE "#include <fapiAttributeService.H>\n\n";
+print ECFILE "#include <fapiAttributeService.H>\n";
+print ECFILE "#include <fapiPlatTrace.H>\n\n";
print ECFILE "namespace fapi\n";
print ECFILE "{\n\n";
print ECFILE "fapi::ReturnCode fapiQueryChipEcFeature(fapi::AttributeId i_id,\n";
-print ECFILE " fapi::Target * i_pTarget,\n";
+print ECFILE " const fapi::Target * i_pTarget,\n";
print ECFILE " uint8_t & o_hasFeature)\n";
print ECFILE "{\n";
print ECFILE " o_hasFeature = false;\n";
diff --git a/src/usr/hwpf/hwp/chip_ec_attributes.xml b/src/usr/hwpf/hwp/chip_ec_attributes.xml
index c8da585bd..0e5870e1e 100644
--- a/src/usr/hwpf/hwp/chip_ec_attributes.xml
+++ b/src/usr/hwpf/hwp/chip_ec_attributes.xml
@@ -19,7 +19,7 @@
Origin: 30
- IBM_PROLOG_END -->
+ IBM_PROLOG_END_TAG -->
<!--
XML file specifying HWPF attributes.
These are example Chip EC Feature attributes that specify chip features
@@ -40,14 +40,14 @@
<chip>
<name>ENUM_ATTR_NAME_CENTAUR</name>
<ec>
- <value>10</value>
+ <value>0x10</value>
<test>EQUAL</test>
</ec>
</chip>
<chip>
<name>ENUM_ATTR_NAME_VENICE</name>
<ec>
- <value>30</value>
+ <value>0x30</value>
<test>GREATER_THAN</test>
</ec>
</chip>
@@ -65,7 +65,7 @@
<chip>
<name>ENUM_ATTR_NAME_MURANO</name>
<ec>
- <value>20</value>
+ <value>0x20</value>
<test>LESS_THAN</test>
</ec>
</chip>
OpenPOWER on IntegriCloud