blob: de365d9a26fe920be6ca99f7a9197f9beeef6c7c [file] [log] [blame]
Ulf Magnussonbd6e0442019-11-01 13:45:29 +01001# General architecture configuration options
Juan Manuel Cruzd15251f2015-05-20 11:40:39 -05002
Juan Manuel Cruzd15251f2015-05-20 11:40:39 -05003# Copyright (c) 2014-2015 Wind River Systems, Inc.
4# Copyright (c) 2015 Intel Corporation
Mazen NEIFER1cded672017-01-13 12:14:33 +01005# Copyright (c) 2016 Cadence Design Systems, Inc.
David B. Kinderac74d8b2017-01-18 17:01:01 -08006# SPDX-License-Identifier: Apache-2.0
Juan Manuel Cruzd15251f2015-05-20 11:40:39 -05007
Ulf Magnussonec3eff52018-07-30 10:57:47 +02008# Include these first so that any properties (e.g. defaults) below can be
Anas Nashiff2cb20c2019-06-18 14:45:40 -04009# overridden (by defining symbols in multiple locations)
Ulf Magnussonec3eff52018-07-30 10:57:47 +020010
Ulf Magnussond0e87522018-09-05 12:58:05 +020011# Note: $ARCH might be a glob pattern
Klaus Petersenc66cb762018-11-15 10:37:46 +010012source "$(ARCH_DIR)/$(ARCH)/Kconfig"
Ulf Magnussonec3eff52018-07-30 10:57:47 +020013
Ulf Magnussonc5839f82020-02-06 18:26:14 +010014# Architecture symbols
15#
16# Should be 'select'ed by low-level symbols like SOC_SERIES_* or, lacking that,
17# by SOC_*.
Anas Nashif77ba3c32015-10-09 06:20:52 -040018
19config ARC
Ulf Magnussonc5839f82020-02-06 18:26:14 +010020 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +010021 select ARCH_IS_SET
Kumar Gala311e6b92018-03-14 19:16:40 -050022 select HAS_DTS
Anas Nashifce595102020-08-02 10:45:10 -040023 imply XIP
Daniel Leungc7704d82020-10-30 10:21:40 -070024 select ARCH_HAS_THREAD_LOCAL_STORAGE
Ulf Magnussonc5839f82020-02-06 18:26:14 +010025 help
26 ARC architecture
Anas Nashif77ba3c32015-10-09 06:20:52 -040027
28config ARM
Ulf Magnussonc5839f82020-02-06 18:26:14 +010029 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +010030 select ARCH_IS_SET
Daniel Leung181d0732020-08-18 12:55:08 -070031 select ARCH_SUPPORTS_COREDUMP if CPU_CORTEX_M
Kumar Gala37f91132018-11-03 07:19:18 -050032 select HAS_DTS
Andrew Boie28be7932020-03-11 10:56:19 -070033 # FIXME: current state of the code for all ARM requires this, but
34 # is really only necessary for Cortex-M with ARM MPU!
Carlo Caione3539c2f2021-03-25 11:56:15 +010035 select GEN_PRIV_STACKS
36 select ARCH_HAS_THREAD_LOCAL_STORAGE if CPU_CORTEX_R || CPU_CORTEX_M
Ulf Magnussonc5839f82020-02-06 18:26:14 +010037 help
38 ARM architecture
Anas Nashif77ba3c32015-10-09 06:20:52 -040039
Carlo Caione3539c2f2021-03-25 11:56:15 +010040config ARM64
41 bool
42 select ARCH_IS_SET
43 select 64BIT
44 select HAS_DTS
45 select HAS_ARM_SMCCC
46 select ARCH_HAS_THREAD_LOCAL_STORAGE
47 select USE_SWITCH
48 select USE_SWITCH_SUPPORTED
49 help
50 ARM64 (AArch64) architecture
51
Martin Åberg07160fa2020-10-16 20:53:59 +020052config SPARC
53 bool
54 select ARCH_IS_SET
Morten Priessa0dd44c2021-04-21 15:15:26 +020055 select HAS_DTS
Martin Åberg07160fa2020-10-16 20:53:59 +020056 select USE_SWITCH
57 select USE_SWITCH_SUPPORTED
58 select BIG_ENDIAN
59 select ATOMIC_OPERATIONS_BUILTIN if SPARC_CASA
60 select ATOMIC_OPERATIONS_C if !SPARC_CASA
Martin Åbergfeae3242020-10-27 12:31:41 +010061 select ARCH_HAS_THREAD_LOCAL_STORAGE
Martin Åberg83f733c2021-02-16 15:38:58 +010062 select ARCH_HAS_EXTRA_EXCEPTION_INFO
Martin Åberg07160fa2020-10-16 20:53:59 +020063 help
64 SPARC architecture
65
Anas Nashif77ba3c32015-10-09 06:20:52 -040066config X86
Ulf Magnussonc5839f82020-02-06 18:26:14 +010067 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +010068 select ARCH_IS_SET
Andrew Boie6a1474e2016-07-15 13:15:00 -070069 select ATOMIC_OPERATIONS_BUILTIN
Kumar Gala37f91132018-11-03 07:19:18 -050070 select HAS_DTS
Daniel Leung8fbb14e2020-08-13 19:18:52 -070071 select ARCH_SUPPORTS_COREDUMP
Andrew Boieff294e02020-06-12 16:50:16 -070072 select CPU_HAS_MMU
Andrew Boied2a72272020-10-27 11:27:37 -070073 select ARCH_MEM_DOMAIN_DATA if USERSPACE && !X86_COMMON_PAGE_TABLE
Andrew Boie00f71b02020-08-25 17:02:38 -070074 select ARCH_MEM_DOMAIN_SYNCHRONOUS_API if USERSPACE
Flavio Ceolin5408f312020-05-21 16:55:28 -070075 select ARCH_HAS_GDBSTUB if !X86_64
Anas Nashif5dec2352020-08-27 23:07:01 -040076 select ARCH_HAS_TIMING_FUNCTIONS
Daniel Leung4b383922020-09-29 15:32:35 -070077 select ARCH_HAS_THREAD_LOCAL_STORAGE
Andrew Boieed220642020-12-09 10:37:52 -080078 select ARCH_HAS_DEMAND_PAGING
Daniel Leung1eba3542021-03-31 14:51:58 -070079 select NEED_LIBC_MEM_PARTITION if USERSPACE && TIMING_FUNCTIONS \
80 && !BOARD_HAS_TIMING_FUNCTIONS \
81 && !SOC_HAS_TIMING_FUNCTIONS
Ulf Magnussonc5839f82020-02-06 18:26:14 +010082 help
83 x86 architecture
Anas Nashif77ba3c32015-10-09 06:20:52 -040084
Andrew Boie94338952016-04-21 14:47:09 -070085config NIOS2
Ulf Magnussonc5839f82020-02-06 18:26:14 +010086 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +010087 select ARCH_IS_SET
Andrew Boie6a1474e2016-07-15 13:15:00 -070088 select ATOMIC_OPERATIONS_C
Kumar Gala37f91132018-11-03 07:19:18 -050089 select HAS_DTS
Anas Nashifce595102020-08-02 10:45:10 -040090 imply XIP
Anas Nashif150c82c2020-08-27 23:16:48 -040091 select ARCH_HAS_TIMING_FUNCTIONS
Ulf Magnussonc5839f82020-02-06 18:26:14 +010092 help
93 Nios II Gen 2 architecture
Andrew Boie94338952016-04-21 14:47:09 -070094
Nicolas Pitre1f4b5dd2019-07-17 13:17:05 -040095config RISCV
Ulf Magnussonc5839f82020-02-06 18:26:14 +010096 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +010097 select ARCH_IS_SET
Kumar Gala8ded3fb2018-11-02 13:29:59 -050098 select HAS_DTS
Daniel Leung8a79ce12020-10-02 13:09:32 -070099 select ARCH_HAS_THREAD_LOCAL_STORAGE
Anas Nashifce595102020-08-02 10:45:10 -0400100 imply XIP
Ulf Magnussonc5839f82020-02-06 18:26:14 +0100101 help
102 RISCV architecture
Jean-Paul Etiennecd83e852017-01-11 00:24:30 +0100103
Mazen NEIFER1cded672017-01-13 12:14:33 +0100104config XTENSA
Ulf Magnussonc5839f82020-02-06 18:26:14 +0100105 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +0100106 select ARCH_IS_SET
Kumar Gala31503a82019-02-01 07:52:05 -0600107 select HAS_DTS
Andrew Boie6fd6b7e2019-08-13 14:02:29 -0700108 select USE_SWITCH
109 select USE_SWITCH_SUPPORTED
Daniel Leung64e99df2021-04-01 11:35:31 -0700110 imply ATOMIC_OPERATIONS_ARCH
Ulf Magnussonc5839f82020-02-06 18:26:14 +0100111 help
112 Xtensa architecture
Mazen NEIFER1cded672017-01-13 12:14:33 +0100113
Alberto Escolar Piedras76f764412017-10-03 16:31:55 +0200114config ARCH_POSIX
Ulf Magnussonc5839f82020-02-06 18:26:14 +0100115 bool
Ulf Magnussonde42aea2020-02-07 00:48:22 +0100116 select ARCH_IS_SET
Kumar Galacd889022020-04-03 14:08:58 -0500117 select HAS_DTS
Alberto Escolar Piedras76f764412017-10-03 16:31:55 +0200118 select ATOMIC_OPERATIONS_BUILTIN
119 select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
120 select ARCH_HAS_CUSTOM_BUSY_WAIT
121 select ARCH_HAS_THREAD_ABORT
122 select NATIVE_APPLICATION
Alberto Escolar Piedras2cd70e62019-02-03 13:04:17 +0100123 select HAS_COVERAGE_SUPPORT
Ulf Magnussonc5839f82020-02-06 18:26:14 +0100124 help
125 POSIX (native) architecture
Anas Nashif46f66f42017-09-08 21:14:06 -0400126
Ulf Magnussonde42aea2020-02-07 00:48:22 +0100127config ARCH_IS_SET
128 bool
129 help
130 Helper symbol to detect SoCs forgetting to select one of the arch
131 symbols above. See the top-level CMakeLists.txt.
132
Anas Nashif46f66f42017-09-08 21:14:06 -0400133menu "General Architecture Options"
134
Anas Nashif8e386702018-09-17 09:56:20 -0500135module = ARCH
136module-str = arch
137source "subsys/logging/Kconfig.template.log_config"
138
139module = MPU
140module-str = mpu
141source "subsys/logging/Kconfig.template.log_config"
142
Yasushi SHOJI6fc0d772018-10-09 18:59:16 +0900143config BIG_ENDIAN
Ulf Magnusson975de212019-11-01 10:24:07 +0100144 bool
145 help
146 This option tells the build system that the target system is big-endian.
147 Little-endian architecture is the default and should leave this option
148 unselected. This option is selected by arch/$ARCH/Kconfig,
149 soc/**/Kconfig, or boards/**/Kconfig and the user should generally avoid
150 modifying it. The option is used to select linker script OUTPUT_FORMAT
151 and command line option for gen_isr_tables.py.
Yasushi SHOJI6fc0d772018-10-09 18:59:16 +0900152
Nicolas Pitre9bd9b752019-05-17 15:15:24 -0400153config 64BIT
154 bool
155 help
156 This option tells the build system that the target system is
157 using a 64-bit address space, meaning that pointer and long types
158 are 64 bits wide. This option is selected by arch/$ARCH/Kconfig,
159 soc/**/Kconfig, or boards/**/Kconfig and the user should generally
160 avoid modifying it.
161
Kumar Gala8ce0cf02019-08-28 09:29:26 -0500162# Workaround for not being able to have commas in macro arguments
163DT_CHOSEN_Z_SRAM := zephyr,sram
164
Kumar Galace7ed182018-12-07 10:35:04 -0600165config SRAM_SIZE
166 int "SRAM Size in kB"
Kumar Gala22e74492019-10-23 15:15:59 -0500167 default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0,K)
Kumar Galace7ed182018-12-07 10:35:04 -0600168 help
Ulf Magnussondef1f0e2019-12-26 16:08:19 +0100169 The SRAM size in kB. The default value comes from /chosen/zephyr,sram in
170 devicetree. The user should generally avoid changing it via menuconfig or
171 in configuration files.
Kumar Galace7ed182018-12-07 10:35:04 -0600172
173config SRAM_BASE_ADDRESS
174 hex "SRAM Base Address"
Kumar Gala22e74492019-10-23 15:15:59 -0500175 default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
Kumar Galace7ed182018-12-07 10:35:04 -0600176 help
Ulf Magnussondef1f0e2019-12-26 16:08:19 +0100177 The SRAM base address. The default value comes from from
178 /chosen/zephyr,sram in devicetree. The user should generally avoid
179 changing it via menuconfig or in configuration files.
180
Carlo Caione3539c2f2021-03-25 11:56:15 +0100181if ARC || ARM || ARM64 || NIOS2 || X86
Kumar Galace7ed182018-12-07 10:35:04 -0600182
Kumar Gala8ce0cf02019-08-28 09:29:26 -0500183# Workaround for not being able to have commas in macro arguments
184DT_CHOSEN_Z_FLASH := zephyr,flash
185
Kumar Galace7ed182018-12-07 10:35:04 -0600186config FLASH_SIZE
187 int "Flash Size in kB"
Carlo Caione3539c2f2021-03-25 11:56:15 +0100188 default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K) if (XIP && (ARM ||ARM64)) || !ARM
Kumar Galace7ed182018-12-07 10:35:04 -0600189 help
190 This option specifies the size of the flash in kB. It is normally set by
191 the board's defconfig file and the user should generally avoid modifying
192 it via the menu configuration.
193
194config FLASH_BASE_ADDRESS
195 hex "Flash Base Address"
Carlo Caione3539c2f2021-03-25 11:56:15 +0100196 default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) if (XIP && (ARM || ARM64)) || !ARM
Kumar Galace7ed182018-12-07 10:35:04 -0600197 help
Ioannis Glaropoulos0348c532019-02-12 15:16:16 +0100198 This option specifies the base address of the flash on the board. It is
Kumar Galace7ed182018-12-07 10:35:04 -0600199 normally set by the board's defconfig file and the user should generally
200 avoid modifying it via the menu configuration.
201
Carlo Caione3539c2f2021-03-25 11:56:15 +0100202endif # ARM || ARM64 || ARC || NIOS2 || X86
Kumar Galace7ed182018-12-07 10:35:04 -0600203
Ioannis Glaropoulos1cc66cf2018-10-12 09:27:28 +0200204if ARCH_HAS_TRUSTED_EXECUTION
205
206config TRUSTED_EXECUTION_SECURE
207 bool "Trusted Execution: Secure firmware image"
208 help
209 Select this option to enable building a Secure firmware
210 image for a platform that supports Trusted Execution. A
211 Secure firmware image will execute in Secure state. It may
212 allow the CPU to execute in Non-Secure (Normal) state.
213 Therefore, a Secure firmware image shall be able to
214 configure security attributions of CPU resources (memory
215 areas, peripherals, interrupts, etc.) as well as to handle
216 faults, related to security violations. It may optionally
217 allow certain functions to be called from the Non-Secure
218 (Normal) domain.
219
220config TRUSTED_EXECUTION_NONSECURE
221 depends on !TRUSTED_EXECUTION_SECURE
222 bool "Trusted Execution: Non-Secure firmware image"
223 help
224 Select this option to enable building a Non-Secure
225 firmware image for a platform that supports Trusted
226 Execution. A Non-Secure firmware image will execute
227 in Non-Secure (Normal) state. Therefore, it shall not
228 access CPU resources (memory areas, peripherals,
229 interrupts etc.) belonging to the Secure domain.
230
231endif # ARCH_HAS_TRUSTED_EXECUTION
232
Anas Nashif46f66f42017-09-08 21:14:06 -0400233config HW_STACK_PROTECTION
234 bool "Hardware Stack Protection"
235 depends on ARCH_HAS_STACK_PROTECTION
236 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500237 Select this option to enable hardware-based platform features to
238 catch stack overflows when the system is running in privileged
239 mode. If CONFIG_USERSPACE is not enabled, the system is always
240 running in privileged mode.
Andrew Boie2a8684f2017-11-06 11:42:54 -0800241
Anas Nashif429c2a42017-12-13 10:08:21 -0500242 Note that this does not necessarily prevent corruption and assertions
243 about the overall system state when a fault is triggered cannot be
244 made.
Anas Nashif46f66f42017-09-08 21:14:06 -0400245
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700246config USERSPACE
Andrew Boie53b52042019-01-18 11:41:06 -0800247 bool "User mode threads"
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700248 depends on ARCH_HAS_USERSPACE
Anas Nashif22b95a22019-11-24 11:28:38 -0500249 depends on RUNTIME_ERROR_CHECKS
Andrew Boie5a58ad52020-11-05 14:30:20 -0800250 depends on SRAM_REGION_PERMISSIONS
Carlo Caioned7708802020-11-12 14:44:14 +0100251 select THREAD_STACK_INFO
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700252 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500253 When enabled, threads may be created or dropped down to user mode,
254 which has significantly restricted permissions and must interact
255 with the kernel via system calls. See Zephyr documentation for more
Dominik Ermel86a12522021-07-15 10:08:48 +0000256 details about this feature.
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700257
Anas Nashif429c2a42017-12-13 10:08:21 -0500258 If a user thread overflows its stack, this will be caught and the
259 kernel itself will be shielded from harm. Enabling this option
260 may or may not catch stack overflows when the system is in
261 privileged mode or handling a system call; to ensure these are always
262 caught, enable CONFIG_HW_STACK_PROTECTION.
Andrew Boie2a8684f2017-11-06 11:42:54 -0800263
Chunlin Han18560a02018-02-01 01:19:49 -0600264config PRIVILEGED_STACK_SIZE
265 int "Size of privileged stack"
Andrew Boie606e6072019-03-28 16:48:43 -0700266 default 1024
Chunlin Han18560a02018-02-01 01:19:49 -0600267 depends on ARCH_HAS_USERSPACE
268 help
Anas Nashif89492332018-02-15 07:36:16 -0600269 This option sets the privileged stack region size that will be used
270 in addition to the user mode thread stack. During normal execution,
271 this region will be inaccessible from user mode. During system calls,
Andrew Boie28be7932020-03-11 10:56:19 -0700272 this region will be utilized by the system call. This value must be
273 a multiple of the minimum stack alignment.
Anas Nashifeb299782018-10-07 11:41:18 -0400274
275config KOBJECT_TEXT_AREA
Daniel Leung11171692021-03-18 14:00:07 -0700276 int "Size of kobject text area"
Adithya Baglody71e90f92018-08-29 16:44:16 +0530277 default 512 if COVERAGE_GCOV
Sebastian Bøeefc6d0a2019-03-15 10:54:06 +0100278 default 512 if NO_OPTIMIZATIONS
Alexandre Mergnat4b976192020-10-29 19:20:06 +0100279 default 512 if STACK_CANARIES && RISCV
Andrew Boie794d3822019-02-20 14:49:36 -0800280 default 256
Anas Nashifeb299782018-10-07 11:41:18 -0400281 depends on ARCH_HAS_USERSPACE
282 help
283 Size of kernel object text area. Used in linker script.
284
Daniel Leung11171692021-03-18 14:00:07 -0700285config KOBJECT_DATA_AREA_RESERVE_EXTRA_PERCENT
286 int "Reserve extra kobject data area (in percentage)"
287 default 100
288 depends on ARCH_HAS_USERSPACE
289 help
290 Multiplication factor used to calculate the size of placeholder to
291 reserve space for kobject metadata hash table. The hash table is
292 generated via gperf is highly dependent on the absolute addresses of
293 kobjects which might change between prebuilts. To reserve enough
294 space for the hash table during final linking passes to keep
295 kobjects in same place, the size of reserved space is calculated
296 from the first prebuilt plus additional space calculated with
297 this percentage (of the kobject data area in first prebuilt).
298
299config KOBJECT_RODATA_AREA_EXTRA_BYTES
300 int "Reserve extra bytes for kobject rodata area"
301 default 16
302 depends on ARCH_HAS_USERSPACE
303 help
304 Reserve a few more bytes for the RODATA region for kobject metadata.
305 This is to account for the uncertainty of tables generated by gperf.
306
Andrew Boie28be7932020-03-11 10:56:19 -0700307config GEN_PRIV_STACKS
308 bool
309 help
310 Selected if the architecture requires that privilege elevation stacks
311 be allocated in a separate memory area. This is typical of arches
312 whose MPUs require regions to be power-of-two aligned/sized.
313
314 FIXME: This should be removed and replaced with checks against
315 CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT, but both ARM and ARC
316 changes will be necessary for this.
317
Andrew Boiea9679152018-03-06 13:17:57 -0800318config STACK_GROWS_UP
319 bool "Stack grows towards higher memory addresses"
Andrew Boiea9679152018-03-06 13:17:57 -0800320 help
321 Select this option if the architecture has upward growing thread
322 stacks. This is not common.
323
Andrew Boieefc5fe02020-02-05 10:41:58 -0800324config NO_UNUSED_STACK_INSPECTION
325 bool
326 help
327 Selected if the architecture will generate a fault if unused stack
328 memory is examined, which is the region between the current stack
329 pointer and the deepest available address in the current stack
330 region.
331
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700332config MAX_THREAD_BYTES
333 int "Bytes to use when tracking object thread permissions"
334 default 2
335 depends on USERSPACE
336 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500337 Every kernel object will have an associated bitfield to store
338 thread permissions for that object. This controls the size of the
339 bitfield (in bytes) and imposes a limit on how many threads can
340 be created in the system.
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700341
Andrew Boie31bdfc02017-11-08 16:38:03 -0800342config DYNAMIC_OBJECTS
Andrew Boie97bf0012018-04-24 17:01:37 -0700343 bool "Allow kernel objects to be allocated at runtime"
Andrew Boie31bdfc02017-11-08 16:38:03 -0800344 depends on USERSPACE
Andrew Boie31bdfc02017-11-08 16:38:03 -0800345 help
Ulf Magnusson975de212019-11-01 10:24:07 +0100346 Enabling this option allows for kernel objects to be requested from
347 the calling thread's resource pool, at a slight cost in performance
348 due to the supplemental run-time tables required to validate such
349 objects.
Andrew Boie97bf0012018-04-24 17:01:37 -0700350
Ulf Magnusson975de212019-11-01 10:24:07 +0100351 Objects allocated in this way can be freed with a supervisor-only
352 API call, or when the number of references to that object drops to
353 zero.
Andrew Boie31bdfc02017-11-08 16:38:03 -0800354
Aurelien Jarno6fd16912018-11-07 23:40:43 +0100355config NOCACHE_MEMORY
356 bool "Support for uncached memory"
Ulf Magnusson378d6b12020-02-09 22:26:07 +0100357 depends on ARCH_HAS_NOCACHE_MEMORY_SUPPORT
Aurelien Jarno6fd16912018-11-07 23:40:43 +0100358 help
359 Add a "nocache" read-write memory section that is configured to
360 not be cached. This memory section can be used to perform DMA
361 transfers when cache coherence issues are not optimal or can not
362 be solved using cache maintenance operations.
363
Anas Nashif8379b7b2017-09-09 08:39:38 -0400364menu "Interrupt Configuration"
Ulf Magnusson41713242019-12-21 08:17:02 +0100365
Andrew Boieff6cce62018-10-30 16:53:56 -0700366config DYNAMIC_INTERRUPTS
367 bool "Enable installation of IRQs at runtime"
Andrew Boieff6cce62018-10-30 16:53:56 -0700368 help
369 Enable installation of interrupts at runtime, which will move some
370 interrupt-related data structures to RAM instead of ROM, and
371 on some architectures increase code size.
372
Anas Nashif8379b7b2017-09-09 08:39:38 -0400373config GEN_ISR_TABLES
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200374 bool "Use generated IRQ tables"
Anas Nashif8379b7b2017-09-09 08:39:38 -0400375 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500376 This option controls whether a platform uses the gen_isr_tables
377 script to generate its interrupt tables. This mechanism will create
378 an appropriate hardware vector table and/or software IRQ table.
Anas Nashif8379b7b2017-09-09 08:39:38 -0400379
380config GEN_IRQ_VECTOR_TABLE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200381 bool "Generate an interrupt vector table"
Anas Nashif8379b7b2017-09-09 08:39:38 -0400382 default y
383 depends on GEN_ISR_TABLES
384 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500385 This option controls whether a platform using gen_isr_tables
386 needs an interrupt vector table created. Only disable this if the
387 platform does not use a vector table at all, or requires the vector
388 table to be in a format that is not an array of function pointers
389 indexed by IRQ line. In the latter case, the vector table must be
390 supplied by the application or architecture code.
Anas Nashif8379b7b2017-09-09 08:39:38 -0400391
392config GEN_SW_ISR_TABLE
Ulf Magnusson8cf8db32018-08-14 16:19:20 +0200393 bool "Generate a software ISR table"
Anas Nashif8379b7b2017-09-09 08:39:38 -0400394 default y
395 depends on GEN_ISR_TABLES
396 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500397 This option controls whether a platform using gen_isr_tables
398 needs a software ISR table table created. This is an array of struct
399 _isr_table_entry containing the interrupt service routine and supplied
400 parameter.
Anas Nashif8379b7b2017-09-09 08:39:38 -0400401
Yasushi SHOJI51bc0a02019-06-20 18:28:37 +0900402config ARCH_SW_ISR_TABLE_ALIGN
403 int "Alignment size of a software ISR table"
404 default 0
405 depends on GEN_SW_ISR_TABLE
406 help
407 This option controls alignment size of generated
408 _sw_isr_table. Some architecture needs a software ISR table
409 to be aligned to architecture specific size. The default
410 size is 0 for no alignment.
411
Anas Nashif8379b7b2017-09-09 08:39:38 -0400412config GEN_IRQ_START_VECTOR
413 int
414 default 0
415 depends on GEN_ISR_TABLES
416 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500417 On some architectures, part of the vector table may be reserved for
418 system exceptions and is declared separately from the tables
419 created by gen_isr_tables.py. When creating these tables, this value
420 will be subtracted from CONFIG_NUM_IRQS to properly size them.
421 This is a hidden option which needs to be set per architecture and
422 left alone.
Anas Nashif8379b7b2017-09-09 08:39:38 -0400423
Anas Nashifa372eae2017-11-23 12:05:55 -0500424config IRQ_OFFLOAD
425 bool "Enable IRQ offload"
Andrew Boiebeba1e02019-11-07 10:33:09 -0800426 depends on TEST
Anas Nashifa372eae2017-11-23 12:05:55 -0500427 help
428 Enable irq_offload() API which allows functions to be synchronously
Andrew Boiebeba1e02019-11-07 10:33:09 -0800429 run in interrupt context. Only useful for test cases that need
430 to validate the correctness of kernel objects in IRQ context.
Anas Nashifa372eae2017-11-23 12:05:55 -0500431
Chris Coleman99a268f2020-08-28 09:02:20 -0400432
433config EXTRA_EXCEPTION_INFO
434 bool "Collect extra exception info"
435 depends on ARCH_HAS_EXTRA_EXCEPTION_INFO
436 help
437 This option enables the collection of extra information, such as
438 register state, when a fault occurs. This information can be useful
439 to collect for post-mortem analysis and debug of issues.
440
Anas Nashif8379b7b2017-09-09 08:39:38 -0400441endmenu # Interrupt configuration
442
Ioannis Glaropoulos20a98482020-10-21 15:48:41 +0200443config INIT_ARCH_HW_AT_BOOT
444 bool "Initialize internal architecture state at boot"
445 depends on ARCH_SUPPORTS_ARCH_HW_INIT
446 help
447 This option instructs Zephyr to force the initialization
448 of the internal architectural state (for example ARCH-level
449 HW registers and system control blocks) during boot to
450 the reset values as specified by the corresponding
451 architecture manual. The option is useful when the Zephyr
452 firmware image is chain-loaded, for example, by a debugger
453 or a bootloader, and we need to guarantee that the internal
454 states of the architecture core blocks are restored to the
455 reset values (as specified by the architecture).
456
457 Note: the functionality is architecture-specific. For the
458 implementation details refer to each architecture where
459 this feature is supported.
460
Anas Nashif46f66f42017-09-08 21:14:06 -0400461endmenu
462
Anas Nashif8379b7b2017-09-09 08:39:38 -0400463#
464# Architecture Capabilities
465#
Ulf Magnusson41713242019-12-21 08:17:02 +0100466
Ioannis Glaropoulos40842422021-05-19 17:45:25 +0200467config ARCH_HAS_SINGLE_THREAD_SUPPORT
468 bool
469
Anas Nashif5dec2352020-08-27 23:07:01 -0400470config ARCH_HAS_TIMING_FUNCTIONS
471 bool
472
Ioannis Glaropoulos1cc66cf2018-10-12 09:27:28 +0200473config ARCH_HAS_TRUSTED_EXECUTION
474 bool
475
Anas Nashif46f66f42017-09-08 21:14:06 -0400476config ARCH_HAS_STACK_PROTECTION
477 bool
478
Andrew Boie9f70c7b2017-09-11 10:34:49 -0700479config ARCH_HAS_USERSPACE
480 bool
481
Leandro Pereirab007b642017-10-17 17:01:48 -0700482config ARCH_HAS_EXECUTABLE_PAGE_BIT
483 bool
484
Aurelien Jarno6fd16912018-11-07 23:40:43 +0100485config ARCH_HAS_NOCACHE_MEMORY_SUPPORT
486 bool
487
Aurelien Jarno992f29a2019-02-10 11:05:51 +0100488config ARCH_HAS_RAMFUNC_SUPPORT
489 bool
490
Ioannis Glaropoulosf0306082019-10-17 19:13:12 +0200491config ARCH_HAS_NESTED_EXCEPTION_DETECTION
492 bool
493
Daniel Leung49206a82020-08-07 10:47:37 -0700494config ARCH_SUPPORTS_COREDUMP
495 bool
496
Ioannis Glaropoulos20a98482020-10-21 15:48:41 +0200497config ARCH_SUPPORTS_ARCH_HW_INIT
498 bool
499
Chris Coleman99a268f2020-08-28 09:02:20 -0400500config ARCH_HAS_EXTRA_EXCEPTION_INFO
501 bool
502
Flavio Ceolin5408f312020-05-21 16:55:28 -0700503config ARCH_HAS_GDBSTUB
504 bool
505
Andy Rossf6d32ab2020-05-13 15:34:04 +0000506config ARCH_HAS_COHERENCE
507 bool
508 help
509 When selected, the architecture supports the
510 arch_mem_coherent() API and can link into incoherent/cached
511 memory using the ".cached" linker section.
512
Daniel Leung240beb42020-09-28 11:03:52 -0700513config ARCH_HAS_THREAD_LOCAL_STORAGE
514 bool
515
Ramesh Thomasbb19e6f2016-03-18 16:43:40 -0700516#
Anas Nashiff4ddb622017-12-05 09:07:39 -0500517# Other architecture related options
518#
519
520config ARCH_HAS_THREAD_ABORT
521 bool
522
Ulf Magnusson41713242019-12-21 08:17:02 +0100523#
524# Hidden CPU family configs
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500525#
526
Ioannis Glaropoulos1cc66cf2018-10-12 09:27:28 +0200527config CPU_HAS_TEE
528 bool
529 help
530 This option is enabled when the CPU has support for Trusted
531 Execution Environment (e.g. when it has a security attribution
532 unit).
533
Stephanos Ioannidisbc8524e2019-10-09 00:52:18 +0900534config CPU_HAS_DCLS
535 bool
536 help
537 This option is enabled when the processor hardware is configured in
538 Dual-redundant Core Lock-step (DCLS) topology.
539
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500540config CPU_HAS_FPU
541 bool
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500542 help
543 This option is enabled when the CPU has hardware floating point
544 unit.
545
Corey Whartonc8f7cd52020-04-14 11:06:23 -0700546config CPU_HAS_FPU_DOUBLE_PRECISION
547 bool
548 select CPU_HAS_FPU
549 help
550 When enabled, this indicates that the CPU has a double floating point
551 precision unit.
552
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500553config CPU_HAS_MPU
554 bool
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500555 help
556 This option is enabled when the CPU has a Memory Protection Unit (MPU).
557
Andrew Boieff294e02020-06-12 16:50:16 -0700558config CPU_HAS_MMU
559 bool
560 help
561 This hidden option is selected when the CPU has a Memory Management Unit
562 (MMU).
Andrew Boie5a58ad52020-11-05 14:30:20 -0800563
Andrew Boie56a9e7b2020-11-16 11:30:35 -0800564config ARCH_HAS_DEMAND_PAGING
565 bool
566 help
567 This hidden configuration should be selected by the architecture if
568 demand paging is supported.
569
Andrew Boie73a3e052020-11-18 13:11:56 -0800570config ARCH_HAS_RESERVED_PAGE_FRAMES
571 bool
572 help
573 This hidden configuration should be selected by the architecture if
574 certain RAM page frames need to be marked as reserved and never used for
575 memory mappings. The architecture will need to implement
576 arch_reserved_pages_update().
577
Andrew Boie14c5d1f2021-01-23 14:08:12 -0800578config ARCH_MAPS_ALL_RAM
579 bool
580 help
581 This hidden option is selected by the architecture to inform the kernel
582 that all RAM is mapped at boot, and not just the bounds of the Zephyr image.
583 If RAM starts at 0x0, the first page must remain un-mapped to catch NULL
584 pointer dereferences. With this enabled, the kernel will not assume that
585 virtual memory addresses past the kernel image are available for mappings,
586 but instead takes into account an entire RAM mapping instead.
587
588 This is typically set by architectures which need direct access to all memory.
589 It is the architecture's responsibility to mark reserved memory regions
590 as such in arch_reserved_pages_update().
591
592 Although the kernel will not disturb this RAM mapping by re-mapping the associated
593 virtual addresses elsewhere, this is limited to only management of the
594 virtual address space. The kernel's page frame ontology will not consider
595 this mapping at all; non-kernel pages will be considered free (unless marked
596 as reserved) and Z_PAGE_FRAME_MAPPED will not be set.
597
Andrew Boie1524ef22020-07-20 17:32:00 -0700598menuconfig MMU
599 bool "Enable MMU features"
Andrew Boie542dcae2020-06-12 17:53:12 -0700600 depends on CPU_HAS_MMU
601 help
602 This option is enabled when the CPU's memory management unit is active
603 and the arch_mem_map() API is available.
604
Andrew Boie1524ef22020-07-20 17:32:00 -0700605if MMU
Andrew Boie542dcae2020-06-12 17:53:12 -0700606config MMU_PAGE_SIZE
607 hex "Size of smallest granularity MMU page"
Andrew Boie542dcae2020-06-12 17:53:12 -0700608 default 0x1000
609 help
610 Size of memory pages. Varies per MMU but 4K is common. For MMUs that
611 support multiple page sizes, put the smallest one here.
612
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800613config KERNEL_VM_BASE
Andrew Boie893822f2020-12-17 14:29:52 -0800614 hex "Virtual address space base address"
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800615 default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
616 help
Andrew Boie893822f2020-12-17 14:29:52 -0800617 Define the base of the kernel's address space.
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800618
619 By default, this is the same as the DT_CHOSEN_Z_SRAM physical base SRAM
620 address from DTS, in which case RAM will be identity-mapped. Some
621 architectures may require RAM to be mapped in this way; they may have
622 just one RAM region and doing this makes linking much simpler, as
623 at least when the kernel boots all virtual RAM addresses are the same
624 as their physical address (demand paging at runtime may later modify
Andrew Boie893822f2020-12-17 14:29:52 -0800625 this for non-pinned page frames).
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800626
627 Otherwise, if RAM isn't identity-mapped:
628 1. It is the architecture's responsibility to transition the
629 instruction pointer to virtual addresses at early boot before
630 entering the kernel at z_cstart().
631 2. The underlying architecture may impose constraints on the bounds of
632 the kernel's address space, such as not overlapping physical RAM
633 regions if RAM is not identity-mapped, or the virtual and physical
634 base addresses being aligned to some common value (which allows
635 double-linking of paging structures to make the instruction pointer
636 transition simpler).
637
Andrew Boie893822f2020-12-17 14:29:52 -0800638 Zephyr does not implement a split address space and if multiple
639 page tables are in use, they all have the same virtual-to-physical
640 mappings (with potentially different permissions).
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800641
Andrew Boie69355d12020-12-17 23:37:47 -0800642config KERNEL_VM_OFFSET
643 hex "Kernel offset within address space"
644 default 0
645 help
646 Offset that the kernel image begins within its address space,
647 if this is not the same offset from the beginning of RAM.
648
649 Some care may need to be taken in selecting this value. In certain
650 build-time cases, or when a physical address cannot be looked up
651 in page tables, the equation:
652
653 virt = phys + ((KERNEL_VM_BASE + KERNEL_VM_OFFSET) -
Daniel Leungece9cad2021-02-20 11:02:17 -0800654 (SRAM_BASE_ADDRESS + SRAM_OFFSET))
Andrew Boie69355d12020-12-17 23:37:47 -0800655
656 Will be used to convert between physical and virtual addresses for
657 memory that is mapped at boot.
658
659 This uncommon and is only necessary if the beginning of VM and
660 physical memory have dissimilar alignment.
661
Andrew Boie7d32e9f2020-09-01 16:50:45 -0700662config KERNEL_VM_SIZE
663 hex "Size of kernel address space in bytes"
Andrew Boieb0b77562020-12-17 21:12:40 -0800664 default 0x800000
Andrew Boie2c3523e2020-07-08 21:34:02 -0700665 help
Andrew Boie7d32e9f2020-09-01 16:50:45 -0700666 Size of the kernel's address space. Constraining this helps control
667 how much total memory can be used for page tables.
Andrew Boie2c3523e2020-07-08 21:34:02 -0700668
Andrew Boie893822f2020-12-17 14:29:52 -0800669 The difference between KERNEL_VM_BASE and KERNEL_VM_SIZE indicates the
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800670 size of the virtual region for runtime memory mappings. This is needed
671 for mapping driver MMIO regions, as well as special RAM mapping use-cases
672 such as VSDO pages, memory mapped thread stacks, and anonymous memory
Andrew Boie893822f2020-12-17 14:29:52 -0800673 mappings. The kernel itself will be mapped in here as well at boot.
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800674
Andrew Boie893822f2020-12-17 14:29:52 -0800675 Systems with very large amounts of memory (such as 512M or more)
Andrew Boieea6e4ad2020-11-04 13:31:14 -0800676 will want to use a 64-bit build of Zephyr, there are no plans to
677 implement a notion of "high" memory in Zephyr to work around physical
Andrew Boie893822f2020-12-17 14:29:52 -0800678 RAM size larger than the defined bounds of the virtual address space.
Andrew Boie2c3523e2020-07-08 21:34:02 -0700679
Daniel Leungae865192021-03-26 12:03:42 -0700680menuconfig DEMAND_PAGING
Andrew Boie56a9e7b2020-11-16 11:30:35 -0800681 bool "Enable demand paging [EXPERIMENTAL]"
682 depends on ARCH_HAS_DEMAND_PAGING
683 help
684 Enable demand paging. Requires architecture support in how the kernel
685 is linked and the implementation of an eviction algorithm and a
686 backing store for evicted pages.
687
688if DEMAND_PAGING
689config DEMAND_PAGING_ALLOW_IRQ
690 bool "Allow interrupts during page-ins/outs"
691 help
692 Allow interrupts to be serviced while pages are being evicted or
693 retrieved from the backing store. This is much better for system
694 latency, but any code running in interrupt context that page faults
695 will cause a kernel panic. Such code must work with exclusively pinned
696 code and data pages.
697
698 The scheduler is still disabled during this operation.
699
700 If this option is disabled, the page fault servicing logic
701 runs with interrupts disabled for the entire operation. However,
702 ISRs may also page fault.
Daniel Leungae865192021-03-26 12:03:42 -0700703
Daniel Leung2dfae4a2021-07-22 15:08:28 -0700704config DEMAND_PAGING_PAGE_FRAMES_RESERVE
705 int "Number of page frames reserved for paging"
706 default 32 if !LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT
707 default 0
708 help
709 This sets the number of page frames that will be reserved for
710 paging that do not count towards free memory. This is to
711 ensure that there are some page frames available for paging
712 code and data. Otherwise, it would be possible to exhaust
713 all page frames via anonymous memory mappings.
714
Daniel Leungae865192021-03-26 12:03:42 -0700715config DEMAND_PAGING_STATS
716 bool "Gather Demand Paging Statistics"
717 help
718 This enables gathering various statistics related to demand paging,
719 e.g. number of pagefaults. This is useful for tuning eviction
720 algorithms and optimizing backing store.
721
722 Should say N in production system as this is not without cost.
723
Daniel Leung09e8db32021-03-31 13:56:05 -0700724config DEMAND_PAGING_STATS_USING_TIMING_FUNCTIONS
725 bool "Use Timing Functions to Gather Demand Paging Statistics"
726 select TIMING_FUNCTIONS_NEED_AT_BOOT
727 help
728 Use timing functions to gather various demand paging statistics.
729
Daniel Leungae865192021-03-26 12:03:42 -0700730config DEMAND_PAGING_THREAD_STATS
731 bool "Gather per Thread Demand Paging Statistics"
732 depends on DEMAND_PAGING_STATS
733 help
734 This enables gathering per thread statistics related to demand
735 paging.
736
737 Should say N in production system as this is not without cost.
738
Daniel Leung8eea5112021-03-30 14:38:00 -0700739config DEMAND_PAGING_TIMING_HISTOGRAM
740 bool "Gather Demand Paging Execution Timing Histogram"
741 depends on DEMAND_PAGING_STATS
742 help
743 This gathers the histogram of execution time on page eviction
744 selection, and backing store page in and page out.
745
746 Should say N in production system as this is not without cost.
747
748config DEMAND_PAGING_TIMING_HISTOGRAM_NUM_BINS
749 int "Number of bins (buckets) in Demand Paging Timing Histogrm"
750 depends on DEMAND_PAGING_TIMING_HISTOGRAM
751 default 10
752 help
753 Defines the number of bins (buckets) in the histogram used for
754 gathering execution timing information for demand paging.
755
Daniel Leung31c362d2021-05-13 11:02:56 -0700756 This requires k_mem_paging_eviction_histogram_bounds[] and
Daniel Leungdfa4b7e2021-05-13 11:57:54 -0700757 k_mem_paging_backing_store_histogram_bounds[] to define
758 the upper bounds for each bin. See kernel/statistics.c for
759 information.
Daniel Leung8eea5112021-03-30 14:38:00 -0700760
Andrew Boie56a9e7b2020-11-16 11:30:35 -0800761endif # DEMAND_PAGING
Andrew Boie1524ef22020-07-20 17:32:00 -0700762endif # MMU
763
Andrew Boie5a58ad52020-11-05 14:30:20 -0800764menuconfig MPU
765 bool "Enable MPU features"
766 depends on CPU_HAS_MPU
Ioannis Glaropoulos39bf24a2018-11-27 15:45:36 +0100767 help
Andrew Boie5a58ad52020-11-05 14:30:20 -0800768 This option, when enabled, indicates to the core kernel that an MPU
769 is enabled.
Ioannis Glaropoulos39bf24a2018-11-27 15:45:36 +0100770
Andrew Boie5a58ad52020-11-05 14:30:20 -0800771if MPU
Andy Grosse8860fe2018-02-01 01:12:32 -0600772config MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT
773 bool
Andy Grosse8860fe2018-02-01 01:12:32 -0600774 help
Anas Nashif89492332018-02-15 07:36:16 -0600775 This option is enabled when the MPU requires a power of two alignment
776 and size for MPU regions.
Andy Grosse8860fe2018-02-01 01:12:32 -0600777
Ioannis Glaropoulosafa78192018-09-25 14:05:56 +0200778config MPU_REQUIRES_NON_OVERLAPPING_REGIONS
779 bool
Ioannis Glaropoulosafa78192018-09-25 14:05:56 +0200780 help
781 This option is enabled when the MPU requires the active (i.e. enabled)
782 MPU regions to be non-overlapping with each other.
Andy Grosse8860fe2018-02-01 01:12:32 -0600783
Ioannis Glaropoulos6d789512019-10-24 15:17:09 +0200784config MPU_GAP_FILLING
785 bool "Force MPU to be filling in background memory regions"
786 depends on MPU_REQUIRES_NON_OVERLAPPING_REGIONS
Ioannis Glaropoulos98201222019-11-11 12:46:31 +0100787 default y if !USERSPACE
Ioannis Glaropoulos6d789512019-10-24 15:17:09 +0200788 help
789 This Kconfig option instructs the MPU driver to enforce
790 a full kernel SRAM partitioning, when it programs the
791 dynamic MPU regions (user thread stack, PRIV stack guard
792 and application memory domains) during context-switch. We
793 allow this to be a configurable option, in order to be able
794 to switch the option off and have an increased number of MPU
795 regions available for application memory domain programming.
796
797 Notes:
798 An increased number of MPU regions should only be required,
Ioannis Glaropoulos98201222019-11-11 12:46:31 +0100799 when building with USERSPACE support. As a result, when we
800 build without USERSPACE support, gap filling should always
801 be required.
Ioannis Glaropoulos6d789512019-10-24 15:17:09 +0200802
803 When the option is switched off, access to memory areas not
804 covered by explicit MPU regions is restricted to privileged
805 code on an ARCH-specific basis. Refer to ARCH-specific
806 documentation for more information on how this option is
807 used.
808
Andrew Boie5a58ad52020-11-05 14:30:20 -0800809endif # MPU
810
811config SRAM_REGION_PERMISSIONS
812 bool "Assign appropriate permissions to kernel areas in SRAM"
813 depends on MMU || MPU
814 default y
815 help
816 This option indicates that memory protection hardware
817 is present, enabled, and regions have been configured at boot for memory
818 ranges within the kernel image.
819
820 If this option is turned on, certain areas of the kernel image will
821 have the following access policies applied for all threads, including
822 supervisor threads:
823
824 1) All program text will be have read-only, execute memory permission
825 2) All read-only data will have read-only permission, and execution
826 disabled if the hardware supports it.
827 3) All other RAM addresses will have read-write permission, and
828 execution disabled if the hardware supports it.
829
830 Options such as USERSPACE or HW_STACK_PROTECTION may additionally
831 impose additional policies on the memory map, which may be global
832 or local to the current running thread.
833
834 This option may consume additional memory to satisfy memory protection
835 hardware alignment constraints.
836
837 If this option is disabled, the entire kernel will have default memory
838 access permissions set, typically read/write/execute. It may be desirable
839 to turn this off on MMU systems which are using the MMU for demand
840 paging, do not need memory protection, and would rather not use up
841 RAM for the alignment between regions.
842
Stephanos Ioannidis4f4e85c2020-04-24 14:06:37 +0900843menu "Floating Point Options"
844
845config FPU
846 bool "Enable floating point unit (FPU)"
Sebastian Bøe7201a1b2018-12-27 16:13:25 +0100847 depends on CPU_HAS_FPU
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500848 help
Stephanos Ioannidis4f4e85c2020-04-24 14:06:37 +0900849 This option enables the hardware Floating Point Unit (FPU), in order to
850 support using the floating point registers and instructions.
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500851
Stephanos Ioannidis4f4e85c2020-04-24 14:06:37 +0900852 When this option is enabled, by default, threads may use the floating
853 point registers only in an exclusive manner, and this usually means that
854 only one thread may perform floating point operations.
855
856 If it is necessary for multiple threads to perform concurrent floating
857 point operations, the "FPU register sharing" option must be enabled to
858 preserve the floating point registers across context switches.
859
860 Note that this option cannot be selected for the platforms that do not
861 include a hardware floating point unit; the floating point support for
862 those platforms is dependent on the availability of the toolchain-
863 provided software floating point library.
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500864
Stephanos Ioannidisaaf93202020-05-03 18:03:19 +0900865config FPU_SHARING
Stephanos Ioannidis4f4e85c2020-04-24 14:06:37 +0900866 bool "FPU register sharing"
Ioannis Glaropoulos86c1b572021-01-27 14:24:59 +0100867 depends on FPU && MULTITHREADING
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500868 help
Stephanos Ioannidis4f4e85c2020-04-24 14:06:37 +0900869 This option enables preservation of the hardware floating point registers
870 across context switches to allow multiple threads to perform concurrent
871 floating point operations.
872
Nicolas Pitre949ef7c2021-04-07 21:41:06 -0400873 Note that some compiler configurations may activate a floating point
874 context by generating FP instructions for any thread, and that
875 context must be preserved when switching such threads in and out.
876 The developers can still disable the FP sharing mode in their
877 application projects, and switch to Unshared FP registers mode,
878 if it is guaranteed that the image code does not generate FP
879 instructions outside the single thread context that is allowed
880 to do so.
Ioannis Glaropoulos86c1b572021-01-27 14:24:59 +0100881
Stephanos Ioannidis4f4e85c2020-04-24 14:06:37 +0900882endmenu
Anas Nashif9c1da0d2017-11-23 17:43:54 -0500883
Carlo Caione923b3be2020-12-02 13:05:37 +0100884menu "Cache Options"
885
Carlo Caione20f59c82020-12-03 10:49:00 +0100886config CACHE_MANAGEMENT
887 bool "Enable cache management features"
Carlo Caione923b3be2020-12-02 13:05:37 +0100888 help
Carlo Caione20f59c82020-12-03 10:49:00 +0100889 This links in the cache management functions (for d-cache and i-cache
890 where possible).
Carlo Caione923b3be2020-12-02 13:05:37 +0100891
Carlo Caionee77c8412020-12-02 12:38:58 +0100892config DCACHE_LINE_SIZE_DETECT
893 bool "Detect d-cache line size at runtime"
894 depends on CACHE_MANAGEMENT
895 help
896 This option enables querying some architecture-specific hardware for
897 finding the d-cache line size at the expense of taking more memory and
898 code and a slightly increased boot time.
899
900 If the CPU's d-cache line size is known in advance, disable this option and
901 manually enter the value for DCACHE_LINE_SIZE or set it in the DT
902 using the 'd-cache-line-size' property.
903
904config DCACHE_LINE_SIZE
905 int "d-cache line size" if !DCACHE_LINE_SIZE_DETECT
906 depends on CACHE_MANAGEMENT
907 default 0
908 help
909 Size in bytes of a CPU d-cache line. If this is set to 0 the value is
910 obtained from the 'd-cache-line-size' DT property instead if present.
911
912
913 Detect automatically at runtime by selecting DCACHE_LINE_SIZE_DETECT.
914
915config ICACHE_LINE_SIZE_DETECT
916 bool "Detect i-cache line size at runtime"
917 depends on CACHE_MANAGEMENT
918 help
919 This option enables querying some architecture-specific hardware for
920 finding the i-cache line size at the expense of taking more memory and
921 code and a slightly increased boot time.
922
923 If the CPU's i-cache line size is known in advance, disable this option and
924 manually enter the value for ICACHE_LINE_SIZE or set it in the DT
925 using the 'i-cache-line-size' property.
926
927config ICACHE_LINE_SIZE
928 int "i-cache line size" if !ICACHE_LINE_SIZE_DETECT
929 depends on CACHE_MANAGEMENT
930 default 0
931 help
932 Size in bytes of a CPU i-cache line. If this is set to 0 the value is
933 obtained from the 'i-cache-line-size' DT property instead if present.
934
935 Detect automatically at runtime by selecting ICACHE_LINE_SIZE_DETECT.
936
Dylan Hungb61ea622021-07-13 15:20:47 +0800937choice CACHE_TYPE
Carlo Caionee2333262021-04-28 10:38:27 +0200938 prompt "Cache type"
939 depends on CACHE_MANAGEMENT
940 default HAS_ARCH_CACHE
941
942config HAS_ARCH_CACHE
943 bool "Integrated cache controller"
944 help
945 "Integrade on-core cache controller"
946
947config HAS_EXTERNAL_CACHE
948 bool "External cache controller"
949 help
950 "External cache controller or cache management system"
951
952endchoice
953
Carlo Caione923b3be2020-12-02 13:05:37 +0100954endmenu
955
Anas Nashif77ba3c32015-10-09 06:20:52 -0400956config ARCH
957 string
958 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500959 System architecture string.
Anas Nashif77ba3c32015-10-09 06:20:52 -0400960
961config SOC
Anas Nashifa02c34e2016-03-31 08:07:42 -0400962 string
963 help
Anas Nashif57444372018-09-03 15:44:13 -0500964 SoC name which can be found under soc/<arch>/<soc name>.
Anas Nashif429c2a42017-12-13 10:08:21 -0500965 This option holds the directory name used by the build system to locate
Marti Bolivar5ec7ed82018-11-21 14:42:47 -0500966 the correct linker and header files for the SoC.
Anas Nashifa02c34e2016-03-31 08:07:42 -0400967
968config SOC_SERIES
969 string
970 help
Anas Nashif57444372018-09-03 15:44:13 -0500971 SoC series name which can be found under soc/<arch>/<family>/<series>.
Anas Nashif429c2a42017-12-13 10:08:21 -0500972 This option holds the directory name used by the build system to locate
973 the correct linker and header files.
Anas Nashifa02c34e2016-03-31 08:07:42 -0400974
975config SOC_FAMILY
976 string
977 help
Anas Nashif57444372018-09-03 15:44:13 -0500978 SoC family name which can be found under soc/<arch>/<family>.
Anas Nashif429c2a42017-12-13 10:08:21 -0500979 This option holds the directory name used by the build system to locate
980 the correct linker and header files.
Anas Nashif66233112015-11-29 19:47:21 -0500981
Anas Nashif2d762242015-12-07 20:20:25 -0500982config BOARD
983 string
984 help
Anas Nashif429c2a42017-12-13 10:08:21 -0500985 This option holds the name of the board and is used to locate the files
986 related to the board in the source tree (under boards/).
987 The Board is the first location where we search for a linker.ld file,
988 if not found we look for the linker file in
Anas Nashif57444372018-09-03 15:44:13 -0500989 soc/<arch>/<family>/<series>
Daniel Leung783b2072021-04-23 20:52:38 -0700990
991config TOOLCHAIN_HAS_BUILTIN_FFS
992 bool
993 default y if !(64BIT && RISCV)
994 help
995 Hidden option to signal that toolchain has __builtin_ffs*().