-
Notifications
You must be signed in to change notification settings - Fork 781
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] Disallow certain state changes when busy #21700
Comments
I have created this primarily for future reference (and evaluation in the D2 sign-off meeting). I don't think this is necessary for the next earlgrey release--It primarily helps for achieving robust behavior when the host is doing something illegal, likely due to a loss of state from a reset or similar. |
A similar discussion about this happened here: #12053 (comment) |
@a-will: This is currently in M4, but your proposal would be rather to not do this for this release (thus backlog), right? |
In the D2 sign-off, I think we decided to just get it done. |
@moidx: I think we already have this feature, so this may only be a coverage gap. Needs to be taken into account for DV. |
@andreaskurth - This needs doing in both RTL and TB (I just checked with @a-will) |
Off the top of my head, I'd probably simply add the current "busy" value as an input to spi_cmdparse, then use it to block the commands that should be ignored. For example, if busy is 1, we could prevent decoding the opcode here: opentitan/hw/ip/spi_device/rtl/spi_cmdparse.sv Lines 194 to 195 in c84524e
There are likely a number of equivalent means of doing it, though. |
Ah, in that case we were wrong about what needs to happen here during today's triage -- sorry! Thanks for clarifying 👍 @antmarzam, as current coordinator for spi_device, may I leave it to you to find someone to do the RTL change (or do it yourself)? |
Description
On a real SPI flash device, many commands are ignored when the device is busy. We might want to consider adding this behavior to our IP as well.
Currently, command uploads, WREN, WRDI, EN4B, and EX4B all are allowed while the busy bit is set.
The text was updated successfully, but these errors were encountered: