-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Bonus Data in Cosmo host flash #1991
Conversation
db505d7
to
672f899
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general question I have is whether this "bonus data" has a stable format even when we change (forward and backward) between host boot images.
We expect to store DIMM training info in here, and doing so with only one section, disconnected from which host image we're booting results in the following questions:
- Is the format guaranteed to be stable between host images, or do we need a separate copy of the data for each host image?
- By putting it in one location for both images, the FPGA is going to have to additionally intercept these accesses and differently translate them. This is fine and possible, but can make reasoning about the system more difficult than say putting both the bonus data after each host image and always using the original offset.
I can probably think of ways to expose more info here to aid in debugging but it just means we'll have multiple address translations depending on the accessed address from the host.
Otherwise, the rest of this is pretty straightforward and seems fine to me, and to be clear, it's also fine to do additional address translations in the fpga so long as we cah characterize what needs to be done which I think is possible.
672f899
to
d8aa8b6
Compare
I chatted briefly with @rmustacc about this, and he thinks that we'll probably want a single storage location for eMCR data – it should be stable even if the host image changes, and we always want to use it to speed up boot. Invalidation is still a little fuzzy. Slide 40 here (internal link, NDA) suggests that "full memory training will be performed" under a variety of circumstances (including DIMMs being moved around), which makes me think the ABL is doing the right thing here (and we don't have to invalidate manually). However, we'll definitely want to test it out (moving DIMMs around, corrupting the eMCR data in flash, etc). I agree that adding more address mappings to FPGA memory is kinda ugly, but it also seems like the most straight-forward way to handle things. Addresses below 0x2000000 (32 MiB) will always add We can then specify this address in the host image BIOS directory (slide 38, is this the same as |
This is something I would like to still spend some time with before I commit, but I think it's directionally the way we want to go. I will build up some confidence in this. |
60fbdcc
to
11bfc51
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like there are a lot of unwrap_lite
creeping in. I don't have a great answer about what me a better approach since e.g. FlashAddr::new_unchecked
also has its problems.
11bfc51
to
e5dd1cb
Compare
In Cosmo and Grapefruit, we divide a 128 MiB flash chip into two (now three) sections:
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:
cosmo-hf
driver, to avoid writing into other sections by accidentu32
for a section-relative address)HostFlash
interface, so they're also added to Gimlet's host flash driver, which just returns an error if you try to use them.bonus_
is a bit awkward (but "auxiliary" is already in use)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)