Add support for {Read,Write}NoAddrIncr SPI operations, leverage them in transceivers
#1768
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.
Part 1) Adjustments to
fpga-api/src/lib.rs
,fpga-server/src/main.rs
, andfpga.idol
for the new SPI operations.As of oxidecomputer/quartz#139 the FPGA's SPI peripheral supports these operations. Prior to this PR the FPGA drivers did not take an operation argument for read operations because there was only a single type of read. Now that there are two (
Read
andReadAddrNoIncr
), the intended operation must be specified. Given that up until this pointRead
was the only option (and will probably remain the primary use 99.9% of the time) that has been made the default for theread
operation which the majority of callers use. To utilize the new read operation, one can just call the underlyingread_bytes
function which takes aReadOp
parameter.Part 2) Making use of the new SPI operations in the
transceivers
codeThis also implements their use for transceivers I2C buffers for the QSFP FPGA design. All the
*_regs.*
files are generated from the FPGA build process and are brought in alongside the.bit
file. The transceivers code has been reworked to leverage the SPI refactoring from oxidecomputer/quartz#146. This code utilizes the non-address incrementing SPI operations to read/write to the I2C buffers in the FPGA.