nrfxlib API 3.3.99
Loading...
Searching...
No Matches
softperipheral_meta.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef SOFTPERIPHERAL_META_H__
8#define SOFTPERIPHERAL_META_H__
9
10#include <stdint.h>
11
12#define SOFTPERIPHERAL_META_SOFTPERIPHERAL_ID_SQSPI 0x45b1
13
14#if (SOFTPERIPHERAL_META_HEADER_VERSION == 1)
15
16#define SOFTPERIPHERAL_META_COMM_ID_REGIF (1)
17#define SOFTPERIPHERAL_META_COMM_ID_JOBLIST (2)
18
19#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_15 (15)
20#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_20 (20)
21
22#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_L (0)
23#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_H (1)
24
25#define SOFTPERIPHERAL_META_PLATFORM_SERIES_54 (54)
26
27#ifndef SOFTPERIPHERAL_META_SELF_BOOTING
28#define SOFTPERIPHERAL_META_SELF_BOOTING (0)
29#endif
30
31typedef struct
32{
33 union
34 {
35 struct
36 {
37 uint32_t magic : 16;
38 uint32_t header_version : 4;
39 uint32_t comm_id : 8;
40 uint32_t reserved0 : 3;
41 uint32_t self_boot : 1; // If True, set INITPC to NVM address.
42 // If False, copy fw_code_size bytes from NVM to fw_ram_base_addr
43 };
44
45 uint32_t w0_raw;
46 };
47
48 union
49 {
50 struct
51 {
52 uint16_t softperiph_id;
53
54 union
55 {
56 struct
57 {
58 uint16_t device : 7;
59 uint16_t platform : 2;
60 uint16_t series : 7;
61 };
62
63 uint16_t raw;
64 } platform;
65 };
66
67 uint32_t w1_raw;
68 };
69
70 union
71 {
72 struct
73 {
74 uint32_t patch : 16;
75 uint32_t minor : 8;
76 uint32_t major : 8;
77 } version;
78
79 uint32_t w2_raw;
80 };
81
82 union
83 {
84 struct
85 {
86 uint16_t fw_code_size; // size / 16
87 uint16_t
88 fw_ram_total_size; // size / 16. Must also include code (RAM CODE region), code RAM (.data/.bss/.stack/.heap), shared and/or allocatable RAM from the FW.
89 };
90
91 uint32_t w3_raw;
92 };
93
94 union
95 {
96 uint32_t fw_code_addr; // Address of where the code is compiled to run from.
97 uint32_t w4_raw;
98 };
99
100 union
101 {
102 uint32_t
103 fw_ram_base_addr; // Dest address for code in case self_boot = False. Also, the RAM start address set by the FW in case of any RAM it needs.
104 uint32_t w5_raw;
105 };
106
107 union
108 {
109 struct
110 {
111 uint16_t fw_shared_ram_size; // size / 16
112 uint16_t fw_shared_ram_addr_offset;
113 };
114
115 uint32_t w6_raw;
116 };
117
118 union
119 {
120 uint32_t fw_vpr_save_ctx_addr;
121 uint32_t w7_raw;
122 };
123} softperipheral_metadata_t;
124
125#elif (SOFTPERIPHERAL_META_HEADER_VERSION == 2)
126
127#define SOFTPERIPHERAL_META_COMM_ID_REGIF (1)
128#define SOFTPERIPHERAL_META_COMM_ID_JOBLIST (2)
129
130#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_05 (1)
131#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_09 (2)
132#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_10 (4)
133#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_15 (8)
134#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_20 (16)
135#define SOFTPERIPHERAL_META_PLATFORM_DEVICE_ANY (31)
136
137#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_L (1)
138#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_H (2)
139#define SOFTPERIPHERAL_META_PLATFORM_PLATFORM_ANY (3)
140
141#define SOFTPERIPHERAL_META_PLATFORM_SERIES_54 (1)
142#define SOFTPERIPHERAL_META_PLATFORM_SERIES_ANY (1)
143
144#ifndef SOFTPERIPHERAL_META_SELF_BOOTING
145#define SOFTPERIPHERAL_META_SELF_BOOTING (0)
146#endif
147
148typedef struct
149{
150 union
151 {
152 struct
153 {
154 uint32_t magic : 16;
155 uint32_t header_version : 4;
156 uint32_t comm_id : 8;
157 uint32_t reserved0 : 3;
158 uint32_t self_boot : 1; // If True, set INITPC to NVM address.
159 // If False, copy fw_code_size bytes from NVM to fw_ram_base_addr
160 };
161
162 uint32_t w0_raw;
163 };
164
165 union
166 {
167 struct
168 {
169 uint16_t softperiph_id;
170
171 union
172 {
173 struct
174 {
175 uint16_t device : 9;
176 uint16_t platform : 4;
177 uint16_t series : 3;
178 };
179
180 uint16_t raw;
181 } platform;
182 };
183
184 uint32_t w1_raw;
185 };
186
187 union
188 {
189 struct
190 {
191 uint32_t patch : 16;
192 uint32_t minor : 8;
193 uint32_t major : 8;
194 } version;
195
196 uint32_t w2_raw;
197 };
198
199 union
200 {
201 struct
202 {
203 uint16_t fw_code_size; // size / 16
204 uint16_t
205 fw_ram_total_size; // size / 16. Must also include code (RAM CODE region), code RAM (.data/.bss/.stack/.heap), shared and/or allocatable RAM from the FW.
206 };
207
208 uint32_t w3_raw;
209 };
210
211 uint32_t w4_raw;
212
213 union
214 {
215 uint32_t
216 fw_ram_base_addr; // Dest address for code in case self_boot = False. Also, the RAM start address set by the FW in case of any RAM it needs.
217 uint32_t w5_raw;
218 };
219
220 union
221 {
222 struct
223 {
224 uint16_t fw_shared_ram_size; // size / 16
225 uint16_t fw_shared_ram_addr_offset;
226 };
227
228 uint32_t w6_raw;
229 };
230 uint32_t w7_raw;
231} softperipheral_metadata_t;
232
233#endif //SOFTPERIPHERAL_META_HEADER_VERSION
234
235#endif // SOFTPERIPHEREAL_META_H__