On 06/01/2018 06:08 AM, Daniel Thompson wrote:
On Thu, May 31, 2018 at 06:08:09PM -0400, William Mills wrote:
Hello,
My notes on "requiring" (or strongly recommending) separate storage.
A couple of times we have gone around the issue of "is it reasonable to require new platforms have separate storage for firmware".
Pros: P1) No disk partition plan etc P2) Runtime var storage is much easier
Cons: C1) Cost C2) Boot speed C3) Board becomes "state full" and brick-able C4) Need Buy-in from board makers
I hope we understand the pros so I won't go deep on those.
WRT C1 & C2: Cost & boot speed
Pocket Beagle ($25) has a 2Kx8 I2C EEPROM built into the SIP (system in package). This allows a single binary SPL to boot from uSD on multiple boards (PocketBeagle BBW, BBB, BBBlue, TI EVM, etc) as the EEPROM has board ID info.
I looked for other low cost boards with dedicated firmware storage. PINE A64-LTS ($32) and SOPINE ($30) have 16MB of SPI flash. The original PINE A64 ($15) has no on board storage.
Are there other boards I should look at?
What would this look like if we put:
- SPL & vars only into SPI flash
- SPL & U-boot & vars into SPI flash
- SPL/U-boot or EDK2 + vars into QSPI
I assume 64KB for SPL, <500KB for SPL+Uboot, and 1MB for EDK2.
I think this is rather optimistic w.r.t. EDK2.
I'd have pretty serious concerns about trying to running EDK2 port from 2MB of FLASH. You'd either have to aggressively restrict the feature set, load most of the drivers from the EFI partition (which rather defeats the point of using SPI flash in the first place) or make running a DEBUG build impossible.
Daniel.
I tend to agree. That is why I quoted 1MB and 2MB flash parts for EDKs. However for boot time I use 1MB.
I got 1MB by downloading the debian buster qemu-efi-aarch64 package: https://packages.debian.org/buster/all/qemu-efi-aarch64/download
bill@gtwmills:/usr/share/AAVMF$ hexdump AAVMF_CODE.fd 00f7520 ffac ffff ffff ffff ffff ffff ffff ffff 00f7530 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 0000 0000 0000 0000 0000 0000 0000 0000 * 4000000
So ~1MB of code, 1MB of FF's, and 62MB of 0's
(/usr/share/qemu-efi-aarch64/QEMU_EFI.fd is just the first 2MB of above)
(/usr/share/AAVMF/AAVMF_VARS.fd is 64MB of 0's)
Bill
QSPI: 1MB $0.67 2MB $0.70 16MB $1.62 (PINE A64-LTS) 133MHz == 66MB/s U-boot, 500KB in 7ms EDK2, 1MB in 14ms
SPI: 128KB $0.28 1MB $0.33 104Mhz == 13MB/s SPL only, 64KB in 5ms U-boot, 500KB in 38ms
I2C: ID only 256x8 $0.09 BBB etc 4Kx8 $0.13 32bytes @100KHz = 2.5ms