diff options
| author | Nick Bofferding <bofferdn@us.ibm.com> | 2018-09-19 15:27:59 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-10-01 15:36:59 -0500 |
| commit | 7209f9061a3cbc8563e583d4abdcb8ffa4653ceb (patch) | |
| tree | 37d467352053263fa08aa0f8ee0d4b924f83031d /src/include/usr | |
| parent | 829943397a902f61a29ff3076e34687ebaf71af0 (diff) | |
| download | talos-hostboot-7209f9061a3cbc8563e583d4abdcb8ffa4653ceb.tar.gz talos-hostboot-7209f9061a3cbc8563e583d4abdcb8ffa4653ceb.zip | |
Trusted Boot: When TPM not detected properly, report errors if TPM is required
When the MRW for a machine defines a possible enabled TPM, and the "TPM
Required" policy is "Required", then it is expected the TPM will be detected as
present. If that is not the case, surface the detection failure as a visible
error log, and generate another visible log indicating that a TPM expected to be
present was not detected correctly.
Change-Id: Icbfca04beaa6fdece147cc24f4e0615b5856a830
CQ: SW444532
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66422
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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
| -rw-r--r-- | src/include/usr/i2c/tpmddif.H | 35 | ||||
| -rw-r--r-- | src/include/usr/i2c/tpmddreasoncodes.H | 8 |
2 files changed, 34 insertions, 9 deletions
diff --git a/src/include/usr/i2c/tpmddif.H b/src/include/usr/i2c/tpmddif.H index 4abd46a04..34128e04c 100644 --- a/src/include/usr/i2c/tpmddif.H +++ b/src/include/usr/i2c/tpmddif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -78,19 +78,40 @@ struct tpm_info_t uint8_t devAddr; ///< I2C Address size_t offset; ///< TPM Device register offset tpm_addr_size_t addrSize; ///< I2C Addr size + + /** + * @brief Construct a default tpm_info_t + */ + tpm_info_t() + : operation(TPM_OP_LASTOP), + i2cMasterPath(), + i2cTarget(nullptr), + tpmTarget(nullptr), + busFreq(0), + port(0), + engine(0), + tpmEnabled(false), + devAddr(0), + offset(0), + addrSize(LAST_DEVICE_TYPE) + { + } }; /** + * @brief Determine if requested TPM is present and enabled in the system * - * @brief Determine if targeted TPM is present and enabled in the system - * - * @param[in] i_target Target node + * @par Detailed Description: + * Determines if requested TPM is present and enabled in the system. If the + * "TPM Required" policy is set to "TPM Required" and a blueprint TPM (which + * is specified as enabled in the object model) is not detected properly, + * the function will throw error logs to help diagnose the problem. * - * @param[in] i_chip Select primary vs secondary TPM + * @param[in] i_pTpm TPM target; must be of TPM type and must not be nullptr * - * @return true if device is present + * @return bool Whether device is present (true) or not (false) */ -bool tpmPresence ( TARGETING::Target * i_target); +bool tpmPresence (TARGETING::Target* i_pTpm); /** * @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 d9abeec67..9041391fb 100644 --- a/src/include/usr/i2c/tpmddreasoncodes.H +++ b/src/include/usr/i2c/tpmddreasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2016 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -60,6 +60,7 @@ enum tpmModuleId TPMDD_READFIFO = 0x0A, TPMDD_READSTSREGVALID = 0x0B, TPMDD_TPMPRESENCEDETECT = 0x0C, + TPMDD_TPMPRESENCE = 0x0D, }; /** @@ -81,8 +82,11 @@ enum tpmReasonCode 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, + TPM_DISABLED_VIA_MRW = TPMDD_COMP_ID | 0x0B, TPM_BUS_SPEED_LOOKUP_FAIL = TPMDD_COMP_ID | 0x0C, + TPM_RC_TPM_NOT_DETECTED = TPMDD_COMP_ID | 0x0D, + TPM_RC_UNEXPECTED_VENDOR_ID = TPMDD_COMP_ID | 0x0E, + TPM_RC_UNEXPECTED_FAMILY_ID = TPMDD_COMP_ID | 0x0F, }; }; // end TPMDD |

