SPI Flash Layout

Overall, the SPI Flash consists of a Header, Checksum and an Image Payload (which includes the image information and the image binary).

The specific images of the flash consists of the Caliptra FW, MCU RT, SoC Manifest, and other SoC images, if any.

Layout

The main layout below describes v3. Legacy v1 and v2 layouts are available in the collapsible Legacy Formats sections at the end.

Note: All fields are little-endian byte-ordered unless specified otherwise.

A typical overall flash layout is:

Flash Layout
Header
Payload

The Payload contains the following fields:

Payload
Image Info (Caliptra FMC + RT)
Image Info (SoC Manifest)
Image Info (MCU RT)
Image Info (Owner Auth Manifest)
Image Info (SoC Image 1)
...
Image Info (SoC Image N)
Caliptra FMC + RT Package
SoC Manifest
MCU RT
Owner Auth Manifest
SoC Image 1
...
SoC Image N

The Header section contains the metadata for the images.

FieldSize (bytes)Description
Header Version2The header version format, allowing for backward compatibility if the package format changes over time.
(Current version is 0x0003)
Image Count2The number of images contained in the Payload.
Each image will have its own image information section.
Payload Offset4Offset in bytes of the header to where the first byte of the Payload is located.
Header Checksum4Checksum calculated for the header excluding this field

Image Information

The Image Information section is repeated for each image and provides detailed manifest data specific to that image.

FieldSize (bytes)Description
Identifier4Vendor selected unique value to distinguish between images.
0x00000000: Caliptra FMC+RT
0x00000001: SoC Manifest
0x00000002: MCU RT
0x00000003: Owner Auth Manifest
0x00000004: Vendor Authorization Key (V_AUTH_KEY_ID)
0x00000005: Owner Measurement Policy (OWNER_MEASUREMENT_POLICY_IDENTIFIER)
0x00000006: Owner Authorization Key (O_AUTH_KEY_ID)
0x00000007-0x00000FFE: Reserved for subsystem control identifiers
0x00000FFF: Reserved for the optional device UEID entry in the SoC Authorization Manifest (not a flash image identifier)
0x00001000-0x0000FFFF: Reserved for other Vendor-defined SoC images
0x00010000-0xFFFFFFFF: Reserved for Owner-only SoC images
Vendor and Owner SoC image entries use the image's component_id (as reported by GET_IMAGE_INFO) as the identifier.
ImageLocationOffset4Offset in bytes from byte 0 of the header to where the image content begins. Used in flash-based boot.
Size4Size in bytes of the image. This is the actual size of the image without padding.
The image itself as written to the flash should be 4-byte aligned and additional
padding will be required to guarantee alignment.
Filename64Used in network boot to specify the TFTP path relative to the TFTP server root. Field is not used in flash-based boot
Image Checksum4Checksum calculated for the binary image.
Image Info Checksum4Checksum calculated for the header excluding this field

Image

The images (raw binary data) are appended after the Image Information section, and should be in the same order as their corresponding Image Information.

FieldSize (bytes)Description
DataNImage content.
Note: The image should be 4-byte aligned.
If the size of a firmware image is not a multiple of 4 bytes,
0x00 padding bytes will be added to meet the alignment requirement.
Only used in flash-based boot

Legacy Formats

These formats use the same image identifiers and payload alignment rules described above. The Payload Offset and ImageLocationOffset fields are relative to the start of the flash image, not the start of the backing flash device.

Each checksum is the wrapping 32-bit negation of the sum of its covered bytes. Checksums do not replace firmware authentication.

Version 1 (v1)

v1 has a 16-byte flash header beginning with the literal ASCII magic FLSH. Each image information entry is 20 bytes and has no filename field.

v1 Header

FieldOffset (bytes)Size (bytes)Description
Magic04ASCII FLSH, stored as bytes 46 4c 53 48.
Header Version420x0001.
Image Count62Number of image information entries.
Payload Offset84Offset to the first image information entry.
Header Checksum124Checksum of bytes 0 through 11, including the magic.
Total16

v1 Image Information

Offsets in this table are relative to the start of each entry.

FieldOffset (bytes)Size (bytes)Description
Identifier04Image identifier, as described above.
ImageLocationOffset44Offset from the start of the flash image to the image content.
Size84Image size in bytes.
Image Checksum124Checksum of the image content.
Image Info Checksum164Checksum of entry bytes 0 through 15.
Total20
Version 2 (v2)

v2 removes the FLSH magic, reducing the flash header to 12 bytes. It retains the same 20-byte image information entries as v1. There is no filename field; filenames were introduced in v3.

v2 Header

FieldOffset (bytes)Size (bytes)Description
Header Version020x0002.
Image Count22Number of image information entries.
Payload Offset44Offset to the first image information entry.
Header Checksum84Checksum of bytes 0 through 7.
Total12

v2 Image Information

Offsets in this table are relative to the start of each entry.

FieldOffset (bytes)Size (bytes)Description
Identifier04Image identifier, as described above.
ImageLocationOffset44Offset from the start of the flash image to the image content.
Size84Image size in bytes.
Image Checksum124Checksum of the image content.
Image Info Checksum164Checksum of entry bytes 0 through 15.
Total20