summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2019-08-28 17:13:58 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-09-20 16:14:31 -0500
commitb7c4af200f89786106e986767ed9f293291f3bdf (patch)
tree047f47154c383bc19ff821e4a2ce523feefe97d7 /src/include
parentd0f0ff1e58757c833149b4e5ee6dc597a5028372 (diff)
downloadtalos-hostboot-b7c4af200f89786106e986767ed9f293291f3bdf.tar.gz
talos-hostboot-b7c4af200f89786106e986767ed9f293291f3bdf.zip
Add wrapper to exp_getidec HWP so we can call it in platform code
There has been a trend to create more HWPs that process raw data. This allows Hostboot and Cronus to share more code. The trick is that we generally want to call these HWPs inside traditionally hostboot-only code. This new fapiwrap directory will help encapsulate all of the calls to ekb code in one place. That way if we ever need to remove HWPs/EKB code it will be easier to stub out the calls. In the past we have contaminated a lot of Hostboot-only code with calls out to EKB code. This new new directory should help avoid this issue. Change-Id: I2b2d0d1e62c97f0976c9c9ede3fe2eac30c7a40f RTC: 214627 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83029 Tested-by: Jenkins Server <pfd-jenkins+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: Ilya Smirnov <ismirno@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/fapiwrap/fapiWrapif.H60
-rw-r--r--src/include/usr/hbotcompid.H10
2 files changed, 70 insertions, 0 deletions
diff --git a/src/include/usr/fapiwrap/fapiWrapif.H b/src/include/usr/fapiwrap/fapiWrapif.H
new file mode 100644
index 000000000..f37aea26b
--- /dev/null
+++ b/src/include/usr/fapiwrap/fapiWrapif.H
@@ -0,0 +1,60 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/fapiwrap/fapiWrapif.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2019 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef _FAPIWRAPIF_H
+#define _FAPIWRAPIF_H
+
+#include <errl/errlentry.H> // Also gets us targeting/common/target.H
+
+
+/* *** Overview ***
+ There has been a trend to create more HWPs that process raw data.
+ This allows Hostboot and Cronus (and other platforms to share more code.
+ The trick is that we generally want to call these HWPs inside what has
+ traditionally been Hostboot-only code. The fapiwrap directory will help
+ encapsulate all of the calls to ekb code in one place. That way if we
+ ever need to remove HWPs/EKB code it will be easier to stub out the calls.
+ We have found in the past we have contaminated a lot of Hostboot-only
+ code with calls to EKB code. This directory should help address that problem.
+*/
+
+
+namespace FAPIWRAP
+{
+ /**
+ * @brief This function wraps around the FAPI2 HWP "exp_getidec" which
+ * takes in a OCMB target and returns the associated chipId
+ * and ec level.
+ * Chip Ids can be found in src/import/chips/common/utils/chipids.H
+ * @param[in] i_ocmbChip - Explorer OCMB target to lookup values on
+ * @param[out] o_chipId - Power Chip Id associated with this OCMB
+ * @param[out] o_ec - EC level of this chip
+ * @return errlHndl_t - nullptr if no error, otherwise contains error
+ */
+ errlHndl_t explorer_getidec( TARGETING::Target * i_ocmbChip,
+ uint16_t& o_chipId,
+ uint8_t& o_ec);
+}
+
+#endif \ No newline at end of file
diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H
index 924091fc6..d8d819f50 100644
--- a/src/include/usr/hbotcompid.H
+++ b/src/include/usr/hbotcompid.H
@@ -506,6 +506,16 @@ const char BPM_COMP_NAME[] = "bpm";
//@}
//
+/** @name FAPIWRAP
+ * Wrapper around fapi2 HWP for hb platform to use
+ */
+//@{
+const compId_t FAPIWRAP_COMP_ID = 0x4400;
+const char FAPIWRAP_COMP_NAME[] = "fapiwrap";
+
+//@}
+
+//
//
/** @name HDAT
* HDAT component
OpenPOWER on IntegriCloud