1# ARM core configuration options 2 3# Copyright (c) 2015 Wind River Systems, Inc. 4# SPDX-License-Identifier: Apache-2.0 5 6config CPU_CORTEX_M 7 bool 8 select CPU_CORTEX 9 select ARCH_HAS_CUSTOM_SWAP_TO_MAIN 10 select HAS_CMSIS_CORE 11 select HAS_FLASH_LOAD_OFFSET 12 select ARCH_HAS_SINGLE_THREAD_SUPPORT 13 select ARCH_HAS_THREAD_ABORT 14 select ARCH_HAS_TRUSTED_EXECUTION if ARM_TRUSTZONE_M 15 select ARCH_HAS_STACK_PROTECTION if (ARM_MPU && !ARMV6_M_ARMV8_M_BASELINE) || CPU_CORTEX_M_HAS_SPLIM 16 select ARCH_HAS_USERSPACE if ARM_MPU 17 select ARCH_HAS_NOCACHE_MEMORY_SUPPORT if ARM_MPU && CPU_HAS_ARM_MPU && CPU_HAS_DCACHE 18 select ARCH_HAS_RAMFUNC_SUPPORT 19 select ARCH_HAS_NESTED_EXCEPTION_DETECTION 20 select SWAP_NONATOMIC 21 select ARCH_HAS_EXTRA_EXCEPTION_INFO 22 select ARCH_HAS_TIMING_FUNCTIONS if CPU_CORTEX_M_HAS_DWT 23 select ARCH_SUPPORTS_ARCH_HW_INIT 24 select ARCH_HAS_SUSPEND_TO_RAM 25 select ARCH_HAS_CODE_DATA_RELOCATION 26 select ARCH_SUPPORTS_ROM_START 27 imply XIP 28 help 29 This option signifies the use of a CPU of the Cortex-M family. 30 31config CPU_AARCH32_CORTEX_R 32 bool 33 select CPU_CORTEX 34 select HAS_CMSIS_CORE 35 select ARCH_HAS_NESTED_EXCEPTION_DETECTION 36 select HAS_FLASH_LOAD_OFFSET 37 select ARCH_HAS_USERSPACE if ARM_MPU && !USE_SWITCH 38 select ARCH_HAS_EXTRA_EXCEPTION_INFO if !USE_SWITCH 39 select ARCH_HAS_CODE_DATA_RELOCATION 40 select ARCH_HAS_NOCACHE_MEMORY_SUPPORT if ARM_MPU && CPU_HAS_ARM_MPU && CPU_HAS_DCACHE 41 select ARCH_SUPPORTS_ROM_START 42 select USE_SWITCH_SUPPORTED 43 help 44 This option signifies the use of a CPU of the Cortex-R family. 45 46config ARM_ZIMAGE_HEADER 47 bool "zImage Header" 48 depends on CPU_AARCH32_CORTEX_R || CPU_AARCH32_CORTEX_A || CPU_CORTEX_M_HAS_VTOR 49 help 50 This option adds a zImage Header. 51 52config CPU_AARCH32_CORTEX_A 53 bool 54 select CPU_CORTEX 55 select CPU_HAS_MMU 56 select HAS_CMSIS_CORE 57 select HAS_FLASH_LOAD_OFFSET 58 select ARCH_HAS_EXTRA_EXCEPTION_INFO if !USE_SWITCH 59 select ARCH_HAS_NOCACHE_MEMORY_SUPPORT 60 select USE_SWITCH_SUPPORTED 61 # GDBSTUB has not yet been tested on Cortex M or R SoCs 62 select ARCH_HAS_GDBSTUB 63 # GDB on ARM needs the extra registers 64 select EXTRA_EXCEPTION_INFO if GDBSTUB 65 help 66 This option signifies the use of a CPU of the Cortex-A family. 67 68config GDBSTUB_BUF_SZ 69 # GDB for ARM expects up to 18 4-byte plus 8 12-byte 70 # registers - 336 HEX letters 71 default 350 if GDBSTUB 72 73config ISA_THUMB2 74 bool 75 help 76 From: http://www.arm.com/products/processors/technologies/instruction-set-architectures.php 77 78 Thumb-2 technology is the instruction set underlying the ARM Cortex 79 architecture which provides enhanced levels of performance, energy 80 efficiency, and code density for a wide range of embedded 81 applications. 82 83 Thumb-2 technology builds on the success of Thumb, the innovative 84 high code density instruction set for ARM microprocessor cores, to 85 increase the power of the ARM microprocessor core available to 86 developers of low cost, high performance systems. 87 88 The technology is backwards compatible with existing ARM and Thumb 89 solutions, while significantly extending the features available to 90 the Thumb instructions set. This allows more of the application to 91 benefit from the best in class code density of Thumb. 92 93 For performance optimized code Thumb-2 technology uses 31 percent 94 less memory to reduce system cost, while providing up to 38 percent 95 higher performance than existing high density code, which can be used 96 to prolong battery-life or to enrich the product feature set. Thumb-2 97 technology is featured in the processor, and in all ARMv7 98 architecture-based processors. 99 100config ISA_ARM 101 bool 102 help 103 From: https://developer.arm.com/products/architecture/instruction-sets/a32-and-t32-instruction-sets 104 105 A32 instructions, known as Arm instructions in pre-Armv8 architectures, 106 are 32 bits wide, and are aligned on 4-byte boundaries. A32 instructions 107 are supported by both A-profile and R-profile architectures. 108 109 A32 was traditionally used in applications requiring the highest 110 performance, or for handling hardware exceptions such as interrupts and 111 processor start-up. Much of its functionality was subsumed into T32 with 112 the introduction of Thumb-2 technology. 113 114config ASSEMBLER_ISA_THUMB2 115 bool 116 default y if ISA_THUMB2 && !ISA_ARM 117 depends on !ISA_ARM 118 help 119 This helper symbol specifies the default target instruction set for 120 the assembler. 121 122 When only the Thumb-2 ISA is supported (i.e. on Cortex-M cores), the 123 assembler must use the Thumb-2 instruction set. 124 125 When both the Thumb-2 and ARM ISAs are supported (i.e. on Cortex-A 126 and Cortex-R cores), the assembler must use the ARM instruction set 127 because the architecture assembly code makes use of the ARM 128 instructions. 129 130config COMPILER_ISA_THUMB2 131 bool "Compile C/C++ functions using Thumb-2 instruction set" 132 depends on ISA_THUMB2 133 default y 134 help 135 This option configures the compiler to compile all C/C++ functions 136 using the Thumb-2 instruction set. 137 138 N.B. The scope of this symbol is not necessarily limited to the C and 139 C++ languages; in fact, this symbol refers to all forms of 140 "compiled" code. 141 142 When an additional natively-compiled language support is added 143 in the future, this symbol shall also specify the Thumb-2 144 instruction set for that language. 145 146config NUM_IRQS 147 int 148 149config STACK_ALIGN_DOUBLE_WORD 150 bool "Align stacks on double-words (8 octets)" 151 default y 152 help 153 This is needed to conform to AAPCS, the procedure call standard for 154 the ARM. It wastes stack space. The option also enforces alignment 155 of stack upon exception entry on Cortex-M3 and Cortex-M4 (ARMv7-M). 156 Note that for ARMv6-M, ARMv8-M, and Cortex-M7 MCUs stack alignment 157 on exception entry is enabled by default and it is not configurable. 158 159config RUNTIME_NMI 160 bool "Attach an NMI handler at runtime" 161 select REBOOT 162 help 163 The kernel provides a simple NMI handler that simply hangs in a tight 164 loop if triggered. This fills the requirement that there must be an 165 NMI handler installed when the CPU boots. If a custom handler is 166 needed, enable this option and attach it via z_arm_nmi_set_handler(). 167 168config PLATFORM_SPECIFIC_INIT 169 bool "Platform (SOC) specific startup hook [DEPRECATED]" 170 select DEPRECATED 171 help 172 The platform specific initialization code (z_arm_platform_init) is 173 executed at the beginning of the startup code (__start). 174 175 This option is deprecated, use SOC_RESET_HOOK instead. 176 177config FAULT_DUMP 178 int "Fault dump level" 179 default 2 180 range 0 2 181 help 182 Different levels for display information when a fault occurs. 183 184 2: The default. Display specific and verbose information. Consumes 185 the most memory (long strings). 186 187 1: Display general and short information. Consumes less memory 188 (short strings). 189 190 0: Off. 191 192config BUILTIN_STACK_GUARD 193 bool "Thread Stack Guards based on built-in ARM stack limit checking" 194 depends on CPU_CORTEX_M_HAS_SPLIM 195 select THREAD_STACK_INFO 196 help 197 Enable Thread/Interrupt Stack Guards via built-in Stack Pointer 198 limit checking. The functionality must be supported by HW. 199 200config ARM_STACK_PROTECTION 201 bool 202 default y if HW_STACK_PROTECTION 203 imply BUILTIN_STACK_GUARD if CPU_CORTEX_M_HAS_SPLIM 204 select MPU_STACK_GUARD if (!BUILTIN_STACK_GUARD && ARM_MPU) 205 help 206 This option enables either: 207 - The built-in Stack Pointer limit checking, or 208 - the MPU-based stack guard 209 to cause a system fatal error 210 if the bounds of the current process stack are overflowed. 211 The two stack guard options are mutually exclusive. The 212 selection of the built-in Stack Pointer limit checking is 213 prioritized over the MPU-based stack guard. The developer 214 still has the option to manually select the MPU-based 215 stack guard, if this is desired. 216 217config ARM_SECURE_FIRMWARE 218 bool 219 depends on ARMV8_M_SE 220 default y if TRUSTED_EXECUTION_SECURE 221 help 222 This option indicates that we are building a Zephyr image that 223 is intended to execute in Secure state. The option is only 224 applicable to ARMv8-M MCUs that implement the Security Extension. 225 226 This option enables Zephyr to include code that executes in 227 Secure state, as well as to exclude code that is designed to 228 execute only in Non-secure state. 229 230 Code executing in Secure state has access to both the Secure 231 and Non-Secure resources of the Cortex-M MCU. 232 233 Code executing in Non-Secure state may trigger Secure Faults, 234 if Secure MCU resources are accessed from the Non-Secure state. 235 Secure Faults may only be handled by code executing in Secure 236 state. 237 238config ARM_NONSECURE_FIRMWARE 239 bool 240 depends on !ARM_SECURE_FIRMWARE 241 depends on ARMV8_M_SE 242 default y if TRUSTED_EXECUTION_NONSECURE 243 help 244 This option indicates that we are building a Zephyr image that 245 is intended to execute in Non-Secure state. Execution of this 246 image is triggered by Secure firmware that executes in Secure 247 state. The option is only applicable to ARMv8-M MCUs that 248 implement the Security Extension. 249 250 This option enables Zephyr to include code that executes in 251 Non-Secure state only, as well as to exclude code that is 252 designed to execute only in Secure state. 253 254 Code executing in Non-Secure state has no access to Secure 255 resources of the Cortex-M MCU, and, therefore, it shall avoid 256 accessing them. 257 258config ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS 259 bool "Allow secure function calls to be preempted" 260 depends on ARM_NONSECURE_FIRMWARE 261 help 262 When enabled, this option indicates that preemptible Zephyr 263 threads performing secure function calls, are allowed to be 264 preempted. When disabled, the option indicates that such 265 threads many not be context-switched-out while doing a Secure 266 function call. 267 268config ARM_STORE_EXC_RETURN 269 bool 270 default y if CPU_CORTEX_M && (FPU_SHARING || ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS) 271 help 272 Store the EXC_RETURN value when switching threads. 273 This is needed when switching between threads that differ in either 274 FPU usage or security domain. 275 276choice 277 prompt "Floating point ABI" 278 default FP_HARDABI 279 depends on FPU 280 281config FP_HARDABI 282 bool "Floating point Hard ABI" 283 help 284 This option selects the Floating point ABI in which hardware floating 285 point instructions are generated and uses FPU-specific calling 286 conventions. 287 288config FP_SOFTABI 289 bool "Floating point Soft ABI" 290 help 291 This option selects the Floating point ABI in which hardware floating 292 point instructions are generated but soft-float calling conventions. 293 294endchoice 295 296config FP16 297 bool "Half-precision floating point support" 298 default y 299 help 300 This option enables the half-precision (16-bit) floating point support 301 via the `__fp16` (both IEEE and ARM alternative formats) and the 302 `_Float16` (defined by ISO/IEC TS 18661-3:2015) types. 303 304choice 305 prompt "FP16 format" 306 default FP16_IEEE 307 depends on FP16 308 309config FP16_IEEE 310 bool "FP16 IEEE format" 311 help 312 This option selects the IEEE 754-2008 format for FP16. This format can 313 represent normalized values in the range of 2^(-14) to 65504. There are 314 11 bits of significand precision, approximately 3 decimal digits. 315 316config FP16_ALT 317 bool "FP16 ARM alternative format" 318 help 319 This option selects the ARM alternative format for FP16. This 320 representation is similar to the IEEE 754-2008 format, but does not 321 support infinites or NaNs. Instead, the range of exponents is extended, 322 so that this format can represent normalized values in the range of 323 2^(-14) to 131008. 324 325 Please note that Clang doesn't support the ARM alternative format. 326 327endchoice 328 329rsource "cortex_m/Kconfig" 330rsource "cortex_a_r/Kconfig" 331 332rsource "mpu/Kconfig" 333rsource "mmu/Kconfig" 334