1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2023 Intel Corporation
6 #ifndef _INTEL_GSC_BINARY_HEADERS_H_
7 #define _INTEL_GSC_BINARY_HEADERS_H_
9 #include <linux/types.h>
11 struct intel_gsc_version {
18 struct intel_gsc_partition {
23 struct intel_gsc_layout_pointers {
24 u8 rom_bypass_vector[16];
26 /* size of pointers layout not including ROM bypass vector */
30 * bit0: Backup copy of layout pointers exist
39 struct intel_gsc_partition datap;
40 struct intel_gsc_partition boot1;
41 struct intel_gsc_partition boot2;
42 struct intel_gsc_partition boot3;
43 struct intel_gsc_partition boot4;
44 struct intel_gsc_partition boot5;
45 struct intel_gsc_partition temp_pages;
48 /* Boot partition structures */
49 struct intel_gsc_bpdt_header {
51 #define INTEL_GSC_BPDT_HEADER_SIGNATURE 0x000055AA
53 u16 descriptor_count; /* num of entries after the header */
61 struct intel_gsc_version tool_version;
64 struct intel_gsc_bpdt_entry {
66 * Bits 0-15: BPDT entry type
67 * Bits 16-17: reserved
68 * Bit 18: code sub-partition
69 * Bits 19-31: reserved
72 #define INTEL_GSC_BPDT_ENTRY_TYPE_MASK GENMASK(15, 0)
73 #define INTEL_GSC_BPDT_ENTRY_TYPE_GSC_RBE 0x1
75 u32 sub_partition_offset; /* from the base of the BPDT header */
76 u32 sub_partition_size;
79 /* Code partition directory (CPD) structures */
80 struct intel_gsc_cpd_header_v2 {
82 #define INTEL_GSC_CPD_HEADER_MARKER 0x44504324
87 u8 header_length; /* in bytes */
93 struct intel_gsc_cpd_entry {
97 * Bits 0-24: offset from the beginning of the code partition
98 * Bit 25: huffman compressed
99 * Bits 26-31: reserved
102 #define INTEL_GSC_CPD_ENTRY_OFFSET_MASK GENMASK(24, 0)
103 #define INTEL_GSC_CPD_ENTRY_HUFFMAN_COMP BIT(25)
106 * Module/Item length, in bytes. For Huffman-compressed modules, this
107 * refers to the uncompressed size. For software-compressed modules,
108 * this refers to the compressed size.
115 struct intel_gsc_manifest_header {
116 u32 header_type; /* 0x4 for manifest type */
117 u32 header_length; /* in dwords */
122 u32 size; /* In dwords, size of entire manifest (header + extensions) */
125 struct intel_gsc_version fw_version;
126 u32 security_version;
127 struct intel_gsc_version meu_kit_version;
128 u32 meu_manifest_version;
131 u32 modulus_size; /* in dwords */
132 u32 exponent_size; /* in dwords */