Commit graph

154 commits

Author SHA1 Message Date
Guillaume Gautier 3d4232290f Kconfig.zephyr: Update UF2 ID for STM32F4 series
Update UF2 family ID for the entire STM32F4 series, except STM32F407xx
which have their own dedicated IDs.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2022-12-22 10:57:49 +01:00
Sebastian Bøe 02b83892d2 mcuboot: doc: Define MCUBOOT_EXTRA_IMGTOOL_ARGS more clearly
imgtool could be used for many things, but
CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS, despite it's generic name, is only
applied when signing. Make it even more clear in the prompt and help
text that it's limited to signing.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-12-21 16:39:19 +01:00
Keith Packard 62bc9bf3e5 cmake: Allow selection of libc API overflow detection mode
This adds a choice of three different libc API buffer overflow detection
modes:

 * None
 * Compile-time
 * Compile-time and Run-time

These correspond with the clang/gcc _FORTIFY_SOURCE modes (0/1/2).
_FORTIFY_SOURCE depends on compiler optimizations and require libc support
which the minimal C library doesn't include, so _FORTIFY_SOURCE is disabled
by default in those cases. Native tooling might also enable
_FORTIFY_SOURCE, so don't enable it by default in that case either.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-10-31 23:23:27 +09:00
Torsten Rasmussen c107827bb7 linker: correct linker script _flash_used calculation
Linker scripts contains a `.last_section` section that is placed in rom
region as NOLOAD for the purpose of retrieve the actual number of bytes
contained in the image. See d85efe0b10

However, a previous section may cause the location counter to be
incremented for alignment purposes. This can result in the size of the
image to be 0x10FA but location counter to be 0x1100 because it has been
aligned for next section placement.

Therefore, two new Kconfig settings are introduced.
Those settings request the linker to will write a pattern in
`.last_section`. Together with removing NOLOAD and writing a patten to
the section then we ensure that data is written after alignment of
location counter, and thereby forces the image size to be in sync with
the location counter.

The default pattern used will be 0xE015 (end of last section).

Some systems may fill up the flash completely, or simply write data at
the end of the flash, which in both cases can result in overflow.
Therefore, the new settings can be disabled.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-10-03 13:13:46 +00:00
Krzysztof Chruscinski 2735a3a2fa testsuite: ztress: Use XOSHIRO generator when ztress is used
Use XOSHIRO random number generator if target has entropy generator.
Some entropy generators may have limitations (e.g. only thread context)
which would conflict with ztress usage.

Added Kconfig.defconfig for testsuite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-08 05:43:17 -04:00
Carles Cufi d800ccc644 blobs: Introduce TAINT and TAINT_BLOBS Kconfig options
In order to ensure that builds properly reflect the use of binary blobs,
it is important to markt the build as tainted. For that purpose
introduce two new Kconfig options that ultimately will be reflected in
the build image itself.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-08-29 15:57:59 +02:00
Martí Bolívar 2bc25deb07 Kconfig: fix "flag LEGACY_INCLUDE_PATH as deprecated"
Commit cd7c44a152
("Kconfig: flag LEGACY_INCLUDE_PATH as deprecated") forgot to select
DEPRECATED when deprecating a Kconfig option. Fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-08-19 08:13:32 +00:00
Kumar Gala 52a3ec9df3 kconfig: Move Kconfig.dts sourcing earlier
Move Kconfig.dts before modules so that any of the auto generated
symbols will be available to module Kconfigs.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-17 08:06:55 +00:00
Fabio Baltieri f9447aeff6 Kconfig: flag LEGACY_INCLUDE_PATH as deprecated
Deprecate the LEGACY_INCLUDE_PATH so that it can be removed down the
road.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-05 13:03:54 +02:00
Fabio Baltieri 855216f582 kconfig: default to LEGACY_INCLUDE_PATH=n
Change the default config for LEGACY_INCLUDE_PATH to 'n'.

This makes any test or sample fail CI if there's any #include missing
the "zephyr/" prefix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Torsten Rasmussen 6066ab43b3 kconfig: add support for warnings when enabling deprecated features
This adds two new Kconfig settings.

The first setting `DEPRECATED` which is a promptless symbol.
This symbol must be selected by any deprecated setting when enabled.

The second setting is `WARN_DEPRECATED` which is a user controlled
setting that configures the build system to print a warning when a
deprecated feature is enabled.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-07-15 09:53:08 -05:00
Anas Nashif 47a673f2f4 build: generate symbols file
Optional way for generating symbols file using binutils. This file will
be generated on demand for tests which will then be parsed by twister to
create an accurate test plan from the listed testcase/suites.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-11 11:56:39 +02:00
Nicolas Pitre 0a386dbe6c build: make Zephyr stdint convention enforcing configurable
There are  few cases where removing this enforcement is desirable:

- linking against binary C++ libs with incompatible type mangling

- linking against system provided headers i.e. native_posix

- compiling with legacy code that assumes a different convention

So let's create a Kconfig symbol for it. This is IMHO a good compromize
compared to using the %"PRId32" abomination everywhere otherwise.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-06-22 12:26:46 +02:00
Chen Peng1 d8fa857b19 LLVM: add built-in lld linker support for x86.
add support to use LLVM built-in lld linker to build
zephyr applications for x86 platforms.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2022-06-05 14:10:25 +02:00
Yuval Peress 1ec0c6f530 build: make non zephyr/ include prefix configurable
Add a Kconfig to disable non prefixed includes. By setting
`CONFIG_LEGACY_INCLUDE_PATH=n` developers can disable having
`include/zephyr` in the search path. This means that includes such
as `#include <kernel.h>` will no longer work.

Internally, every header should be updated to add the `zephyr/`
prefix to the headers. Only then, will developers be able to use
this config value for their applications.

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Xudong Zheng 8db98691c6 soc: Add UF2 family ID for nRF52833
ID from https://github.com/Microsoft/uf2#family-list

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2022-04-06 10:57:57 +02:00
Gerard Marull-Paretas dffaf5375c kconfig: tweak Kconfig prompts
Tweak some Kconfig prompts after the removal of "Enable...".

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Gerard Marull-Paretas 95fb0ded6b kconfig: remove Enable from boolean prompts
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:

sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Yonatan Schachter efa170f480 soc: rp2040: Added UF2 output file support
Added support for the UF2 file format for the RP2040 SoC

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-02-02 16:23:35 +01:00
Peter Johanson 3f3320713c build: uf2: Flexible UF2 offset selection.
UF2 offset configurable to be either flash base reg + offset,
or simply the flash bare reg if the offset is configured
to be ignored.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2022-02-02 16:23:35 +01:00
Torsten Rasmussen d51a67b7c0 cmake: support ELF image adjustment
This commit adds support for adjust the addresses of the final image.
This is useful when the image is to be flashed at a location different
from the LMA address encoded in the ELF file by the linker.

An example use-case is multicore systems where core A might load image
from a flash partition into RAM in order for core B to execute and load,
but where the image itself is build with the RAM addresses as LMA.

It updates the zephyr_image_info.h header with information of adjustment
value.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-01-22 16:57:31 -05:00
Torsten Rasmussen c8ddc34bb8 scripts: generate image info header file
This commit adds the `gen_image_info.py` script which supports creation
of a header file with image information from the EFL file.

This version populates the header file with:
- Number of segments in the image
- LMA address of each segment
- VMA address of each segment
- Size of each segment

The header file can be used by a secondary build system which needs this
information.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-01-22 16:57:31 -05:00
Sylvio Alves 16571db029 soc: esp32: add support to mcuboot build
Select configuration when mcuboot is enabled.
At this moment, only UNSIGNED image is supported as per
Espressif's mcuboot porting.

This also updates esp32 runner to use proper bin_file name
and updates default bootloader check.

Move CMakeLists.txt content from board to soc directory
as this support is for esp32 architecture and not board
specific.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-12-18 07:20:38 -05:00
Shubham Kulkarni f9eaabbd9b module: mcuboot: Add config option to support unsigned binary generation
This commit adds a change to support running west sign command even if
the keyfile is not provided. Default value of the configuration
is set to n in order to maintain backward compatibility.

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-12-18 07:20:38 -05:00
Torsten Rasmussen 1a51993192 scripts: support propagating workspace status to zephyr revision
The PR #39382 raised a discussion on build reproducibility and knowledge
of west projects being out of sync with the west manifest.

Similar to how `git submodules` will report the working tree dirty if
any of the submodules HEAD points to a SHA different than the one
recorded in the super project.

Based on this discussion this commit extends the Zephyr and manifest
repo (when `west` is used) revisions to include the concatenated states
of the workspace.

The workspace states are:
>  dirty: false / true
>  extra: false / true
>  off:   false / true

the final revision will become: <SHA>-<state1>-<state2>-<state3>

For example:
> zephyr:
>  path: /.../zephyr
>  revision: <SHA>-dirty-extra-off

or
> zephyr:
>  path: /.../zephyr
>  revision: <SHA>-extra

The `BUILD_OUTPUT_META_STATE_PROPAGATE` Kconfig setting is introduced
to provide user control of this behavior.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-12-14 12:32:10 +01:00
Torsten Rasmussen 64ec6ee3a3 scripts: build meta file workspace status extension
The PR #39382 raised a discussion on build reproducibility and knowledge
of west projects being out of sync with the west manifest.

Similar to how `git submodules` will report the working tree dirty if
any of the submodules HEAD points to a SHA different than the one
recorded in the super project.

Based on this discussion this commit extends the Zephyr build meta file
with overall workspace status included in the meta file.

It adds the following meta info to the build meta file:
> workspace:
>  dirty: false / true
>  extra: false / true
>  off:   false / true

A project using west and having an extra Zephyr module loaded not
controlled using git and a west project at a SHA different than the
SHA referenced by the manifest can look like:
zephyr:
  path: /.../zephyr
  revision: 863600cd0e
modules:
- name: mcuboot
  path: /.../bootloader/mcuboot
  revision: c61538748ead773ea75a551a7beee299228bdcaf
- name: local_module
  path: /.../local_module
  revision: null
west:
  manifest: /.../zephyr/west.yml
  projects:
  - path: /.../zephyr
    revision: 863600cd0e
  - path: /.../bootloader/mcuboot
    revision: c61538748ead773ea75a551a7beee299228bdcaf-off
  - path: /.../tools/net-tools
    revision: f49bd1354616fae4093bf36e5eaee43c51a55127
workspace:
  dirty: false
  extra: true
  'off': true

And without west:
zephyr:
  path: /.../zephyr
  revision: 863600cd0e
modules:
- name: hal_nordic
  path: /.../modules/hal/nordic
  revision: a6e5299041f152da5ae0ab17b2e44e088bb96d6d
- name: local_module
  path: /.../local_module
  revision: null
workspace:
  dirty: false
  extra: true

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-12-14 12:32:10 +01:00
MORGER Patrick 90aa2d33b2 kconfig: fix typo in compiler options
This commit fix the misspelling of the word "diagnostics"

Signed-off-by: MORGER Patrick <patrick.morger@leica-geosystems.com>
2021-11-16 12:12:58 -05:00
Torsten Rasmussen fffaf05e5d scripts: support for build meta file creation
This commit is motivated by the west discussion in:
https://github.com/zephyrproject-rtos/west/issues/548

The commit provides the ability to generate a build meta info file
containing lists of:
- Zephyr:         path and revision
- Zephyr modules: name, path, and revision
- West:           manifest path
                  path and revision for each project

For Zephyr or Zephyr modules the revision will be `null` if it is not
under git version control.

If Zephyr, a modules, or a project has uncommitted changes, the revision
will be marked dirty.

If west is not installed or used for the build process, the
west-projects list will be empty.

If a project is both a Zephyr module and a west project it will show up
in both lists.

Similar to Zephyr, which is independently referred as the Zephyr in use
but also listed as west project when west is used.
This is important in case ZEPHYR_BASE was manually set and pointing to
a different Zephyr repository.

The build meta file is not created per default but can be enabled with
the BUILD_OUTPUT_META Kconfig setting.

A project using west and having an extra Zephyr module loaded not
controlled using git can look like:
zephyr:
  path: /.../zephyr
  revision: 863600cd0e3c0a271e86629c5089821e5e4380cc-dirty
modules:
- name: mcuboot
  path: /.../bootloader/mcuboot
  revision: c61538748ead773ea75a551a7beee299228bdcaf
- name: local_module
  path: /.../local_module
  revision: null
west:
  manifest: /.../zephyr/west.yml
  projects:
  - path: /.../zephyr
    revision: 863600cd0e3c0a271e86629c5089821e5e4380cc-dirty
  - path: /.../bootloader/mcuboot
    revision: c61538748ead773ea75a551a7beee299228bdcaf
  - path: /.../tools/net-tools
    revision: f49bd1354616fae4093bf36e5eaee43c51a55127

And without west:
zephyr:
  path: /.../zephyr
  revision: 863600cd0e3c0a271e86629c5089821e5e4380cc-dirty
modules:
- name: hal_nordic
  path: /.../modules/hal/nordic
  revision: a6e5299041f152da5ae0ab17b2e44e088bb96d6d
west: null

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-11-11 06:06:07 -05:00
Torsten Rasmussen 1c911290e9 kconfig: add support for warnings when using experimental features
This adds two new Kconfig settings.

The first setting `EXPERIMENTAL` which is a promptless symbol.
This symbol must be selected by any setting which is used to enable
an experimental feature.

The second setting is `WARN_EXPERIMENTAL` which is a user controlled
setting that configures the build system to print a warning when
experimental features are enabled.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-10-22 13:59:21 +02:00
Emil Lindqvist f7dad07bb0 kconfig: add names to some choices
In order to be able to make a "choice" from any other
Kconfig.defconfig (-ish) file, the choice needs to be named.
This commit names a few choices.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-09-28 19:56:32 -04:00
Torsten Rasmussen 36bb00d1f5 armclang: ARM Compiler C library support
Support for ARM Compiler C library.

This commit add support for the ARM Compiler C libary in:
- Kconfig
- libc/armstdc

A new Kconfig symbol is added to allow a toolchain to specify if they
support linking with the minimal C library.
Also the CMake variable `TOOLCHAIN_HAS_NEWLIB` is exported to Kconfig
so that CONFIG_NEWLIB_LIBS can only be enabled if the toolchain has
newlib.

The armclang toolchain selects the CMake scatter file generator and
disables support for the LD linker template which is not supported by
armlink.

For the ARM Compiler C library, a corresponding lib/libc/armstc/ folder
with a minimal implementation to work with the ARM Compiler C library
is added.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-30 08:54:23 -04:00
Torsten Rasmussen 761eada9d3 kconfig: cmake: CMake linker script generator symbol added
A "Linker script" choice group has been added to the linker options
menu.

The existing HAVE_CUSTOM_LINKER_SCRIPT config has been relocated inside
the linker script menu.

Two new entries has been created:
- LD template, for using the old ld template files together with the C
  pre-processor to create the final linker script.
- CMake linker generator, used for ARMClang / armlink toolchain.
  The CMake linker generator is also supported for LD linker scripts
  for the ARM architecture.

In CMake, the file cmake/linker/ld/target.cmake has been updated to
support the CMake LD linker generator.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-30 08:54:23 -04:00
Daniel Leung 6a006d71b7 kernel: add kconfig to say not all code/data is present at boot
With demand paging and pinned sections enabled, it is possible for
data to be brought into physical memory as required by current
execution context. However, the kernel still assumes that all data
pages are present at boot which may not be desirable for certain
scenarios. This introduces a new kconfig to specify that those
data pages other than the boot and pinned sections are not present,
and they would be paged in on demand.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-26 21:16:22 -04:00
Helge Juul 8749cd4d76 kconfig: Add option for encryption of binaries
Introduce new Kconfig option MCUBOOT_ENCRYPTION_KEY_FILE. If the
string is not empty Cmake will try to encrypt the final binaries using
the given key file.

Signed-off-by: Helge Juul <helge@fastmail.com>
2021-08-26 21:15:54 -04:00
Glauber Maroto Ferreira ed63e2a562 soc: esp32s2: add initial soc support files for esp32s2
by adding specific soc files for esp32s2 bring-up, such as:
- linker script
- soc initialization code
- initial device tree source files
- esp32s2 saola board support.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-07-28 21:09:27 -04:00
Torsten Rasmussen 6be1b2af9b kconfig: soc and shield cleanup
Always source the Zephyr base soc and shield (board root) Kconfigs
directly from Kconfig instead of generated Kconfig files.

This has the benefit that it is no longer necessary to generate Kconfig
files to source SoC root and shield (board root) when no custom roots
are provided.

Also this cleans up the doc/CMakeLists.txt and ensures that the
doc/CMakeLists.txt is not getting out of sync with the Kconfig.cmake.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-06-11 16:13:22 +02:00
Martí Bolívar e5cc8540e4 Kconfig.zephyr: fix MISRA_SANE location
This belongs under "Compiler Options", not "Boot Options" where it
currently is.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-21 18:11:26 -04:00
Gerson Fernando Budke f3a7f041bf scripts: runners: bossac: Add legacy mode
Add compatibility mode with old sam-ba flash bootloaders that don't have
offset capabilities.  These bootloaders flash to a pre-defined flash
region.  At end, bossac will suppress --offset parameter.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-05-21 21:20:58 +02:00
Daniel Leung 1310ad6b0e linker: add bits for pinned regions
This adds the necessary bits for linker scripts and source code
to specify which symbols need to be pinned in memory. This is
needed for demand paging as some functions and data must reside
in memory all the time and cannot be paged out (e.g. paging,
scheduler, and interrupt routines for functionality).

This is up to the arch/SoC/board to define the sections in
their linker scripts as the pinned section may need special
alignment which cannot be done in common script snippets.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung d812728ec4 linker: add bits for boot regions
This adds the necessary bits for linker scripts and source code
to specify which symbols are needed for boot process so they
can be grouped together.

One use of this is to group boot related code and data so these
won't interval with other kernel and application for better
caching.

This is a must for demand paging as some functions and data
must be available during the boot process and before the memory
manager is initialized. During this time, paging cannot be used
so symbols linked in virtual memory space are unavailable.

This is up to the arch/SoC/board to define the sections in
their linker scripts as section may need special alignment
which cannot be done in common script snippets.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Mahesh Mahadevan 64e973fdcd Kconfig: Add a new config CODE_DATA_RELOCATION_SRAM
1. This will help us identify if the relocation is to
SRAM which is used when setting up the MPU entry
for the SRAM region where code is relocated
2. Move CODE_DATA_RELOCATION configs to ARM specific
folder

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-05-04 15:46:52 +02:00
Jordan Yates 318ee971c5 boards: stm32f0: explicit RAM vector table control
Add a new Kconfig symbol that explicitly controls whether the vector
table should be placed in RAM. This eliminates the side effect of
`IS_BOOTLOADER` controlling vector table location. Making the condition
a positive assertion also allows the config to be used in CMakeLists
conditions (`zephyr_linker_sources_ifdef()`, etc).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-30 15:16:02 +02:00
Gerard Marull-Paretas f163bdb280 power: move reboot functionality to os lib
Reboot functionality has nothing to do with PM, so move it out to the
subsys/os folder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 20:34:00 -04:00
Arvin Farahmand e430b7b64f cmake: gcc/clang: enable colour diagnostics in terminal output
When compiler results are piped through a non-terminal (e.g. ninja)
the compiler disables colour diagnostics. Using `-fdiagnostics-color`
forces the compiler to enable colour output. This flag is always
enabled for clang and gcc.

Setting `CONFIG_COMPILER_COLOR_DIAGNOSTICS=n` disables this
feature and reverts to plain diagnostic messages with no formatting.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-04-22 17:23:12 -04:00
Daniel Leung e211d3a999 kernel: remove CONFIG_KERNEL_LINK_IN_VIRT
There actually is no need for a separate kconfig here, as
the kernel VM address and SRAM address can be used to figure
out if the kernel is linked in virtual address space.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-03-16 15:03:44 -04:00
Kumar Gala 19e5a9c061 zephyr: Remove support for deprecated int types
Its been 2 releases since we deprecated the old zephyr integer types.
We can now remove support for the Kconfig option, code, and, test to
allow the old int types to be supported.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-05 04:56:13 -06:00
Pete Johanson ff01a00d60 soc: Add standard UF2 family IDs for supported SoCs.
Defaults from https://github.com/Microsoft/uf2#family-list

Signed-off-by: Pete Johanson <peter@peterjohanson.com>
2021-02-23 21:11:04 +01:00
Pete Johanson 310a464acf cmake: Add UF2 as an additional build output option.
Add ability to build a UF2 (https://github.com/Microsoft/uf2)
image as an additional output type. This leverages the code
partition offset for the UF2 base address, and a configurable
UF2 family ID.

Includes an unmodified (except for headers for licensing, pylit
disabling) version of the uf2conv.py script copied the UF2
format specification repository, used to convert the bin to UF2.

Origin: UF2 file format specification reference utilies
License: MIT
URL: https://github.com/microsoft/uf2/blob/master/utils/uf2conv.py
commit: 587abb8b909266e9b468d6284f2fbd425235d1b5
Signed-off-by: Pete Johanson <peter@peterjohanson.com>
2021-02-23 21:11:04 +01:00
Daniel Leung 3d457e1a36 linker: add CONFIG_KERNEL_LINK_IN_VIRT
This adds the kconfig CONFIG_KERNEL_LINK_IN_VIRT and supporting
kconfigs to indicate that the linker script can link the kernel
in virtual address space. This is needed for demand paging where
the kernel can be bigger than physical address space.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-22 14:55:28 -05:00
Daniel Leung ece9cad858 kernel: add CONFIG_SRAM_OFFSET
This adds a new kconfig CONFIG_SRAM_OFFSET to specify the offset
from beginning of SRAM where the kernel begins. On x86 and
PC compatible platforms, the first 1MB of RAM is reserved and
Zephyr should not link anything there. However, this 1MB still
needs to be mapped by the MMU to access various platform related
information. CONFIG_SRAM_OFFSET serves similar function as
CONFIG_KERNEL_VM_OFFSET and is needed for proper phys/virt
address translations.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-22 14:55:28 -05:00