zephyr/scripts
Ulf Magnusson ec3eff57e0 Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.

There are at least three problems with the patch:

  1. It's inconsistent with how Kconfig works in other projects, which
     might confuse newcomers.

  2. Due to oversights, earlier 'range' properties are still preferred,
     as well as earlier 'default' properties on choices.

     In addition to being inconsistent, this makes it impossible to
     override 'range' properties and choice 'default' properties if the
     base definition of the symbol/choice already has 'range'/'default'
     properties.

     I've seen errors caused by the inconsistency, and I suspect there
     are more.

  3. A fork of Kconfiglib that adds the patch needs to be maintained.

Get rid of the patch and go back to standard Kconfig behavior, as
follows:

  1. Include the Kconfig.defconfig files first instead of last in
     Kconfig.zephyr.

  2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
     last in arch/Kconfig.

  3. Include arch/<arch>/soc/*/Kconfig first instead of last in
     arch/<arch>/Kconfig.

  4. Swap a few other 'source's to preserve behavior for some scattered
     symbols with multiple definitions.

     Swap 'source's in some no-op cases too, where it might match the
     intent.

  5. Reverse the defaults on symbol definitions that have more than one
     default.

     Skip defaults that are mutually exclusive, e.g. where each default
     has an 'if <some board>' condition. They are already safe.

  6. Remove the prefer-later-defaults patch from Kconfiglib.

Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions

As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).

This commit includes some default-related cleanups as well:

  - Simplify some symbol definitions, e.g. where a default has 'if FOO'
    when the symbol already has 'depends on FOO'.

  - Remove some redundant 'default ""' for string symbols. This is the
    implicit default.

Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).

Piggyback some fixes for style nits too, e.g. unindented help texts.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
..
checkpatch scripts: cleanup scripts directory 2018-04-03 09:28:09 -04:00
ci check-compliance: Fix list_undef_kconfig_refs.py for external projects 2018-06-27 19:14:22 +02:00
cmake Introduce cmake-based rewrite of KBuild 2017-11-08 20:00:22 -05:00
cross_compiler toolchains: fix xtools configurations 2017-10-12 16:27:12 -05:00
dts scripts: extract_dts_includes: use deepcopcy when accessing reduced 2018-08-06 09:44:21 -05:00
footprint size_report: Don't assume all paths start with ZEPHYR_BASE 2018-01-29 23:59:16 +05:30
gitlint gitlint: fix check for line_count 2018-01-11 10:48:03 -05:00
kconfig Kconfig: Use the first default with a satisfied condition 2018-08-10 12:38:28 -07:00
meta/west scripts: west: sync with upstream 2018-07-30 17:56:21 -04:00
sanity_chk sanitycheck: allow blacklisting boards 2018-07-24 09:58:18 -04:00
support scripts: make runner a west subpackage 2018-05-19 07:01:39 +03:00
.gitignore expr_parser.py: simple expression language 2016-05-04 22:57:39 +00:00
check_host_is_ok.py cmake: Give descriptive error to user when cloned with core.autocrlf 2018-01-10 22:12:27 -05:00
check_link_map.py scripts: python: cleanup script and fix PEP8 issues 2018-01-03 19:03:41 -05:00
checkpatch.pl checkpatch: downgrade COMPLEX_MACRO to a warning 2018-05-08 08:56:12 -07:00
checkstack.pl First commit 2015-04-10 16:44:37 -07:00
dir_is_writeable.py cmake: Add function for checking if a directory is write-able 2018-04-27 12:06:02 +02:00
elf_helper.py Fix struct offsets (DWARF v2 compatibility) 2018-05-25 16:49:42 +02:00
file2hex.py scripts: python: cleanup script and fix PEP8 issues 2018-01-03 19:03:41 -05:00
filter-known-issues.py scripts: filter-known-issues: Add extra newline 2018-07-12 23:11:46 -04:00
gen_alignment_script.py arm: Add app data section alignment constraints 2018-02-06 15:31:16 -08:00
gen_app_smem.py userspace: compartmentalized app memory organization 2018-07-25 12:02:01 -07:00
gen_gdt.py cmake: Fix "make VERBOSE=1" 2018-01-10 22:14:53 -05:00
gen_idt.py gen_isr_tables: Delete the dead code accompanying .intList.num_isrs 2018-06-25 12:54:49 -07:00
gen_kobject_list.py kernel: threads: assign index no. to dynamically created threads 2018-08-09 09:20:14 -07:00
gen_mmu_x86.py cmake: Fix "make VERBOSE=1" 2018-01-10 22:14:53 -05:00
gen_offset_header.py scripts: python: cleanup script and fix PEP8 issues 2018-01-03 19:03:41 -05:00
gen_priv_stacks.py scripts: Covert scripts to use elf_helper.py 2018-02-06 15:31:16 -08:00
gen_syscall_header.py gen_syscall_header.py: fix include issue 2018-03-28 20:52:08 -04:00
gen_syscalls.py gen_syscalls.py: do not output data to stdout 2018-07-26 00:53:45 -04:00
parse_syscalls.py userspace: adjust syscall generation scripts 2018-07-24 14:39:38 -04:00
process_gperf.py arm: Generate privileged stacks 2018-02-06 15:31:16 -08:00
qemu-machine-hack.py scripts: python: cleanup script and fix PEP8 issues 2018-01-03 19:03:41 -05:00
requirements.txt doc: scripts: Updates for pyocd v0.11.1 2018-07-27 00:54:55 +02:00
sanitycheck userspace: compartmentalized app memory organization 2018-07-25 12:02:01 -07:00
spelling.txt scripts: updated spelling.txt file 2017-07-14 12:57:40 +03:00
subfolder_list.py cmake: Using symlinks on unix like os'es for dependencies 2018-06-19 17:00:27 +02:00
tags.sh scripts: fix tags.sh to current source tree 2018-01-15 18:30:28 -05:00
waitpid sanitycheck: Let waitpid script kill Xtensa ISS if user hits ctrl+c. 2017-04-11 16:53:41 +00:00
west scripts: create meta-tool package, "west" 2018-05-19 07:01:39 +03:00
west-win.py scripts: create meta-tool package, "west" 2018-05-19 07:01:39 +03:00