Branch data Line data Source code
1 : : #ifndef NRF91_ERRATAS_H 2 : : #define NRF91_ERRATAS_H 3 : : 4 : : /* 5 : : 6 : : Copyright (c) 2010 - 2021, 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 : : 68 : : /* ========= Errata 1 ========= */ 69 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 70 : : #define NRF91_ERRATA_1_PRESENT 1 71 : : #else 72 : : #define NRF91_ERRATA_1_PRESENT 0 73 : : #endif 74 : : 75 : : #ifndef NRF91_ERRATA_1_ENABLE_WORKAROUND 76 : : #define NRF91_ERRATA_1_ENABLE_WORKAROUND NRF91_ERRATA_1_PRESENT 77 : : #endif 78 : : 79 : 0 : static bool nrf91_errata_1(void) 80 : : { 81 : : #ifndef NRF91_SERIES 82 : 0 : return false; 83 : : #else 84 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 85 : : #if defined(NRF_TRUSTZONE_NONSECURE) 86 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 87 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 88 : : #else 89 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 90 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 91 : : #endif 92 : : #endif 93 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 94 : : __DSB(); 95 : : if (var1 == 0x09) 96 : : { 97 : : switch(var2) 98 : : { 99 : : case 0x01ul: 100 : : return true; 101 : : case 0x02ul: 102 : : return true; 103 : : default: 104 : : return true; 105 : : } 106 : : } 107 : : #endif 108 : : return false; 109 : : #endif 110 : : } 111 : : 112 : : /* ========= Errata 2 ========= */ 113 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 114 : : #define NRF91_ERRATA_2_PRESENT 1 115 : : #else 116 : : #define NRF91_ERRATA_2_PRESENT 0 117 : : #endif 118 : : 119 : : #ifndef NRF91_ERRATA_2_ENABLE_WORKAROUND 120 : : #define NRF91_ERRATA_2_ENABLE_WORKAROUND NRF91_ERRATA_2_PRESENT 121 : : #endif 122 : : 123 : 0 : static bool nrf91_errata_2(void) 124 : : { 125 : : #ifndef NRF91_SERIES 126 : 0 : return false; 127 : : #else 128 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 129 : : #if defined(NRF_TRUSTZONE_NONSECURE) 130 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 131 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 132 : : #else 133 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 134 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 135 : : #endif 136 : : #endif 137 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 138 : : __DSB(); 139 : : if (var1 == 0x09) 140 : : { 141 : : switch(var2) 142 : : { 143 : : case 0x01ul: 144 : : return true; 145 : : case 0x02ul: 146 : : return true; 147 : : default: 148 : : return true; 149 : : } 150 : : } 151 : : #endif 152 : : return false; 153 : : #endif 154 : : } 155 : : 156 : : /* ========= Errata 4 ========= */ 157 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 158 : : #define NRF91_ERRATA_4_PRESENT 1 159 : : #else 160 : : #define NRF91_ERRATA_4_PRESENT 0 161 : : #endif 162 : : 163 : : #ifndef NRF91_ERRATA_4_ENABLE_WORKAROUND 164 : : #define NRF91_ERRATA_4_ENABLE_WORKAROUND NRF91_ERRATA_4_PRESENT 165 : : #endif 166 : : 167 : 0 : static bool nrf91_errata_4(void) 168 : : { 169 : : #ifndef NRF91_SERIES 170 : 0 : return false; 171 : : #else 172 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 173 : : #if defined(NRF_TRUSTZONE_NONSECURE) 174 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 175 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 176 : : #else 177 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 178 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 179 : : #endif 180 : : #endif 181 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 182 : : __DSB(); 183 : : if (var1 == 0x09) 184 : : { 185 : : switch(var2) 186 : : { 187 : : case 0x01ul: 188 : : return true; 189 : : case 0x02ul: 190 : : return true; 191 : : default: 192 : : return true; 193 : : } 194 : : } 195 : : #endif 196 : : return false; 197 : : #endif 198 : : } 199 : : 200 : : /* ========= Errata 6 ========= */ 201 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 202 : : #define NRF91_ERRATA_6_PRESENT 1 203 : : #else 204 : : #define NRF91_ERRATA_6_PRESENT 0 205 : : #endif 206 : : 207 : : #ifndef NRF91_ERRATA_6_ENABLE_WORKAROUND 208 : : #define NRF91_ERRATA_6_ENABLE_WORKAROUND NRF91_ERRATA_6_PRESENT 209 : : #endif 210 : : 211 : 0 : static bool nrf91_errata_6(void) 212 : : { 213 : : #ifndef NRF91_SERIES 214 : 0 : return false; 215 : : #else 216 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 217 : : #if defined(NRF_TRUSTZONE_NONSECURE) 218 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 219 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 220 : : #else 221 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 222 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 223 : : #endif 224 : : #endif 225 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 226 : : __DSB(); 227 : : if (var1 == 0x09) 228 : : { 229 : : switch(var2) 230 : : { 231 : : case 0x01ul: 232 : : return true; 233 : : case 0x02ul: 234 : : return true; 235 : : default: 236 : : return true; 237 : : } 238 : : } 239 : : #endif 240 : : return false; 241 : : #endif 242 : : } 243 : : 244 : : /* ========= Errata 7 ========= */ 245 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 246 : : #define NRF91_ERRATA_7_PRESENT 1 247 : : #else 248 : : #define NRF91_ERRATA_7_PRESENT 0 249 : : #endif 250 : : 251 : : #ifndef NRF91_ERRATA_7_ENABLE_WORKAROUND 252 : : #define NRF91_ERRATA_7_ENABLE_WORKAROUND NRF91_ERRATA_7_PRESENT 253 : : #endif 254 : : 255 : 0 : static bool nrf91_errata_7(void) 256 : : { 257 : : #ifndef NRF91_SERIES 258 : 0 : return false; 259 : : #else 260 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 261 : : #if defined(NRF_TRUSTZONE_NONSECURE) 262 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 263 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 264 : : #else 265 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 266 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 267 : : #endif 268 : : #endif 269 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 270 : : __DSB(); 271 : : if (var1 == 0x09) 272 : : { 273 : : switch(var2) 274 : : { 275 : : case 0x01ul: 276 : : return true; 277 : : case 0x02ul: 278 : : return true; 279 : : default: 280 : : return true; 281 : : } 282 : : } 283 : : #endif 284 : : return false; 285 : : #endif 286 : : } 287 : : 288 : : /* ========= Errata 8 ========= */ 289 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 290 : : #define NRF91_ERRATA_8_PRESENT 1 291 : : #else 292 : : #define NRF91_ERRATA_8_PRESENT 0 293 : : #endif 294 : : 295 : : #ifndef NRF91_ERRATA_8_ENABLE_WORKAROUND 296 : : #define NRF91_ERRATA_8_ENABLE_WORKAROUND NRF91_ERRATA_8_PRESENT 297 : : #endif 298 : : 299 : 0 : static bool nrf91_errata_8(void) 300 : : { 301 : : #ifndef NRF91_SERIES 302 : 0 : return false; 303 : : #else 304 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 305 : : #if defined(NRF_TRUSTZONE_NONSECURE) 306 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 307 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 308 : : #else 309 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 310 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 311 : : #endif 312 : : #endif 313 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 314 : : __DSB(); 315 : : if (var1 == 0x09) 316 : : { 317 : : switch(var2) 318 : : { 319 : : case 0x01ul: 320 : : return true; 321 : : case 0x02ul: 322 : : return false; 323 : : default: 324 : : return false; 325 : : } 326 : : } 327 : : #endif 328 : : return false; 329 : : #endif 330 : : } 331 : : 332 : : /* ========= Errata 9 ========= */ 333 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 334 : : #define NRF91_ERRATA_9_PRESENT 1 335 : : #else 336 : : #define NRF91_ERRATA_9_PRESENT 0 337 : : #endif 338 : : 339 : : #ifndef NRF91_ERRATA_9_ENABLE_WORKAROUND 340 : : #define NRF91_ERRATA_9_ENABLE_WORKAROUND NRF91_ERRATA_9_PRESENT 341 : : #endif 342 : : 343 : 0 : static bool nrf91_errata_9(void) 344 : : { 345 : : #ifndef NRF91_SERIES 346 : 0 : return false; 347 : : #else 348 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 349 : : #if defined(NRF_TRUSTZONE_NONSECURE) 350 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 351 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 352 : : #else 353 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 354 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 355 : : #endif 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 false; 365 : : case 0x02ul: 366 : : return true; 367 : : default: 368 : : return true; 369 : : } 370 : : } 371 : : #endif 372 : : return false; 373 : : #endif 374 : : } 375 : : 376 : : /* ========= Errata 10 ========= */ 377 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 378 : : #define NRF91_ERRATA_10_PRESENT 1 379 : : #else 380 : : #define NRF91_ERRATA_10_PRESENT 0 381 : : #endif 382 : : 383 : : #ifndef NRF91_ERRATA_10_ENABLE_WORKAROUND 384 : : #define NRF91_ERRATA_10_ENABLE_WORKAROUND NRF91_ERRATA_10_PRESENT 385 : : #endif 386 : : 387 : 0 : static bool nrf91_errata_10(void) 388 : : { 389 : : #ifndef NRF91_SERIES 390 : 0 : return false; 391 : : #else 392 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 393 : : #if defined(NRF_TRUSTZONE_NONSECURE) 394 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 395 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 396 : : #else 397 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 398 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 399 : : #endif 400 : : #endif 401 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 402 : : __DSB(); 403 : : if (var1 == 0x09) 404 : : { 405 : : switch(var2) 406 : : { 407 : : case 0x01ul: 408 : : return true; 409 : : case 0x02ul: 410 : : return false; 411 : : default: 412 : : return false; 413 : : } 414 : : } 415 : : #endif 416 : : return false; 417 : : #endif 418 : : } 419 : : 420 : : /* ========= Errata 12 ========= */ 421 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 422 : : #define NRF91_ERRATA_12_PRESENT 1 423 : : #else 424 : : #define NRF91_ERRATA_12_PRESENT 0 425 : : #endif 426 : : 427 : : #ifndef NRF91_ERRATA_12_ENABLE_WORKAROUND 428 : : #define NRF91_ERRATA_12_ENABLE_WORKAROUND NRF91_ERRATA_12_PRESENT 429 : : #endif 430 : : 431 : 0 : static bool nrf91_errata_12(void) 432 : : { 433 : : #ifndef NRF91_SERIES 434 : 0 : return false; 435 : : #else 436 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 437 : : #if defined(NRF_TRUSTZONE_NONSECURE) 438 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 439 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 440 : : #else 441 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 442 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 443 : : #endif 444 : : #endif 445 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 446 : : __DSB(); 447 : : if (var1 == 0x09) 448 : : { 449 : : switch(var2) 450 : : { 451 : : case 0x01ul: 452 : : return true; 453 : : case 0x02ul: 454 : : return false; 455 : : default: 456 : : return false; 457 : : } 458 : : } 459 : : #endif 460 : : return false; 461 : : #endif 462 : : } 463 : : 464 : : /* ========= Errata 14 ========= */ 465 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 466 : : #define NRF91_ERRATA_14_PRESENT 1 467 : : #else 468 : : #define NRF91_ERRATA_14_PRESENT 0 469 : : #endif 470 : : 471 : : #ifndef NRF91_ERRATA_14_ENABLE_WORKAROUND 472 : : #define NRF91_ERRATA_14_ENABLE_WORKAROUND NRF91_ERRATA_14_PRESENT 473 : : #endif 474 : : 475 : 0 : static bool nrf91_errata_14(void) 476 : : { 477 : : #ifndef NRF91_SERIES 478 : 0 : return false; 479 : : #else 480 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 481 : : #if defined(NRF_TRUSTZONE_NONSECURE) 482 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 483 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 484 : : #else 485 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 486 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 487 : : #endif 488 : : #endif 489 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 490 : : __DSB(); 491 : : if (var1 == 0x09) 492 : : { 493 : : switch(var2) 494 : : { 495 : : case 0x01ul: 496 : : return true; 497 : : case 0x02ul: 498 : : return false; 499 : : default: 500 : : return false; 501 : : } 502 : : } 503 : : #endif 504 : : return false; 505 : : #endif 506 : : } 507 : : 508 : : /* ========= Errata 15 ========= */ 509 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 510 : : #define NRF91_ERRATA_15_PRESENT 1 511 : : #else 512 : : #define NRF91_ERRATA_15_PRESENT 0 513 : : #endif 514 : : 515 : : #ifndef NRF91_ERRATA_15_ENABLE_WORKAROUND 516 : : #define NRF91_ERRATA_15_ENABLE_WORKAROUND NRF91_ERRATA_15_PRESENT 517 : : #endif 518 : : 519 : 0 : static bool nrf91_errata_15(void) 520 : : { 521 : : #ifndef NRF91_SERIES 522 : 0 : return false; 523 : : #else 524 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 525 : : #if defined(NRF_TRUSTZONE_NONSECURE) 526 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 527 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 528 : : #else 529 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 530 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 531 : : #endif 532 : : #endif 533 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 534 : : __DSB(); 535 : : if (var1 == 0x09) 536 : : { 537 : : switch(var2) 538 : : { 539 : : case 0x01ul: 540 : : return false; 541 : : case 0x02ul: 542 : : return true; 543 : : default: 544 : : return true; 545 : : } 546 : : } 547 : : #endif 548 : : return false; 549 : : #endif 550 : : } 551 : : 552 : : /* ========= Errata 16 ========= */ 553 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 554 : : #define NRF91_ERRATA_16_PRESENT 1 555 : : #else 556 : : #define NRF91_ERRATA_16_PRESENT 0 557 : : #endif 558 : : 559 : : #ifndef NRF91_ERRATA_16_ENABLE_WORKAROUND 560 : : #define NRF91_ERRATA_16_ENABLE_WORKAROUND NRF91_ERRATA_16_PRESENT 561 : : #endif 562 : : 563 : 0 : static bool nrf91_errata_16(void) 564 : : { 565 : : #ifndef NRF91_SERIES 566 : 0 : return false; 567 : : #else 568 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 569 : : #if defined(NRF_TRUSTZONE_NONSECURE) 570 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 571 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 572 : : #else 573 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 574 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 575 : : #endif 576 : : #endif 577 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 578 : : __DSB(); 579 : : if (var1 == 0x09) 580 : : { 581 : : switch(var2) 582 : : { 583 : : case 0x01ul: 584 : : return true; 585 : : case 0x02ul: 586 : : return false; 587 : : default: 588 : : return false; 589 : : } 590 : : } 591 : : #endif 592 : : return false; 593 : : #endif 594 : : } 595 : : 596 : : /* ========= Errata 17 ========= */ 597 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 598 : : #define NRF91_ERRATA_17_PRESENT 1 599 : : #else 600 : : #define NRF91_ERRATA_17_PRESENT 0 601 : : #endif 602 : : 603 : : #ifndef NRF91_ERRATA_17_ENABLE_WORKAROUND 604 : : #define NRF91_ERRATA_17_ENABLE_WORKAROUND NRF91_ERRATA_17_PRESENT 605 : : #endif 606 : : 607 : 0 : static bool nrf91_errata_17(void) 608 : : { 609 : : #ifndef NRF91_SERIES 610 : 0 : return false; 611 : : #else 612 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 613 : : #if defined(NRF_TRUSTZONE_NONSECURE) 614 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 615 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 616 : : #else 617 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 618 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 619 : : #endif 620 : : #endif 621 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 622 : : __DSB(); 623 : : if (var1 == 0x09) 624 : : { 625 : : switch(var2) 626 : : { 627 : : case 0x01ul: 628 : : return true; 629 : : case 0x02ul: 630 : : return false; 631 : : default: 632 : : return false; 633 : : } 634 : : } 635 : : #endif 636 : : return false; 637 : : #endif 638 : : } 639 : : 640 : : /* ========= Errata 20 ========= */ 641 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 642 : : #define NRF91_ERRATA_20_PRESENT 1 643 : : #else 644 : : #define NRF91_ERRATA_20_PRESENT 0 645 : : #endif 646 : : 647 : : #ifndef NRF91_ERRATA_20_ENABLE_WORKAROUND 648 : : #define NRF91_ERRATA_20_ENABLE_WORKAROUND NRF91_ERRATA_20_PRESENT 649 : : #endif 650 : : 651 : 0 : static bool nrf91_errata_20(void) 652 : : { 653 : : #ifndef NRF91_SERIES 654 : 0 : return false; 655 : : #else 656 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 657 : : #if defined(NRF_TRUSTZONE_NONSECURE) 658 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 659 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 660 : : #else 661 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 662 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 663 : : #endif 664 : : #endif 665 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 666 : : __DSB(); 667 : : if (var1 == 0x09) 668 : : { 669 : : switch(var2) 670 : : { 671 : : case 0x01ul: 672 : : return true; 673 : : case 0x02ul: 674 : : return false; 675 : : default: 676 : : return false; 677 : : } 678 : : } 679 : : #endif 680 : : return false; 681 : : #endif 682 : : } 683 : : 684 : : /* ========= Errata 21 ========= */ 685 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 686 : : #define NRF91_ERRATA_21_PRESENT 1 687 : : #else 688 : : #define NRF91_ERRATA_21_PRESENT 0 689 : : #endif 690 : : 691 : : #ifndef NRF91_ERRATA_21_ENABLE_WORKAROUND 692 : : #define NRF91_ERRATA_21_ENABLE_WORKAROUND NRF91_ERRATA_21_PRESENT 693 : : #endif 694 : : 695 : 0 : static bool nrf91_errata_21(void) 696 : : { 697 : : #ifndef NRF91_SERIES 698 : 0 : return false; 699 : : #else 700 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 701 : : #if defined(NRF_TRUSTZONE_NONSECURE) 702 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 703 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 704 : : #else 705 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 706 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 707 : : #endif 708 : : #endif 709 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 710 : : __DSB(); 711 : : if (var1 == 0x09) 712 : : { 713 : : switch(var2) 714 : : { 715 : : case 0x01ul: 716 : : return true; 717 : : case 0x02ul: 718 : : return true; 719 : : default: 720 : : return true; 721 : : } 722 : : } 723 : : #endif 724 : : return false; 725 : : #endif 726 : : } 727 : : 728 : : /* ========= Errata 23 ========= */ 729 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 730 : : #define NRF91_ERRATA_23_PRESENT 1 731 : : #else 732 : : #define NRF91_ERRATA_23_PRESENT 0 733 : : #endif 734 : : 735 : : #ifndef NRF91_ERRATA_23_ENABLE_WORKAROUND 736 : : #define NRF91_ERRATA_23_ENABLE_WORKAROUND NRF91_ERRATA_23_PRESENT 737 : : #endif 738 : : 739 : 0 : static bool nrf91_errata_23(void) 740 : : { 741 : : #ifndef NRF91_SERIES 742 : 0 : return false; 743 : : #else 744 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 745 : : #if defined(NRF_TRUSTZONE_NONSECURE) 746 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 747 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 748 : : #else 749 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 750 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 751 : : #endif 752 : : #endif 753 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 754 : : __DSB(); 755 : : if (var1 == 0x09) 756 : : { 757 : : switch(var2) 758 : : { 759 : : case 0x01ul: 760 : : return true; 761 : : case 0x02ul: 762 : : return true; 763 : : default: 764 : : return true; 765 : : } 766 : : } 767 : : #endif 768 : : return false; 769 : : #endif 770 : : } 771 : : 772 : : /* ========= Errata 24 ========= */ 773 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 774 : : #define NRF91_ERRATA_24_PRESENT 1 775 : : #else 776 : : #define NRF91_ERRATA_24_PRESENT 0 777 : : #endif 778 : : 779 : : #ifndef NRF91_ERRATA_24_ENABLE_WORKAROUND 780 : : #define NRF91_ERRATA_24_ENABLE_WORKAROUND NRF91_ERRATA_24_PRESENT 781 : : #endif 782 : : 783 : 0 : static bool nrf91_errata_24(void) 784 : : { 785 : : #ifndef NRF91_SERIES 786 : 0 : return false; 787 : : #else 788 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 789 : : #if defined(NRF_TRUSTZONE_NONSECURE) 790 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 791 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 792 : : #else 793 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 794 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 795 : : #endif 796 : : #endif 797 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 798 : : __DSB(); 799 : : if (var1 == 0x09) 800 : : { 801 : : switch(var2) 802 : : { 803 : : case 0x01ul: 804 : : return true; 805 : : case 0x02ul: 806 : : return true; 807 : : default: 808 : : return true; 809 : : } 810 : : } 811 : : #endif 812 : : return false; 813 : : #endif 814 : : } 815 : : 816 : : /* ========= Errata 26 ========= */ 817 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 818 : : #define NRF91_ERRATA_26_PRESENT 1 819 : : #else 820 : : #define NRF91_ERRATA_26_PRESENT 0 821 : : #endif 822 : : 823 : : #ifndef NRF91_ERRATA_26_ENABLE_WORKAROUND 824 : : #define NRF91_ERRATA_26_ENABLE_WORKAROUND NRF91_ERRATA_26_PRESENT 825 : : #endif 826 : : 827 : 0 : static bool nrf91_errata_26(void) 828 : : { 829 : : #ifndef NRF91_SERIES 830 : 0 : return false; 831 : : #else 832 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 833 : : #if defined(NRF_TRUSTZONE_NONSECURE) 834 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 835 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 836 : : #else 837 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 838 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 839 : : #endif 840 : : #endif 841 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 842 : : __DSB(); 843 : : if (var1 == 0x09) 844 : : { 845 : : switch(var2) 846 : : { 847 : : case 0x01ul: 848 : : return true; 849 : : case 0x02ul: 850 : : return true; 851 : : default: 852 : : return true; 853 : : } 854 : : } 855 : : #endif 856 : : return false; 857 : : #endif 858 : : } 859 : : 860 : : /* ========= Errata 27 ========= */ 861 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 862 : : #define NRF91_ERRATA_27_PRESENT 1 863 : : #else 864 : : #define NRF91_ERRATA_27_PRESENT 0 865 : : #endif 866 : : 867 : : #ifndef NRF91_ERRATA_27_ENABLE_WORKAROUND 868 : : #define NRF91_ERRATA_27_ENABLE_WORKAROUND NRF91_ERRATA_27_PRESENT 869 : : #endif 870 : : 871 : 0 : static bool nrf91_errata_27(void) 872 : : { 873 : : #ifndef NRF91_SERIES 874 : 0 : return false; 875 : : #else 876 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 877 : : #if defined(NRF_TRUSTZONE_NONSECURE) 878 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 879 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 880 : : #else 881 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 882 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 883 : : #endif 884 : : #endif 885 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 886 : : __DSB(); 887 : : if (var1 == 0x09) 888 : : { 889 : : switch(var2) 890 : : { 891 : : case 0x01ul: 892 : : return false; 893 : : case 0x02ul: 894 : : return true; 895 : : default: 896 : : return true; 897 : : } 898 : : } 899 : : #endif 900 : : return false; 901 : : #endif 902 : : } 903 : : 904 : : /* ========= Errata 28 ========= */ 905 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 906 : : #define NRF91_ERRATA_28_PRESENT 1 907 : : #else 908 : : #define NRF91_ERRATA_28_PRESENT 0 909 : : #endif 910 : : 911 : : #ifndef NRF91_ERRATA_28_ENABLE_WORKAROUND 912 : : #define NRF91_ERRATA_28_ENABLE_WORKAROUND NRF91_ERRATA_28_PRESENT 913 : : #endif 914 : : 915 : 0 : static bool nrf91_errata_28(void) 916 : : { 917 : : #ifndef NRF91_SERIES 918 : 0 : return false; 919 : : #else 920 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 921 : : #if defined(NRF_TRUSTZONE_NONSECURE) 922 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 923 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 924 : : #else 925 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 926 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 927 : : #endif 928 : : #endif 929 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 930 : : __DSB(); 931 : : if (var1 == 0x09) 932 : : { 933 : : switch(var2) 934 : : { 935 : : case 0x01ul: 936 : : return true; 937 : : case 0x02ul: 938 : : return true; 939 : : default: 940 : : return true; 941 : : } 942 : : } 943 : : #endif 944 : : return false; 945 : : #endif 946 : : } 947 : : 948 : : /* ========= Errata 29 ========= */ 949 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 950 : : #define NRF91_ERRATA_29_PRESENT 1 951 : : #else 952 : : #define NRF91_ERRATA_29_PRESENT 0 953 : : #endif 954 : : 955 : : #ifndef NRF91_ERRATA_29_ENABLE_WORKAROUND 956 : : #define NRF91_ERRATA_29_ENABLE_WORKAROUND NRF91_ERRATA_29_PRESENT 957 : : #endif 958 : : 959 : 0 : static bool nrf91_errata_29(void) 960 : : { 961 : : #ifndef NRF91_SERIES 962 : 0 : return false; 963 : : #else 964 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 965 : : #if defined(NRF_TRUSTZONE_NONSECURE) 966 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 967 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 968 : : #else 969 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 970 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 971 : : #endif 972 : : #endif 973 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 974 : : __DSB(); 975 : : if (var1 == 0x09) 976 : : { 977 : : switch(var2) 978 : : { 979 : : case 0x01ul: 980 : : return true; 981 : : case 0x02ul: 982 : : return true; 983 : : default: 984 : : return true; 985 : : } 986 : : } 987 : : #endif 988 : : return false; 989 : : #endif 990 : : } 991 : : 992 : : /* ========= Errata 30 ========= */ 993 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 994 : : #define NRF91_ERRATA_30_PRESENT 1 995 : : #else 996 : : #define NRF91_ERRATA_30_PRESENT 0 997 : : #endif 998 : : 999 : : #ifndef NRF91_ERRATA_30_ENABLE_WORKAROUND 1000 : : #define NRF91_ERRATA_30_ENABLE_WORKAROUND NRF91_ERRATA_30_PRESENT 1001 : : #endif 1002 : : 1003 : 0 : static bool nrf91_errata_30(void) 1004 : : { 1005 : : #ifndef NRF91_SERIES 1006 : 0 : return false; 1007 : : #else 1008 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1009 : : #if defined(NRF_TRUSTZONE_NONSECURE) 1010 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 1011 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 1012 : : #else 1013 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 1014 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 1015 : : #endif 1016 : : #endif 1017 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1018 : : __DSB(); 1019 : : if (var1 == 0x09) 1020 : : { 1021 : : switch(var2) 1022 : : { 1023 : : case 0x01ul: 1024 : : return true; 1025 : : case 0x02ul: 1026 : : return true; 1027 : : default: 1028 : : return true; 1029 : : } 1030 : : } 1031 : : #endif 1032 : : return false; 1033 : : #endif 1034 : : } 1035 : : 1036 : : /* ========= Errata 31 ========= */ 1037 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1038 : : #define NRF91_ERRATA_31_PRESENT 1 1039 : : #else 1040 : : #define NRF91_ERRATA_31_PRESENT 0 1041 : : #endif 1042 : : 1043 : : #ifndef NRF91_ERRATA_31_ENABLE_WORKAROUND 1044 : : #define NRF91_ERRATA_31_ENABLE_WORKAROUND NRF91_ERRATA_31_PRESENT 1045 : : #endif 1046 : : 1047 : 0 : static bool nrf91_errata_31(void) 1048 : : { 1049 : : #ifndef NRF91_SERIES 1050 : 0 : return false; 1051 : : #else 1052 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1053 : : #if defined(NRF_TRUSTZONE_NONSECURE) 1054 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 1055 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 1056 : : #else 1057 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 1058 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 1059 : : #endif 1060 : : #endif 1061 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1062 : : __DSB(); 1063 : : if (var1 == 0x09) 1064 : : { 1065 : : switch(var2) 1066 : : { 1067 : : case 0x01ul: 1068 : : return true; 1069 : : case 0x02ul: 1070 : : return true; 1071 : : default: 1072 : : return true; 1073 : : } 1074 : : } 1075 : : #endif 1076 : : return false; 1077 : : #endif 1078 : : } 1079 : : 1080 : : /* ========= Errata 32 ========= */ 1081 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1082 : : #define NRF91_ERRATA_32_PRESENT 1 1083 : : #else 1084 : : #define NRF91_ERRATA_32_PRESENT 0 1085 : : #endif 1086 : : 1087 : : #ifndef NRF91_ERRATA_32_ENABLE_WORKAROUND 1088 : : #define NRF91_ERRATA_32_ENABLE_WORKAROUND NRF91_ERRATA_32_PRESENT 1089 : : #endif 1090 : : 1091 : 0 : static bool nrf91_errata_32(void) 1092 : : { 1093 : : #ifndef NRF91_SERIES 1094 : 0 : return false; 1095 : : #else 1096 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1097 : : #if defined(NRF_TRUSTZONE_NONSECURE) 1098 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 1099 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 1100 : : #else 1101 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 1102 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 1103 : : #endif 1104 : : #endif 1105 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1106 : : __DSB(); 1107 : : if (var1 == 0x09) 1108 : : { 1109 : : switch(var2) 1110 : : { 1111 : : case 0x01ul: 1112 : : return true; 1113 : : case 0x02ul: 1114 : : return true; 1115 : : default: 1116 : : return true; 1117 : : } 1118 : : } 1119 : : #endif 1120 : : return false; 1121 : : #endif 1122 : : } 1123 : : 1124 : : /* ========= Errata 33 ========= */ 1125 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1126 : : #define NRF91_ERRATA_33_PRESENT 1 1127 : : #else 1128 : : #define NRF91_ERRATA_33_PRESENT 0 1129 : : #endif 1130 : : 1131 : : #ifndef NRF91_ERRATA_33_ENABLE_WORKAROUND 1132 : : #define NRF91_ERRATA_33_ENABLE_WORKAROUND NRF91_ERRATA_33_PRESENT 1133 : : #endif 1134 : : 1135 : 0 : static bool nrf91_errata_33(void) 1136 : : { 1137 : : #ifndef NRF91_SERIES 1138 : 0 : return false; 1139 : : #else 1140 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1141 : : #if defined(NRF_TRUSTZONE_NONSECURE) 1142 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000130ul)); 1143 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_NS + 0x00000134ul)); 1144 : : #else 1145 : : uint32_t var1 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000130ul)); 1146 : : uint32_t var2 = *((volatile uint32_t *)((uint32_t)NRF_FICR_S + 0x00000134ul)); 1147 : : #endif 1148 : : #endif 1149 : : #if defined (NRF9160_XXAA) || defined (DEVELOP_IN_NRF9160) 1150 : : __DSB(); 1151 : : if (var1 == 0x09) 1152 : : { 1153 : : switch(var2) 1154 : : { 1155 : : case 0x01ul: 1156 : : return true; 1157 : : case 0x02ul: 1158 : : return true; 1159 : : default: 1160 : : return true; 1161 : : } 1162 : : } 1163 : : #endif 1164 : : return false; 1165 : : #endif 1166 : : } 1167 : : 1168 : : #endif /* NRF91_ERRATAS_H */