diff options
Diffstat (limited to 'src/include/usr/i2c/tpmddif.H')
-rw-r--r-- | src/include/usr/i2c/tpmddif.H | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/include/usr/i2c/tpmddif.H b/src/include/usr/i2c/tpmddif.H index 0a8233eda..08fbebfc0 100644 --- a/src/include/usr/i2c/tpmddif.H +++ b/src/include/usr/i2c/tpmddif.H @@ -51,6 +51,35 @@ enum tpm_op_types_t }; /** +* @brief Enumerations to describe the type of devices to be accessed. +*/ +enum tpm_addr_size_t +{ + ONE_BYTE_ADDR = 1, + TWO_BYTE_ADDR = 2, + LAST_DEVICE_TYPE +}; + +/** + * @brief Structure of common parameters needed by different parts of + * the code. + */ +struct tpm_info_t +{ + tpm_op_types_t operation; ///< TPM operation to perform + TARGETING::EntityPath i2cMasterPath; ///< I2C Master path + TARGETING::Target * i2cTarget; ///< I2C Target + + uint8_t port; ///< I2C Master port + uint8_t engine; ///< I2C Master engine + uint8_t chip; ///< Chip target, primary/backup + uint8_t tpmEnabled; ///< TPM attribute defined as available + uint8_t devAddr; ///< I2C Address + size_t offset; ///< TPM Device register offset + tpm_addr_size_t addrSize; ///< I2C Addr size +}; + +/** * * @brief Determine if targeted TPM is present and enabled in the system * @@ -63,6 +92,23 @@ enum tpm_op_types_t bool tpmPresence ( TARGETING::Target * i_target, tpm_chip_types_t i_chip ); +/** + * @brief this function will read all of the associated attributes needed + * to access the intended TPM. These attributes will be used to + * determine the type of I2C device as well as how to address it via + * the I2C device driver. + * + * @param[in] i_target target node. + * + * @param[in/out] io_tpmInfo The structure that will contain the attribute data + * read from the target device. Chip field must be set + * + * @return errlHndl_t NULL if successful, otherwise a pointer to the + * error log. + */ +errlHndl_t tpmReadAttributes ( TARGETING::Target * i_target, + tpm_info_t & io_tpmInfo ); + }; // end namespace TPMDD |