1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef TFM_READ_RANGES_H__ 8 #define TFM_READ_RANGES_H__ 9 10 #include <tfm_ioctl_core_api.h> 11 12 #include <nrf.h> 13 14 #ifdef NRF_FICR_S_BASE 15 16 #define FICR_BASE NRF_FICR_S_BASE 17 18 #define FICR_INFO_ADDR (FICR_BASE + offsetof(NRF_FICR_Type, INFO)) 19 #define FICR_INFO_SIZE (sizeof(FICR_INFO_Type)) 20 21 #if defined(FICR_NFC_TAGHEADER0_MFGID_Msk) 22 #define FICR_NFC_ADDR (FICR_BASE + offsetof(NRF_FICR_Type, NFC)) 23 #define FICR_NFC_SIZE (sizeof(FICR_NFC_Type)) 24 #endif 25 26 #if defined(FICR_XOSC32MTRIM_SLOPE_Msk) 27 #define FICR_XOSC32MTRIM_ADDR (FICR_BASE + offsetof(NRF_FICR_Type, XOSC32MTRIM)) 28 #define FICR_XOSC32MTRIM_SIZE (sizeof(uint32_t)) 29 #endif 30 31 /* Used by nrf_erratas.h */ 32 #define FICR_RESTRICTED_ADDR (FICR_BASE + 0x130) 33 #define FICR_RESTRICTED_SIZE 0x8 34 35 #if defined(FICR_SIPINFO_PARTNO_PARTNO_Pos) 36 #define FICR_SIPINFO_ADDR (FICR_BASE + offsetof(NRF_FICR_Type, SIPINFO)) 37 #define FICR_SIPINFO_SIZE (sizeof(FICR_SIPINFO_Type)) 38 #endif 39 40 #endif /* NRF_FICR_S_BASE */ 41 42 static const struct tfm_read_service_range ranges[] = { 43 #if defined(FICR_INFO_ADDR) 44 { .start = FICR_INFO_ADDR, .size = FICR_INFO_SIZE }, 45 #endif 46 #if defined(FICR_NFC_ADDR) 47 { .start = FICR_NFC_ADDR, .size = FICR_NFC_SIZE }, 48 #endif 49 #if defined(FICR_RESTRICTED_ADDR) 50 { .start = FICR_RESTRICTED_ADDR, .size = FICR_RESTRICTED_SIZE }, 51 #endif 52 #if defined(FICR_XOSC32MTRIM_ADDR) 53 { .start = FICR_XOSC32MTRIM_ADDR, .size = FICR_XOSC32MTRIM_SIZE }, 54 #endif 55 #if defined(FICR_SIPINFO_ADDR) 56 { .start = FICR_SIPINFO_ADDR, .size = FICR_SIPINFO_SIZE }, 57 #endif 58 }; 59 60 #endif /* TFM_READ_RANGES_H__ */ 61