4. Firmware Storage¶
In general, EBBR compliant platforms should use dedicated storage for boot firmware images and data, independent of the storage used for OS partitions and the EFI System Partition (ESP). This could be a physically separate device (e.g. SPI flash), or a dedicated logical unit (LU) within a device (e.g. eMMC boot partition, 1 or UFS boot LU 2).
However, many embedded systems have size, cost, or implementation constraints that make separate firmware storage unfeasible. On such systems, firmware and the OS reside in the same storage device. Care must be taken to ensure firmware kept in normal storage does not conflict with normal usage of the media by an OS.
Firmware must be stored on the media in a way that does not conflict with normal partitioning and usage by the operating system.
Normal operation of the OS must not interfere with firmware files.
Firmware needs a method to modify variable storage at runtime while the OS controls access to the device. 3
- 1
Watch out for the ambiguity of the word ‘partition’. In most of this document, a ‘partition’ is a contiguous region of a block device as described by a GPT or MBR partition table, but eMMC devices also provide a dedicated ‘boot partition’ that is addressed separately from the main storage region, and does not appear in the partition table.
- 2
For the purposes of this document, logical units are treated as independent storage devices, each with their own GPT or MBR partition table. A platform that uses one LU for firmware, and another LU for OS partitions and the ESP is considered to be using dedicated firmware storage.
- 3
Runtime access to firmware data may still be an issue when firmware is stored in a dedicated LU, simply because the OS remains in control of the storage device command stream. If firmware doesn’t have a dedicated channel to the storage device, then the OS must proxy all runtime storage IO.
4.2. Firmware Partition Filesystem¶
Where possible, firmware images and data should be stored in a filesystem. Firmware can be stored either in a dedicated firmware partition, or in certain circumstances in the UEFI System Partition (ESP). Using a filesystem makes it simpler to manage multiple firmware files and makes it possible for a single disk image to contain firmware for multiple platforms.
When firmware is stored in the ESP, the ESP should contain a directory named
/FIRMWARE in the root directory,
and all firmware images and data should be stored in platform vendor
subdirectories under /FIRMWARE.
Dedicated firmware partitions should be formatted with a FAT
filesystem as defined by the UEFI specification.
Dedicated firmware partitions should use the same /FIRMWARE directory
hierarchy.
OS tools shall ignore dedicated firmware partitions,
and shall not attempt to use a dedicated firmware partition as an ESP.
Vendors may choose their own subdirectory name under /FIRMWARE,
but shall choose names that do not conflict with other vendors.
Normally the vendor name will be the name of the SoC vendor, because the
firmware directory name will be hard coded in the SoC’s boot ROM.
Vendors are recommended to use their Devicetree vendor prefix or ACPI
vendor ID as their vendor subdirectory name.
Vendors are free to decide how to structure subdirectories under their own vendor directory, but they shall use a naming convention that allows multiple SoCs to be supported in the same filesystem.
For example, a vendor named Acme with two SoCs, AM100 & AM300, could choose to use the SoC part number as a subdirectory in the firmware path:
/FIRMWARE
/ACME
/AM100
fw.img
/AM300
fw.img
It is also recommended for dedicated firmware partitions to use the
/FIRMWARE file hierarchy.
The following is a sample directory structure for firmware files:
/FIRMWARE
/<Vendor 1 Directory>
/<SoC A Directory>
<Firmware image>
<Firmware data>
/<SoC B Directory>
<Firmware image>
<Firmware data>
/<Vendor 2 Directory>
<Common Firmware image>
<Common Firmware data>
/<Vendor 3 Directory>
/<SoC E Directory>
<Firmware image>
Operating systems and installers should not manipulate any files in the
/FIRMWARE hierarchy during normal operation.
The sections below discuss the requirements when using both fixed and removable storage. However, it should be noted that the recommended behaviour of firmware should be identical regardless of storage type. In both cases, the recommended boot sequence is to first search for firmware in a dedicated firmware partition, and second search for firmware in the ESP. The only difference between fixed and removable storage is the recommended factory settings for the platform.