diff options
author | Chris Engel <cjengel@us.ibm.com> | 2016-02-25 20:41:52 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-03-08 14:03:10 -0500 |
commit | 76ec87b247baa7a9f2564ab576a05385b8814c83 (patch) | |
tree | ec0cf31fdb87e779a72ae127e4fe78fd66e021bf /src/usr/secureboot/trusted/trustedboot.H | |
parent | ced9d370d02715fb8e492623b4d49b873ea48d0e (diff) | |
download | talos-hostboot-76ec87b247baa7a9f2564ab576a05385b8814c83.tar.gz talos-hostboot-76ec87b247baa7a9f2564ab576a05385b8814c83.zip |
Trustedboot : Refactor to allow for skiboot import of TSSLite
Change-Id: I1e90a71f1027e0a801b96cbad6d59e432357f281
RTC: 125289
ForwardPort: yes
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21318
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Tested-by: FSP CI Jenkins
Reviewed-by: Timothy R. Block <block@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21809
Diffstat (limited to 'src/usr/secureboot/trusted/trustedboot.H')
-rw-r--r-- | src/usr/secureboot/trusted/trustedboot.H | 85 |
1 files changed, 22 insertions, 63 deletions
diff --git a/src/usr/secureboot/trusted/trustedboot.H b/src/usr/secureboot/trusted/trustedboot.H index 76630ba9a..1549f7810 100644 --- a/src/usr/secureboot/trusted/trustedboot.H +++ b/src/usr/secureboot/trusted/trustedboot.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -35,17 +35,35 @@ // ----------------------------------------------- #include <secureboot/trustedbootif.H> #include <i2c/tpmddif.H> +#include <trace/interface.H> #include "trustedTypes.H" +// ---------------------------------------------- +// Trace definitions +// ---------------------------------------------- +extern trace_desc_t* g_trac_trustedboot; + +// Easy macro replace for unit testing +//#define TRACUCOMP(args...) TRACFCOMP(args) +#define TRACUCOMP(args...) +//#define TRACUBIN(args...) TRACFBIN(args) +#define TRACUBIN(args...) + +#define TB_SUCCESS NULL + namespace TRUSTEDBOOT { -enum +/// Class object to store system TPM information +class SystemTpms { - BUFSIZE = 256, - MAX_TRANSMIT_SIZE = 1024, ///< Maximum send/receive transmit size +public: + SystemTpms(); + + TpmTarget tpm[MAX_SYSTEM_TPMS]; }; + /** * @brief Initialize the targetted TPM * @param[in/out] io_target Current TPM target structure @@ -62,64 +80,5 @@ void tpmInitialize(TRUSTEDBOOT::TpmTarget & io_target, */ void tpmMarkFailed(TRUSTEDBOOT::TpmTarget & io_target); -/** - * @brief Transmit the command to the TPM and perform marshaling - * @param[in/out] io_target Current TPM target structure - * @param[in/out] io_buffer Input the command buffer to send, response on exit - * @param[in] i_bufsize Size of io_buffer in bytes - * @return errlHndl_t NULL if successful, otherwise a pointer to the - * error log. - */ -errlHndl_t tpmTransmitCommand(TRUSTEDBOOT::TpmTarget & io_target, - uint8_t* io_buffer, - size_t i_bufsize ); - -/** - * @brief Take structure pointed to by cmd and format for input into TPM - * @param[in] i_cmd Prefilled command input structure - * @param[out] o_outbuf Buffer to place marshalled data - * @param[in] i_bufsize Size of o_outbuf in bytes - * @param[out] o_cmdSize Byte size of io_outbuf data after marshal - * @return errlHndl_t NULL if successful, otherwise a pointer to the - * error log. - */ -errlHndl_t tpmMarshalCommandData(TRUSTEDBOOT::TPM2_BaseIn* i_cmd, - uint8_t* o_outbuf, - size_t i_bufsize, - size_t & o_cmdSize); - -/** - * @brief Take structure pointed to by cmd and format for input into TPM - * @param[in] i_commandCode Command code that was executed on the TPM - * @param[in] i_respBuf Buffer with response data from TPM - * @param[in] i_respBufSize Byte size of respBuf buffer from TPM - * @param[out] o_outBuf Buffer to place formatted response data - * @param[in] i_outBufSize Byte size of o_outBuf buffer - * @return errlHndl_t NULL if successful, otherwise a pointer to the - * error log. - */ -errlHndl_t tpmUnmarshalResponseData(uint32_t i_commandCode, - uint8_t* i_respBuf, - size_t i_respBufSize, - TRUSTEDBOOT::TPM2_BaseOut* o_outBuf, - size_t i_outBufSize); -/** - * @brief Send the TPM_STARTUP command to the targetted TPM - * @param[in/out] io_target Current TPM target structure - * @return errlHndl_t NULL if successful, otherwise a pointer to the - * error log. -*/ -errlHndl_t tpmCmdStartup(TRUSTEDBOOT::TpmTarget & io_target); - -/** - * @brief Send the TPM_GETCAPABILITY command to read FW version from TPM - * @param[in/out] io_target Current TPM target structure - * @return errlHndl_t NULL if successful, otherwise a pointer to the - * error log. -*/ - -errlHndl_t tpmCmdGetCapFwVersion(TRUSTEDBOOT::TpmTarget & io_target); - - } // end TRUSTEDBOOT namespace #endif |