-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Bonus Data in Cosmo host flash (#1991)
In Cosmo and Grapefruit, we divide a 128 MiB flash chip into two (now three) sections: - 32 MiB of slot 0 (host boot data) - 32 MiB of slot 1 (host boot data) - 64 MiB of Bonus Data (previously unused) The host boot slots use the lowest 64 KiB for "persistent data", which right now encodes which slot to select at boot time. This behavior is identical to Gimlet, and is unchanged in the PR. This PR consists of three standalone commits, which do the following: - Check flash addresses in the `cosmo-hf` driver, to avoid writing into other sections by accident - Use a strong type for an absolute address (versus `u32` for a section-relative address) - Add new Hiffy APIs to read and write the upper 64 MiB of flash - These APIs are added to the `HostFlash` interface, so they're also added to Gimlet's host flash driver, which just returns an error if you try to use them. Under the hood, the W25Q01JV uses two 64 MiB dies and exposes manual APIs to select which die is active (e.g. checking BUSY status only reads from the active die). However, all of the QSPI commands that we use take a 4-byte address and automatically switch between dies, so everything Just Works™ (feel free to double-check this, [here's the docs](https://drive.google.com/file/d/1qcurvqkNYha0cWxEeEhD_J2qGgi_r4AL/))
- Loading branch information
Showing
5 changed files
with
228 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.