Commit 3084591
authored
Fix Cosmo flash capacity (#2098)
@rmustacc noticed that updating host flash didn't work over the
management network on Cosmo. I reproduced this locally on a Grapefruit;
this PR is the fix.
The issue was that MGS uses `HostFlash::capacity` to decide how many
sectors to erase. On Gimlet, this is the true capacity of a physical
flash chip, of which there are two. On Cosmo, we instead split a single
1 GiB flash into 2× 32 MiB + 1× 64 MiB virtual devices.
We were returning the full 1 GiB flash size, so MGS tried to erase
outside the range of the 32 MiB virtual slot. On the bright side, Hubris
correctly detects this and returned an `HfError::BadAddress`.
The fix is to return a capacity of 32 MiB, because that's the capacity
that MGS needs to know about.1 parent 7032964 commit 3084591
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
256 | | - | |
| 261 | + | |
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
| |||
0 commit comments