Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI-Helper: Checking expect bit requires checking stsValid as well #2891

Open
AndreasFuchsTPM opened this issue Aug 20, 2024 · 0 comments · May be fixed by #2899
Open

SPI-Helper: Checking expect bit requires checking stsValid as well #2891

AndreasFuchsTPM opened this issue Aug 20, 2024 · 0 comments · May be fixed by #2899

Comments

@AndreasFuchsTPM
Copy link
Member

AndreasFuchsTPM commented Aug 20, 2024

The SPI-Helper seems to not check the expect bit nor the stsValid bit during command transmission.

The transfer should go as follows:

  • Write 1 byte
  • Check that expect and stsValid are both set (loop until stsValid)
  • Write the rest of the command except for the last byte (respecting burstcount and expect and stsValid along the way).
  • Check that expect and stsValid are set.
  • Write the last byte
  • Check that except is clear but stsValid is set.

Same applies for dataAvail during reception.

static void spi_tpm_helper_fifo_transfer(TSS2_TCTI_SPI_HELPER_CONTEXT* ctx, uint8_t* transfer_buffer, size_t transfer_size, enum TCTI_SPI_HELPER_FIFO_TRANSFER_DIRECTION direction)

@wxleong wxleong linked a pull request Sep 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant