From b692f91c173ca684b557b8f76d268720e58b36a4 Mon Sep 17 00:00:00 2001 From: Chris Engel Date: Wed, 13 Jul 2016 16:10:54 -0500 Subject: Trustedboot support for using TPM target Change-Id: I362085fd81663b9b8ec56ed9e0670cf71fc851e4 RTC: 153386 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28482 Reviewed-by: Christopher J. Engel Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa --- src/include/usr/devicefw/userif.H | 6 ++---- src/include/usr/i2c/tpmddif.H | 18 +++--------------- src/include/usr/i2c/tpmddreasoncodes.H | 1 + src/include/usr/secureboot/trustedbootif.H | 14 ++++++++++++-- 4 files changed, 18 insertions(+), 21 deletions(-) (limited to 'src/include') diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H index 970a747a6..59e812d8a 100644 --- a/src/include/usr/devicefw/userif.H +++ b/src/include/usr/devicefw/userif.H @@ -304,15 +304,13 @@ namespace DeviceFW /** * Construct the device addressing parameters for the TPM device ops. - * @param[in] i_tpm_enum The chip number of the TPM to access. See - * tpm_chip_types_t in tpmddif.H * @param[in] i_tpm_operation The TPM operation to perform. See * tpm_op_types_t in tpmddif.H * @param[in] i_command_len Command length to write during transmit * operations */ - #define DEVICE_TPM_ADDRESS( i_tpm_enum, i_tpm_op, i_command_len )\ - DeviceFW::TPM, static_cast(( i_tpm_enum )),\ + #define DEVICE_TPM_ADDRESS( i_tpm_op, i_command_len )\ + DeviceFW::TPM,\ static_cast(( i_tpm_op )),\ static_cast(( i_command_len )) diff --git a/src/include/usr/i2c/tpmddif.H b/src/include/usr/i2c/tpmddif.H index fe8bd0c4a..67602c2be 100644 --- a/src/include/usr/i2c/tpmddif.H +++ b/src/include/usr/i2c/tpmddif.H @@ -28,17 +28,6 @@ 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 */ @@ -68,12 +57,12 @@ struct tpm_info_t { tpm_op_types_t operation; ///< TPM operation to perform TARGETING::EntityPath i2cMasterPath; ///< I2C Master path - TARGETING::Target * i2cTarget; ///< I2C Target + TARGETING::Target * i2cTarget; ///< I2C Master Target + TARGETING::Target * tpmTarget; ///< TPM Target uint64_t busFreq; ///< Bus speed in Hz 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 @@ -90,8 +79,7 @@ struct tpm_info_t * * @return true if device is present */ -bool tpmPresence ( TARGETING::Target * i_target, - tpm_chip_types_t i_chip ); +bool tpmPresence ( TARGETING::Target * i_target); /** * @brief this function will read all of the associated attributes needed diff --git a/src/include/usr/i2c/tpmddreasoncodes.H b/src/include/usr/i2c/tpmddreasoncodes.H index 7bd2df1cf..d9abeec67 100644 --- a/src/include/usr/i2c/tpmddreasoncodes.H +++ b/src/include/usr/i2c/tpmddreasoncodes.H @@ -59,6 +59,7 @@ enum tpmModuleId TPMDD_WRITEFIFO = 0x09, TPMDD_READFIFO = 0x0A, TPMDD_READSTSREGVALID = 0x0B, + TPMDD_TPMPRESENCEDETECT = 0x0C, }; /** diff --git a/src/include/usr/secureboot/trustedbootif.H b/src/include/usr/secureboot/trustedbootif.H index 27dd1e8d4..21ab262a6 100644 --- a/src/include/usr/secureboot/trustedbootif.H +++ b/src/include/usr/secureboot/trustedbootif.H @@ -42,11 +42,21 @@ namespace TRUSTEDBOOT { struct _TpmLogMgr; + /// Enumerations to select TPM + typedef enum + { + TPM_PRIMARY = 0, + TPM_BACKUP = 1, + LAST_CHIP_TYPE, + FIRST_CHIP_TYPE = TPM_PRIMARY + } TPM_role; + + /// Track system TPM status struct TpmTarget { - TARGETING::Target* nodeTarget; ///< Node target ptr - TPMDD::tpm_chip_types_t chip; ///< Chip Pri vs Backup + TARGETING::Target* tpmTarget; ///< TPM target ptr + TPM_role role; ///< Pri vs Backup uint8_t initAttempted:1;///< Has TPM init been run uint8_t available:1; ///< Is TPM physically in system uint8_t failed:1; ///< Is TPM currently failed -- cgit v1.2.1