xref: /aosp_15_r20/external/gsc-utils/extra/usb_updater/signed_manifest.h (revision 4f2df630800bdcf1d4f0decf95d8a1cb87344f5f)
1 /* Copyright 2024 The ChromiumOS Authors
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 #ifndef __CROS_EC_SIGNED_MANIFEST_H
6 #define __CROS_EC_SIGNED_MANIFEST_H
7 
8 
9 #include "compile_time_macros.h"
10 #include "stdint.h"
11 
12 /*
13  * This is the signed manifest header for Opentitan images. See also
14  * third_party/lowriscv/opentitan/sw/device/silicon_creator/lib/manifest.h
15  */
16 struct SignedManifest {
17 	uint32_t signature[96];
18 	uint32_t constraint_selector_bits;
19 	uint32_t constraint_device_id[8];
20 	uint32_t constraint_manuf_state_creator;
21 	uint32_t constraint_manuf_state_owner;
22 	uint32_t constraint_life_cycle_state;
23 	uint32_t modulus[96];
24 	uint32_t address_translation;
25 	uint32_t identifier;
26 	uint16_t manifest_version_major;
27 	uint16_t manifest_version_minor;
28 	uint32_t signed_region_end;
29 	uint32_t length;
30 	uint32_t version_major;
31 	uint32_t version_minor;
32 	uint32_t security_version;
33 	uint32_t timestamp_low;
34 	uint32_t timestamp_high;
35 	uint32_t binding_value[8];
36 	uint32_t max_key_version;
37 	uint32_t code_start;
38 	uint32_t code_end;
39 	uint32_t entry_point;
40 	uint32_t extensions[30];
41 };
42 
43 BUILD_ASSERT(sizeof(struct SignedManifest) == 1024);
44 /* Verify a few of the field offsets we use most often */
45 BUILD_ASSERT(offsetof(struct SignedManifest, identifier) == 820);
46 BUILD_ASSERT(offsetof(struct SignedManifest, length) == 832);
47 BUILD_ASSERT(offsetof(struct SignedManifest, version_major) == 836);
48 BUILD_ASSERT(offsetof(struct SignedManifest, version_minor) == 840);
49 
50 /* Identifier that marks the header as ROM_EXT "OTRE" */
51 #define ID_ROM_EXT 0x4552544F
52 /* Identifier that marks the header as owner firmware "OTB0" */
53 #define ID_OWNER_FW 0x3042544F
54 
55 #endif /* __CROS_EC_SIGNED_MANIFEST_H */
56