blob: 0268a67b0a55df36c38e4361465a4d555baed749 [file] [log] [blame]
Ulf Magnussonbd6e0442019-11-01 13:45:29 +01001# General configuration options
Anas Nashif7d4163d2015-08-22 14:43:07 -04002
Anas Nashif7d4163d2015-08-22 14:43:07 -04003# Copyright (c) 2014-2015 Wind River Systems, Inc.
Daniel Leung8df10d42016-03-25 14:30:50 -07004# Copyright (c) 2016 Intel Corporation
David B. Kinderac74d8b2017-01-18 17:01:01 -08005# SPDX-License-Identifier: Apache-2.0
Sebastian Bøe4b61bd12018-01-09 14:12:07 +01006
Anas Nashif658f6bc2019-05-28 14:22:51 -04007menu "Modules"
8
Sebastian Bøe7061c032019-03-01 12:57:11 +01009source "$(CMAKE_BINARY_DIR)/Kconfig.modules"
Anas Nashif8017c592019-05-23 17:19:41 -040010source "modules/Kconfig"
Emanuele Di Santo9acb6432019-03-13 15:30:55 +010011
Anas Nashif658f6bc2019-05-28 14:22:51 -040012endmenu
13
Ulf Magnussonec3eff52018-07-30 10:57:47 +020014# Include these first so that any properties (e.g. defaults) below can be
Anas Nashiff2cb20c2019-06-18 14:45:40 -040015# overridden in *.defconfig files (by defining symbols in multiple locations).
Ulf Magnussonec3eff52018-07-30 10:57:47 +020016# After merging all the symbol definitions, Kconfig picks the first property
17# (e.g. the first default) with a satisfied condition.
18#
19# Board defaults should be parsed before SoC defaults, because boards usually
Erwan Gourioue3bed1f2019-11-22 10:37:01 +010020# overrides SoC values. Similarly shields defaults should be parsed before
21# boards defaults, because shields defaults override boards defaults.
Ulf Magnussonec3eff52018-07-30 10:57:47 +020022#
Ulf Magnussond0e87522018-09-05 12:58:05 +020023# Note: $ARCH and $BOARD_DIR might be glob patterns.
Erwan Gourioue3bed1f2019-11-22 10:37:01 +010024source "boards/shields/*/Kconfig.defconfig"
25
Ulf Magnussond7130332018-09-05 13:10:19 +020026source "$(BOARD_DIR)/Kconfig.defconfig"
Ulf Magnussonec3eff52018-07-30 10:57:47 +020027
Anas Nashif96455d52018-09-04 14:34:06 -050028source "$(SOC_DIR)/$(ARCH)/*/Kconfig.defconfig"
Ulf Magnussonec3eff52018-07-30 10:57:47 +020029
Anas Nashifabcf2ad2018-09-04 08:32:07 -050030source "boards/Kconfig"
31
Anas Nashif96455d52018-09-04 14:34:06 -050032source "$(SOC_DIR)/Kconfig"
Anas Nashifabcf2ad2018-09-04 08:32:07 -050033
Anas Nashif77ba3c32015-10-09 06:20:52 -040034source "arch/Kconfig"
35
36source "kernel/Kconfig"
37
Anas Nashifc6ba67f2017-08-03 07:47:44 -040038source "dts/Kconfig"
39
Anas Nashif77ba3c32015-10-09 06:20:52 -040040source "drivers/Kconfig"
41
Anas Nashif0b2c44a2016-05-14 23:10:51 -040042source "lib/Kconfig"
43
Ramesh Thomase354ad22016-10-29 04:10:36 -070044source "subsys/Kconfig"
Ramesh Thomascc745722016-07-25 16:20:54 -070045
Kumar Gala7584a122016-05-24 14:23:26 -050046source "ext/Kconfig"
47
Kumar Gala2630fba2020-01-24 09:39:40 -060048osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig"
Anas Nashif8017c592019-05-23 17:19:41 -040049
Anas Nashif86ad37a2018-11-02 07:12:07 -040050menu "Build and Link Features"
51
52menu "Linker Options"
53
Daniel Leung6600c642018-10-19 10:15:19 -070054choice
55 prompt "Linker Orphan Section Handling"
56 default LINKER_ORPHAN_SECTION_WARN
57
58config LINKER_ORPHAN_SECTION_PLACE
59 bool "Place"
60 help
61 Linker puts orphan sections in place without warnings
62 or errors.
63
64config LINKER_ORPHAN_SECTION_WARN
65 bool "Warn"
66 help
Anas Nashiff2cb20c2019-06-18 14:45:40 -040067 Linker places the orphan sections in output and issues
Daniel Leung6600c642018-10-19 10:15:19 -070068 warning about those sections.
69
70config LINKER_ORPHAN_SECTION_ERROR
71 bool "Error"
72 help
73 Linker exits with error when an orphan section is found.
74
75endchoice
Anas Nashif86ad37a2018-11-02 07:12:07 -040076
Adithya Baglody91c5b842018-11-13 16:57:45 +053077config CODE_DATA_RELOCATION
Ulf Magnusson975de212019-11-01 10:24:07 +010078 bool "Relocate code/data sections"
79 depends on ARM
80 help
Adithya Baglody91c5b842018-11-13 16:57:45 +053081 When selected this will relocate .text, data and .bss sections from
82 the specified files and places it in the required memory region. The
83 files should be specified in the CMakeList.txt file with
Håkon Øye Amundsend3aa6192019-08-15 09:03:26 +000084 a cmake API zephyr_code_relocate().
Adithya Baglody91c5b842018-11-13 16:57:45 +053085
Anas Nashif86ad37a2018-11-02 07:12:07 -040086config HAS_FLASH_LOAD_OFFSET
87 bool
88 help
89 This option is selected by targets having a FLASH_LOAD_OFFSET
90 and FLASH_LOAD_SIZE.
91
Ulf Magnussonfd9981a2019-11-16 01:33:09 +010092if HAS_FLASH_LOAD_OFFSET
93
Ulf Magnusson90b9eb32019-11-16 01:22:16 +010094config USE_DT_CODE_PARTITION
Ulf Magnusson1f9c5f12019-11-16 01:16:57 +010095 bool "Link application into /chosen/zephyr,code-partition from devicetree"
Andrzej Puzdrowski2b1227f2019-03-18 14:02:11 +010096 help
Ulf Magnusson1f9c5f12019-11-16 01:16:57 +010097 When enabled, the application will be linked into the flash partition
98 selected by the zephyr,code-partition property in /chosen in devicetree.
99 When this is disabled, the flash load offset and size can be set manually
100 below.
Andrzej Puzdrowski2b1227f2019-03-18 14:02:11 +0100101
Kumar Gala8ce0cf02019-08-28 09:29:26 -0500102# Workaround for not being able to have commas in macro arguments
103DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
104
Anas Nashif86ad37a2018-11-02 07:12:07 -0400105config FLASH_LOAD_OFFSET
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100106 # Only user-configurable when USE_DT_CODE_PARTITION is disabled
107 hex "Kernel load offset" if !USE_DT_CODE_PARTITION
108 default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -0400109 default 0
Anas Nashif86ad37a2018-11-02 07:12:07 -0400110 help
111 This option specifies the byte offset from the beginning of flash that
112 the kernel should be loaded into. Changing this value from zero will
113 affect the Zephyr image's link, and will decrease the total amount of
114 flash available for use by application code.
115
116 If unsure, leave at the default value 0.
117
118config FLASH_LOAD_SIZE
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100119 # Only user-configurable when USE_DT_CODE_PARTITION is disabled
120 hex "Kernel load size" if !USE_DT_CODE_PARTITION
121 default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -0400122 default 0
Anas Nashif86ad37a2018-11-02 07:12:07 -0400123 help
124 If non-zero, this option specifies the size, in bytes, of the flash
125 area that the Zephyr image will be allowed to occupy. If zero, the
126 image will be able to occupy from the FLASH_LOAD_OFFSET to the end of
127 the device.
128
129 If unsure, leave at the default value 0.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400130
Ulf Magnussonfd9981a2019-11-16 01:33:09 +0100131endif # HAS_FLASH_LOAD_OFFSET
132
Anas Nashif86ad37a2018-11-02 07:12:07 -0400133config TEXT_SECTION_OFFSET
Ole Sæther985446a2019-01-23 14:13:03 +0100134 hex
135 prompt "TEXT section offset" if !BOOTLOADER_MCUBOOT
Anas Nashif86ad37a2018-11-02 07:12:07 -0400136 default 0x200 if BOOTLOADER_MCUBOOT
137 default 0
138 help
139 If the application is built for chain-loading by a bootloader this
140 variable is required to be set to value that leaves sufficient
141 space between the beginning of the image and the start of the .text
142 section to store an image header or any other metadata.
143 In the particular case of the MCUboot bootloader this reserves enough
144 space to store the image header, which should also meet vector table
145 alignment requirements on most ARM targets, although some targets
146 may require smaller or larger values.
147
148config HAVE_CUSTOM_LINKER_SCRIPT
149 bool "Custom linker scripts provided"
150 help
151 Set this option if you have a custom linker script which needed to
152 be define in CUSTOM_LINKER_SCRIPT.
153
154config CUSTOM_LINKER_SCRIPT
155 string "Path to custom linker script"
156 depends on HAVE_CUSTOM_LINKER_SCRIPT
157 help
158 Path to the linker script to be used instead of the one define by the
159 board.
160
161 The linker script must be based on a version provided by Zephyr since
162 the kernel can expect a certain layout/certain regions.
163
164 This is useful when an application needs to add sections into the
165 linker script and avoid having to change the script provided by
166 Zephyr.
167
168config CUSTOM_RODATA_LD
Øyvind Rønningstad901c0a12019-03-20 12:53:49 +0100169 bool "(DEPRECATED) Include custom-rodata.ld"
Anas Nashif86ad37a2018-11-02 07:12:07 -0400170 help
Øyvind Rønningstad901c0a12019-03-20 12:53:49 +0100171 Note: This is deprecated, use Cmake function zephyr_linker_sources() instead.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400172 Include a customized linker script fragment for inserting additional
173 data and linker directives into the rodata section.
174
175config CUSTOM_RWDATA_LD
Øyvind Rønningstad901c0a12019-03-20 12:53:49 +0100176 bool "(DEPRECATED) Include custom-rwdata.ld"
Anas Nashif86ad37a2018-11-02 07:12:07 -0400177 help
Øyvind Rønningstad901c0a12019-03-20 12:53:49 +0100178 Note: This is deprecated, use Cmake function zephyr_linker_sources() instead.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400179 Include a customized linker script fragment for inserting additional
180 data and linker directives into the data section.
181
182config CUSTOM_SECTIONS_LD
Øyvind Rønningstad901c0a12019-03-20 12:53:49 +0100183 bool "(DEPRECATED) Include custom-sections.ld"
Anas Nashif86ad37a2018-11-02 07:12:07 -0400184 help
Øyvind Rønningstad901c0a12019-03-20 12:53:49 +0100185 Note: This is deprecated, use Cmake function zephyr_linker_sources() instead.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400186 Include a customized linker script fragment for inserting additional
187 arbitrary sections.
188
Anas Nashif86ad37a2018-11-02 07:12:07 -0400189config KERNEL_ENTRY
190 string "Kernel entry symbol"
191 default "__start"
192 help
193 Code entry symbol, to be set at linking phase.
194
Sebastian Bøe3a0597f2019-03-15 14:05:09 +0100195config LINKER_SORT_BY_ALIGNMENT
196 bool "Sort input sections by alignment"
197 default y
198 help
199 This turns on the linker flag to sort sections by alignment
200 in decreasing size of symbols. This helps to minimize
201 padding between symbols.
202
Anas Nashif86ad37a2018-11-02 07:12:07 -0400203endmenu
204
205menu "Compiler Options"
206
Anas Nashif86ad37a2018-11-02 07:12:07 -0400207config NATIVE_APPLICATION
208 bool "Build as a native host application"
209 help
210 Build as a native application that can run on the host and using
211 resources and libraries provided by the host.
212
213choice
214 prompt "Optimization level"
215 default NO_OPTIMIZATIONS if COVERAGE
216 default DEBUG_OPTIMIZATIONS if DEBUG
217 default SIZE_OPTIMIZATIONS
218 help
219 Note that these flags shall only control the compiler
220 optimization level, and that no extra debug code shall be
221 conditionally compiled based on them.
222
223config SIZE_OPTIMIZATIONS
224 bool "Optimize for size"
225 help
226 Compiler optimizations will be set to -Os independently of other
227 options.
228
229config SPEED_OPTIMIZATIONS
230 bool "Optimize for speed"
231 help
232 Compiler optimizations will be set to -O2 independently of other
233 options.
234
235config DEBUG_OPTIMIZATIONS
236 bool "Optimize debugging experience"
237 help
238 Compiler optimizations will be set to -Og independently of other
239 options.
240
241config NO_OPTIMIZATIONS
242 bool "Optimize nothing"
243 help
244 Compiler optimizations will be set to -O0 independently of other
245 options.
246
247endchoice
248
249config COMPILER_OPT
250 string "Custom compiler options"
251 help
252 This option is a free-form string that is passed to the compiler
253 when building all parts of a project (i.e. kernel).
254 The compiler options specified by this string supplement the
255 predefined set of compiler supplied by the build system,
256 and can be used to change compiler optimization, warning and error
257 messages, and so on.
258
259endmenu
260
Anas Nashif22b95a22019-11-24 11:28:38 -0500261choice
262 prompt "Error checking behavior for CHECK macro"
263 default RUNTIME_ERROR_CHECKS
264
265config ASSERT_ON_ERRORS
266 bool "Assert on all errors"
267 help
268 Assert on errors covered with the CHECK macro.
269
270config NO_RUNTIME_CHECKS
271 bool "No runtime error checks"
272 help
273 Do not do any runtime checks or asserts when using the CHECK macro.
274
275config RUNTIME_ERROR_CHECKS
276 bool "Enable runtime error checks"
277 help
278 Always perform runtime checks covered with the CHECK macro. This
279 option is the default and the only option used during testing.
280
281endchoice
282
Anas Nashif86ad37a2018-11-02 07:12:07 -0400283menu "Build Options"
284
285config KERNEL_BIN_NAME
286 string "The kernel binary name"
287 default "zephyr"
288 help
289 This option sets the name of the generated kernel binary.
290
291config OUTPUT_STAT
292 bool "Create a statistics file"
293 default y
294 help
295 Create a stat file using readelf -e <elf>
296
297config OUTPUT_DISASSEMBLY
298 bool "Create a disassembly file"
299 default y
300 help
301 Create an .lst file with the assembly listing of the firmware.
302
303config OUTPUT_PRINT_MEMORY_USAGE
304 bool "Print memory usage to stdout"
305 default y
306 help
307 If the toolchain supports it, this option will pass
308 --print-memory-region to the linker when it is doing it's first
309 linker pass. Note that the memory regions are symbolic concepts
310 defined by the linker scripts and do not necessarily map
311 directly to the real physical address space. Take also note that
312 some platforms do two passes of the linker so the results do not
313 match exactly to the final elf file. See also rom_report,
314 ram_report and
315 https://sourceware.org/binutils/docs/ld/MEMORY.html
316
317config BUILD_OUTPUT_HEX
318 bool "Build a binary in HEX format"
319 help
320 Build a binary in HEX format. This will build a zephyr.hex file need
321 by some platforms.
322
323config BUILD_OUTPUT_BIN
324 bool "Build a binary in BIN format"
325 default y
326 help
327 Build a binary in BIN format. This will build a zephyr.bin file need
328 by some platforms.
329
330config BUILD_OUTPUT_EXE
331 bool "Build a binary in ELF format with .exe extension"
332 help
333 Build a binary in ELF format that can run in the host system. This
334 will build a zephyr.exe file.
335
336config BUILD_OUTPUT_S19
337 bool "Build a binary in S19 format"
338 help
339 Build a binary in S19 format. This will build a zephyr.s19 file need
340 by some platforms.
341
Håkon Øye Amundsenc086b932018-11-26 09:47:16 +0000342config BUILD_NO_GAP_FILL
343 bool "Don't fill gaps in generated hex/bin/s19 files."
Håkon Øye Amundsenc086b932018-11-26 09:47:16 +0000344
Anas Nashif86ad37a2018-11-02 07:12:07 -0400345config BUILD_OUTPUT_STRIPPED
346 bool "Build a stripped binary"
347 help
348 Build a stripped binary. This will build a zephyr.stripped file need
349 by some platforms.
350
351config APPLICATION_DEFINED_SYSCALL
352 bool "Scan application folder for any syscall definition"
353 help
354 Scan additional folders inside application source folder
355 for application defined syscalls.
356
Sebastian Bøed3a8fd42019-10-17 14:25:34 +0200357config MAKEFILE_EXPORTS
358 bool "Generate build metadata files named Makefile.exports"
359 help
360 Generates a file with build information that can be read by
361 third party Makefile-based build systems.
362
Anas Nashif86ad37a2018-11-02 07:12:07 -0400363endmenu
364endmenu
365
366
367menu "Boot Options"
368
369config IS_BOOTLOADER
370 bool "Act as a bootloader"
371 depends on XIP
372 depends on ARM
373 help
374 This option indicates that Zephyr will act as a bootloader to execute
375 a separate Zephyr image payload.
376
377config BOOTLOADER_SRAM_SIZE
378 int "SRAM reserved for bootloader"
379 default 16
380 depends on !XIP || IS_BOOTLOADER
Rajavardhan Gundie584b052018-12-14 16:55:43 +0530381 depends on ARM || XTENSA
Anas Nashif86ad37a2018-11-02 07:12:07 -0400382 help
383 This option specifies the amount of SRAM (measure in kB) reserved for
384 a bootloader image, when either:
385 - the Zephyr image itself is to act as the bootloader, or
386 - Zephyr is a !XIP image, which implicitly assumes existence of a
387 bootloader that loads the Zephyr !XIP image onto SRAM.
388
389config BOOTLOADER_MCUBOOT
390 bool "MCUboot bootloader support"
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100391 select USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -0400392 help
393 This option signifies that the target uses MCUboot as a bootloader,
394 or in other words that the image is to be chain-loaded by MCUboot.
395 This sets several required build system and Device Tree options in
396 order for the image generated to be bootable using the MCUboot open
397 source bootloader. Currently this includes:
398
399 * Setting TEXT_SECTION_OFFSET to a default value that allows space
400 for the MCUboot image header
401 * Activating SW_VECTOR_RELAY on Cortex-M0 (or Armv8-M baseline)
402 targets with no built-in vector relocation mechanisms
403 * Including dts/common/mcuboot.overlay when building the Device
404 Tree in order to place and link the image at the slot0 offset
405
406config BOOTLOADER_ESP_IDF
407 bool "ESP-IDF bootloader support"
408 depends on SOC_ESP32
409 help
410 This option will trigger the compilation of the ESP-IDF bootloader
411 inside the build folder.
412 At flash time, the bootloader will be flashed with the zephyr image
413
Anas Nashif86ad37a2018-11-02 07:12:07 -0400414config BOOTLOADER_KEXEC
415 bool "Boot using Linux kexec() system call"
416 depends on X86
417 help
418 This option signifies that Linux boots the kernel using kexec system call
419 and utility. This method is used to boot the kernel over the network.
420
Anas Nashif86ad37a2018-11-02 07:12:07 -0400421config BOOTLOADER_CONTEXT_RESTORE
422 bool "Boot loader has context restore support"
423 default y
Piotr Zięcik9cc63e02019-02-12 11:07:20 +0100424 depends on SYS_POWER_DEEP_SLEEP_STATES && BOOTLOADER_CONTEXT_RESTORE_SUPPORTED
Anas Nashif86ad37a2018-11-02 07:12:07 -0400425 help
426 This option signifies that the target has a bootloader
427 that restores CPU context upon resuming from deep sleep
428 power state.
429
430config REBOOT
431 bool "Reboot functionality"
432 select SYSTEM_CLOCK_DISABLE
433 help
434 Enable the sys_reboot() API. Enabling this can drag in other subsystems
435 needed to perform a "safe" reboot (e.g. SYSTEM_CLOCK_DISABLE, to stop the
436 system clock before issuing a reset).
Andy Rossfe04adf2019-02-27 11:53:18 -0800437
438config MISRA_SANE
439 bool "MISRA standards compliance features"
440 help
441 Causes the source code to build in "MISRA" mode, which
442 disallows some otherwise-permitted features of the C
443 standard for safety reasons. Specifically variable length
444 arrays are not permitted (and gcc will enforce this).
445
Anas Nashif86ad37a2018-11-02 07:12:07 -0400446endmenu
Carlo Caioned048faa2019-12-17 17:13:47 +0000447
448menu "Compatibility"
449
450config COMPAT_INCLUDES
451 bool "Suppress warnings when using header shims"
452 default y
453 help
454 Suppress any warnings from the pre-processor when including
455 deprecated header files.
456
457endmenu