Documentation/OifwFirmwareFormat

Firmware format

Structure

All strings are null-terminated, string size includes terminating '\0'. Numbers are in little-endian format.

Firmware file consists of header and body.

4 bytes magic string 0x4f 0x49 0x46 0x57
4 bytes size of file header (from start of file to end of blocks list)

List of properties:

4 bytes size of property name
4 bytes size of property
N bytes property name (ASCII string)
N bytes property value

List ends with the property with empty name (0 bytes of length).

List of blocks:

4 bytes size of block name
8 bytes block offset from the start of file (required to be 4-bytes alinged)
8 bytes block size
N bytes block name
M bytes List of block-specific properties (see above for the format of the properties list)

List ends with block with empty name (0 bytes of length)

Body

Body of firmware consists of data, according to the blocks information in header.

Known properties

  • device - name of device the firmware is suitable for
    • n516 for N516
  • hwrev - hardware revision (ASCII string)
  • description - free-formed description of firmware (ASCII string)
  • date - firmware build time, unixtime (ASCII string of digits)
  • epoch - "epoch" of firmware, determining the layout and size of blocks (ASCII string of digits)

Known block-level properties

  • crc32 - crc32 checksum (4-byte value)
  • raw - (n516 firmware updater) If true, then block should be flashed to MTD partition. By default blocks are flashed to UBI.
  • compression - compression method. The only supported value is gzip. If this property is not present, then block data is assumed to be uncompressed. Supported since epoch 1 of N516 bootloader.

N516 firmware epochs

  • 0 - first firmware revision, supporting crc32 and raw properties on block level
  • 1 - added support for compression=gzip on block level