summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2016-04-07 14:14:26 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-14 15:13:10 -0400
commit5006f0f763b4e3ec65443859f7e8f6ffcaa5cfd8 (patch)
treec9c3e72d13651d2b250ed218430a7aa4e0cc0429
parentd6673ab6f0f6e6166d1916261fa08ec6e1c8a1bd (diff)
downloadtalos-hostboot-5006f0f763b4e3ec65443859f7e8f6ffcaa5cfd8.tar.gz
talos-hostboot-5006f0f763b4e3ec65443859f7e8f6ffcaa5cfd8.zip
Procedure crashes when trying to query an EC feature
-Updated queryEcFeature to have two parts, base attribute reading is now in a library, while feature checking logic is now in small individual inline functions. Change-Id: I318258a73874e55fadc59ed48fac72cf2bad00d8 Original-Change-Id: I4c3685d6a85946297af31f7f3da4d918bca88039 RTC:151184 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23025 Tested-by: Jenkins Server Tested-by: PPE CI Tested-by: Hostboot CI Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25728 Tested-by: FSP CI Jenkins
-rw-r--r--src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml70
-rw-r--r--src/import/hwpf/fapi2/src/fapi2_utils.C56
-rw-r--r--src/import/hwpf/fapi2/src/fapi2_utils.mk22
3 files changed, 148 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml
new file mode 100644
index 000000000..d89a34ad8
--- /dev/null
+++ b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml
@@ -0,0 +1,70 @@
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml $ -->
+<!-- -->
+<!-- IBM CONFIDENTIAL -->
+<!-- -->
+<!-- EKB Project -->
+<!-- -->
+<!-- COPYRIGHT 2012,2016 -->
+<!-- [+] International Business Machines Corp. -->
+<!-- -->
+<!-- -->
+<!-- The source code for this program is not published or otherwise -->
+<!-- divested of its trade secrets, irrespective of what has been -->
+<!-- deposited with the U.S. Copyright Office. -->
+<!-- -->
+<!-- IBM_PROLOG_END_TAG -->
+<!--
+ XML file specifying HWPF attributes.
+ These are example Chip EC Feature attributes that specify chip features
+ based on the EC level of a chip
+-->
+
+<attributes>
+ <!-- ********************************************************************* -->
+ <attribute>
+ <id>ATTR_CHIP_EC_FEATURE_TEST1</id>
+ <targetType>TARGET_TYPE_PROC_CHIP, TARGET_TYPE_MEMBUF_CHIP</targetType>
+ <description>
+ Returns if a chip contains the TEST1 feature. True if either:
+ Centaur EC 10
+ Venice EC greater than 30
+ </description>
+ <chipEcFeature>
+ <chip>
+ <name>ENUM_ATTR_NAME_CENTAUR</name>
+ <ec>
+ <value>0x10</value>
+ <test>EQUAL</test>
+ </ec>
+ </chip>
+ <chip>
+ <name>ENUM_ATTR_NAME_CUMULUS</name>
+ <ec>
+ <value>0x30</value>
+ <test>GREATER_THAN</test>
+ </ec>
+ </chip>
+ </chipEcFeature>
+ </attribute>
+ <!-- ********************************************************************* -->
+ <attribute>
+ <id>ATTR_CHIP_EC_FEATURE_TEST2</id>
+ <targetType>TARGET_TYPE_PROC_CHIP, TARGET_TYPE_MEMBUF_CHIP</targetType>
+ <description>
+ Returns if a chip contains the TEST2 feature. True if:
+ Murano EC less than 20
+ </description>
+ <chipEcFeature>
+ <chip>
+ <name>ENUM_ATTR_NAME_NIMBUS</name>
+ <ec>
+ <value>0x20</value>
+ <test>LESS_THAN</test>
+ </ec>
+ </chip>
+ </chipEcFeature>
+ </attribute>
+</attributes>
diff --git a/src/import/hwpf/fapi2/src/fapi2_utils.C b/src/import/hwpf/fapi2/src/fapi2_utils.C
new file mode 100644
index 000000000..f6708fbca
--- /dev/null
+++ b/src/import/hwpf/fapi2/src/fapi2_utils.C
@@ -0,0 +1,56 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: hwpf/fapi2/src/fapi2_utils.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* EKB Project */
+/* */
+/* COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file utils.C
+ * @brief Implements fapi2 utilities
+ */
+#include <fapi2_attribute_service.H>
+#include <attribute_ids.H>
+#include <return_code.H>
+#include <plat_trace.H>
+#include <target.H>
+
+namespace fapi2
+{
+
+ReturnCode queryChipEcAndName(
+ const Target < fapi2::TARGET_TYPE_PROC_CHIP |
+ fapi2::TARGET_TYPE_MEMBUF_CHIP > & i_target,
+ fapi2::ATTR_NAME_Type& o_chipName, fapi2::ATTR_EC_Type& o_chipEc )
+{
+
+ ReturnCode l_rc = FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_NAME, i_target, o_chipName);
+
+ if ( l_rc != FAPI2_RC_SUCCESS )
+ {
+ FAPI_ERR("queryChipEcFeature: error getting chip name");
+ }
+ else
+ {
+ l_rc = FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_EC, i_target, o_chipEc);
+
+ if ( l_rc != FAPI2_RC_SUCCESS )
+ {
+ FAPI_ERR("queryChipEcFeature: error getting chip ec");
+ }
+ }
+
+ return l_rc;
+}
+};
diff --git a/src/import/hwpf/fapi2/src/fapi2_utils.mk b/src/import/hwpf/fapi2/src/fapi2_utils.mk
new file mode 100644
index 000000000..94ad81782
--- /dev/null
+++ b/src/import/hwpf/fapi2/src/fapi2_utils.mk
@@ -0,0 +1,22 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: hwpf/fapi2/src/fapi2_utils.mk $
+#
+# IBM CONFIDENTIAL
+#
+# EKB Project
+#
+# COPYRIGHT 2016
+# [+] International Business Machines Corp.
+#
+#
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# IBM_PROLOG_END_TAG
+MODULE=fapi2_utils
+$(call ADD_MODULE_INCDIR,$(MODULE),$(FAPI2_PLAT_INCLUDE))
+OBJS+=fapi2_utils.o
+$(call BUILD_MODULE)
OpenPOWER on IntegriCloud