1 #ifndef NRF91_ERRATAS_H
2 #define NRF91_ERRATAS_H
3
4 /*
5
6 Copyright (c) 2010 - 2023, Nordic Semiconductor ASA All rights reserved.
7
8 SPDX-License-Identifier: BSD-3-Clause
9
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are met:
12
13 1. Redistributions of source code must retain the above copyright notice, this
14 list of conditions and the following disclaimer.
15
16 2. Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
19
20 3. Neither the name of Nordic Semiconductor ASA nor the names of its
21 contributors may be used to endorse or promote products derived from this
22 software without specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35
36 */
37
38 #include <stdint.h>
39 #include <stdbool.h>
40 #include "compiler_abstraction.h"
41
42 static bool nrf91_errata_1(void) __UNUSED;
43 static bool nrf91_errata_2(void) __UNUSED;
44 static bool nrf91_errata_4(void) __UNUSED;
45 static bool nrf91_errata_6(void) __UNUSED;
46 static bool nrf91_errata_7(void) __UNUSED;
47 static bool nrf91_errata_8(void) __UNUSED;
48 static bool nrf91_errata_9(void) __UNUSED;
49 static bool nrf91_errata_10(void) __UNUSED;
50 static bool nrf91_errata_12(void) __UNUSED;
51 static bool nrf91_errata_14(void) __UNUSED;
52 static bool nrf91_errata_15(void) __UNUSED;
53 static bool nrf91_errata_16(void) __UNUSED;
54 static bool nrf91_errata_17(void) __UNUSED;
55 static bool nrf91_errata_20(void) __UNUSED;
56 static bool nrf91_errata_21(void) __UNUSED;
57 static bool nrf91_errata_23(void) __UNUSED;
58 static bool nrf91_errata_24(void) __UNUSED;
59 static bool nrf91_errata_26(void) __UNUSED;
60 static bool nrf91_errata_27(void) __UNUSED;
61 static bool nrf91_errata_28(void) __UNUSED;
62 static bool nrf91_errata_29(void) __UNUSED;
63 static bool nrf91_errata_30(void) __UNUSED;
64 static bool nrf91_errata_31(void) __UNUSED;
65 static bool nrf91_errata_32(void) __UNUSED;
66 static bool nrf91_errata_33(void) __UNUSED;
67 static bool nrf91_errata_35(void) __UNUSED;
68 static bool nrf91_errata_36(void) __UNUSED;
69 static bool nrf91_errata_37(void) __UNUSED;
70
71 /* ========= Errata 1 ========= */
72 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
73 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
74 #define NRF91_ERRATA_1_PRESENT 1
75 #else
76 #define NRF91_ERRATA_1_PRESENT 0
77 #endif
78
79 #ifndef NRF91_ERRATA_1_ENABLE_WORKAROUND
80 #define NRF91_ERRATA_1_ENABLE_WORKAROUND NRF91_ERRATA_1_PRESENT
81 #endif
82
nrf91_errata_1(void)83 static bool nrf91_errata_1(void)
84 {
85 #ifndef NRF91_SERIES
86 return false;
87 #else
88 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
89 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
90 #if defined(NRF_TRUSTZONE_NONSECURE)
91 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
92 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
93 #else
94 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
95 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
96 #endif
97 #endif
98 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
99 __DSB();
100 if (var1 == 0x09)
101 {
102 switch(var2)
103 {
104 case 0x01ul:
105 return true;
106 case 0x02ul:
107 return true;
108 default:
109 return true;
110 }
111 }
112 #endif
113 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
114 __DSB();
115 if (var1 == 0x09)
116 {
117 switch(var2)
118 {
119 case 0x01ul:
120 return true;
121 case 0x02ul:
122 return true;
123 default:
124 return true;
125 }
126 }
127 #endif
128 return false;
129 #endif
130 }
131
132 /* ========= Errata 2 ========= */
133 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
134 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
135 #define NRF91_ERRATA_2_PRESENT 1
136 #else
137 #define NRF91_ERRATA_2_PRESENT 0
138 #endif
139
140 #ifndef NRF91_ERRATA_2_ENABLE_WORKAROUND
141 #define NRF91_ERRATA_2_ENABLE_WORKAROUND NRF91_ERRATA_2_PRESENT
142 #endif
143
nrf91_errata_2(void)144 static bool nrf91_errata_2(void)
145 {
146 #ifndef NRF91_SERIES
147 return false;
148 #else
149 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
150 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
151 #if defined(NRF_TRUSTZONE_NONSECURE)
152 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
153 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
154 #else
155 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
156 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
157 #endif
158 #endif
159 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
160 __DSB();
161 if (var1 == 0x09)
162 {
163 switch(var2)
164 {
165 case 0x01ul:
166 return true;
167 case 0x02ul:
168 return true;
169 default:
170 return true;
171 }
172 }
173 #endif
174 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
175 __DSB();
176 if (var1 == 0x09)
177 {
178 switch(var2)
179 {
180 case 0x01ul:
181 return true;
182 case 0x02ul:
183 return true;
184 default:
185 return true;
186 }
187 }
188 #endif
189 return false;
190 #endif
191 }
192
193 /* ========= Errata 4 ========= */
194 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
195 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
196 #define NRF91_ERRATA_4_PRESENT 1
197 #else
198 #define NRF91_ERRATA_4_PRESENT 0
199 #endif
200
201 #ifndef NRF91_ERRATA_4_ENABLE_WORKAROUND
202 #define NRF91_ERRATA_4_ENABLE_WORKAROUND NRF91_ERRATA_4_PRESENT
203 #endif
204
nrf91_errata_4(void)205 static bool nrf91_errata_4(void)
206 {
207 #ifndef NRF91_SERIES
208 return false;
209 #else
210 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
211 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
212 #if defined(NRF_TRUSTZONE_NONSECURE)
213 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
214 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
215 #else
216 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
217 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
218 #endif
219 #endif
220 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
221 __DSB();
222 if (var1 == 0x09)
223 {
224 switch(var2)
225 {
226 case 0x01ul:
227 return true;
228 case 0x02ul:
229 return true;
230 default:
231 return true;
232 }
233 }
234 #endif
235 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
236 __DSB();
237 if (var1 == 0x09)
238 {
239 switch(var2)
240 {
241 case 0x01ul:
242 return true;
243 case 0x02ul:
244 return true;
245 default:
246 return true;
247 }
248 }
249 #endif
250 return false;
251 #endif
252 }
253
254 /* ========= Errata 6 ========= */
255 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
256 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
257 #define NRF91_ERRATA_6_PRESENT 1
258 #else
259 #define NRF91_ERRATA_6_PRESENT 0
260 #endif
261
262 #ifndef NRF91_ERRATA_6_ENABLE_WORKAROUND
263 #define NRF91_ERRATA_6_ENABLE_WORKAROUND NRF91_ERRATA_6_PRESENT
264 #endif
265
nrf91_errata_6(void)266 static bool nrf91_errata_6(void)
267 {
268 #ifndef NRF91_SERIES
269 return false;
270 #else
271 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
272 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
273 #if defined(NRF_TRUSTZONE_NONSECURE)
274 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
275 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
276 #else
277 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
278 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
279 #endif
280 #endif
281 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
282 __DSB();
283 if (var1 == 0x09)
284 {
285 switch(var2)
286 {
287 case 0x01ul:
288 return true;
289 case 0x02ul:
290 return true;
291 default:
292 return true;
293 }
294 }
295 #endif
296 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
297 __DSB();
298 if (var1 == 0x09)
299 {
300 switch(var2)
301 {
302 case 0x01ul:
303 return true;
304 case 0x02ul:
305 return true;
306 default:
307 return true;
308 }
309 }
310 #endif
311 return false;
312 #endif
313 }
314
315 /* ========= Errata 7 ========= */
316 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
317 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
318 #define NRF91_ERRATA_7_PRESENT 1
319 #else
320 #define NRF91_ERRATA_7_PRESENT 0
321 #endif
322
323 #ifndef NRF91_ERRATA_7_ENABLE_WORKAROUND
324 #define NRF91_ERRATA_7_ENABLE_WORKAROUND NRF91_ERRATA_7_PRESENT
325 #endif
326
nrf91_errata_7(void)327 static bool nrf91_errata_7(void)
328 {
329 #ifndef NRF91_SERIES
330 return false;
331 #else
332 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
333 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
334 #if defined(NRF_TRUSTZONE_NONSECURE)
335 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
336 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
337 #else
338 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
339 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
340 #endif
341 #endif
342 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
343 __DSB();
344 if (var1 == 0x09)
345 {
346 switch(var2)
347 {
348 case 0x01ul:
349 return true;
350 case 0x02ul:
351 return true;
352 default:
353 return true;
354 }
355 }
356 #endif
357 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
358 __DSB();
359 if (var1 == 0x09)
360 {
361 switch(var2)
362 {
363 case 0x01ul:
364 return true;
365 case 0x02ul:
366 return true;
367 default:
368 return true;
369 }
370 }
371 #endif
372 return false;
373 #endif
374 }
375
376 /* ========= Errata 8 ========= */
377 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
378 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
379 #define NRF91_ERRATA_8_PRESENT 1
380 #else
381 #define NRF91_ERRATA_8_PRESENT 0
382 #endif
383
384 #ifndef NRF91_ERRATA_8_ENABLE_WORKAROUND
385 #define NRF91_ERRATA_8_ENABLE_WORKAROUND NRF91_ERRATA_8_PRESENT
386 #endif
387
nrf91_errata_8(void)388 static bool nrf91_errata_8(void)
389 {
390 #ifndef NRF91_SERIES
391 return false;
392 #else
393 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
394 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
395 #if defined(NRF_TRUSTZONE_NONSECURE)
396 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
397 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
398 #else
399 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
400 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
401 #endif
402 #endif
403 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
404 __DSB();
405 if (var1 == 0x09)
406 {
407 switch(var2)
408 {
409 case 0x01ul:
410 return true;
411 case 0x02ul:
412 return false;
413 default:
414 return false;
415 }
416 }
417 #endif
418 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
419 __DSB();
420 if (var1 == 0x09)
421 {
422 switch(var2)
423 {
424 case 0x01ul:
425 return true;
426 case 0x02ul:
427 return false;
428 default:
429 return false;
430 }
431 }
432 #endif
433 return false;
434 #endif
435 }
436
437 /* ========= Errata 9 ========= */
438 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
439 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
440 #define NRF91_ERRATA_9_PRESENT 1
441 #else
442 #define NRF91_ERRATA_9_PRESENT 0
443 #endif
444
445 #ifndef NRF91_ERRATA_9_ENABLE_WORKAROUND
446 #define NRF91_ERRATA_9_ENABLE_WORKAROUND NRF91_ERRATA_9_PRESENT
447 #endif
448
nrf91_errata_9(void)449 static bool nrf91_errata_9(void)
450 {
451 #ifndef NRF91_SERIES
452 return false;
453 #else
454 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
455 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
456 #if defined(NRF_TRUSTZONE_NONSECURE)
457 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
458 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
459 #else
460 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
461 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
462 #endif
463 #endif
464 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
465 __DSB();
466 if (var1 == 0x09)
467 {
468 switch(var2)
469 {
470 case 0x01ul:
471 return false;
472 case 0x02ul:
473 return true;
474 default:
475 return true;
476 }
477 }
478 #endif
479 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
480 __DSB();
481 if (var1 == 0x09)
482 {
483 switch(var2)
484 {
485 case 0x01ul:
486 return false;
487 case 0x02ul:
488 return true;
489 default:
490 return true;
491 }
492 }
493 #endif
494 return false;
495 #endif
496 }
497
498 /* ========= Errata 10 ========= */
499 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
500 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
501 #define NRF91_ERRATA_10_PRESENT 1
502 #else
503 #define NRF91_ERRATA_10_PRESENT 0
504 #endif
505
506 #ifndef NRF91_ERRATA_10_ENABLE_WORKAROUND
507 #define NRF91_ERRATA_10_ENABLE_WORKAROUND NRF91_ERRATA_10_PRESENT
508 #endif
509
nrf91_errata_10(void)510 static bool nrf91_errata_10(void)
511 {
512 #ifndef NRF91_SERIES
513 return false;
514 #else
515 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
516 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
517 #if defined(NRF_TRUSTZONE_NONSECURE)
518 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
519 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
520 #else
521 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
522 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
523 #endif
524 #endif
525 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
526 __DSB();
527 if (var1 == 0x09)
528 {
529 switch(var2)
530 {
531 case 0x01ul:
532 return true;
533 case 0x02ul:
534 return false;
535 default:
536 return false;
537 }
538 }
539 #endif
540 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
541 __DSB();
542 if (var1 == 0x09)
543 {
544 switch(var2)
545 {
546 case 0x01ul:
547 return true;
548 case 0x02ul:
549 return false;
550 default:
551 return false;
552 }
553 }
554 #endif
555 return false;
556 #endif
557 }
558
559 /* ========= Errata 12 ========= */
560 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
561 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
562 #define NRF91_ERRATA_12_PRESENT 1
563 #else
564 #define NRF91_ERRATA_12_PRESENT 0
565 #endif
566
567 #ifndef NRF91_ERRATA_12_ENABLE_WORKAROUND
568 #define NRF91_ERRATA_12_ENABLE_WORKAROUND NRF91_ERRATA_12_PRESENT
569 #endif
570
nrf91_errata_12(void)571 static bool nrf91_errata_12(void)
572 {
573 #ifndef NRF91_SERIES
574 return false;
575 #else
576 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
577 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
578 #if defined(NRF_TRUSTZONE_NONSECURE)
579 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
580 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
581 #else
582 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
583 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
584 #endif
585 #endif
586 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
587 __DSB();
588 if (var1 == 0x09)
589 {
590 switch(var2)
591 {
592 case 0x01ul:
593 return true;
594 case 0x02ul:
595 return false;
596 default:
597 return false;
598 }
599 }
600 #endif
601 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
602 __DSB();
603 if (var1 == 0x09)
604 {
605 switch(var2)
606 {
607 case 0x01ul:
608 return true;
609 case 0x02ul:
610 return false;
611 default:
612 return false;
613 }
614 }
615 #endif
616 return false;
617 #endif
618 }
619
620 /* ========= Errata 14 ========= */
621 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
622 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
623 #define NRF91_ERRATA_14_PRESENT 1
624 #else
625 #define NRF91_ERRATA_14_PRESENT 0
626 #endif
627
628 #ifndef NRF91_ERRATA_14_ENABLE_WORKAROUND
629 #define NRF91_ERRATA_14_ENABLE_WORKAROUND NRF91_ERRATA_14_PRESENT
630 #endif
631
nrf91_errata_14(void)632 static bool nrf91_errata_14(void)
633 {
634 #ifndef NRF91_SERIES
635 return false;
636 #else
637 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
638 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
639 #if defined(NRF_TRUSTZONE_NONSECURE)
640 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
641 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
642 #else
643 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
644 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
645 #endif
646 #endif
647 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
648 __DSB();
649 if (var1 == 0x09)
650 {
651 switch(var2)
652 {
653 case 0x01ul:
654 return true;
655 case 0x02ul:
656 return false;
657 default:
658 return false;
659 }
660 }
661 #endif
662 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
663 __DSB();
664 if (var1 == 0x09)
665 {
666 switch(var2)
667 {
668 case 0x01ul:
669 return true;
670 case 0x02ul:
671 return false;
672 default:
673 return false;
674 }
675 }
676 #endif
677 return false;
678 #endif
679 }
680
681 /* ========= Errata 15 ========= */
682 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
683 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
684 #define NRF91_ERRATA_15_PRESENT 1
685 #else
686 #define NRF91_ERRATA_15_PRESENT 0
687 #endif
688
689 #ifndef NRF91_ERRATA_15_ENABLE_WORKAROUND
690 #define NRF91_ERRATA_15_ENABLE_WORKAROUND NRF91_ERRATA_15_PRESENT
691 #endif
692
nrf91_errata_15(void)693 static bool nrf91_errata_15(void)
694 {
695 #ifndef NRF91_SERIES
696 return false;
697 #else
698 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
699 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
700 #if defined(NRF_TRUSTZONE_NONSECURE)
701 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
702 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
703 #else
704 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
705 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
706 #endif
707 #endif
708 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
709 __DSB();
710 if (var1 == 0x09)
711 {
712 switch(var2)
713 {
714 case 0x01ul:
715 return false;
716 case 0x02ul:
717 return true;
718 default:
719 return true;
720 }
721 }
722 #endif
723 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
724 __DSB();
725 if (var1 == 0x09)
726 {
727 switch(var2)
728 {
729 case 0x01ul:
730 return false;
731 case 0x02ul:
732 return true;
733 default:
734 return true;
735 }
736 }
737 #endif
738 return false;
739 #endif
740 }
741
742 /* ========= Errata 16 ========= */
743 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
744 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
745 #define NRF91_ERRATA_16_PRESENT 1
746 #else
747 #define NRF91_ERRATA_16_PRESENT 0
748 #endif
749
750 #ifndef NRF91_ERRATA_16_ENABLE_WORKAROUND
751 #define NRF91_ERRATA_16_ENABLE_WORKAROUND NRF91_ERRATA_16_PRESENT
752 #endif
753
nrf91_errata_16(void)754 static bool nrf91_errata_16(void)
755 {
756 #ifndef NRF91_SERIES
757 return false;
758 #else
759 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
760 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
761 #if defined(NRF_TRUSTZONE_NONSECURE)
762 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
763 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
764 #else
765 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
766 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
767 #endif
768 #endif
769 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
770 __DSB();
771 if (var1 == 0x09)
772 {
773 switch(var2)
774 {
775 case 0x01ul:
776 return true;
777 case 0x02ul:
778 return false;
779 default:
780 return false;
781 }
782 }
783 #endif
784 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
785 __DSB();
786 if (var1 == 0x09)
787 {
788 switch(var2)
789 {
790 case 0x01ul:
791 return true;
792 case 0x02ul:
793 return false;
794 default:
795 return false;
796 }
797 }
798 #endif
799 return false;
800 #endif
801 }
802
803 /* ========= Errata 17 ========= */
804 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
805 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
806 #define NRF91_ERRATA_17_PRESENT 1
807 #else
808 #define NRF91_ERRATA_17_PRESENT 0
809 #endif
810
811 #ifndef NRF91_ERRATA_17_ENABLE_WORKAROUND
812 #define NRF91_ERRATA_17_ENABLE_WORKAROUND NRF91_ERRATA_17_PRESENT
813 #endif
814
nrf91_errata_17(void)815 static bool nrf91_errata_17(void)
816 {
817 #ifndef NRF91_SERIES
818 return false;
819 #else
820 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
821 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
822 #if defined(NRF_TRUSTZONE_NONSECURE)
823 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
824 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
825 #else
826 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
827 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
828 #endif
829 #endif
830 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
831 __DSB();
832 if (var1 == 0x09)
833 {
834 switch(var2)
835 {
836 case 0x01ul:
837 return true;
838 case 0x02ul:
839 return false;
840 default:
841 return false;
842 }
843 }
844 #endif
845 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
846 __DSB();
847 if (var1 == 0x09)
848 {
849 switch(var2)
850 {
851 case 0x01ul:
852 return true;
853 case 0x02ul:
854 return false;
855 default:
856 return false;
857 }
858 }
859 #endif
860 return false;
861 #endif
862 }
863
864 /* ========= Errata 20 ========= */
865 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
866 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
867 #define NRF91_ERRATA_20_PRESENT 1
868 #else
869 #define NRF91_ERRATA_20_PRESENT 0
870 #endif
871
872 #ifndef NRF91_ERRATA_20_ENABLE_WORKAROUND
873 #define NRF91_ERRATA_20_ENABLE_WORKAROUND NRF91_ERRATA_20_PRESENT
874 #endif
875
nrf91_errata_20(void)876 static bool nrf91_errata_20(void)
877 {
878 #ifndef NRF91_SERIES
879 return false;
880 #else
881 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
882 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
883 #if defined(NRF_TRUSTZONE_NONSECURE)
884 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
885 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
886 #else
887 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
888 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
889 #endif
890 #endif
891 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
892 __DSB();
893 if (var1 == 0x09)
894 {
895 switch(var2)
896 {
897 case 0x01ul:
898 return true;
899 case 0x02ul:
900 return false;
901 default:
902 return false;
903 }
904 }
905 #endif
906 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
907 __DSB();
908 if (var1 == 0x09)
909 {
910 switch(var2)
911 {
912 case 0x01ul:
913 return true;
914 case 0x02ul:
915 return false;
916 default:
917 return false;
918 }
919 }
920 #endif
921 return false;
922 #endif
923 }
924
925 /* ========= Errata 21 ========= */
926 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
927 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
928 #define NRF91_ERRATA_21_PRESENT 1
929 #else
930 #define NRF91_ERRATA_21_PRESENT 0
931 #endif
932
933 #ifndef NRF91_ERRATA_21_ENABLE_WORKAROUND
934 #define NRF91_ERRATA_21_ENABLE_WORKAROUND NRF91_ERRATA_21_PRESENT
935 #endif
936
nrf91_errata_21(void)937 static bool nrf91_errata_21(void)
938 {
939 #ifndef NRF91_SERIES
940 return false;
941 #else
942 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
943 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
944 #if defined(NRF_TRUSTZONE_NONSECURE)
945 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
946 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
947 #else
948 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
949 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
950 #endif
951 #endif
952 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
953 __DSB();
954 if (var1 == 0x09)
955 {
956 switch(var2)
957 {
958 case 0x01ul:
959 return true;
960 case 0x02ul:
961 return true;
962 default:
963 return true;
964 }
965 }
966 #endif
967 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
968 __DSB();
969 if (var1 == 0x09)
970 {
971 switch(var2)
972 {
973 case 0x01ul:
974 return true;
975 case 0x02ul:
976 return true;
977 default:
978 return true;
979 }
980 }
981 #endif
982 return false;
983 #endif
984 }
985
986 /* ========= Errata 23 ========= */
987 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
988 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
989 #define NRF91_ERRATA_23_PRESENT 1
990 #else
991 #define NRF91_ERRATA_23_PRESENT 0
992 #endif
993
994 #ifndef NRF91_ERRATA_23_ENABLE_WORKAROUND
995 #define NRF91_ERRATA_23_ENABLE_WORKAROUND NRF91_ERRATA_23_PRESENT
996 #endif
997
nrf91_errata_23(void)998 static bool nrf91_errata_23(void)
999 {
1000 #ifndef NRF91_SERIES
1001 return false;
1002 #else
1003 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1004 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1005 #if defined(NRF_TRUSTZONE_NONSECURE)
1006 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1007 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1008 #else
1009 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1010 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1011 #endif
1012 #endif
1013 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1014 __DSB();
1015 if (var1 == 0x09)
1016 {
1017 switch(var2)
1018 {
1019 case 0x01ul:
1020 return true;
1021 case 0x02ul:
1022 return true;
1023 default:
1024 return true;
1025 }
1026 }
1027 #endif
1028 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1029 __DSB();
1030 if (var1 == 0x09)
1031 {
1032 switch(var2)
1033 {
1034 case 0x01ul:
1035 return true;
1036 case 0x02ul:
1037 return true;
1038 default:
1039 return true;
1040 }
1041 }
1042 #endif
1043 return false;
1044 #endif
1045 }
1046
1047 /* ========= Errata 24 ========= */
1048 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1049 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1050 #define NRF91_ERRATA_24_PRESENT 1
1051 #else
1052 #define NRF91_ERRATA_24_PRESENT 0
1053 #endif
1054
1055 #ifndef NRF91_ERRATA_24_ENABLE_WORKAROUND
1056 #define NRF91_ERRATA_24_ENABLE_WORKAROUND NRF91_ERRATA_24_PRESENT
1057 #endif
1058
nrf91_errata_24(void)1059 static bool nrf91_errata_24(void)
1060 {
1061 #ifndef NRF91_SERIES
1062 return false;
1063 #else
1064 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1065 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1066 #if defined(NRF_TRUSTZONE_NONSECURE)
1067 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1068 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1069 #else
1070 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1071 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1072 #endif
1073 #endif
1074 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1075 __DSB();
1076 if (var1 == 0x09)
1077 {
1078 switch(var2)
1079 {
1080 case 0x01ul:
1081 return true;
1082 case 0x02ul:
1083 return true;
1084 default:
1085 return true;
1086 }
1087 }
1088 #endif
1089 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1090 __DSB();
1091 if (var1 == 0x09)
1092 {
1093 switch(var2)
1094 {
1095 case 0x01ul:
1096 return true;
1097 case 0x02ul:
1098 return true;
1099 default:
1100 return true;
1101 }
1102 }
1103 #endif
1104 return false;
1105 #endif
1106 }
1107
1108 /* ========= Errata 26 ========= */
1109 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1110 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1111 #define NRF91_ERRATA_26_PRESENT 1
1112 #else
1113 #define NRF91_ERRATA_26_PRESENT 0
1114 #endif
1115
1116 #ifndef NRF91_ERRATA_26_ENABLE_WORKAROUND
1117 #define NRF91_ERRATA_26_ENABLE_WORKAROUND NRF91_ERRATA_26_PRESENT
1118 #endif
1119
nrf91_errata_26(void)1120 static bool nrf91_errata_26(void)
1121 {
1122 #ifndef NRF91_SERIES
1123 return false;
1124 #else
1125 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1126 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1127 #if defined(NRF_TRUSTZONE_NONSECURE)
1128 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1129 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1130 #else
1131 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1132 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1133 #endif
1134 #endif
1135 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1136 __DSB();
1137 if (var1 == 0x09)
1138 {
1139 switch(var2)
1140 {
1141 case 0x01ul:
1142 return true;
1143 case 0x02ul:
1144 return true;
1145 default:
1146 return true;
1147 }
1148 }
1149 #endif
1150 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1151 __DSB();
1152 if (var1 == 0x09)
1153 {
1154 switch(var2)
1155 {
1156 case 0x01ul:
1157 return true;
1158 case 0x02ul:
1159 return true;
1160 default:
1161 return true;
1162 }
1163 }
1164 #endif
1165 return false;
1166 #endif
1167 }
1168
1169 /* ========= Errata 27 ========= */
1170 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1171 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1172 #define NRF91_ERRATA_27_PRESENT 1
1173 #else
1174 #define NRF91_ERRATA_27_PRESENT 0
1175 #endif
1176
1177 #ifndef NRF91_ERRATA_27_ENABLE_WORKAROUND
1178 #define NRF91_ERRATA_27_ENABLE_WORKAROUND NRF91_ERRATA_27_PRESENT
1179 #endif
1180
nrf91_errata_27(void)1181 static bool nrf91_errata_27(void)
1182 {
1183 #ifndef NRF91_SERIES
1184 return false;
1185 #else
1186 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1187 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1188 #if defined(NRF_TRUSTZONE_NONSECURE)
1189 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1190 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1191 #else
1192 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1193 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1194 #endif
1195 #endif
1196 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1197 __DSB();
1198 if (var1 == 0x09)
1199 {
1200 switch(var2)
1201 {
1202 case 0x01ul:
1203 return false;
1204 case 0x02ul:
1205 return true;
1206 default:
1207 return true;
1208 }
1209 }
1210 #endif
1211 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1212 __DSB();
1213 if (var1 == 0x09)
1214 {
1215 switch(var2)
1216 {
1217 case 0x01ul:
1218 return false;
1219 case 0x02ul:
1220 return true;
1221 default:
1222 return true;
1223 }
1224 }
1225 #endif
1226 return false;
1227 #endif
1228 }
1229
1230 /* ========= Errata 28 ========= */
1231 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1232 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1233 #define NRF91_ERRATA_28_PRESENT 1
1234 #else
1235 #define NRF91_ERRATA_28_PRESENT 0
1236 #endif
1237
1238 #ifndef NRF91_ERRATA_28_ENABLE_WORKAROUND
1239 #define NRF91_ERRATA_28_ENABLE_WORKAROUND NRF91_ERRATA_28_PRESENT
1240 #endif
1241
nrf91_errata_28(void)1242 static bool nrf91_errata_28(void)
1243 {
1244 #ifndef NRF91_SERIES
1245 return false;
1246 #else
1247 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1248 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1249 #if defined(NRF_TRUSTZONE_NONSECURE)
1250 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1251 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1252 #else
1253 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1254 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1255 #endif
1256 #endif
1257 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1258 __DSB();
1259 if (var1 == 0x09)
1260 {
1261 switch(var2)
1262 {
1263 case 0x01ul:
1264 return true;
1265 case 0x02ul:
1266 return true;
1267 default:
1268 return true;
1269 }
1270 }
1271 #endif
1272 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1273 __DSB();
1274 if (var1 == 0x09)
1275 {
1276 switch(var2)
1277 {
1278 case 0x01ul:
1279 return true;
1280 case 0x02ul:
1281 return true;
1282 default:
1283 return true;
1284 }
1285 }
1286 #endif
1287 return false;
1288 #endif
1289 }
1290
1291 /* ========= Errata 29 ========= */
1292 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1293 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1294 #define NRF91_ERRATA_29_PRESENT 1
1295 #else
1296 #define NRF91_ERRATA_29_PRESENT 0
1297 #endif
1298
1299 #ifndef NRF91_ERRATA_29_ENABLE_WORKAROUND
1300 #define NRF91_ERRATA_29_ENABLE_WORKAROUND NRF91_ERRATA_29_PRESENT
1301 #endif
1302
nrf91_errata_29(void)1303 static bool nrf91_errata_29(void)
1304 {
1305 #ifndef NRF91_SERIES
1306 return false;
1307 #else
1308 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1309 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1310 #if defined(NRF_TRUSTZONE_NONSECURE)
1311 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1312 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1313 #else
1314 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1315 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1316 #endif
1317 #endif
1318 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1319 __DSB();
1320 if (var1 == 0x09)
1321 {
1322 switch(var2)
1323 {
1324 case 0x01ul:
1325 return true;
1326 case 0x02ul:
1327 return true;
1328 default:
1329 return true;
1330 }
1331 }
1332 #endif
1333 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1334 __DSB();
1335 if (var1 == 0x09)
1336 {
1337 switch(var2)
1338 {
1339 case 0x01ul:
1340 return true;
1341 case 0x02ul:
1342 return true;
1343 default:
1344 return true;
1345 }
1346 }
1347 #endif
1348 return false;
1349 #endif
1350 }
1351
1352 /* ========= Errata 30 ========= */
1353 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1354 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1355 #define NRF91_ERRATA_30_PRESENT 1
1356 #else
1357 #define NRF91_ERRATA_30_PRESENT 0
1358 #endif
1359
1360 #ifndef NRF91_ERRATA_30_ENABLE_WORKAROUND
1361 #define NRF91_ERRATA_30_ENABLE_WORKAROUND NRF91_ERRATA_30_PRESENT
1362 #endif
1363
nrf91_errata_30(void)1364 static bool nrf91_errata_30(void)
1365 {
1366 #ifndef NRF91_SERIES
1367 return false;
1368 #else
1369 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1370 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1371 #if defined(NRF_TRUSTZONE_NONSECURE)
1372 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1373 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1374 #else
1375 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1376 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1377 #endif
1378 #endif
1379 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1380 __DSB();
1381 if (var1 == 0x09)
1382 {
1383 switch(var2)
1384 {
1385 case 0x01ul:
1386 return true;
1387 case 0x02ul:
1388 return true;
1389 default:
1390 return true;
1391 }
1392 }
1393 #endif
1394 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1395 __DSB();
1396 if (var1 == 0x09)
1397 {
1398 switch(var2)
1399 {
1400 case 0x01ul:
1401 return true;
1402 case 0x02ul:
1403 return true;
1404 default:
1405 return true;
1406 }
1407 }
1408 #endif
1409 return false;
1410 #endif
1411 }
1412
1413 /* ========= Errata 31 ========= */
1414 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1415 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1416 #define NRF91_ERRATA_31_PRESENT 1
1417 #else
1418 #define NRF91_ERRATA_31_PRESENT 0
1419 #endif
1420
1421 #ifndef NRF91_ERRATA_31_ENABLE_WORKAROUND
1422 #define NRF91_ERRATA_31_ENABLE_WORKAROUND NRF91_ERRATA_31_PRESENT
1423 #endif
1424
nrf91_errata_31(void)1425 static bool nrf91_errata_31(void)
1426 {
1427 #ifndef NRF91_SERIES
1428 return false;
1429 #else
1430 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1431 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1432 #if defined(NRF_TRUSTZONE_NONSECURE)
1433 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1434 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1435 #else
1436 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1437 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1438 #endif
1439 #endif
1440 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1441 __DSB();
1442 if (var1 == 0x09)
1443 {
1444 switch(var2)
1445 {
1446 case 0x01ul:
1447 return true;
1448 case 0x02ul:
1449 return true;
1450 default:
1451 return true;
1452 }
1453 }
1454 #endif
1455 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1456 __DSB();
1457 if (var1 == 0x09)
1458 {
1459 switch(var2)
1460 {
1461 case 0x01ul:
1462 return true;
1463 case 0x02ul:
1464 return true;
1465 default:
1466 return true;
1467 }
1468 }
1469 #endif
1470 return false;
1471 #endif
1472 }
1473
1474 /* ========= Errata 32 ========= */
1475 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1476 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1477 #define NRF91_ERRATA_32_PRESENT 1
1478 #else
1479 #define NRF91_ERRATA_32_PRESENT 0
1480 #endif
1481
1482 #ifndef NRF91_ERRATA_32_ENABLE_WORKAROUND
1483 #define NRF91_ERRATA_32_ENABLE_WORKAROUND NRF91_ERRATA_32_PRESENT
1484 #endif
1485
nrf91_errata_32(void)1486 static bool nrf91_errata_32(void)
1487 {
1488 #ifndef NRF91_SERIES
1489 return false;
1490 #else
1491 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1492 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1493 #if defined(NRF_TRUSTZONE_NONSECURE)
1494 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1495 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1496 #else
1497 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1498 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1499 #endif
1500 #endif
1501 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1502 __DSB();
1503 if (var1 == 0x09)
1504 {
1505 switch(var2)
1506 {
1507 case 0x01ul:
1508 return true;
1509 case 0x02ul:
1510 return true;
1511 default:
1512 return true;
1513 }
1514 }
1515 #endif
1516 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1517 __DSB();
1518 if (var1 == 0x09)
1519 {
1520 switch(var2)
1521 {
1522 case 0x01ul:
1523 return true;
1524 case 0x02ul:
1525 return true;
1526 default:
1527 return true;
1528 }
1529 }
1530 #endif
1531 return false;
1532 #endif
1533 }
1534
1535 /* ========= Errata 33 ========= */
1536 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1537 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1538 #define NRF91_ERRATA_33_PRESENT 1
1539 #else
1540 #define NRF91_ERRATA_33_PRESENT 0
1541 #endif
1542
1543 #ifndef NRF91_ERRATA_33_ENABLE_WORKAROUND
1544 #define NRF91_ERRATA_33_ENABLE_WORKAROUND NRF91_ERRATA_33_PRESENT
1545 #endif
1546
nrf91_errata_33(void)1547 static bool nrf91_errata_33(void)
1548 {
1549 #ifndef NRF91_SERIES
1550 return false;
1551 #else
1552 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1553 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1554 #if defined(NRF_TRUSTZONE_NONSECURE)
1555 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1556 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1557 #else
1558 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1559 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1560 #endif
1561 #endif
1562 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1563 __DSB();
1564 if (var1 == 0x09)
1565 {
1566 switch(var2)
1567 {
1568 case 0x01ul:
1569 return true;
1570 case 0x02ul:
1571 return true;
1572 default:
1573 return true;
1574 }
1575 }
1576 #endif
1577 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1578 __DSB();
1579 if (var1 == 0x09)
1580 {
1581 switch(var2)
1582 {
1583 case 0x01ul:
1584 return true;
1585 case 0x02ul:
1586 return true;
1587 default:
1588 return true;
1589 }
1590 }
1591 #endif
1592 return false;
1593 #endif
1594 }
1595
1596 /* ========= Errata 35 ========= */
1597 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120) \
1598 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1599 #define NRF91_ERRATA_35_PRESENT 1
1600 #else
1601 #define NRF91_ERRATA_35_PRESENT 0
1602 #endif
1603
1604 #ifndef NRF91_ERRATA_35_ENABLE_WORKAROUND
1605 #define NRF91_ERRATA_35_ENABLE_WORKAROUND 0
1606 #endif
1607
nrf91_errata_35(void)1608 static bool nrf91_errata_35(void)
1609 {
1610 #ifndef NRF91_SERIES
1611 return false;
1612 #else
1613 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)\
1614 || defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1615 #if defined(NRF_TRUSTZONE_NONSECURE)
1616 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1617 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1618 #else
1619 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1620 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1621 #endif
1622 #endif
1623 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1624 __DSB();
1625 if (var1 == 0x09)
1626 {
1627 switch(var2)
1628 {
1629 case 0x01ul:
1630 return true;
1631 case 0x02ul:
1632 return true;
1633 default:
1634 return true;
1635 }
1636 }
1637 #endif
1638 #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160)
1639 __DSB();
1640 if (var1 == 0x09)
1641 {
1642 switch(var2)
1643 {
1644 case 0x01ul:
1645 return true;
1646 case 0x02ul:
1647 return true;
1648 default:
1649 return true;
1650 }
1651 }
1652 #endif
1653 return false;
1654 #endif
1655 }
1656
1657 /* ========= Errata 36 ========= */
1658 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1659 #define NRF91_ERRATA_36_PRESENT 1
1660 #else
1661 #define NRF91_ERRATA_36_PRESENT 0
1662 #endif
1663
1664 #ifndef NRF91_ERRATA_36_ENABLE_WORKAROUND
1665 #define NRF91_ERRATA_36_ENABLE_WORKAROUND NRF91_ERRATA_36_PRESENT
1666 #endif
1667
nrf91_errata_36(void)1668 static bool nrf91_errata_36(void)
1669 {
1670 #ifndef NRF91_SERIES
1671 return false;
1672 #else
1673 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1674 #if defined(NRF_TRUSTZONE_NONSECURE)
1675 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul))) & 0x00000FFFul;
1676 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul));
1677 #else
1678 uint32_t var1 = (*((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul))) & 0x00000FFFul;
1679 uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul));
1680 #endif
1681 #endif
1682 #if defined (NRF9120_XXAA) || defined (DEVELOP_IN_NRF9120)
1683 __DSB();
1684 if (var1 == 0x09)
1685 {
1686 switch(var2)
1687 {
1688 case 0x01ul:
1689 return false;
1690 case 0x02ul:
1691 return false;
1692 case 0x03ul:
1693 return true;
1694 default:
1695 return true;
1696 }
1697 }
1698 #endif
1699 return false;
1700 #endif
1701 }
1702
1703 /* ========= Errata 37 ========= */
1704 #define NRF91_ERRATA_37_PRESENT 0
1705
1706 #ifndef NRF91_ERRATA_37_ENABLE_WORKAROUND
1707 #define NRF91_ERRATA_37_ENABLE_WORKAROUND NRF91_ERRATA_37_PRESENT
1708 #endif
1709
nrf91_errata_37(void)1710 static bool nrf91_errata_37(void)
1711 {
1712 #ifndef NRF91_SERIES
1713 return false;
1714 #else
1715 return false;
1716 #endif
1717 }
1718
1719 #endif /* NRF91_ERRATAS_H */
1720