diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2015-11-12 13:30:00 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-15 13:08:00 -0800 |
commit | 422cb0c5e227b4f944af5e31d8c34c18dd0c5b11 (patch) | |
tree | cfc1af264704be10ccc34c3c1018a96601ec93a7 /include | |
parent | 684d25b41aa77f14aae48afb5968a8aa1643c629 (diff) | |
download | chrome-ec-422cb0c5e227b4f944af5e31d8c34c18dd0c5b11.tar.gz |
cr50: make use of byteorder routinesstabilize-7647.74.Bstabilize-7647.72.Bstabilize-7647.32.Brelease-R48-7647.B
Use the previously introduced endian conversion routines in the driver
and the TPM2 library.
Use packed TPM message header structure to make it easy to access
unaligned header fields.
BRANCH=none
BUG=chrome-os-partner:43025
TEST=the tpm startup command still succeeds.
Change-Id: I03078481664858a19617e248f98cb20013c27445
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312585
Diffstat (limited to 'include')
-rw-r--r-- | include/tpm_registers.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/tpm_registers.h b/include/tpm_registers.h index 2bdd87bc25..ea8011bfed 100644 --- a/include/tpm_registers.h +++ b/include/tpm_registers.h @@ -14,6 +14,8 @@ #include <stdint.h> +#include "common.h" + /* The SPI master is writing data into a TPM register. */ void tpm_register_put(uint32_t regaddr, const uint8_t *data, uint32_t data_size); @@ -24,4 +26,17 @@ void tpm_register_get(uint32_t regaddr, uint8_t *dest, uint32_t data_size); /* Enable SPS TPM driver. */ void sps_tpm_enable(void); +/* + * This structure describes the header of all commands and responses sent and + * received over TPM FIFO. + * + * Note that all fields are stored in the network (big endian) byte order. + */ + +struct tpm_cmd_header { + uint16_t tag; + uint32_t size; + uint32_t command_code; +} __packed; + #endif /* __CROS_EC_TPM_REGISTERS_H */ |