Closed mkeeter closed 1 month ago
For me the highest priority things to look at here are:
Switch the generic flash read functions to use
dyn
so we don't generate multiple copies of them in flash. (The traits appear object-safe.)The use of
Result<(), ()>
seems suspicious, consider whether the error type could be something more useful. (I think this might have been inherited fromBufWriter
, but I think it's arguably wrong there too; no reason to propagate the wrongness when your IPC error types are right there.)Comment that unwrap please, it's subtle
Make sure those todo!s will get todone, otherwise the operations shouldn't be in the IPC protocol (and we need to fork it).
The
flash_foo
functions toward the end could use doc comments explaining any assumptions and failure cases.
This is all done except 2, because I opened https://github.com/oxidecomputer/idolatry/pull/55 to fix it upstream.
This PR implements the
HostFlash
API for the Cosmo / Grapefruit flash IC, mediated by an FPGA.gimlet-hf
is renamed tohf
in a few places, because we're now using the same API for both Gimlet and Cosmo systems. There are no changes to the API itself.drv-fmc-nor-flash
is renamed todrv-cosmo-hf
for symmetry with Gimlet. It is split intomain.rs
(implementing the actual chip wrangling) andhf.rs
(implementing theHostFlash
Idol API).Many functions are left as stubs, to be implemented in later PRs. However, this PR is sufficient to program and verify the flash chip with
humility qspi
!