Commit graph

154 commits

Author SHA1 Message Date
Anas Nashif 51c34bb609 boards: x86: depend on CONFIG_BUILD_OUTPUT_EFI
Add a new Kconfig CONFIG_BUILD_OUTPUT_EFI and select that for boards
that want to generate an EFI application.
Make qemu_x86_64 also generate an EFI file, however do not enable this
by default yet.

Goal is to boot qemu using EFI to be able to test this path in the
future.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-26 21:41:14 -05:00
Torsten Rasmussen 3673e288bd modules: introducing MODULE_EXT_ROOT to allow glue code in Zephyr repo
This commit introduces MODULE_EXT_ROOT which allows CMake and Kconfig
glue code to be placed outside of the Zephyr module repository.

This allows for placing glue code in Zephyr, but also allows users to
specify custom MODULE_EXT_ROOTs for glue code using either
`-DMODULE_EXT_ROOT` or `zephyr/module.yml` with
`build:settings:module_ext_root` settings.

MODULE_EXT_ROOT' is a list of directories, similar to other roots such
as BOARD_ROOT, DTS_ROOT, etc.
The Zephyr repo folder ${ZEPHYR_BASE} is always to the MODULE_EXT_ROOT
list as lowest priority.
For each MODULE_EXT_ROOT, the file
`<module_ext_root>/modules/modules.cmake` will be processed.

In Zephyr repo, the folder `modules/<module>/` contains CMakeLists.txt
and Kconfig glue code for the Zephyr module.

A Zephyr module can specify that CMakeLists.txt and Kconfig glue code is
placed in an external module root by specifying:
```
build:
  cmake-ext: True
  kconfig-ext: True
```

It is still possible to place the CMakeLists.txt and Kconfig files
directly in the Zephyr module using the existing:
```
build:
  cmake: <path>
  kconfig: <file>
```.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-18 18:02:46 +01:00
Håkon Øye Amundsen c92a60b735 kconfig: hide option for mcuboot support if image is mcuboot
Don't show the option for MCUBoot bootloader support
when the image being built is MCUBoot itself.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2021-01-10 15:42:07 -05:00
Flavio Ceolin 47e0621bb7 power: Remove not used build option
There is no usage of BOOTLOADER_CONTEXT_RESTORE since quark support
was removed.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-08 06:49:43 -05:00
Ioannis Glaropoulos c520385a39 Kconfig.zephyr: allow override default values in module Kconfig files
Allow Kconfig to override default values of Kconfig symbols
defined in modules' Kconfig files. For that, the .defonfig
files need to be source'd before the modules' Kconfig files.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-12-10 08:00:57 -05:00
Anas Nashif dd931f93a2 power: standarize PM Kconfigs and cleanup
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Torsten Rasmussen 4558ba7128 cmake: ensure shields can be placed in other BOARD_ROOTs
Fixes: #28462

This commit allows shields to be defined in other BOARD_ROOTs, either
using `-DBOARD_ROOT=<path>` or a Zephyr module defined BOARD_ROOT.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-11-13 13:36:48 +01:00
Ioannis Glaropoulos 071ab4a6d5 zephyr: make images loaded by MCUboot enable arch core HW regs init
Instruct Zephyr images that are loaded by MCUboot to
force the initialization of architecture core HW registers,
if the architecture supports the functionality.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-11-02 15:02:24 +01:00
Anas Nashif fdbf2dbd2b build: add option to delete intermediate files
Add option to remove intermediate files to save space and remove
clutter.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-21 06:38:53 -04:00
Andrei Emeltchenko c8c9ab028c kconfig: Remove unused configuration option
Remove unused configuration option BOOTLOADER_KEXEC.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-10-14 11:49:12 -07:00
Martí Bolívar 8165008f44 dts: remove legacy macro support
The legacy macros were first deprecated in Zephyr v2.3. Now that
Zephyr v2.4 has been released, that makes two releases where these
macros have been deprecated, so it's OK to remove them.

This leaves support for legacy binding syntax in place. Removing that
is left to future work.

We need to update various pieces of documentation related to flash
partitions that never got updated when the new API was introduced.
Consolidate this information in the flash_map.h API reference page,
since that's really where users will run into it. This also gives us
the opportunity to improve this documentation.

Adjust a couple of kconfigfunctions.py and sanitycheck bits to use
non-legacy edtlib APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-09 08:45:38 -05:00
Henrik Brix Andersen 7e39e1d747 cmake: mcuboot: confirmed images needs to be padded
Add --pad to imgtool.py command line arguments when generating confirmed
images, otherwise the image contains no trailer magic for writing the
confirmed status.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-09-04 12:00:04 +02:00
Martí Bolívar f66a0c3772 build: auto-generate signed mcuboot binaries
Add new Kconfig options which depend on CONFIG_BOOTLOADER_MCUBOOT:

- CONFIG_MCUBOOT_SIGNATURE_KEY_FILE: the path to the key pair which
  should be used to sign the image, in PEM format. This is sent to
  imgtool via 'west sign' when set to produce zephyr.signed.bin and
  zephyr.signed.hex files as needed.

- CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS: additional arguments to pass to
  imgtool.

- CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE: also generate
  zephyr.signed.confirmed.{bin,hex}

Add build system support for these options.

This makes a separate 'west sign' step unnecessary when using MCUboot,
if the application image is properly configured with the location of
the key file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Flavio Ceolin b587e8d063 coding_guideline: Add an option to enforce rules
Add a Kconfig option to enable compiler flags that help to enforce
some code guideline rules.

Note: As the current code base is not in compliance with the adopted
code guideline, some rules will generate warnings during the
build. This is intended to help to spot violations.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-08-28 16:50:39 -04:00
Martí Bolívar f39fdc410d Kconfig.zephyr: help text fixes
The text "need by some platforms" in various CONFIG_BUILD_OUTPUT_FOO
help is grammatically incorrect. Fix this by rewording.

Move 'config BUILD_NO_GAP_FILL' to before the list of 'config
BUILD_OUTPUT_FOO' definitions instead of sandwiching it inside.

Fix the extension of the stripped binary.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-09 09:31:36 -04:00
Torsten Rasmussen 5f7cc8ded9 cmake: kconfig: support for multiple SOC_ROOT
This commit introduces support for multiple SOC_ROOT.

This means that additional SOC_ROOTs specified using -DSOC_ROOT as
argument to CMake will be forming a list together with ${ZEPHYR_BASE}.

This allows for greater flexibility, as developers can now specify
multiple out-of-tree SoCs and not worry about the SoC used for the
board they compile for.

Also it avoid code, such as:
if(BOARD STREQUAL my_board_using_out_of_tree_soc)
  set(SOC_ROOT some/out/of/tree/soc/path)
endif()
in application CMakeLists.txt.

Finally, allowing multiple SOC_ROOTs prepares for specifying SOC_ROOTs
in Zephyr modules.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Torsten Rasmussen 01f55a4e53 cmake: relocation of generated Kconfig file for Zephyr modules
This commit relocates the generated Kconfig.modules file from
${CMAKE_BINARY_DIR} into ${CMAKE_BINARY_DIR}/Kconfig.

This is done as preparation of multiple SOC and ARCH root support.

A single Kconfig folder inside ${CMAKE_BINARY_DIR} helps to keep the
build folder tidy.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00
Michael Hope 8c1f1865af soc: sam0: add support for the BOSSA bootloader
This adds a new config option for SAM0 targets that use the BOSSA
bootloader.  If the CDC ACM driver is also enabled, then the
programmer can automatically reset the board into the bootloader for
programming.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-22 13:24:37 +02:00
Stephanos Ioannidis 3322489d22 config: Rename TEXT_SECTION_OFFSET to ROM_START_OFFSET
The `TEXT_SECTION_OFFSET` symbol is used to specify the offset between
the beginning of the ROM area and the address of the first ROM section.

This commit renames `TEXT_SECTION_OFFSET` to `ROM_START_OFFSET` because
the first ROM section is not always the `.text` section.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-09 14:02:38 -04:00
Andrzej Puzdrowski c7ab1a178c Kconfig: update BOOTLOADER_MCUBOOT help message
Description was updated so reflects fact that this
option activates SW_VECTOR_RELAY_CLIENT feature now.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-07-03 13:34:50 -04:00
Kumar Gala 9ca541a504 linker: Remove deprecated Kconfig options related to linker scripts
Remove Kconfig, linker script, and related bits associated with
CUSTOM_RODATA_LD, CUSTOM_RWDATA_LD, CUSTOM_SECTIONS_LD,
SOC_NOINIT_LD, SOC_RODATA_LD, and SOC_RWDATA_LD options that have been
deprecated since Zephyr 2.2.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-12 11:14:28 +02:00
Kumar Gala 1737bd082d zephyr: Use deprecated instead of legacy for Kconfig int types
Rename the Kconfig symbol from LEGACY_ZEPHYR_INT_TYPES to
DEPRECATED_ZEPHYR_INT_TYPES.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-09 06:49:56 -05:00
Kumar Gala e353d123fd zephyr: Make Zephyr int types deprecated by default
As the int types defined in include/zephyr/types.h are typdef's we
utilize a Kconfig option (LEGACY_ZEPHYR_INT_TYPES) to enable/disable
the support for them.  By default to LEGACY_ZEPHYR_INT_TYPES not
being enabled and add an explicit test to ensure the types continue to
function until removed in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala 43cbb59db2 Kconfig: Default to 'n' for LEGACY_DEVICETREE_MACROS
Set LEGACY_DEVICETREE_MACROS to default to no since we are deprecating
the old macro style and all in tree users are now converted.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Rohit Gujarathi 35713f2ef6 cmake: Assembly listing containing all sections
Added support for creating an assembly listing containing all sections
like rodata, data and debug sections, not just those expected to
contain instructions.

Signed-off-by: Rohit Gujarathi <gujju.rohit@gmail.com>
2020-05-08 09:03:18 -04:00
Martí Bolívar 270dfffc8d devicetree: add CONFIG_LEGACY_DEVICETREE_MACROS
This default-y option allows continued use of the legacy devicetree
macros.

There are no functional changes yet, but when this is default n,
old-style DT code won't build. At that point, adding any of these will
be a fix to keep old-style code working:

- "CONFIG_LEGACY_DEVICETREE_MACROS=y" to prj.conf
- "-- -DCONFIG_LEGACY_DEVICETREE_MACROS=y" to the west build command
- "-DCONFIG_LEGACY_DEVICETREE_MACROS=y" to the cmake command

This option can be changed to default n in time for the Zephyr 2.3
release. That will provide users of Zephyr 2.2 with a smooth migration
path to the new devicetree.h API after 2.3 is released, which
nonetheless will alert them immediately that something is wrong due to
build errors.

Unfortunately, __DEPRECATED_MACRO is not sufficient in all cases as a
warning to users. This is because, at least in GCC, macros defined
using __DEPRECATED_MACRO cannot be used in preprocessor lines like
"#if DT_SOME_LEGACY_MACRO".

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-23 11:03:53 -05:00
Carles Cufi d212bc4d60 ext: lib: Move fnmatch to lib/
Since we already have similarly licensed 3-clause BSD files in the tree,
and in particular in our minimal libc, move the fnmatch functionality
from ext/ to lib/.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-20 22:56:19 -04:00
Piotr Mienkowski 6baff1b3b9 doc: update BOOTLOADER_MCUBOOT description
mcuboot.overlay is not used any more when BOOTLOADER_MCUBOOT Kconfig
option is selected. Update the documentation accordingly.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-19 07:30:43 -06:00
Ulf Magnusson e63b6525bf kconfig: Clarify Kconfig.defconfig explanation in Kconfig.zephyr
Group the 'source's of Kconfig.defconfig files together to make it
clearer what the comment is talking about. Remove blank lines between
the other 'source's too, splitting the 'source's into two groups.

Also touch up the comment to make it more concrete and shorten it a bit.
Mention that it applies to 'choice's as well.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-11 17:40:12 +02:00
Alexey Brodkin 2d79dc3bcd kconfig: Make BUILD_NO_GAP_FILL independent
Even though it looks logical to not expose BUILD_NO_GAP_FILL
when we don't expect to use objcopy for creation of .bin, .hex etc
in reality generation of at least zephyr.hex happens if one wants
to use openocd runner, see CMakeLists.txt:
---------------------------->8----------------------
if(CONFIG_BUILD_OUTPUT_HEX OR BOARD_FLASH_RUNNER STREQUAL openocd)
  set(out_hex_cmd    "")
  set(out_hex_byprod "")
  set(out_hex_sections_remove
    .comment
    COMMON
    .eh_frame
    )
  bintools_objcopy(
    RESULT_CMD_LIST    out_hex_cmd
    RESULT_BYPROD_LIST out_hex_byprod
    STRIP_ALL
    GAP_FILL           ${GAP_FILL}
    TARGET_OUTPUT      "ihex"
    SECTION_REMOVE     ${out_hex_sections_remove}
    FILE_INPUT         ${KERNEL_ELF_NAME}
    FILE_OUTPUT        ${KERNEL_HEX_NAME}
    )
  list(APPEND
    post_build_commands
    ${out_hex_cmd}
    )
  list(APPEND
    post_build_byproducts
    ${KERNEL_HEX_NAME}
    ${out_hex_byprod}
    )
endif()
---------------------------->8----------------------

So if there's a good reason to disable gap filling
(like funny memory map wit huuuuge holes) let's keep that opportunity
instead of relying on sanity of all the other code.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-02-08 09:59:20 +02:00
Kumar Gala 2630fbaa75 cmake: Introduce optional Kconfig for toolchains
Allow a given toolchain to specify Kconfig options that might be
relevant to a feature available in that toolchain.

For example, the ARM embedded GNU toolchain supports two variants of
newlib and you select the smaller one via a spec file.  We can use a
Kconfig option like HAS_NEWLIB_LIBC_NANO to convey that this feature is
supported by that toolchain.

We look for the toolchain Kconfig in ${TOOLCHAIN_KCONFIG_DIR}/Kconfig,
and default TOOLCHAIN_KCONFIG_DIR to:

${TOOLCHAIN_ROOT}/cmake/toolchain/${ZEPHYR_TOOLCHAIN_VARIANT})

toolchain specific cmake files can override the default if needed.

Additionally tweaked the zephyr/generic.cmake to use
${CMAKE_CURRENT_LIST_DIR} to reduce some duplication.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-01-29 12:22:31 -06:00
Sebastian Bøe d3a8fd40b9 cmake: Add option for exporting build metadata to Make
Add an opt-in feature that will generate a Makefile with build
variables like CC, and KBUILD_CFLAGS for consumption by third-party
Make-based build systems.

This emulates the 'outputexports' target that KBuild supported and is
supported for the same reasons that KBuild supported it. Easier
integration with third-party build systems.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-01-23 15:09:12 -05:00
Anas Nashif 22b95a2047 base: add error checking macros
Define there options for runtime error handling:
- assert on all errors (ASSERT_ON_ERRORS)
- no runtime checks (no asserts, no runtime error handling)
  (NO_RUNTIME_CHECKS)
- full runtime error handling (the default) (RUNTIME_ERROR_CHECKS)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-20 17:19:54 -05:00
Erwan Gouriou e3bed1f260 boards: Kconfig: Enable use of shield conditional Kconfig files
To make use of shields Kconfig.defconfig, parse these files
and newly created Kconfig.shield files which will define the
SHIELD_XXX Kconfig symbols that will be used for conditional
configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-02 17:02:41 -05:00
Carlo Caione d048faacf2 aarch32: Add header shims to support old file locations
Out-of-tree code can still be using the old file locations. Introduce
header shims to include the headers from the new correct location and
print a warning message.

Add also a new Kconfig symbol to suppress such warning.

The shim will go away after two releases, so make sure to adapt your
application for the new locations.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Kumar Gala 1342dadc36 include: Remove compat include headers
Remove the compat headers as its been 2 releases since we introduced
them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Ulf Magnusson fd9981a7c4 kconfig: Factor out HAS_FLASH_LOAD_OFFSET dependency
Use a top-level 'if' instead of three separate 'depends on'. They're
exactly equivalent (top-level 'if's are just a shorthand for adding
'depends on' to each item within the 'if').

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:40:24 -05:00
Ulf Magnusson 90b9eb3a9e kconfig: Rename USE_CODE_PARTITION to USE_DT_CODE_PARTITION
USE_CODE_PARTITION is a bit vague as a symbol name ("use code partition
how?"). Rename it to USE_DT_CODE_PARTITION to make it clearer that it's
about devicetree.

This would break any third-party configuration files that set it, but
it'll generate an error since kconfig.py promotes warnings to errors, so
it's probably not a big deal.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:40:24 -05:00
Ulf Magnusson 1f9c5f136d kconfig: Improve USE_CODE_PARTITION prompt and help string
The prompt and help string for USE_CODE_PARTITION were too terse and
didn't make it clear that it's related to devicetree, which confused me.
Spell things out in more detail.

Unless the meaning of a symbol is completely obvious from context, aim
for at least a few sentences of help text. Think about what would be
confusing for someone coming at it without much context.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:40:24 -05:00
Ulf Magnusson 9cdb6f4033 kconfig: Make FLASH_LOAD_OFFSET/SIZE non-configurable when DT is used
Having FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE always configurable froze
their values at 0 when BOOTLOADER_MCUBOOT was enabled in menuconfig,
when instead the values from /chosen/zephyr,code-partition in devicetree
should be used. BOOTLOADER_MCUBOOT selects USE_CODE_PARTITION, which is
a flag to use the devicetree information.

To fix it, only make FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE configurable
when USE_CODE_PARTITION is disabled. It looks like no configuration
files set them at the moment.

See the added documentation in
https://github.com/zephyrproject-rtos/zephyr/pull/20722 for an
explanation of why this happens. This bit novalisek in
https://github.com/zephyrproject-rtos/zephyr/issues/20673.

Fixes: #20673

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-09 16:40:24 -05:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Ulf Magnusson 975de21858 kconfig: Global whitespace/consistency cleanup
Clean up space errors and use a consistent style throughout the Kconfig
files. This makes reading the Kconfig files more distraction-free, helps
with grepping, and encourages the same style getting copied around
everywhere (meaning another pass hopefully won't be needed).

Go for the most common style:

 - Indent properties with a single tab, including for choices.

   Properties on choices work exactly the same syntactically as
   properties on symbols, so not sure how the no-indentation thing
   happened.

 - Indent help texts with a tab followed by two spaces

 - Put a space between 'config' and the symbol name, not a tab. This
   also helps when grepping for definitions.

 - Do '# A comment' instead of '#A comment'

I tweaked Kconfiglib a bit to find most of the stuff.

Some help texts were reflowed to 79 columns with 'gq' in Vim as well,
though not all, because I was afraid I'd accidentally mess up
formatting.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-01 15:53:23 +01:00
Kumar Gala 22e7449b73 kconfig: Introduce typed dt kconfig functions
Replace:
  dt_chosen_reg_addr
  dt_chosen_reg_size
  dt_node_reg_addr
  dt_node_reg_size

with:
  dt_chosen_reg_addr_int
  dt_chosen_reg_size_int
  dt_chosen_reg_addr_hex
  dt_chosen_reg_size_hex
  dt_node_reg_addr_int
  dt_node_reg_size_int
  dt_node_reg_addr_hex
  dt_node_reg_size_hex

So that we get the proper formatted string for the type of symbol.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-24 08:51:06 -05:00
Kumar Gala 2d7303e13f Revert "kconfig: Fix wrong partition size by changing type of FLASH_LOAD_SIZE"
This reverts commit f065eb4271.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-10-24 08:51:06 -05:00
Ulf Magnusson f065eb4271 kconfig: Fix wrong partition size by changing type of FLASH_LOAD_SIZE
FLASH_LOAD_SIZE gets its default from the $(dt_chosen_reg_size)
function, which is defined in scripts/kconfig/kconfigfunctions.py.
$(dt_chosen_reg_size) returns a decimal value rather than a hex value.

Previously, FLASH_LOAD_SIZE was declared as hex, which made Kconfiglib
automatically prepend 0x to its value (the same logic is in the C
Kconfig tools). This gave an incorrect size in .config, e.g.
CONFIG_FLASH_LOAD_SIZE=0x374784 where CONFIG_FLASH_LOAD_SIZE=374784 was
intended.

Fix it by changing the type of FLASH_LOAD_SIZE to int. All other symbols
that use $(dt_node_reg_size) and $(dt_chosen_reg_size) are int too
(FLASH_SIZE and SRAM_SIZE, plus BOOTLOADER_SRAM_SIZE is also int).

This has some subtle breakage potential in that FLASH_LOAD_SIZE has a
prompt (is user-configurable in the menuconfig or by changing .config
files). Nothing seems to directly assign in Zephyr at least.

Fixes: #19877

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-18 08:05:39 -05:00
Ulf Magnusson cfd3d4b935 kconfig: Remove long-unused LINK_WHOLE_ARCHIVE symbol
Seems to have been unused since commit 06e78de681 ("build: do not use
link-zephyr"), committed in 2015.

Discovered with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-18 08:03:48 -05:00
Kumar Gala 8ce0cf0126 kconfig: Convert device tree chosen properties to new kconfigfunctions
Convert how we get the various chosen properties like "zephyr,console"
to use the new kconfig functions like dt_chosen_to_label.

Because of how kconfig parses things we define a set of variables of the
form DT_CHOSEN_Z_<PROP> since comma's are parsed as field seperators in
macros.

This conversion allows us to remove code in gen_defines.py for the
following chosen properties:

zephyr,console
zephyr,shell-uart
zephyr,bt-uart
zephyr,uart-pipe
zephyr,bt-mon-uart
zephyr,uart-mcumgr
zephyr,bt-c2h-uart

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-13 11:42:34 -05:00
Håkon Øye Amundsen d3aa619f31 kconfig: fix name of cmake function in help text
The function is called zephyr_code_relocate.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2019-08-15 08:55:45 -04:00
Charles E. Youse f7a0dce636 arch/x86: remove support for CONFIG_REALMODE
We no longer support any platforms that bootstrap from real mode.

Fixes: #17166

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-07-29 21:29:38 -07:00
Andy Ross 50b78f08ea cmake: Remove check_link_map.py
This script is looking for a hyperspecific error (mismatched padding
when linking into two simultaneous output sections) that bit us once,
in an era where the linker scripts were less unified.  We haven't seen
it crop up since, and multiple platforms have changed the way they do
this anyway.

It's needless complexity.  Junk it.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-14 04:54:29 -07:00
Anas Nashif cdfddecb35 include/: cleanup: add Kconfig for suppressing warnings
Suppress warnings from deprecated header shims. Use when you have an
application that needs to work with older versions of Zephyr where
headers were located in different directories.

The shim will go away after two releases, so make sure to adapt your
application for the new locations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Anas Nashif 8017c59cb0 modules: move module kconfig to main tree
Due to in-tree dependencies on Kconfig options defined in modules we end
up having warnings and errors when those modules are not part of the
manifest.

Users should be able to remove unwanted modules from their downstream
manifest and still build any board configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-30 17:50:37 -04:00
Anas Nashif 658f6bc71f kconfig: enclose module Kconfigs into a menu
Solve the issue of having all module Kconfig land in the top level
Kconfig menu when viewed in menuconfig.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-29 07:27:32 -04:00
Øyvind Rønningstad 901c0a1cfd linker: Port usage of custom-sections to use Cmake
Mark custom-sections as deprecated

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-05-20 22:28:28 -04:00
Charles E. Youse 50c71e6043 arch/x86: CONFIG_BOOTLOADER_UNKNOWN renamed to CONFIG_X86_MULTIBOOT
The only use of the BOOTLOADER_UNKNOWN config option is on x86, where
it controls whether a multiboot header is embedded in the output.
This patch renames the option to be more descriptive, and makes it
an x86-specific option, rather than a Zephyr top-level option.

This also enables X86_MULTIBOOT by default, since the header only
occupies 12-16 bytes of memory and is (almost always) harmless.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-08 14:49:19 -04:00
Sebastian Bøe 3a0597f099 cmake: LD: Allow input sections to remain unsorted
We have users that have problems in their linker scripts where the
order of input sections matters.

To allow users to use the latest Zephyr while working on a fix to
their linker scripts we add an option to allow leaving the sections
unsorted.

See discussion here for more details
https://github.com/zephyrproject-rtos/zephyr/pull/14183

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-04-24 13:58:00 -07:00
Sebastian Bøe 7061c035cd kconfig: Move Kconfig.modules to the root build directory
Currently, the Kconfig.modules file is placed in the build directory
relative to the CMake "project". But technically, the file is not
project-specific, but global, or build-directory specific.

So we move it up one level to the CMAKE_BINARY_DIR instead. Currently,
there is only one project, so this change has no effect, but this
enables us to have multiple projects in the future, which again
enables multi-image builds.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2019-03-28 09:23:02 -04:00
Andrzej Puzdrowski 2b1227f155 zephyr: fix mcuboot can't link into boot-partition
Objective of the path is to allow to select by the application
to link into the chosen code-partition.
Introduced USE_CODE_PARTITION will be set by bootloader project.

fixes #14566

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-03-19 11:12:47 +01:00
Emanuele Di Santo 9acb643d23 kconfig: move Zephyr modules Kconfig entries to the top
Zephyr modules' Kconfig entries appear in a seemingly random spot
in menuconfig. This patch moves those entries at the top of the menu,
to improve their visibility and make their location predictable.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-03-15 07:13:46 -05:00
Andy Ross fe04adf99b lib/os: Conditionally eliminate alloca/VLA usage
MISRA rules (see #9892) forbid alloca() and family, even though those
features can be valuable performance and memory size optimizations
useful to Zephyr.

Introduce a MISRA_SANE kconfig, which when true enables a gcc error
condition whenever a variable length array is used.

When enabled, the mempool code will use a theoretical-maximum array
size on the stack instead of one tailored to the current pool
configuration.

The rbtree code will do similarly, but because the theoretical maximum
is quite a bit larger (236 bytes on 32 bit platforms) the array is
placed into struct rbtree instead so it can live in static data (and
also so I don't have to go and retune all the test stack sizes!).
Current code only uses at most two of these (one in the scheduler when
SCHED_SCALABLE is selected, and one for dynamic kernel objects when
USERSPACE and DYNAMIC_OBJECTS are set).

This tunable is false by default, but is selected in a single test (a
subcase of tests/kernel/common) for coverage.  Note that the I2C and
SPI subsystems contain uncorrected VLAs, so a few platforms need to be
blacklisted with a filter.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-28 10:06:35 -08:00
Ulf Magnusson 7db2e20ba3 kconfig: tests: Fix double 'source' of subsys/testsuite/Kconfig
Both Kconfig.zephyr and subsys/Kconfig 'source's
subsys/testsuite/Kconfig, giving multiple redundant identical
definitions for all the symbols in it.

Remove the 'source' in Kconfig.zephyr.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-02-26 20:12:09 -06:00
Anas Nashif ccad9d0d09 tests: move testsuite and configs into subsys/
Move test related code and the testsuite away from tests/ and make it a
proper subsystem.
The way tests were integrate in the tree was not obvious and actual
tests were intermixed with the testsuite code.

This will allow us to have trees with the testcode and without the
samples by just remove the folders tests/ and samples, needed for
isolating actual code from test/sample code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-22 08:58:40 -05:00
Piotr Zięcik 9cc63e07e4 power: Fix naming of Kconfig options controlling deep sleep states
This commit changes the names of SYS_POWER_DEEP_SLEEP* Kconfig
options in order to match SYS_POWER_LOW_POWER_STATE* naming
scheme.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-12 07:46:32 -05:00
Torsten Rasmussen 7e9d1bdda4 CMake/Kconfig: CMake and Kconfig build integration
This commit allows for Zephyr modules to be natively integrated into
the build system with CMakeLists.txt and Kconfig files.

The sourcing of module files are done in following order:
- If <module>/zephyr/module.yml exists, use cmake and kconfig settings
  for sourcing of additional file
- Else if <module>/zephyr/CMakeLists.txt exists, source this file into
  CMake build tree and add <module>/zephyr/Kconfig as osource

If none of the above files are present, the project is considered to
not be a Zephyr module

Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
2019-02-08 22:47:02 -05:00
Kumar Gala 87915cd36f dts: stop generating CONFIG_FLASH_LOAD_{OFFSET,SIZE}
As a step to completing removing use of Kconfig defines in dts files we
need to change how we configure/set CONFIG_FLASH_LOAD_{OFFSET,SIZE}.

Previously we would set them based on how the chosen property
'zephyr,code-partition' was set to.  If 'zephyr,code-partition' wasn't
set we would default the values to 0.  We had some generic overlay logic
which would define 'zephyr,code-partition' based on
CONFIG_BOOTLOADER_MCUBOOT.

Going forward if the DTS has 'zephyr,code-partition' set we will
generate DT_CODE_PARTITION_OFFSET & DT_CODE_PARTITION_SIZE defines.  We
will leave it to Kconfig to set CONFIG_FLASH_LOAD_OFFSET &
CONFIG_FLASH_LOAD_SIZE.

We introduce a python script that allows Kconfig to extract data from
the DTS and thus we can utilize DT_CODE_PARTITION_OFFSET and
DT_CODE_PARTITION_SIZE values to set defaults for
CONFIG_FLASH_LOAD_OFFSET & CONFIG_FLASH_LOAD_SIZE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-02-01 10:16:06 -06:00
Ole Sæther 985446a704 kconfig: Removed prompt for TEXT_SECTION_OFFSET when MCUboot is used
When this syntax is used for the type definition:

hex "TEXT section offset"

Kconfig expect the user to enter the value for TEXT_SECTION_OFFSET and
the defaut value for BOOTLOADER_MCUBOOT is not used. Changing the syntax
to this:

hex
	prompt "TEXT section offset" if !BOOTLOADER_MCUBOOT

will tell Kconfig that TEXT_SECTION_OFFSET will not be set by the user
when BOOTLOADER_MCUBOOT is set and then Kconfig will use the default
value.

Signed-off-by: Ole Sæther <ole.saether@nordicsemi.no>
2019-01-29 17:50:41 +01:00
Erwan Gouriou 5a197bf8f2 boards/shields: Clean up Kconfig'ery
Following change of selection mechanism, clean boards/shields from
Kconfig related code.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-18 13:20:59 -06:00
Rajavardhan Gundi e584b05215 dts: intel_s1000: Exclude sram space dedicated for mcubootloader
The starting 192kB SRAM is reserved for the mcubootloader. Exclude
this region while building an application to be loaded by mcubootloader.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2019-01-16 21:22:56 -05:00
Adithya Baglody 91c5b84cd5 kernel: init.c: Added required hooks for the relocation
This patch splits the text section into 2 parts. The first section
will have some info regarding vector tables and debug info. The
second section will have the complete text section.
This is needed to force the required functions and data variables
the correct locations.
This is due to the behavior of the linker. The linker will only link
once and hence this text section had to be split to make room
for the generated linker script.

Added a new Kconfig CODE_DATA_RELOCATION which when enabled will
invoke the script, which does the required relocation.

Added hooks inside init.c for bss zeroing and data copy operations.
Needed when we have to copy data from ROM to required memory type.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-12-07 10:32:41 -05:00
Håkon Øye Amundsen c086b935aa kconfig: cmake: Support for images without gaps.
Defines a Kconfig variable which allows the user to specify
that any generated hex/bin/s19 file should not have filled gaps.

This is done to support building in a multi image context,
where several image files will be merged together.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-11-26 06:41:05 -08:00
Sebastian Bøe 8ba5aff8c0 kconfig: Drop support for specifying CROSS_COMPILE through Kconfig
When we move DT infront of Kconfig we are going to need access to a C
toolchain before Kconfig is evaluated. This means it will not be
possible to specify the toolchain used through Kconfig.

To deal with this we ...

Drop support for specifying CROSS_COMPILE through Kconfig. Still
available is the ability to specify CROSS_COMPILE through the
environment or through a CMake variable.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-19 15:04:13 -05:00
Anas Nashif 86ad37a533 kconfig: distribute misc/Kconfig option where they belong
Move misc/Kconfig options to where they belong. misc/Kconfig was used as
a catch-all, but we are now able to put things in a better place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-12 08:01:15 -05:00
Daniel Leung 6600c64331 linker: warn about orphan sections
(Previous patch set was reverted due to issue with priv_stack.
 Resubmitting after fixing the faults caused by priv_stack.noinit
 not at the end of RAM.)

This adds a linker flag and necessary changes to linker scripts
so that linker will warn about orphan sections.

Relates to #5534.

Fixes #10473, #10474, #10515.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-10-19 16:11:34 -04:00
Erwan Gouriou 6af514b67f build: enable shields dir treatment
In dts.cmake, build shield list. For each shield, check if
associate KCONFIG is enabled and if it is, add matching files
to following new cmake variables:
-DTC_SHIELD_OVERLAY_FILE
-DTC_SHIELD_FIXUP
Then, consume these variables when needed.

Shield overlay is conceived as the very first overlay applied
to the board dts. It intends to build a new board that should
then behave as any other board versus common or user's overlay.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Anas Nashif 96455d5881 build: support out of tree SoC definition
Add the glue to make this work with SoC code outside of the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-13 00:56:48 -04:00
Anas Nashif abcf2ad5a8 kconfig: move soc selection to ZEPHYR_BASE/soc/
Rather than do that for each architecture, source SoC Kconfigs where the
code is maintained, under ZEPHYR_BASE/soc.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-13 00:56:48 -04:00
Anas Nashif 3d1252ff2d soc: adapt Kconfig/CMake for soc in top /
Change build system to point to soc/ in the top directory rather than
under arch/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-13 00:56:48 -04:00
Ulf Magnusson d713033d5c Kconfig: Use new preprocessor syntax for env. variables
With the new Kconfig preprocessor (described in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt), the syntax for expanding environment
variables is $(FOO) rather than $FOO.

$(FOO) is a general preprocessor variable expansion, which falls back to
environment variables if the variable isn't set (like in Make). It can
also be used in prompts, 'comment's, etc.

The old syntax will probably be supported forever in Kconfiglib for
backwards compatibility, but might as well make it consistent now that
people might start using the preprocessor more.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Ulf Magnusson d0e8752a52 Kconfig: Rename $ENV_VAR_{ARCH,BOARD_DIR} to $ARCH/$BOARD_DIR
The prefixes might be a leftover from the old 'option env="..."' symbols
(which are no longer needed). Since environment variables can be
referenced directly now, there's no point in having a prefix.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Ulf Magnusson 17f1b0adec Kconfig: Switch to improved globbing statements
A design flaw of 'gsource' is that there's no way to require at least
one file to match the glob pattern. This could lead to silent errors.

Switch to a new design, where a plain 'source' is globbing and requires
at least one file to match. A separate 'osource' (optional source)
statement is available for cases where it's okay for a pattern (or plain
filename) to not match any files.

'orsource' combines 'osource' and 'rsource' (relative source).

This commit search-replaces 'gsource' with 'source', but backwards
compatibility with 'gsource' is still maintained by making it an alias
for 'osource' (and by making 'grsource' an alias for 'orsource').

The three Kconfig files arch/{nios2,posix,xtensa}/Kconfig source
arch/{nios2,posix,xtensa}/soc/*/Kconfig, which doesn't match any files.
Use 'osource' for those. The soc/*/Kconfig files seem to be for
additional SoC-specific symbols, only none exist yet on those ARCHes.

Also use 'osource' for the source of $ENV_VAR_BOARD_DIR/Kconfig in
boards/Kconfig, which doesn't exist for all boards.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-15 04:07:44 -07:00
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
Ulf Magnusson 4dc9e5b2de kconfig: Get rid of 'option env' bounce symbols
This commit gets rid of the 'option env="ENV_VAR"' bounce symbols.
"$FOO" now expands directly to the value of the environment variable
FOO, instead of to the value of the Kconfig symbol FOO.

This change is likely to soon appear in the C tools as well. Those
'option env' symbols always seemed kinda pointless, and have broken
dependency handling due to forcing symbol evaluation during parsing,
before all the symbols have even been seen.

Compatibility with the C tools could be retained by naming all
'option env' symbols the same as the environment variable they
reference.

This commit also updated the Zephyr documentation to explain the new
behavior. It's relevant for $ZEPHYR_BASE and out-of-tree Kconfig
extensions.

Commit message from Kconfiglib (cbf32e29a130d)
==============================================

Make "$FOO" directly reference the environment variable $FOO in e.g.
'source' statements, instead of the symbol FOO. Use os.path.expandvars()
to expand strings (which preserves "$FOO" as-is if no environment
variable FOO exists).

This gets rid of the 'option env' "bounce" symbols, which are mostly
just spam and are buggy in the C tools (dependencies aren't always
respected, due to parsing and evaluation getting mixed up). The same
change will probably appear soon in the C tools as well.

Keep accepting 'option env' to preserve some backwards compatibility,
but ignore it when expanding strings. For compatibility with the C
tools, bounce symbols will need to be named the same as the environment
variables they reference (which is the case for the Linux kernel).

This is a compatibility break, so the major version will be bumped to 6
at the next release.

The main motivation for adding this now is to allow recording properties
on each MenuNode in a clean way. 'option env' symbols interact badly
with delayed dependency propagation.

Side note: I have a feeling that recording environment variable values
might be redundant to trigger rebuilds if sync_deps() is run at each
compile. It should detect all changes to symbol values due to
environment variables changing value.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-17 23:55:07 +03:00
Ulf Magnusson 547ed9b563 kconfig: Make 'source' non-globbing and use 'gsource'
Until now, Zephyr has used a patched Kconfiglib that turns 'source' into
a globbing source (by replacing 'source' with 'gsource' at the token
level). There's two problems with this:

  - The patch needs to be maintained separately

  - Misspelled filenames are silently ignored, as they look like glob
    patterns that don't match anything

Fix it as follows:

  1. Replace all 'source' statements that use wildcards with 'gsource'

  2. Remove the custom Kconfiglib patch so that 'source' no longer globs

The sed pattern '/source.*[*?]/s/source/gsource/' was run over all
Kconfig* files to do the replacement.

source's that use environment variables that might contain glob patterns
were manually changed to gsource.

Building the docs in doc/ is a good test, as doc/Makefile deliberately
sets the environment variables to glob up as many Kconfig files as
possible.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-08 11:14:12 +02:00
Sebastian Bøe b2dfb327a2 kconfig: Don't source the non-existing zephyr/net/Kconfig
Remove a source statement that is referencing a file that does not
exist. Presumably net/Kconfig was re-organized without this path being
updated so this statement is effectively dead code.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-13 06:27:07 -07:00
Sebastian Bøe 4b61bd1b7a kconfig: Prune kconfig files that don't match the ARCH or BOARD
When Kconfiglib was introduced it caused a significant performance
issue. This patch uses pruning to mitigate the performance issue.

The pruning exploits the fact that before the Kconfig database is
parsed we already know what ARCH and BOARD has been selected. So in
theory we could prune away all Kconfig sources that are not related to
the current ARCH or BOARD. In practice, it is only the Kconfig sources
in zephyr/arch/$ARCH and zephyr/board/$ARCH/ that are easy to prune.

Still, that is quite a few Kconfig sources. For qemu_x86 this patch
reduced the number of parsed Kconfig source files from 632 to
272. This pruning resulted in a incremental reconfiguration (time
cmake ..) speedup of 21% (0.56s to 0.46) and a clean build speedup of
4% (Using board qemu_x86 and sample hello_world).

Furthermore, it should be easier to maintain ARCH's and BOARD's
out-of-tree since the user now has a mechanism to redirect where
Kconfig sources are found. But this has not been explored.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-12 07:29:05 -05:00
Anas Nashif c6ba67fe3f kconfig: move dts Kconfigs to dts/
Those were placed under kernel/ for no good reason.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-03 07:19:29 -05:00
Anas Nashif e3806d9766 Revert "Kconfig: Source Kconfig from Zephyr application directory."
This reverts commit 83edd615ca.

Causes the documentation build to fail on Kconfig parsing, needs fixing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-20 10:40:16 -04:00
Michał Kruszewski 83edd615ca Kconfig: Source Kconfig from Zephyr application directory.
Enable application specific configuration to be easily included
and manageable via Kconfig. Add sample.

Signed-off-by: Michał Kruszewski <mkru@protonmail.com>
2017-06-20 08:48:36 -04:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Anas Nashif 4d090e09d6 usb: move usb subsystem to subsys/usb and cleanup header inclusion
Change-Id: I5bdfd2cf5fee62af2ca772d778477f4f378a6a55
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 19:21:42 +00:00
Ramesh Thomas e354ad2a36 fs: Move file system code to subsys/
Subsystems code will reside in subsys/ folder. This patch creates the
folder and moves FS code there.

Jira: ZEP-1120
Change-Id: If3b1bcb996c5fbd4056cd5d1920d41d29810d6b2
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-30 13:23:58 +00:00
Kumar Gala 8d35760fec board: organize boards based on architecture
Introduce an architecture sorting of boards.  This is to allow for
easier maintenance going forward as the number of boards grows.  It
will be easier for any scripts to know the board/arch mapping without
having to maintain an explicit list of what boards are associated with
which arch.  We can also do things like have architecture maintainers
cover reviews and branches for arch/${ARCH} and boards/${ARCH} going
forward.

Change-Id: I02e0a30292b31fad58fb5dfab2682ad1c5a7d5a7
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-24 19:59:42 +00:00
Jaakko Hannikainen 9167a0305f tests: Add a generic testing framework
This framework makes testing in most parts a lot easier, since it gives
an unified base to work with, removing a lot of unnecessary code from
tests. This framework currently features simple assertions and basic
mocking support. The framework works both with and without Zephyr
running, so it can be used for real unit testing.

Origin: Original

Change-Id: I8c5bf2e6b8d6656b6197ee91699b61e730c1cfe3
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:39 +00:00
Anas Nashif 3f3dc59ea1 parse board defconfig at the very end
The board defconfig is useless if it does not override what the SoC
sets. Boards can have different values than those set by the SoC.

Change-Id: Iab287c62986b20585b4df3e77bd973dbab50eea4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:34 +00:00
Ramesh Thomas cc74572c5b fs: Adds diskio interface
Adds the diskio interface for the FAT file system.  This
revision uses RAM to emulate disk storage.

Origin: Original
Jira: ZEP-285
Change-Id: I7a30c8761d5ed9b564f1d1e08482c5ef199d7372
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-08-01 16:46:38 -07:00
Adrian Bradianu 7a16ade6d1 usb: Add USB device core layer
USB Device core layer is a hardware independent interface between USB
device controller driver and USB device class drivers or customer
applications. It's a port of the LPCUSB device stack.

Change-Id: I9371ffab7034d20953fec0525e72fbe9e094c931
Signed-off-by: Adrian Bradianu <adrian.bradianu@windriver.com>
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-06-30 17:51:56 +00:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05:00
Kumar Gala 7584a1273f ext: plumb out Kconfig support for external source code
Add missing Kconfig files and connections to expose Kconfig options
in ext/ directories.  Fixup QMSI to only be exposed on platforms that
utilize it.

Change-Id: I6c6c5011b2bf2966f65aa8279dc594a244821956
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 11:28:34 +00:00
Anas Nashif 0b2c44a771 tinycrypt: move from lib to regular objects
tinycrypt was built using the lib- scripts without any real benefit. We
also had a wrong placement of the Kconfig files under misc/ and a Kconfig
file for Crypto that was never used before.

Change-Id: I82d5902d92e7c06e10a95f418d9ead3cbcabcce4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-16 19:43:50 +00:00