1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2016-2018 Solarflare Communications Inc.
7 /* These structures define the layouts for the signed firmware image binary
8 * saved in NVRAM. The original image is in the Cryptographic message
9 * syntax (CMS) format which contains the bootable firmware binary plus the
10 * signatures. The entire image is written into NVRAM to enable the firmware
11 * to validate the signatures. However, the bootrom still requires the
12 * bootable-image to start at offset 0 of the NVRAM partition. Hence the image
13 * is parsed upfront by host utilities (sfupdate) and written into nvram as
14 * 'signed_image_chunks' described by a header.
16 * This file is used by the MC as well as host-utilities (sfupdate).
20 #ifndef CI_MGMT_SIGNED_IMAGE_LAYOUT_H
21 #define CI_MGMT_SIGNED_IMAGE_LAYOUT_H
23 /* Signed image chunk type identifiers */
25 SIGNED_IMAGE_CHUNK_CMS_HEADER, /* CMS header describing the signed data */
26 SIGNED_IMAGE_CHUNK_REFLASH_HEADER, /* Reflash header */
27 SIGNED_IMAGE_CHUNK_IMAGE, /* Bootable binary image */
28 SIGNED_IMAGE_CHUNK_REFLASH_TRAILER, /* Reflash trailer */
29 SIGNED_IMAGE_CHUNK_SIGNATURE, /* Remaining contents of the signed image,
30 * including the certifiates and signature */
31 NUM_SIGNED_IMAGE_CHUNKS,
35 #define SIGNED_IMAGE_CHUNK_HDR_MAGIC 0xEF105161 /* EF10 SIGned Image */
37 /* Initial version definition - version 1 */
38 #define SIGNED_IMAGE_CHUNK_HDR_VERSION 0x1
40 /* Header length is 32 bytes */
41 #define SIGNED_IMAGE_CHUNK_HDR_LEN 32
42 /* Structure describing the header of each chunk of signed image
45 typedef struct signed_image_chunk_hdr_e {
46 /* Magic field to recognise a valid entry
47 * should match SIGNED_IMAGE_CHUNK_HDR_MAGIC
50 /* Version number of this header */
52 /* Chunk type identifier */
58 /* Reserved for future expansion of this structure - always set to zeros */
60 } signed_image_chunk_hdr_t;
62 #endif /* CI_MGMT_SIGNED_IMAGE_LAYOUT_H */