5.1 TCG TPM Command Protocol
The TPM command protocol, as defined by the TCG TPM specification, specifies an initial predefined sequence of 10 data bytes for all commands transmitted to the TPM and also for all responses returned by the TPM. A required component of this 10-byte sequence is commandSize, which specifies the total number of data bytes in the command input or the response output.
The TPM uses a combination of commandSize and the host deasserting SPI_CS# inactive high to define the termination point of all input and output sequences. After the input or output sequence has completed, the TPM automatically enters an Idle (Wait) state until the next communication is received from the host. A new input or output sequence is initiated by the host asserting SPI_CS# active-low.