Insert delay after release power-down SPI flash command #167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SPI flash chips which support entering the power-down state require a delay after the release from power down command (ABh) before they are operational. This PR implements that delay for picosoc, where previously no delay was present. Without this PR I found that my board was able to boot reliably with a 10 MHz system clock, but not 25 MHz, despite being out of spec at both rates.
I looked at a few different SPI flash chips to find a reasonable delay:
To try and account for all reasonable delays without being excessive, I have chosen 2^12 cycles. It meets the Micron required delay at 100MHz, whilst being less than 0.5ms at 10MHz. I'm happy to change this to be a parameter if you would prefer.
N.B. I have only tested this in simulation, and with my custom PCB using the default single bit wide I/O mode. I haven't tested with an ICEBreaker, or the Lattice dev board.