This PR implement persistent storage in host flash for Cosmo, using the same strategy as Gimlet: reserve sector 0 and tile it with a small data payload, using a CRC to ensure validity and a monotonic counter to find the newest payload.
This only works because the AMD boot sequence ignores sector 0 (other than word 0, which must be all 1s).
RawPersistentData is moved to drv-hf-api and renamed HfRawPersistentData for consistency. In addition, it now implements cmp, making a few operations cleaner.
The new code in drv-cosmo-hf is mostly copypasta from drv-gimlet-hf, but with a few tweaks (both virtual devices are on the same flash chip, the QSPI driver has a slightly different API, etc).
Staged on top of #1853
This PR implement persistent storage in host flash for Cosmo, using the same strategy as Gimlet: reserve sector 0 and tile it with a small data payload, using a CRC to ensure validity and a monotonic counter to find the newest payload.
This only works because the AMD boot sequence ignores sector 0 (other than word 0, which must be all 1s).
RawPersistentData
is moved todrv-hf-api
and renamedHfRawPersistentData
for consistency. In addition, it now implementscmp
, making a few operations cleaner.The new code in
drv-cosmo-hf
is mostly copypasta fromdrv-gimlet-hf
, but with a few tweaks (both virtual devices are on the same flash chip, the QSPI driver has a slightly different API, etc).