[ip/spi_device] Software Usage
Current SPI_DEVICE module has wrong interrupt connections for tx full, tx empty, rx not empty. Those are connected to the Asynchronous FIFO used between SRAM FIFO and SPI Clock domain logic. RX level and TX level connect to the SRAM FIFO.
The question is: do we need any info from the SPI_DEVICE SRAM FIFO (2kB) other than the levels? I think SRAM RX FULL interrupt might be needed even the logic has rx level interrupt (triggers when RX depth is greater than the configured depth). TX SRAM FIFO case, I am not sure the software needs TX Empty interrupt or not. empty can happen every time the all the data sent out to the host.
CC: @tjaychen @weicaiyang
Personally I think the the tx empty interrupt is nice to have, especially if software does a bulk transfer of data and just wants to know when it completes.
I think the reality is that they'll use level way more often on big transfers to make sure things never stall and just continuously fill in, but it's probably very nice to have the flexibility.
Can TX level just be used for empty? (program no data left?)
Can TX level just be used for empty? (program no data left?)
If the level is set to 1 then yes, it detects when TX depth goes to 0 (empty) it generates an interrupt.
Yeah then I'd say just get rid of the tx empty interrupt then, it's functionally a subset of the level right? Speaking of which, I should probably do the same for flash
On Wed, Aug 21, 2019, 17:24 Eunchan Kim [email protected] wrote:
Can TX level just be used for empty? (program no data left?)
If the level is set to 1 then yes, it detects when TX depth goes to 0 (empty) it generates an interrupt.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/opentitan/issues/5?email_source=notifications&email_token=AAH2RSSEFOT3MK2KZNQZ2TDQFXMDXA5CNFSM4IOPGJHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD43P6QY#issuecomment-523697987, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH2RSSCFMA2DFQE5JHVSZTQFXMDXANCNFSM4IOPGJHA .
@moidx If you have a time later (after repo migrated), could you also comment here?
I agree that rxlvl and txlvl interrupts fulfill most use cases, and that it is ok to remove txempty.
How do we handle overflows at the moment? Would it be ok to add support for rxoverflow. We can discuss this further here or on a separate issue.
Also, there are some emulated protocols running on top of SPI dev that operate at the frame boundary. In such cases, cs_deassert (and sometimes cs_assert) interrupts are useful to manage the abstraction. I can open a separate issue to investigate if there is a need to adding support for this in OpenTitan.
the plan is probably to implement the CS de-assert read back status. The interrupt will likely be held until later. Fork this issue into two.
@tjaychen or @eunchan is this closed now?
@tjaychen @eunchan ping
Yes. Can be close now.