summaryrefslogtreecommitdiffstats
path: root/src/include/usr/i2c
diff options
context:
space:
mode:
authorChris Engel <cjengel@us.ibm.com>2015-03-19 16:05:07 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-08-31 17:54:12 -0500
commit0795cc6781a4d937786b39c23b655397432ec90e (patch)
treec046357de087101de900b3958e18d60812462381 /src/include/usr/i2c
parentb9c64e6a1948009018490b3cd41bc8725a8a6050 (diff)
downloadtalos-hostboot-0795cc6781a4d937786b39c23b655397432ec90e.tar.gz
talos-hostboot-0795cc6781a4d937786b39c23b655397432ec90e.zip
Nuvoton TPM 1.2 Device Driver
This adds support for the Nuvoton TPM 1.2 in simics Change-Id: I24973cb9824e31967aae3fb97e86a631e514b2ff RTC: 125287 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16535 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/i2c')
-rw-r--r--src/include/usr/i2c/tpmddif.H70
-rw-r--r--src/include/usr/i2c/tpmddreasoncodes.H88
2 files changed, 158 insertions, 0 deletions
diff --git a/src/include/usr/i2c/tpmddif.H b/src/include/usr/i2c/tpmddif.H
new file mode 100644
index 000000000..0a8233eda
--- /dev/null
+++ b/src/include/usr/i2c/tpmddif.H
@@ -0,0 +1,70 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/i2c/tpmddif.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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 __TPMDDIF_H
+#define __TPMDDIF_H
+
+namespace TPMDD
+{
+
+/**
+ * @brief Enumerations to select TPM
+*/
+enum tpm_chip_types_t
+{
+ TPM_PRIMARY = 0,
+ TPM_BACKUP = 1,
+ LAST_CHIP_TYPE,
+ FIRST_CHIP_TYPE = TPM_PRIMARY
+};
+
+/**
+ * @brief TPM Operation to perform
+*/
+enum tpm_op_types_t
+{
+ TPM_OP_READVENDORID = 0, ///< Read Vendor/Dev ID from device, max 4 bytes
+ TPM_OP_TRANSMIT = 1, ///< Transmit/Receive command block to TPM
+ TPM_OP_LASTOP,
+ TPM_OP_FIRSTOP = TPM_OP_READVENDORID
+};
+
+/**
+ *
+ * @brief Determine if targeted TPM is present and enabled in the system
+ *
+ * @param[in] i_target Target node
+ *
+ * @param[in] i_chip Select primary vs secondary TPM
+ *
+ * @return true if device is present
+ */
+bool tpmPresence ( TARGETING::Target * i_target,
+ tpm_chip_types_t i_chip );
+
+
+}; // end namespace TPMDD
+
+#endif // end __TPMDDIF_H
+
diff --git a/src/include/usr/i2c/tpmddreasoncodes.H b/src/include/usr/i2c/tpmddreasoncodes.H
new file mode 100644
index 000000000..081a00b70
--- /dev/null
+++ b/src/include/usr/i2c/tpmddreasoncodes.H
@@ -0,0 +1,88 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/i2c/tpmddreasoncodes.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* [+] 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 */
+/**
+ * @file tpmddreasoncodes.H
+ *
+ * @brief Reason codes and module ids for the TPM device driver
+ *
+ */
+#ifndef __TPMDDREASONCODES_H
+#define __TPMDDREASONCODES_H
+// -----------------------------------------------
+// Includes
+// -----------------------------------------------
+#include <hbotcompid.H>
+
+namespace TPMDD
+{
+
+/**
+* @enum tpmModuleid
+*
+* @brief Module Ids used in created errorlogs. Indicates which
+* functions an error log was created in.
+*
+*/
+enum tpmModuleId
+{
+ TPMDD_INVALID_MODULE = 0x00, // Invalid Module Id
+ TPMDD_PERFORM_OP = 0x01,
+ TPMDD_READ = 0x02,
+ TPMDD_WRITE = 0x03,
+ TPMDD_PREPAREADDRESS = 0x04,
+ TPMDD_READATTRIBUTES = 0x05,
+ TPMDD_GETI2CMASTERTARGET = 0x06,
+ TPMDD_POLLFORCOMMMANDREADY = 0x07,
+ TPMDD_POLLFORDATAAVAIL = 0x08,
+ TPMDD_WRITEFIFO = 0x09,
+ TPMDD_READFIFO = 0x0A,
+ TPMDD_READSTSREGVALID = 0x0B,
+};
+
+/**
+ * @enum tpmReasonCode
+ *
+ * @brief Reasoncodes used to describe what errors are being indicated.
+ *
+ */
+enum tpmReasonCode
+{
+ TPM_INVALID_REASONCODE = TPMDD_COMP_ID | 0x00,
+ TPM_INVALID_OPERATION = TPMDD_COMP_ID | 0x01,
+ TPM_INVALID_DEVICE_TYPE = TPMDD_COMP_ID | 0x02,
+ TPM_ATTR_INFO_NOT_FOUND = TPMDD_COMP_ID | 0x03,
+ TPM_INVALID_CHIP = TPMDD_COMP_ID | 0x04,
+ TPM_I2C_MASTER_PATH_ERROR = TPMDD_COMP_ID | 0x05,
+ TPM_TARGET_NULL = TPMDD_COMP_ID | 0x06,
+ TPM_INVALID_ADDR_OFFSET_SIZE = TPMDD_COMP_ID | 0x07,
+ TPM_OVERFLOW_ERROR = TPMDD_COMP_ID | 0x08,
+ TPM_UNDERFLOW_ERROR = TPMDD_COMP_ID | 0x09,
+ TPM_TIMEOUT = TPMDD_COMP_ID | 0x0A,
+ TPM_DEVICE_NOT_AVAILABLE = TPMDD_COMP_ID | 0x0B,
+};
+
+}; // end TPMDD
+
+#endif
OpenPOWER on IntegriCloud