blob: f5ff632d6d1fe9e57f8b94ff2d02ef29f848ffc1 [file] [log] [blame]
Krishna Prasad Bhat333edcc2021-11-26 06:52:27 +05301/* BPDT version 1.7 support */
2/* SPDX-License-Identifier: GPL-2.0-only */
3
Kapil Porwal53e5d1f2024-06-17 11:32:58 +00004#ifndef SOC_INTEL_COMMON_CSE_LAYOUT_H
5#define SOC_INTEL_COMMON_CSE_LAYOUT_H
6
Krishna Prasad Bhat333edcc2021-11-26 06:52:27 +05307#include <sys/types.h>
8
9enum bpdt_entry_type {
10 SMIP = 0,
11 CSE_RBE = 1,
12 CSE_BUP = 2,
13 UCODE = 3,
14 IBB = 4,
15 S_BPDT = 5,
16 OBB = 6,
17 CSE_MAIN = 7,
18 ISH = 8,
19 CSE_IDLM = 9,
20 IFP_OVERRIDE = 10,
21 UTOK = 11,
22 UFS_PHY = 12,
23 UFS_GPP = 13,
24 PMC = 14,
25 IUNIT = 15,
26 NVM_CFG = 16,
27 UEP = 17,
28 OEM_KM = 20,
29 PAVP = 22,
30 IOM_FW = 23,
31 NPHY_FW = 24,
32 TBT_FW = 25,
33 ICC = 32,
34
35 MAX_SUBPARTS,
36};
37
38struct bpdt_header {
39 uint32_t signature; /* BPDT_SIGNATURE */
40 uint16_t descriptor_count;
41 uint8_t version; /* Layout 1.7 = 2 */
42 uint8_t flags;
43 uint32_t checksum;
44 uint32_t ifwi_version;
45 struct {
46 uint16_t major;
47 uint16_t minor;
48 uint16_t build;
49 uint16_t hotfix;
50 } fit_tool_version;
51} __packed;
52
53struct cse_layout {
54 uint8_t rom_bypass[16];
55 uint16_t size;
56 uint16_t redundancy;
57 uint32_t checksum;
58 uint32_t data_offset;
59 uint32_t data_size;
60 uint32_t bp1_offset;
61 uint32_t bp1_size;
62 uint32_t bp2_offset;
63 uint32_t bp2_size;
64 uint32_t bp3_offset;
65 uint32_t bp3_size;
66 uint32_t bp4_offset;
67 uint32_t bp4_size;
68 uint32_t bp5_offset;
69 uint32_t bp5_size;
70 uint32_t temp_base_addr;
71 uint32_t temp_base_size;
72 uint32_t flog_offset;
73 uint32_t flog_size;
74} __packed;
75
76struct bpdt_entry {
77 uint32_t type;
78 uint32_t offset;
79 uint32_t size;
80} __packed;
81
82struct subpart_hdr {
83 uint32_t signature; /* SUBPART_SIGNATURE */
84 uint32_t count;
85 uint8_t hdr_version; /* Header version = 2 */
86 uint8_t entry_version; /* Entry version = 1 */
87 uint8_t length;
88 uint8_t reserved;
89 uint8_t name[4];
90 uint32_t checksum;
91} __packed;
92
93struct subpart_entry {
94 uint8_t name[12];
95 uint32_t offset_bytes;
96 uint32_t length;
97 uint32_t rsvd2;
98} __packed;
99
100struct subpart_entry_manifest_header {
101 uint8_t reserved[36];
102 struct {
103 uint16_t major;
104 uint16_t minor;
105 uint16_t build;
106 uint16_t hotfix;
107 } binary_version;
108} __packed;
Kapil Porwal53e5d1f2024-06-17 11:32:58 +0000109
110#define BPDT_HEADER_SZ sizeof(struct bpdt_header)
111#define BPDT_ENTRY_SZ sizeof(struct bpdt_entry)
112#define SUBPART_HEADER_SZ sizeof(struct subpart_hdr)
113#define SUBPART_ENTRY_SZ sizeof(struct subpart_entry)
114#define SUBPART_MANIFEST_HDR_SZ sizeof(struct subpart_entry_manifest_header)
115
116#endif // SOC_INTEL_COMMON_CSE_LAYOUT_H