summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorMike Baiocchi <mbaiocch@us.ibm.com>2018-02-28 13:01:46 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-03-01 09:51:04 -0500
commiteeadfb7bf9852f327256b17786796809458118ce (patch)
tree4bbfb138279bc5f6b43e32e36a9b7394de1e0e68 /src/include/usr
parenta8b0039d4e3af6fb2a7cbc82b328fa73e14dbc30 (diff)
downloadtalos-hostboot-eeadfb7bf9852f327256b17786796809458118ce.tar.gz
talos-hostboot-eeadfb7bf9852f327256b17786796809458118ce.zip
Add Reset to TPM's I2C Bus for MPIPLs
This commit updates the general I2C reset function to only reset certain engine(s) of the I2C master. This new functionality is then used to reset all of the processor I2C engines that can drive the TPMs on MPIPLs. Change-Id: Ie19e93233b5012b69d59bfc3f485ce2914d665da CQ:SW419116 Backport:release-fips910 Backport:release-fips900 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54840 CI-Ready: Nicholas E. Bofferding <bofferdn@us.ibm.com> CI-Ready: Marshall J. Wilks <mjwilks@us.ibm.com> CI-Ready: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@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/usr')
-rw-r--r--src/include/usr/i2c/i2cif.H48
1 files changed, 44 insertions, 4 deletions
diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H
index 583eb5083..5fa3216e4 100644
--- a/src/include/usr/i2c/i2cif.H
+++ b/src/include/usr/i2c/i2cif.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -34,8 +34,8 @@ namespace I2C
/**
* @enum i2cProcessType
*
- * @brief I2C Process Type specifies which targets and which I2C master
- * engines are reset or setup
+ * @brief I2C Process Type specifies which targets and which mode the
+ * I2C master engines are in to be reset or setup
*
* Specifically:
*
@@ -70,6 +70,45 @@ enum i2cProcessType
};
/**
+ * @enum i2cEngineSelect
+ *
+ * @brief I2C Engine Select determines which engine(s) the action will be
+ * executed on.
+ *
+ * @note This enum is setup to be used as a bit-mask where _ALL combines
+ * all possibilities.
+ *
+ * @note See i2cEngineToEngineSelect() function for converting an engine
+ * number to a value represented by this enum.
+ */
+enum i2cEngineSelect : uint8_t
+{
+ // Individual Engines
+ I2C_ENGINE_SELECT_ONLY_0 = 0x80,
+ I2C_ENGINE_SELECT_ONLY_1 = 0x40,
+ I2C_ENGINE_SELECT_ONLY_2 = 0x20,
+ I2C_ENGINE_SELECT_ONLY_3 = 0x10,
+
+ I2C_ENGINE_SELECT_ALL = I2C_ENGINE_SELECT_ONLY_0 |
+ I2C_ENGINE_SELECT_ONLY_1 |
+ I2C_ENGINE_SELECT_ONLY_2 |
+ I2C_ENGINE_SELECT_ONLY_3,
+};
+
+/**
+ * @brief This inline function will take an engine number input and convert
+ * it to the corresponding i2cEngineSelect enum.
+ *
+ * @param[in] i_engine - Specfies which engine number to convert
+ *
+ * @return i2cEngineSelect - Corresponding enum value
+ */
+inline i2cEngineSelect i2cEngineToEngineSelect(const uint8_t i_engine)
+{
+ return static_cast<i2cEngineSelect>(0x80 >> i_engine);
+}
+
+/**
* @brief This function will handle everything required to reset a target's
* "active" I2C master engine.
* [NOTE: "active" engine is determined by target's I2C_SWITCHES attribute]
@@ -88,7 +127,8 @@ enum i2cProcessType
* the error log.
*/
errlHndl_t i2cResetActiveMasters ( i2cProcessType i_resetType,
- bool i_functional = true );
+ bool i_functional = true,
+ i2cEngineSelect = I2C_ENGINE_SELECT_ALL);
/**
* @brief This function will handle everything required to setup a target's
OpenPOWER on IntegriCloud