On Mon, 2023-11-13 at 17:07 -0600, Jon Humphreys wrote:
Firmware locations:
- the EBBR states that a dedicated partition is preferred for storing
firmware. This seems to imply that all firmwares will be in a single location. This isn't true in many cases (eg, some partitions aren't large enough and subsequent stages are loaded from a different partition). Is there guidance (or should be guidance) in EBBR on how to handle these scenarios?
Not sure what you mean here. In general if a partition containing a filesystem isn't big enough then we can just make it bigger...
Not always. Consider a eMMC hardware partition that is limited in size. For example, BeaglePlay will put the first stage SPL in the eMMC hardware partition and other stages (eg, u-boot) in the UDA partition, so that all stages will fit.
The smallest eMMC HW boot partition I've ever seen was ~4MiB many years ago. More modern eMMC have 8, 16 or even 32MiB. I'd expect that to be enough for all firmware components (perhaps even including OP-TEE).
From what you have said, the main point is to reduce the possibility of the OS messing with the firmware, so the spec recommends that the firmware be in dedicated partitions. This is clear at the beginning of chapter 4:
In general, EBBR compliant platforms should use dedicated storage for boot firmware images and data ...
What confused me is that 4.2 goes a bit further is specifying firmware to be stored in "a dedicated firmware partition". (But no SHALLs here!) Maybe replace "a dedicated firmware partition" with "dedicated firmware partitions".
One thing to keep in mind is that using only the HW boot partition for all firmware components simplifies atomic updates a lot. Otherwise you'd need to have either use matching A/B partitions in the UDA for the later components or ensure compatibility across SPL/main u-boot versions.
Jan