1 /* 2 * Copyright 1997-2016 Freescale Semiconductor, Inc. 3 * Copyright 2016-2021 NXP 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 /*! 9 * @file S32K344_SDA_AP.h 10 * @version 1.9 11 * @date 2021-10-27 12 * @brief Peripheral Access Layer for S32K344_SDA_AP 13 * 14 * This file contains register definitions and macros for easy access to their 15 * bit fields. 16 * 17 * This file assumes LITTLE endian system. 18 */ 19 20 /** 21 * @page misra_violations MISRA-C:2012 violations 22 * 23 * @section [global] 24 * Violates MISRA 2012 Advisory Rule 2.3, local typedef not referenced 25 * The SoC header defines typedef for all modules. 26 * 27 * @section [global] 28 * Violates MISRA 2012 Advisory Rule 2.5, local macro not referenced 29 * The SoC header defines macros for all modules and registers. 30 * 31 * @section [global] 32 * Violates MISRA 2012 Advisory Directive 4.9, Function-like macro 33 * These are generated macros used for accessing the bit-fields from registers. 34 * 35 * @section [global] 36 * Violates MISRA 2012 Required Rule 5.1, identifier clash 37 * The supported compilers use more than 31 significant characters for identifiers. 38 * 39 * @section [global] 40 * Violates MISRA 2012 Required Rule 5.2, identifier clash 41 * The supported compilers use more than 31 significant characters for identifiers. 42 * 43 * @section [global] 44 * Violates MISRA 2012 Required Rule 5.4, identifier clash 45 * The supported compilers use more than 31 significant characters for identifiers. 46 * 47 * @section [global] 48 * Violates MISRA 2012 Required Rule 5.5, identifier clash 49 * The supported compilers use more than 31 significant characters for identifiers. 50 * 51 * @section [global] 52 * Violates MISRA 2012 Required Rule 21.1, defined macro '__I' is reserved to the compiler 53 * This type qualifier is needed to ensure correct I/O access and addressing. 54 */ 55 56 /* Prevention from multiple including the same memory map */ 57 #if !defined(S32K344_SDA_AP_H_) /* Check if memory map has not been already included */ 58 #define S32K344_SDA_AP_H_ 59 60 #include "S32K344_COMMON.h" 61 62 /* ---------------------------------------------------------------------------- 63 -- SDA_AP Peripheral Access Layer 64 ---------------------------------------------------------------------------- */ 65 66 /*! 67 * @addtogroup SDA_AP_Peripheral_Access_Layer SDA_AP Peripheral Access Layer 68 * @{ 69 */ 70 71 /** SDA_AP - Size of Registers Arrays */ 72 #define SDA_AP_KEYCHAL_COUNT 8u 73 #define SDA_AP_KEYRESP_COUNT 8u 74 75 /** SDA_AP - Register Layout Typedef */ 76 typedef struct { 77 __I uint32_t AUTHSTTS; /**< Authentication Status, offset: 0x0 */ 78 __IO uint32_t AUTHCTL; /**< Authentication Control, offset: 0x4 */ 79 uint8_t RESERVED_0[8]; 80 __I uint32_t KEYCHAL[SDA_AP_KEYCHAL_COUNT]; /**< Key Challenge, array offset: 0x10, array step: 0x4 */ 81 uint8_t RESERVED_1[16]; 82 __IO uint32_t KEYRESP[SDA_AP_KEYRESP_COUNT]; /**< Key Response, array offset: 0x40, array step: 0x4 */ 83 uint8_t RESERVED_2[16]; 84 __I uint32_t UID0; /**< User Identification 0, offset: 0x70 */ 85 __I uint32_t UID1; /**< User Identification 1, offset: 0x74 */ 86 uint8_t RESERVED_3[8]; 87 __IO uint32_t DBGENCTRL; /**< Debug Enable Control, offset: 0x80 */ 88 uint8_t RESERVED_4[12]; 89 __IO uint32_t SDAAPRSTCTRL; /**< Reset Control, offset: 0x90 */ 90 uint8_t RESERVED_5[12]; 91 __I uint32_t SDAAPGENSTATUS0; /**< SDA_AP Generic Status, offset: 0xA0 */ 92 __IO uint32_t SDAAPGENCTRL0; /**< Generic Control 0, offset: 0xA4 */ 93 uint8_t RESERVED_6[8]; 94 __I uint32_t SDAAPGENSTATUS1; /**< SDA_AP Generic Status, offset: 0xB0 */ 95 uint8_t RESERVED_7[12]; 96 __I uint32_t SDAAPGENSTATUS2; /**< SDA_AP Generic Status, offset: 0xC0 */ 97 uint8_t RESERVED_8[12]; 98 __I uint32_t SDAAPGENSTATUS3; /**< SDA_AP Generic Status, offset: 0xD0 */ 99 uint8_t RESERVED_9[12]; 100 __I uint32_t SDAAPGENSTATUS4; /**< SDA_AP Generic Status, offset: 0xE0 */ 101 uint8_t RESERVED_10[24]; 102 __I uint32_t ID; /**< Identity, offset: 0xFC */ 103 } SDA_AP_Type, *SDA_AP_MemMapPtr; 104 105 /** Number of instances of the SDA_AP module. */ 106 #define SDA_AP_INSTANCE_COUNT (1u) 107 108 /* SDA_AP - Peripheral instance base addresses */ 109 /** Peripheral SDA_AP base address */ 110 #define IP_SDA_AP_BASE (0x40254700u) 111 /** Peripheral SDA_AP base pointer */ 112 #define IP_SDA_AP ((SDA_AP_Type *)IP_SDA_AP_BASE) 113 /** Array initializer of SDA_AP peripheral base addresses */ 114 #define IP_SDA_AP_BASE_ADDRS { IP_SDA_AP_BASE } 115 /** Array initializer of SDA_AP peripheral base pointers */ 116 #define IP_SDA_AP_BASE_PTRS { IP_SDA_AP } 117 118 /* ---------------------------------------------------------------------------- 119 -- SDA_AP Register Masks 120 ---------------------------------------------------------------------------- */ 121 122 /*! 123 * @addtogroup SDA_AP_Register_Masks SDA_AP Register Masks 124 * @{ 125 */ 126 127 /*! @name AUTHSTTS - Authentication Status */ 128 /*! @{ */ 129 130 #define SDA_AP_AUTHSTTS_CHALRDY_MASK (0x1U) 131 #define SDA_AP_AUTHSTTS_CHALRDY_SHIFT (0U) 132 #define SDA_AP_AUTHSTTS_CHALRDY_WIDTH (1U) 133 #define SDA_AP_AUTHSTTS_CHALRDY(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_AUTHSTTS_CHALRDY_SHIFT)) & SDA_AP_AUTHSTTS_CHALRDY_MASK) 134 135 #define SDA_AP_AUTHSTTS_UIDSTATUS_MASK (0x4U) 136 #define SDA_AP_AUTHSTTS_UIDSTATUS_SHIFT (2U) 137 #define SDA_AP_AUTHSTTS_UIDSTATUS_WIDTH (1U) 138 #define SDA_AP_AUTHSTTS_UIDSTATUS(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_AUTHSTTS_UIDSTATUS_SHIFT)) & SDA_AP_AUTHSTTS_UIDSTATUS_MASK) 139 140 #define SDA_AP_AUTHSTTS_SWAPPDBG_MASK (0x8U) 141 #define SDA_AP_AUTHSTTS_SWAPPDBG_SHIFT (3U) 142 #define SDA_AP_AUTHSTTS_SWAPPDBG_WIDTH (1U) 143 #define SDA_AP_AUTHSTTS_SWAPPDBG(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_AUTHSTTS_SWAPPDBG_SHIFT)) & SDA_AP_AUTHSTTS_SWAPPDBG_MASK) 144 145 #define SDA_AP_AUTHSTTS_APPDBGEN_MASK (0x40000000U) 146 #define SDA_AP_AUTHSTTS_APPDBGEN_SHIFT (30U) 147 #define SDA_AP_AUTHSTTS_APPDBGEN_WIDTH (1U) 148 #define SDA_AP_AUTHSTTS_APPDBGEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_AUTHSTTS_APPDBGEN_SHIFT)) & SDA_AP_AUTHSTTS_APPDBGEN_MASK) 149 /*! @} */ 150 151 /*! @name AUTHCTL - Authentication Control */ 152 /*! @{ */ 153 154 #define SDA_AP_AUTHCTL_HSEAUTHREQ_MASK (0x1U) 155 #define SDA_AP_AUTHCTL_HSEAUTHREQ_SHIFT (0U) 156 #define SDA_AP_AUTHCTL_HSEAUTHREQ_WIDTH (1U) 157 #define SDA_AP_AUTHCTL_HSEAUTHREQ(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_AUTHCTL_HSEAUTHREQ_SHIFT)) & SDA_AP_AUTHCTL_HSEAUTHREQ_MASK) 158 159 #define SDA_AP_AUTHCTL_HSENEWDATACTL_MASK (0x2U) 160 #define SDA_AP_AUTHCTL_HSENEWDATACTL_SHIFT (1U) 161 #define SDA_AP_AUTHCTL_HSENEWDATACTL_WIDTH (1U) 162 #define SDA_AP_AUTHCTL_HSENEWDATACTL(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_AUTHCTL_HSENEWDATACTL_SHIFT)) & SDA_AP_AUTHCTL_HSENEWDATACTL_MASK) 163 /*! @} */ 164 165 /*! @name KEYCHAL - Key Challenge */ 166 /*! @{ */ 167 168 #define SDA_AP_KEYCHAL_KEYCHAL_MASK (0xFFFFFFFFU) 169 #define SDA_AP_KEYCHAL_KEYCHAL_SHIFT (0U) 170 #define SDA_AP_KEYCHAL_KEYCHAL_WIDTH (32U) 171 #define SDA_AP_KEYCHAL_KEYCHAL(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_KEYCHAL_KEYCHAL_SHIFT)) & SDA_AP_KEYCHAL_KEYCHAL_MASK) 172 /*! @} */ 173 174 /*! @name KEYRESP - Key Response */ 175 /*! @{ */ 176 177 #define SDA_AP_KEYRESP_KEYRESP_MASK (0xFFFFFFFFU) 178 #define SDA_AP_KEYRESP_KEYRESP_SHIFT (0U) 179 #define SDA_AP_KEYRESP_KEYRESP_WIDTH (32U) 180 #define SDA_AP_KEYRESP_KEYRESP(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_KEYRESP_KEYRESP_SHIFT)) & SDA_AP_KEYRESP_KEYRESP_MASK) 181 /*! @} */ 182 183 /*! @name UID0 - User Identification 0 */ 184 /*! @{ */ 185 186 #define SDA_AP_UID0_UID0_MASK (0xFFFFFFFFU) 187 #define SDA_AP_UID0_UID0_SHIFT (0U) 188 #define SDA_AP_UID0_UID0_WIDTH (32U) 189 #define SDA_AP_UID0_UID0(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_UID0_UID0_SHIFT)) & SDA_AP_UID0_UID0_MASK) 190 /*! @} */ 191 192 /*! @name UID1 - User Identification 1 */ 193 /*! @{ */ 194 195 #define SDA_AP_UID1_UID1_MASK (0xFFFFFFFFU) 196 #define SDA_AP_UID1_UID1_SHIFT (0U) 197 #define SDA_AP_UID1_UID1_WIDTH (32U) 198 #define SDA_AP_UID1_UID1(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_UID1_UID1_SHIFT)) & SDA_AP_UID1_UID1_MASK) 199 /*! @} */ 200 201 /*! @name DBGENCTRL - Debug Enable Control */ 202 /*! @{ */ 203 204 #define SDA_AP_DBGENCTRL_GDBGEN_MASK (0x10U) 205 #define SDA_AP_DBGENCTRL_GDBGEN_SHIFT (4U) 206 #define SDA_AP_DBGENCTRL_GDBGEN_WIDTH (1U) 207 #define SDA_AP_DBGENCTRL_GDBGEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_DBGENCTRL_GDBGEN_SHIFT)) & SDA_AP_DBGENCTRL_GDBGEN_MASK) 208 209 #define SDA_AP_DBGENCTRL_GNIDEN_MASK (0x20U) 210 #define SDA_AP_DBGENCTRL_GNIDEN_SHIFT (5U) 211 #define SDA_AP_DBGENCTRL_GNIDEN_WIDTH (1U) 212 #define SDA_AP_DBGENCTRL_GNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_DBGENCTRL_GNIDEN_SHIFT)) & SDA_AP_DBGENCTRL_GNIDEN_MASK) 213 214 #define SDA_AP_DBGENCTRL_GSPIDEN_MASK (0x40U) 215 #define SDA_AP_DBGENCTRL_GSPIDEN_SHIFT (6U) 216 #define SDA_AP_DBGENCTRL_GSPIDEN_WIDTH (1U) 217 #define SDA_AP_DBGENCTRL_GSPIDEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_DBGENCTRL_GSPIDEN_SHIFT)) & SDA_AP_DBGENCTRL_GSPIDEN_MASK) 218 219 #define SDA_AP_DBGENCTRL_GSPNIDEN_MASK (0x80U) 220 #define SDA_AP_DBGENCTRL_GSPNIDEN_SHIFT (7U) 221 #define SDA_AP_DBGENCTRL_GSPNIDEN_WIDTH (1U) 222 #define SDA_AP_DBGENCTRL_GSPNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_DBGENCTRL_GSPNIDEN_SHIFT)) & SDA_AP_DBGENCTRL_GSPNIDEN_MASK) 223 224 #define SDA_AP_DBGENCTRL_CDBGEN_MASK (0x10000000U) 225 #define SDA_AP_DBGENCTRL_CDBGEN_SHIFT (28U) 226 #define SDA_AP_DBGENCTRL_CDBGEN_WIDTH (1U) 227 #define SDA_AP_DBGENCTRL_CDBGEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_DBGENCTRL_CDBGEN_SHIFT)) & SDA_AP_DBGENCTRL_CDBGEN_MASK) 228 229 #define SDA_AP_DBGENCTRL_CNIDEN_MASK (0x20000000U) 230 #define SDA_AP_DBGENCTRL_CNIDEN_SHIFT (29U) 231 #define SDA_AP_DBGENCTRL_CNIDEN_WIDTH (1U) 232 #define SDA_AP_DBGENCTRL_CNIDEN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_DBGENCTRL_CNIDEN_SHIFT)) & SDA_AP_DBGENCTRL_CNIDEN_MASK) 233 /*! @} */ 234 235 /*! @name SDAAPRSTCTRL - Reset Control */ 236 /*! @{ */ 237 238 #define SDA_AP_SDAAPRSTCTRL_RSTRELTLCM70_MASK (0x2000000U) 239 #define SDA_AP_SDAAPRSTCTRL_RSTRELTLCM70_SHIFT (25U) 240 #define SDA_AP_SDAAPRSTCTRL_RSTRELTLCM70_WIDTH (1U) 241 #define SDA_AP_SDAAPRSTCTRL_RSTRELTLCM70(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPRSTCTRL_RSTRELTLCM70_SHIFT)) & SDA_AP_SDAAPRSTCTRL_RSTRELTLCM70_MASK) 242 /*! @} */ 243 244 /*! @name SDAAPGENSTATUS0 - SDA_AP Generic Status */ 245 /*! @{ */ 246 247 #define SDA_AP_SDAAPGENSTATUS0_SDAAPGENSTATUS_MASK (0xFFFFFFFFU) 248 #define SDA_AP_SDAAPGENSTATUS0_SDAAPGENSTATUS_SHIFT (0U) 249 #define SDA_AP_SDAAPGENSTATUS0_SDAAPGENSTATUS_WIDTH (32U) 250 #define SDA_AP_SDAAPGENSTATUS0_SDAAPGENSTATUS(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPGENSTATUS0_SDAAPGENSTATUS_SHIFT)) & SDA_AP_SDAAPGENSTATUS0_SDAAPGENSTATUS_MASK) 251 /*! @} */ 252 253 /*! @name SDAAPGENCTRL0 - Generic Control 0 */ 254 /*! @{ */ 255 256 #define SDA_AP_SDAAPGENCTRL0_JTAG_CR_EN_MASK (0x1U) 257 #define SDA_AP_SDAAPGENCTRL0_JTAG_CR_EN_SHIFT (0U) 258 #define SDA_AP_SDAAPGENCTRL0_JTAG_CR_EN_WIDTH (1U) 259 #define SDA_AP_SDAAPGENCTRL0_JTAG_CR_EN(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPGENCTRL0_JTAG_CR_EN_SHIFT)) & SDA_AP_SDAAPGENCTRL0_JTAG_CR_EN_MASK) 260 /*! @} */ 261 262 /*! @name SDAAPGENSTATUS1 - SDA_AP Generic Status */ 263 /*! @{ */ 264 265 #define SDA_AP_SDAAPGENSTATUS1_SDAAPGENSTATUS_MASK (0xFFFFFFFFU) 266 #define SDA_AP_SDAAPGENSTATUS1_SDAAPGENSTATUS_SHIFT (0U) 267 #define SDA_AP_SDAAPGENSTATUS1_SDAAPGENSTATUS_WIDTH (32U) 268 #define SDA_AP_SDAAPGENSTATUS1_SDAAPGENSTATUS(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPGENSTATUS1_SDAAPGENSTATUS_SHIFT)) & SDA_AP_SDAAPGENSTATUS1_SDAAPGENSTATUS_MASK) 269 /*! @} */ 270 271 /*! @name SDAAPGENSTATUS2 - SDA_AP Generic Status */ 272 /*! @{ */ 273 274 #define SDA_AP_SDAAPGENSTATUS2_SDAAPGENSTATUS_MASK (0xFFFFFFFFU) 275 #define SDA_AP_SDAAPGENSTATUS2_SDAAPGENSTATUS_SHIFT (0U) 276 #define SDA_AP_SDAAPGENSTATUS2_SDAAPGENSTATUS_WIDTH (32U) 277 #define SDA_AP_SDAAPGENSTATUS2_SDAAPGENSTATUS(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPGENSTATUS2_SDAAPGENSTATUS_SHIFT)) & SDA_AP_SDAAPGENSTATUS2_SDAAPGENSTATUS_MASK) 278 /*! @} */ 279 280 /*! @name SDAAPGENSTATUS3 - SDA_AP Generic Status */ 281 /*! @{ */ 282 283 #define SDA_AP_SDAAPGENSTATUS3_SDAAPGENSTATUS_MASK (0xFFFFFFFFU) 284 #define SDA_AP_SDAAPGENSTATUS3_SDAAPGENSTATUS_SHIFT (0U) 285 #define SDA_AP_SDAAPGENSTATUS3_SDAAPGENSTATUS_WIDTH (32U) 286 #define SDA_AP_SDAAPGENSTATUS3_SDAAPGENSTATUS(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPGENSTATUS3_SDAAPGENSTATUS_SHIFT)) & SDA_AP_SDAAPGENSTATUS3_SDAAPGENSTATUS_MASK) 287 /*! @} */ 288 289 /*! @name SDAAPGENSTATUS4 - SDA_AP Generic Status */ 290 /*! @{ */ 291 292 #define SDA_AP_SDAAPGENSTATUS4_SDAAPGENSTATUS_MASK (0xFFFFFFFFU) 293 #define SDA_AP_SDAAPGENSTATUS4_SDAAPGENSTATUS_SHIFT (0U) 294 #define SDA_AP_SDAAPGENSTATUS4_SDAAPGENSTATUS_WIDTH (32U) 295 #define SDA_AP_SDAAPGENSTATUS4_SDAAPGENSTATUS(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_SDAAPGENSTATUS4_SDAAPGENSTATUS_SHIFT)) & SDA_AP_SDAAPGENSTATUS4_SDAAPGENSTATUS_MASK) 296 /*! @} */ 297 298 /*! @name ID - Identity */ 299 /*! @{ */ 300 301 #define SDA_AP_ID_ID_MASK (0xFFFFFFFFU) 302 #define SDA_AP_ID_ID_SHIFT (0U) 303 #define SDA_AP_ID_ID_WIDTH (32U) 304 #define SDA_AP_ID_ID(x) (((uint32_t)(((uint32_t)(x)) << SDA_AP_ID_ID_SHIFT)) & SDA_AP_ID_ID_MASK) 305 /*! @} */ 306 307 /*! 308 * @} 309 */ /* end of group SDA_AP_Register_Masks */ 310 311 /*! 312 * @} 313 */ /* end of group SDA_AP_Peripheral_Access_Layer */ 314 315 #endif /* #if !defined(S32K344_SDA_AP_H_) */ 316