-
Notifications
You must be signed in to change notification settings - Fork 12
[ot] hw/opentitan: ot_spi_host: SPI Host V3 changes #120
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
[ot] hw/opentitan: ot_spi_host: SPI Host V3 changes #120
Conversation
Some progress:
|
db325c8
to
6a84cf0
Compare
(stealing PR #119 title) |
Should be address with another PR; it might be impossible to fix all issues without tweaking the unit tests so that they do not expect a fixed clock ratio between CPU and SPI host. |
@jwnrt you may need to update the Bazel CI files once this PR is merged, as the embedded flash is now using MTD bus # 2 (used to be # 1) |
b8812a0
to
cdb471f
Compare
…read out Refill the RX FIFO only when it is about to be empty or when its level reaches the specified RX watermark level. This reduces the overhead required for filling up the RX FIFO. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com> (cherry picked from commit 04792225206608b2e0deb7cd26590cca3542edaf)
Should be closer to real HW. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com> (cherry picked from commit 938395d0deb06df0f73f9062abd2c94d5817b844)
Replace previous boolean-based state with an enumeration, as non-executing command can be either about to execute or in finalization stage. This enables differentiation of zero length command which can either be a 1-byte command to be executed, or a command whose all bytes have been processed. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com> (cherry picked from commit 98a555a1449856df66c331de05d9338aac5fc096)
cdb471f
to
9995d51
Compare
Note: need to check if the ACTIVE bit implementation has been reworked in the RTL. If used to flicker between each command, rendering it useless from a SW perspective. Maybe this has been fixed, in which case QEMU needs also be fixed. Update: |
I do not think it is possible to fully pass the
On my machine (timings may differ from one host to another), it is possible to pass all the This PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
…ble property. A better solution would be to compute the delay based on the input clock and the SPI clock, but it requires basic clock management, which is not available yet. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
It is no longer edge-driven, but level-driven. The SPI event bit cannot be explicitly cleared, it only tracks the current statuses of the IP. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
… qemu_log_mask This is more coherent with other OT IP blocks. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
This command is supported on Macronix flash devices, among other. It is similar to the existing QPP command, with a different opcode. Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
- enables multiple SPI data flash configuration - fixes bus assignment (collisions between SPI buses and internal flash) - flash device type should now be defined as board properties - only explicitly defined flash devices are instantiated, as the OT FPGA HW enables swapping/selecting flash types Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
9995d51
to
bbb07d1
Compare
SFDP definitions are missing for now, and IRQ tests is still failing.
Moreover the
pyot.py
configuration needs to be updated (so shall the Bazel rules I guess)