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_device] Late CSb de-assertion for op-complete commands #15517

Open
eunchan opened this issue Oct 14, 2022 · 7 comments
Open

[spi_device] Late CSb de-assertion for op-complete commands #15517

eunchan opened this issue Oct 14, 2022 · 7 comments
Assignees
Labels
Component:RTL Earlgrey-PROD Candidate Temporary label to triage issues into Earlgrey-PROD Milestones IP:spi_device Priority:P3 Priority: low
Milestone

Comments

@eunchan
Copy link
Contributor

eunchan commented Oct 14, 2022

The current SPI_DEVICE HWIP has a few limitation of detecting the host system's misbehaviors:

  • If host de-asserts CSb prior to the full 8 bit opcode, HW IP silently drops
  • If host de-assrets CSb later than 8th beat, but the received opcode expects op-complete command (such as chip erase), it is expected to discard the command. The current version of SPI_DEVICE, if host terminates the command at 9th beat ~15th beat, the HW uploads the opcode but does not report any errors.

CC: @tjaychen @a-will @weicaiyang @jeoongp

@andreaskurth
Copy link
Contributor

Triaged for spi_device. Assigning to M2.5 with Priority:P2 Priority: medium because even though this is about robustness in an environment with errors, we should check with the product team if the behavior of spi_device is acceptable. If yes, we can defer this to Type:FutureRelease Not relevant to currently planned releases/milestones .

@andreaskurth andreaskurth added Priority:P2 Priority: medium Triaged labels Feb 23, 2023
@hcallahan-lowrisc
Copy link
Contributor

hcallahan-lowrisc commented Mar 22, 2023

  • If host de-asserts CSb prior to the full 8 bit opcode, HW IP silently drops

From the V2 review #15539, it sounds like #15637 was merged to check the block does not lock up if CSB de-asserts in bits 0-7.

  • If host de-assrets CSb later than 8th beat, but the received opcode expects op-complete command (such as chip erase), it is expected to discard the command. The current version of SPI_DEVICE, if host terminates the command at 9th beat ~15th beat, the HW uploads the opcode but does not report any errors.

This condition appears to be currently untested, follow up to check priority of a fix + test of the expected discard behaviour.

estimate 8
remaining 2023-03-22 8

@andreaskurth
Copy link
Contributor

From the V2 review #15539, it sounds like #15637 was merged to check the block does not lock up if CSB de-asserts in bits 0-7.

Caution: Since PR #15770, this test has been weakened to

SpiTransIncompleteOpcode: begin
// TODO(#15721), need to have at least 3 spi_clk when CSB is active, otherwise,
// this incomplete req may have bad side effect due to `sys_csb_deasserted_pulse_i`
// isn't set correctly
int num_bits = $urandom_range(3, 7);

due to the known limitation in #15721

@hcallahan-lowrisc
Copy link
Contributor

Note that there is a number of open issues about CSB behaviour and robustness to errors, so some estimated effort (if deemed necessary) may overlap between those issues. (#10058 #12747 #15517 #15721)

@moidx
Copy link
Contributor

moidx commented Apr 5, 2023

Postponed for production integration.

@a-will
Copy link
Contributor

a-will commented Jan 31, 2024

I don't think the host aborting commands needs to be reported to SW, but it might be good to upload only commands that are a valid length.

@msfschaffner
Copy link
Contributor

Agreed on that first point.
The second point would be nice to have, but ok to implement in a future revision because it is technically not required from a functionality behavior (this functionality would be detecting out of spec behavior).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:RTL Earlgrey-PROD Candidate Temporary label to triage issues into Earlgrey-PROD Milestones IP:spi_device Priority:P3 Priority: low
Projects
None yet
Development

No branches or pull requests

6 participants