Commit graph

495 commits

Author SHA1 Message Date
Jordan Yates d1ae54a022 modules: cmsis: integrate CMSIS-NN
Integrate the CMSIS-NN libraries from the CMSIS 5.8.0 release.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-03-22 12:56:02 +01:00
Yuval Peress 347a297da2 modules: fff: Fix issue with tests being skipped in CI
The filter in the testcase.yaml made it impossible for these to run.
Also, the Kconfig names for the options didn't really make much sense
so they were renamed to avoid conflict.

This fixes an issue found by #36433.

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-22 12:33:58 +01:00
Artur Hadasz 9f5c159c7c modules: hal_nordic: fixed wrong 802.15.4 NET core init level
The intialization level of 802.15.4 on NET core was set to APPLICATION,
which caused some applications to break during initialization. Changed
it to POST_KERNEL. CONFIG_NRF_802154_SER_RADIO_INIT_PRIO default value
was adjusted.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
2022-03-22 12:29:01 +01:00
Henrik Brix Andersen 67ba9900f0 drivers: can: add struct device argument to callback functions
Include a pointer to the CAN controller device for the CAN
transmit, receive, and state change callback functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-19 14:31:22 -04:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Yonatan Schachter 90b20fffa4 drivers: hwinfo: Added unique ID support for RPi Pico
Added support for hwinfo's hwinfo_get_device_id for the
RPi Pico series.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-03-16 10:24:32 +01:00
Yonatan Schachter 36888b1fb7 soc: rp2040: Enable bootrom functions
Support function and data lookup in the RPi's ROM.
The objects are obtained by including <pico/bootrom.h> and calling
rom_func_lookup or rom_data_lookup.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-03-16 10:24:32 +01:00
Andrzej Głąbek 222d42c22a modules: hal_nordic: Improve reservation of resources for BT_CTLR
Instead of including from nrfx_glue.h a specific Zephyr Bluetooth
controller header file that defines PPI and GPIOTE resources to be
reserved for exclusive use by the controller, include a file with
only a fixed name and expect the chosen Bluetooth controller to
provide the location of this file in include paths. This way, when
a different Bluetooth controller implementation is used downstream,
a different file can be easily pointed to.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-15 14:59:35 +01:00
Nazar Kazakov 9713f0d47c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-14 20:22:24 -04:00
Gerard Marull-Paretas b2001388b7 modules: hal_nordic: obtain entropy device using DEVICE_DT_GET
The entropy device can be obtained at compile time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-11 15:27:05 -08:00
Joakim Andersson 5ee41d8b4e scripts: size_report: Add support for TF-M and BL2 image size reports
Add support for TF-M and BL2 image size reports.
This adds the following targets when TF-M or BL2 is enabled:
tfm_rom_report, tfm_ram_report, tfm_footprint
bl2_rom_report, bl2_ram_report, bl2_footprint

Example:
west build -t tfm_rom_report

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-03-09 14:03:52 -05: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
Bartosz Golaszewski 134f56dd2d lvgl: bump supported version to v8.2.0
In upstream the LV_COLOR_DEPTH_BITS option is called LV_COLOR_DEPTH, this
needs changing if we want to support v8.2.0.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2022-03-07 16:20:27 -06:00
Daniel DeGrasse cb685709e5 soc: nxp_imx: Enable inclusion of power management HAL drivers
Add KConfig symbols to select power management HAL drivers required for low
power modes. Set ZTEST_NO_YEILD if PM is enabled, since RT series SOCs
do not connect to a debugger in WAIT mode.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-07 13:53:14 -06:00
Rafał Kuźnia a8dd5bfe3a modules: hal_nordic: Select RPMSG backend by default
The nrf_802154 module should use the IPC_SERVICE_BACKEND_RPMSG
backend by default.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2022-03-07 10:55:16 +01:00
Artur Hadasz 5451c8b70f modules: hal_nordic: 802.15.4 make possible to disable CSMA-CA
Currently if an attempt to disable CSMA-CA in by setting an
appropriate flag in another (for example application)
CmakeLists.txt it caused lots of warnings. This fix allows
higher level CMakeLists.txt to disable CSMA-CA without
warnings.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
2022-03-07 10:51:21 +01:00
Przemyslaw Bida 47557d7d9d manifest: openthread: Simplification of openthread integration.
This commit moves openthread CMakeLists.txt from openthread submodule
to zephyr/modules/openthread.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2022-03-02 10:06:03 -08:00
Kamil Piszczek 3e5812cc5f modules: hal_nordic: Port nrf_802154 to ipc_service
The nrf_802154 Spinel serialization was ported to multi-instance
ipc_service.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-02 17:03:01 +01:00
Torsten Rasmussen aff31cf62b modules: littlefs: move CMake glue code from littlefs repo into Zephyr
Fixes: #40559

Moving CMakeLists.txt gluecode into Zephyr repo minimizes the patching
needed in LittleFS repo.

It provides a dedicate Zephyr LFS config header which will define the
equivalent LittleFS settings based upon Kconfig settings.
This further reduces the patching needed in LittleFS.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-03-02 15:34:11 +01:00
Torsten Rasmussen 6b56b3c14e modules: littlefs copy the naive crc function from LittleFS
LittleFS requires a `lfs_crc()` function, however the basic crc
function provided by LittleFS gets disabled when a custom configuration
header is used.

To ensure identical crc behavior let Zephyr have a copy of the basic
lfs_crc.

This allows to ensure identical behavior when moving glue code into
Zephyr repo, and allow us to change to an existing crc implementation
provided natively by Zephyr at a later time.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-03-02 15:34:11 +01:00
Flavio Ceolin 26d7a929d4 modules: mbedTLS: Add Kconfig options for hashing
Add explicit Kconfig options to enable SHA support on mbedTLS.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-03-01 16:32:43 -05:00
YuLong Yao 1ad0b193d9 modules: arm: gigadevice: set HAXTL_VALUE for gd32_e103
set HAXTL_VALUE to GD32_HXTAL_8MHZ for gd32_e103.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2022-03-01 18:06:14 +01:00
Bartosz Golaszewski 3470ace98d modules: lvgl: add stubs for Kconfig symbols overridden in-tree
There are several Kconfig symbols defined in the lvgl module that are
referenced from various defconfigs in the zephyr tree. If the LVGL module
is unavailable, they need to be redefined as stubs in Kconfig.lvgl.

Fixes: 6c190292c0 ("lvgl: move the lvgl glue out of the zephyr tree")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 16:37:33 -08:00
Rafał Kuźnia 4635c0866f modules: hal_nordic: Remove nrf_802154_lp_timer platform
The nrf_802154_lp_timer_zephyr.c platform file is unused in the
opensource SL library variant.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2022-02-24 14:05:09 -08:00
Bartosz Golaszewski 6c190292c0 lvgl: move the lvgl glue out of the zephyr tree
Start using the upstream Kconfig from LVGL and move the glue code out
of the zephyr tree and put it under lvgl/zephyr/ in modules.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 11:51:33 +01:00
Bradley Bolen c0dd594d4d arch: arm: aarch32: Change CPU_CORTEX_R kconfig option
Change the CPU_CORTEX_R kconfig option to CPU_AARCH32_CORTEX_R to
distinguish the armv7 version from the armv8 version of Cortex-R.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-02-23 08:14:15 -06:00
Andrzej Kuros 7ce93ebfed modules: hal_nordic: nrf_802154_irq ZLI support
Parameter `prio` of `nrf_802154_irq_init` is now allowed to have
negative value what means use of ZLI priority or highest possible
priority if ZLIs are disabled.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2022-02-23 11:18:17 +01:00
Joakim Andersson bfbee8c54f tfm: Add config to disable all TF-M output
Add config to disable all TF-M output. This configuration is needed
in order to exclude the UART driver through a select in Kconfig
when either the code size optimization or the UART instance requires it.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-02-21 21:02:25 -05:00
Yonatan Schachter db5b2780bf soc: Added support for Raspberry Pi's RP2040 SoC
Added basic support for the RP2040 SoC. Support
includes booting and starting the kernel, on one
core only.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2022-02-02 16:23:35 +01:00
Torbjörn Leksell 8426cbdf8a Modules: Percepio TraceRecorder: Update module from v4.5.2 to v4.6.0(RC1)
This update updates the TraceRecorder module from version v4.5.2
to v4.6.0(RC1). The primary motivation for this update is to
fix some breaking trace hook changes introduced into Zephyr
v2.7.99, which resulted in compilation errors when using the
TraceRecorder module.

The update to v4.6.0 also introduce Snapshot tracing support,
extended kernel object naming, and a reworked configuration
scheme with better naming and layout in guiconfig.

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
2022-02-01 07:45:09 -05:00
Joakim Andersson 17f8932f16 modules: trusted-firmware-m: Use TF-M install headers as interface
Use the set of headers that the TF-M build system places in the
install output. Not all public header files are available in the
interface/include directory and the TF-M build system uses the install
mechanism of cmake to include additional headers based on platform
or configuration.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-02-01 11:31:36 +01:00
Daniel DeGrasse 2ac1b42952 drivers: usb_dc_mcux: Move mcux callback handler out of ISR context
MCUX usb ISR was making usb callbacks directly, which caused assertion
failures when a callback attempted to lock a mutex. Move USB callback
handler to separate thread, and make ISR notify thread via message
queue.

Fixes #40638

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-28 10:05:47 +01:00
Henrik Brix Andersen 2aed5a1237 drivers: can: remove CAN_BUS_UNKNOWN CAN controller state
The CAN_BUS_UNKNOWN CAN controller state is only used to indicate that
the current CAN controller state could not be read.

Remove it and change the signature of the can_get_state() API function
to return an integer indicating success or failure.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-28 10:05:29 +01:00
Daniel DeGrasse f5ebc30087 soc: imx_rt: Enable IMX.RT General Power Controller Driver
GPC driver is used for power management operations on RT series SoCs.
Enable inclusion of the driver into the build.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-18 14:09:45 -05:00
Erwan Gouriou 26cde3ab23 boards: b_u585i_iot02a: Add a non-secure target
Provide a _ns target for b_u585i_iot02a board.
Flash partition is given as default for most applications,
with the following sizes:
MCUBoot: 208K
Secure: 256K
Non secure: 512K

Tested using tfm_ipc sample.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-18 10:42:45 -05:00
Daniel Leung b63b71aa1b tfm: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Henrik Brix Andersen d727547f79 modules: canopennode: increase stack sizes
Increase the default CANopenNode stack sizes a bit. The current stack
sizes are too small for e.g. ST STM32F3, likely other platforms as well.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-11 14:40:49 -06:00
Henrik Brix Andersen 12388b9965 modules: mcux: add support for indicating the presence of MCAN
Add Kconfig option for indicating that a given SoC contains the NXP
MCAN CAN FD controller.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-01-10 12:00:20 +01:00
Henrik Brix Andersen 8af4bb722d drivers: can: rename API functions for better consistency
Rename a few CAN API functions for clarity and consistency with other
Zephyr RTOS APIs.

CAN_DEFINE_MSGQ() becomes CAN_MSGQ_DEFINE() to match K_MSGQ_DEFINE().

can_attach_isr() becomes can_add_rx_filter() since a filter callback
function is not an interrupt service routine (although it is called in
isr context). The word "attach" is replaced with "add" since filters are
added, not attached. This matches the terminology used is other Zephyr
APIs better.

can_detach() becomes can_remove_rx_filter() to pair with
can_add_rx_filter().

can_attach_msgq() becomes can_add_rx_filter_msgq() and documentation is
updated to mention its relationship with can_add_rx_filter().

can_register_state_change_isr() becomes can_set_state_change_callback()
since a state change callback function is not an interrupt service
routine (although it is called in isr context). The word "register" is
replaced with "set" since only one state change callback can be in
place.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 10:44:37 +01:00
Paweł Kwiek 2c387c6a50 modules: hal_nordic: align & extend lp_timer platform
This commit aligns nrf_802154_lp_timer_zephyr platform to new API of
nrf_rtc_timer. Moreover, it implements lp_timer synchronization
functions using the new nrf_rtc_timer API.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2022-01-04 17:44:32 +01:00
Sebastian Bøe 7ea7eb05ae tfm: kconfig: Fix config regression from TF-M 1.5
In TF-M 1.5 some defaults changed. Some of our CMake code was
unfortunately making assumptions about the defaults.

This is now rectified. The TF-M CMake variables that had their
defaults changed are now always set dependent on the Kconfig values
and we no longer leave the CMake variables unset and with default
values.

A cleanup will be done later to not rely on default values for all
variables. This patch only fixes the defaults that have changed.

Also, TFM_PSA_API is removed as it is now an internal variable.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-01-04 12:33:23 +01:00
Krzysztof Chruscinski 3457ebc667 modules: hal_nordic: Add NRFX_GPIOTE_NUM_OF_EVT_HANDLERS option
Add option to specifiy number of nrfx_gpiote user handlers in Kconfig.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-04 09:50:02 +01:00
Henrik Brix Andersen b1b77c1774 drivers: can: change can_tx_callback_t function signature
Change the can_tx_callback_t function signature to use an "int" (not an
uint32_t) for representing transmission errors.

The "error" callback function parameter is functionally equivalent to
the return value from can_send() and thus needs to use the same data
type and needs to be able to hold negative errno values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-01 07:40:29 -05:00
Carles Cufi c7ec3db5e5 Revert "modules: hal_nordic: align & extend lp_timer platform"
This reverts commit 9cdd8cd168.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-12-20 21:04:26 +01:00
TOKITA Hiroshi 5c7a0ef888 drivers: interrupt-controller: add Nuclei ECLIC driver
Add support for the ECLIC interrupt controller
which is used with the Nuclei processor core.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2021-12-20 17:51:30 +01:00
TOKITA Hiroshi 5f3a6af91c modules: Add Configurations for GD32VF103
Add configuration for GD32VF103 SoC.

- Add compiler definition HXTAL_VALUE for compile GigaDevice's HAL.
- Redefine gd32_cmsis_dir for source commonize.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2021-12-20 17:51:30 +01:00
Paweł Kwiek 9cdd8cd168 modules: hal_nordic: align & extend lp_timer platform
This commit aligns nrf_802154_lp_timer_zephyr platform to new API of
nrf_rtc_timer. Moreover, it implements lp_timer synchronization
functions using the new nrf_rtc_timer API.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2021-12-20 16:25:49 +01:00
Paweł Kwiek f3fea0e6f1 modules: hal_nordic: Add CCA macros when nRF Radio Driver is enabled
This patch restricts access of CCA configuration related macros to
builds for which nRF 802.15.4 Radio Driver is enabled. This reduces
clutter and prevents misuse of CCA macros.

Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2021-12-16 10:12:36 +01:00
Damian Krolik 45307140ac tfm: kconfig: make ITS size configurable
Add two Kconfig variables for controlling the size and
the number of assets to be stored in Internal Trusted
Storage (ITS).

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2021-12-14 13:42:57 -06:00
HaiLong Yang 33a44a7748 modules: hal_gigadevie: add CEC and TSI drivers
Add CEC and TSI drivers from GD32F3X0.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2021-12-13 20:27:30 -05:00
Joakim Andersson faad102707 modules: tfm: Fix in SPM log level silence configuration
Fix copy-paste mistake in SPM log level silence configuration, PARTITION
should be SPM in order to correctly silence SPM log.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-12-13 16:36:06 +01:00
Henrik Brix Andersen f499559434 drivers: can: deprecate the use of CAN-specific error return values
Deprecate the use of CAN-specific error return values and replace them
with standard errno values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-09 12:37:40 -05:00
Robert Lubos 2bc43cf94d modules: mbedtls: Remove MBEDTLS_ECP_MAX_BITS from generic config
MBEDTLS_ECP_MAX_BITS is now set automatically by mbed TLS, redefining it
in the config file ends up in compilation warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-12-08 08:56:03 -05:00
Jimmy Brisson ee001fa4bb boards: Add mps3-an547-ns target; build mps3-an547 with TFM in secure mode
This includes a new device tree, new target yaml and new target
defconfig

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2021-12-07 10:44:23 -06:00
Pieter De Gendt 4d161a3b23 drivers: counter: NXP SNVS rtc: Add support for NXP imx SNVS RTC
Adds a driver using the SNVS high power and optionally low power
RTC instances. A device specific function `mcux_snvs_rtc_set` is
provided to update the current counter value.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-12-07 09:45:43 -06:00
Henrik Brix Andersen 53f85df551 modules: canopennode: switch to using can_set_mode()
Switch from using can_configure() to using can_set_mode() for disabling
CAN controller transmissions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-02 10:54:44 +01:00
Hake Huang f37a227201 modules: add HAS_MCUX_I2S module
add HAS_MCUX_I2S in mcux platforms

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-12-02 10:50:21 +01:00
Krzysztof Chruscinski 5ef63d8313 Bluetooth: Controller: nordic: Rework hw resources files
Move all defines that specifies (D)PPI resources which are used
to dedicated files which have no include dependencies. This allow
to use them in nrfx_glue.h to specify fixed (D)PPI channels used
by the bluetooth.

Additionally, added mask with GPIOTE channels used by the bluetooth
controller. It was previously not defined which could lead to
conflicts since same channels could be allocated by the nrfx_gpiote
user

Updated nrfx_glue.h to use new approach.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-02 09:55:48 +01:00
Krzysztof Chruscinski 1345b2ddd4 modules: hal_nordic: nrfx: Set NRF_SKIP_FICR_NS_COPY_TO_RAM
Set NRF_SKIP_FICR_NS_COPY_TO_RAM for nrf53 and nrf91 until corresponding
memory region is excluded from use.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-02 09:55:48 +01:00
Krzysztof Chruscinski 7e0f1d08e4 modules: hal_nordic: Update nrfx to version 2.6.0
Update the hal_nordic module revision, to switch to nrfx v2.6.0.

nrfx 2.6.0 includes extended API in nrfx_gpiote which can be
used by the zephyr shim.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-02 09:55:48 +01:00
Andrzej Puzdrowski 81b1e7fdac modules: Hooks Kconfig for MCUboot's bootutil
Mcuboot's bootutil libraries has option to use hooks which
allows to customize its behavior while proceeding on images
date. This patch introduces configuration options required for
enabling that option.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-11-30 12:08:03 +01:00
Krzysztof Chruscinski 9886bdc0c8 drivers: pwm: pwm_nrf5_sw: Use runtime resources allocation
Use nrfx_gpiote and nrfx_ppi allocators to allocate channels
at runtime instead of fixed, device-tree based allocation which
is harder to maintain.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-26 09:31:54 +01:00
Sam Hurst 55831a280c stm32: Add UCPD support to Kconfig
This commit adds UCPD HAL and LL drivers to the Kconfig system
required to enable USB Power Delivery interface (UCPD)
on STM32G0/G4/L5/U5 devices

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2021-11-24 14:21:04 -05:00
Joakim Andersson 3db41349f5 cmake: Add variable for the TFM build directory
The TFM build directory path is hardcoded in many places.
In order to support out-of-tree secure partitions the output path
has to be known in potentially out-of-tree build scripts.
This could potentially break out-of-tree build scripts if the
location of the build directory was changed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-22 22:19:41 -05:00
Gerard Marull-Paretas f8017dc5ad drivers: pinctrl: gd32: initial support for AFIO based SoCs
Add a pin control driver for GD32 SoCs using the AFIO model.

Thanks to Gerson Fernando Budke for testing and implementation
suggestions.

Co-authored-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas 543a3843ff drivers: pinctrl: gd32: initial support for AF based SoCs
Add a pin control driver for GD32 SoCs using the AF model.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas df6dd42ca3 modules: hal_gigadevice: include module headers
Include the module `include` folder to allow access to the dt-bindings
helpers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Joakim Andersson 13230747e3 modules: trusted-firmware-m: Fix mcuboot imgtool not found on path
Fix issue with TFM signing of images not using the correct imgtool.
The wrapper command expects the mcuboot scripts folder to be the
current working directory when called in order to find its own
version of imgtool.
Since the command is using a different current working directory
this is not found and the system imgtool is used instead.
This causes the commands to be run with 2 different version of imgtool
if the system imgtool is found and does not have any issues.
The system imgtool could not be installed or have compatibility issues
as 1.7.2 version of imgtool is currently required by the wrapper script

Fixes: #40254

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-21 18:51:16 -05:00
Gerson Fernando Budke 7fba91f383 modules: hal_gigadevice: Set directories to lowercase
This rework module hal_gigadevice to be compliance with rule
that requires firmware libraries directories names be lowercase.
This rule was created at hal_gigadevice/README and it is not
a Zephyr general rule. This only affect how hal_gigadevice is
used.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-11-20 11:54:08 -05:00
Gerard Marull-Paretas 5f99dc7a1c modules: hal_gigadevice: add missing drivers
Add missing drivers included in F4XX HAL:

- DCI
- IPA
- IREF
- SYSCFG
- TLI
- TRNG

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
Gerard Marull-Paretas 74538a1709 modules: hal_gigadevice: make compile definitions global
GD32F4XX requires access to SoC definitions (e.g. GD32F450) when
including library header files, so expose them at Zephyr level.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
Gerard Marull-Paretas 20d3711984 modules: hal_gigadevice: adjust CMake
Adjust CMake according to latest SoC changes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-18 17:42:57 +01:00
Joakim Andersson 9b87d6f7fc modules: tfm: Fix cmake warnings for unused variables
Fix cmake warnings for TF-M build system when PSA tests are not enabled.
This produces the following warnings:
"
CMake Warning:
  Manually-specified variables were not used by the project:

    PSA_TOOLCHAIN_FILE
    TOOLCHAIN
"

These warnings can point to cache or config variables being updated in
the TF-M build system so keep this free of warnings.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-15 14:54:48 -05:00
Joakim Andersson 4a60dce67c modules: tfm: Update crypto modules prompt strings
Update crypto modules prompt strings to follow the Kconfig guidelines.
"For a Kconfig symbol that enables a driver/subsystem FOO, consider
having just “Foo” as the prompt, instead of “Enable Foo support” or the
like."

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-13 07:58:50 -05:00
Joakim Andersson aaa38bfcb6 modules: tfm: Split CRYPTO_ASYMMETRIC module into SIGN and ENCRYPT
The ASSYMETRIC crypto module has been split in two, for sign and
encrypt. Update Kconfig entries to match.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-13 07:58:50 -05:00
Joakim Andersson 81c5fb47a8 modules: tfm: Remove CRYPTO_GENERATOR_MODULE kconfig
Remove CRYPTO_GENERATOR_MODULE Kconfig which has been removed.
Its features are covered by TFM_CRYPTO_KEY_MODULE and
CRYPTO_KEY_DERIVATION_MODULE.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-13 07:58:50 -05:00
Fabio Baltieri b5f9f34fb5 modules: canopennode: set tx_workq thread name
Set a thread name for the tx_workq thread, so that it shows up in
"kernel stacks" when the shell or thread debugging are enabled.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-12 14:51:16 +01:00
Sam Chen 671ab46e2b modules/mbedtls: add the PKCS5 enabler
Kconfig support to `MBEDTLS_PKCS5_C` feature

Signed-off-by: Sam Chen <sam.chen@iota.org>
2021-11-11 07:18:47 -05:00
Marcin Niestroj c32b524d6d mbedtls: support configuration of PSK maximum length via Kconfig
So far maximum PSK length was configured by mbedTLS as 32 bytes.
Introduce Kconfig option that will configure it instead of relying on
default value from mbedTLS library, so that user can easily adjust that
value to application needs.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-11-10 08:28:15 -05:00
Joakim Andersson dda3a5ad0d modules: tfm: Split trusted-firmware-m repository
Split the zephyr project maintained repository trusted-firmware-m into
forks of the individual upstream repositories.

https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git
Upstream: TF-Mv1.4.1
Additions:
zephyr: module: Add zephyr module file
trusted-firmware-m: platform: lpcxpresso55s69: Update SDK

https://git.trustedfirmware.org/TF-M/tf-m-tests.git
Upstream: 51ff2bdfae043f6dd0813b000d928c4bda172660
Additions:
zephyr: module: Add module file for tf-m-tests

https://github.com/ARM-software/psa-arch-tests.git
Upstream: 60faad2ead1b967ec8e73accd793d3ed0e5c56bd
Additions:
zephyr: module: Add module file for psa-arch-tests
psa-arch-tests: Allow overriding of toolchain file

The organization of folders remain the same with the following
exceptions:
Moved:
root folder moved from modules/tee/tfm to modules/tee/tf-m to avoid
problems with west update.
zephyr/module.yml to trusted-firmware-m/zephyr/module.yml and
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR} points to what was previously
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m.
Added:
psa-arch-tests/zephyr/module.yml and ${ZEPHYR_PSA_ARCH_TESTS_MODULE_DIR}
tf-m-tests/zephyr/module/ and ${ZEPHYR_TF_M_TESTS_MODULE_DIR}
Removed:
init-git.sh
README.rst

Fixes: #39353

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-01 11:20:06 -04:00
Joakim Andersson 8c09cd374f modules: trusted-firmware-m: Use module location variable for .pem keys
Use the zephyr module dir variable for the trusted-firmware-m root
folder. Update documentation to TF-M documentation in
tfm-secure-boot.rst.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-01 11:20:06 -04:00
Martin Jäger ec576a59d3 canbus: canopen: Use new API to check number of filters
The previous CONFIG_CAN_MAX_FILTER is specific to certain drivers.

Using the new API makes the CAN open driver independent of the used
CAN hardware / driver.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-10-28 13:56:58 -04:00
Immo Birnbaum ee7ac70c10 modules: cmsis: add core_ca inclusion for aarch32 Cortex-A SoCs
Add the inclusion of the Common Peripheral Access Layer for aarch32
Cortex-A SoCs in combination with the respective SoC's header file,
in which the feature flags evaluated in core_ca.h must be provided.

The corresponding CMSIS include path is added to the build by setting
the HAS_CMSIS_CORE_A Kconfig item for all aarch32 Cortex-A CPUs.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@Weidmueller.com>
2021-10-28 15:26:50 +02:00
Gerson Fernando Budke 087be00b58 soc: arm: Introduce gigadevice soc
Add gigadevice soc initial version.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-10-28 11:17:25 +02:00
Gerson Fernando Budke 6d8c03422c modules: Add gigadevice hal module
This add access to modules/hal/gigadevice with three firmware
libraries by updating west.yaml file:

 - GD32E10X ARM (Cortex-M4F)
 - GD32F403 ARM (Cortex-M4F)
 - GD32VF103 RISC-V (Nucleisys Bumblebee core)

It introduce module/hal_gigadevice, which contains all Cmake
and Kconfig rules to build GigaDevice SoCs into zephyr main
tree.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2021-10-28 11:17:25 +02:00
Joakim Andersson 4748777126 modules: tfm: Fix not defined configuration for TF-M log options
Fix configuration options for TF-M log levels configured to an empty
string when not defined. This can happen when none of the options
have been selected due to dependencies not being met.
For example when TFM_MINIMAL=y then TFM_PARTITION_LOG_LEVEL will not be
defined.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-10-27 10:51:34 +02:00
Andrei Auchynnikau 3b3a30612f drivers: add adc driver for the NXP RT series
adc driver is based on the NXP MCUX hal library

Signed-off-by: Andrei Auchynnikau <ovchinnikov@strim-tech.com>
2021-10-22 15:43:36 -05:00
Yuval Peress f6f24a2a79 modules: Add fff mocking framework
Issue #38643

Introduce a more powerful and well established mocking framework
into Zephyr. It also allows running the actual FFF tests using the
zephyr SDK and ztest framework to ensure compatibility.

As per TSC meeting, the fff.h header was directly added to
subsys/testsuite/include/. As per the guidelines, the file is exactly
the same as it is in FFF's library, but re-styled with clang-format.

The west.yml entry was added using the "ci" group and filtered by
default. (note that the tests will break until the CI actually
specifies that the group is needed).

Signed-off-by: Yuval Peress <peress@google.com>
2021-10-22 09:43:13 -04:00
David Brown 1491551ca6 modules: Allow for Mbed TLS module to match upstream
Use the Mbed TLS module, expecting the upstream directory layout rather
than the nested directory we've been using before.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-10-18 09:51:06 -05:00
Joakim Andersson 70a9bc0e57 modules: tfm: Add configuration for TF-M log options
Add Kconfig options for configuring TF-M log options.
 - Partition log level
 - SPM log level
 - Exception info dump

Set log level to "info" which is the default in upstream TF-M.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-10-17 11:50:53 -04:00
Joakim Andersson f26f416e74 modules: tfm: Remove duplicate tfm cmakecache config
Remove duplicated setting of TF-M CMakeCache.txt entry TFM_BOARD.
In addition it is also wrong since the CONFIG_ prefix is missing.

Leftover from: 583d5a6db3

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-10-17 11:50:53 -04:00
Sebastian Bøe 3a3e3c041b tfm: build: Build TF-M with 1 thread on Windows
Don't build TF-M in parallel on Windows as it has been reported to
expose dependency issues with the TF-M build system.

These issues will be investigated at a later time.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2021-10-13 10:12:57 -04:00
Manivannan Sadhasivam d66a745d64 modules: loramac-node: Fix the build issue for US915 and AU915 regions
These 2 regions depends on the RegionBaseUS.c file.

Fixes: #39297

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2021-10-12 15:22:04 -04:00
Joakim Andersson 0f53679859 modules: tfm: Use ZEPHYR_<MODULE>_MODULE_DIR instead of relative paths
Use ZEPHYR_<MODULE>_MODULE_DIR instead of relative paths. Moving the
module folder would otherwise break the build system.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-10-11 21:05:30 -04:00
David Brown 7d8640aec3 modules: mbedtls: Fix buffer size configs for 3.0
Mbed TLS 3.0 changes the configuration defines used to determine the
buffer size used for TLS.  We were still setting the old one, which was
causing Mbed TLS to revert back to the large default buffer size.  Set
both the in and out buffer sizes to match the config setting.  A future
improvement may be to separate this into two configurations within the
Zephyr config.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-10-07 14:02:40 -05:00
Sebastian Bøe e3b3afa7a5 tfm: Fix zephyr-sdk toolchain variant integration
The psa-arch-tests project changed how third-party toolchains are
integrated. This broke the Zephyr sdk.

This patch aligns with the new mechanism.

https://github.com/ARM-software/psa-arch-tests/pull/276

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2021-10-07 14:02:40 -05:00
Flavio Ceolin 0f39eac07c modules: mbdetls: define MBEDTLS_SHA224_c
Newer versions of mbedTLS require MBEDTLS_SHA224_C definition to use
sha256.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-10-07 14:02:40 -05:00
Frank Audun Kvamtrø fb90efef1b modules: mbedtls: Allow custom mbedtls implementation
-The current scheme in zephyr has the two choices MBEDTLS_BUILTIN
 and MBEDTLS_LIBRARY, but the choice of MBEDTLS_LIBRARY requires
 setting CONFIG_MBEDTLS_INSTALL_PATH for includes and library linking.
 This may not be neccesary when an alternative implementation of the
 library is being used. This adds support for custom choices in
 MBEDTLS_IMPLEMENTATION which can be added in an out-of-tree Kconfig
 file.
-Made else an elseif(CONFIG_MBEDTLS_LIBRARY.
-Removed reduntant assertion between the two choices.

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
2021-09-29 15:32:40 -04:00
Pieter De Gendt 4e2bb0e762 drivers: hwinfo: add reset cause support for iMX RT series
Add a shim driver to get/clear the reset reason on NXP i.MX
RT controllers

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-09-29 14:44:21 -04:00
Gregers Gram Rygg d47bd60933 soc: nordic_nrf: Add Kconfig option for enabling trace port
Add Kconfig option to enable the hardware trace port in the SystemInit()
function.

Signed-off-by: Gregers Gram Rygg <gregers.gram.rygg@nordicsemi.no>
2021-09-28 20:11:40 -04:00
Torsten Rasmussen 9b43e7a23d modules: hal_nxp: removing always empty zephyr_library
No sources were ever added to the `zephyr_library()` defined in
modules/hal_nxp/usb/CMakeLists.txt, thus removing this lib to avoid
the warning:

> No SOURCES given to Zephyr library: modules__hal_nxp__usb
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Tom Owen d63d828c8f stm32: Add FMAC support to Kconfig
This commit adds FMAC HAL and LL drivers to the Kconfig system
Required to enable Filter Math Accelerator (FMAC)
 on STM32G4/H7 devices

Signed-off-by: Tom Owen <tom.owen@zepler.net>
2021-09-15 22:36:49 -04:00
Frank Audun Kvamtrø c91efdf939 modules: tfm: Override the TF-M MBEDCRYPTO_PATH
The TF-M build is passed a path to the mbedtls project
directory, however, NCS has its own mbedtls variant. When
building with TF-M we use a generator expression to allow
setting the path to mbedtls from nrf_security.

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-30 17:08:34 -04:00
Stephanos Ioannidis 2e5204b785 modules: cmsis_dsp: Update configs for CMSIS-DSP 1.9.0 (CMSIS 5.8.0)
This commit updates the CMSIS-DSP configurations for the CMSIS-DSP
1.9.0, which is part of the CMSIS 5.8.0 release.

Note that the Helium/MVE configurations are removed because CMSIS-DSP
now automatically selects them if available.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-08-30 18:17:47 +02:00
Joakim Andersson fb90113dc8 modules: hal_nordic: Add nrf51 MDK defines needed to apply nrf51 erratas
Add nrf51 MDK defines needed to correctly select the nrf51 erratas
needed on the specific SoCs. The nrf51_erratas.h header file only uses
these defines to check which erratas should be applied.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-30 15:48:19 +02:00
Toby Firth 893bfc0fc1 drivers: counter: added ctimer driver for lpcexpresso55s69
Added shim driver for the CTIMERs for the lpcexpresso55s69 board.

Fixes: #22705

Signed-off-by: Toby Firth <tobyjfirth@gmail.com>
2021-08-24 17:13:22 -04:00
Andrzej Głąbek 72e3bfe1c0 soc: nordic_nrf: Add Kconfig options for APPROTECT handling
Add Kconfig options that allow users to select the way the APPROTECT
mechanism is handled in the SystemInit() function.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-24 07:27:12 -04:00
Lauren Murphy 6cf73956c8 modules: tflite-micro: fix cmakelists.txt
Adds *_common.cc files to fix undefined references during build
of updated samples. Remove unnecessary LICENSE files. Remove
unnecessary header files in zephyr_library_sources().

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Lauren Murphy 804285ae63 modules: update tensorflow to tflite-micro
Updates west manifest and module folder name to point to new
TensorFlow Lite Micro repo Google recently pulled out of
the TensorFlow repo.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Mahesh Mahadevan 1939d48dbb modules: hal_nxp: Updates for LPC USB
Add the defines to add support for LPC USB

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-19 17:19:11 -04:00
Mahesh Mahadevan 36c9ffe8ec modules: mcux: Add support for LPC USB
Add support for LPC USB controller

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-19 17:19:11 -04:00
Mahesh Mahadevan a69bd75bd8 modules: hal_nxp: Move NXP USB file to modules folder
Move USB file to from modules/hal_nxp to zephyr/modules
folder

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-13 12:51:46 -04:00
Kumar Gala 689864ebe0 modules: hal_nxp: tweak integration to utilize cmake-ext/kconfig-ext
Update zephyr side to handle hal_nxp using cmake-ext/kconfig-ext.  This
allows for having zephyr specific integration code live with the zephyr
source tree.

For now on the cmake side we just use add_subdirectory() of the hal_nxp
repo so the integration is effectively transparent.

For Kconfig we add a place holder Kconfig file since the hal_nxp repo
doesn't have any Kconfig files in it currently.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-11 12:26:28 -05:00
Paweł Kwiek da8f9d77c4 modules: hal_nordic: Increase number of serialization buffers
This commit increases number of available serialization buffers to
account for possible delays caused by serialization itself and
processing on the application core.

Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2021-08-11 11:47:10 +02:00
Paweł Kwiek b7bd1be622 hal_nordic: Rework nRF IEEE 802.15.4 temperature update module
This commit reworks nRF IEEE 802.15.4 temperature update module to save
resources, otherwise used to create thread, by using work queue.

Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2021-08-09 17:52:58 +02:00
Przemyslaw Bida 082efb4e9d hal_nordic: Adjust temperature sensor stack size.
This commit extends size of stack used by IEEE 802.15.4 radio
temperature sensor. This commit fixes stack overflow issue in
echo_server sample for OpenThread.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2021-07-31 14:57:19 -04:00
Mahesh Mahadevan 5f636286d3 drivers: pwm: Add PWM support for NXP LPC devices
Add PWM support using the LPC SCTimer module

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-07-30 13:08:03 -05:00
Håkon Øye Amundsen 881b877eca modules: tfm: add configuration for disabling the RNG module
A new configuration is available in TF-M, for disabling RNG
independent from key derivation. Introduce a corresponding
Kconfig option to control the RNG API enabling/disabling from
Zephyr.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 20:09:58 +02:00
Ioannis Glaropoulos 138be0a080 modules: tf-m: allow DOWNLOAD option for mcuboot
Allow developers the option of using the DOWNLOAD option
for MCUboot in TF-M bulds with BL2. Using MCUboot from
Zephyr is still the default option.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos aa3bd927df modules: tf-m: add TFM_BL2 dependency on TFM_MCUBOOT_IMAGE_NUMBER
TFM_MCUBOOT_IMAGE_NUMBER Kconfig option should have
a dependency on TFM_BL2, since it is not applicable
otherwise.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos 5e6503f6a7 manifest: remove mcuboot version for TF-M in Zephyr
We remove the tfm-mcuboot module in Zephyr (which hosts the
mcuboot version that is used for TF-M builds in Zephyr). We
will force TF-M builds in Zephyr to  use the MCUboot version
that any Zephyr builds are using. This will allow Zephyr to
maintain a single mcuboot module version in its default
manifest.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos d42671737e modules: tf-m: supply NXP HAL directory path for builds for LPC
For TF-M builds on LPCXPRESSO55S69 we set the path to the
NXP HAL sources that are required for building TF-M for this
platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos 101e32f1d1 modules: tf-m: update target names for arm targets
Upstream TF-M has modified the path name for ARM platforms,
so we fix the board names in the module integration code.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Pawel Kwiek b2487e3c88 manifest: Update hal_nordic
This commit adds temperature platform used by the IEEE 802.15.4 Radio
Driver. The new platform requires an enabled temperature sensor.
The new hal_nordic revision updates the nRF 802.15.4 component.

Signed-off-by: Pawel Kwiek <pawel.kwiek@nordicsemi.no>
2021-07-23 15:54:59 -04:00
Yuriy Vynnychek 4b0b1e0eee modules: hal_telink: introduce new HAL Telink module
This commit introduce new HAL Telink module used by
new Telink B91 RISC-V platform drivers.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-07-21 05:37:12 -04:00
Mahesh Mahadevan db162bb05d counter: Add counter support for rt600
Add counter support using the RTC for RT600

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-07-16 18:56:15 -04:00
Marcin Niestroj 84c5a469ab module: mbedtls: add shell module
Add mbedTLS specific shell module, which allows (for now) to show heap
allocation statistics.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-07-14 21:14:35 -04:00
Kevin Townsend 703021a78a boards: arm: nrf9160dk_nrf9160: Rename NS target
This commit updates the NS board variant from
`nrf9160dk_nrf9160ns` to `nrf9160dk_nrf9160_ns`
to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend b8c9dc169e boards: arm: nrf5340dk_nrf5340: Rename NS target
This commit updates the NS board variant from
`nrf5340dk_nrf5340_cpuappns` to `nrf5340dk_nrf5340_cpuapp_ns`
to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend 58638563b5 boards: arm: bl5340_dvk: Rename NS target
This commit update the NS board variant from `bl5340_dvk_cpuappns`
to `bl5340_dvk_cpuapp_ns` to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Henrik Brix Andersen f1fe5212b9 modules: mcux: add support for indicating the presence of RCM
Add Kconfig option for indicating that a given SoC contains the NXP
Kinetis Reset Control Module (RCM).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Henrik Brix Andersen 4216b9f622 modules: canopennode: rename header and Kconfig options
Rename the top-level header file from <canbus/canopen.h> to
<canopennode.h>.

Rename CANopenNode related Kconfig options from CONFIG_CANOPEN* to
CONFIG_CANOPENNODE*.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-01 13:32:18 -04:00
Henrik Brix Andersen d679037643 modules: canopennode: move glue code to modules directory
Move the Zephyr-specific interface and support code for CANopenNode into
the modules directory. Consolidate the CMakeLists.txt files into one.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-01 13:32:18 -04:00
Ryan QIAN 2883d727a7 drivers: clock_control: add ccm driver for rt117x
- add ccm driver for rt117x

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2021-06-29 11:30:00 -04:00
Ioannis Glaropoulos bbcd7ef7cd trusted-firmware-m: rename AN521 target to BOARD_MPS2_AN521_CPU0_NS
Since we now have separate Kconfig symbols for the different
MPS2 AN521 board variants, we need to update the BOARD switch
for the TF-M target on MPS2 AN521.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-22 08:45:41 -04:00
Øyvind Rønningstad 583d5a6db3 tfm: Refactor the TF-M Cmake code to simplify and remove the function
The current CMakeLists.txt contains a function that is called from
the same file.

This patch removes the abstraction, allowing to remove many
lines of parameter handling.

Additionally, with this patch, the Cmake argument handling is now
done via a list, which removes many more named variables.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-06-22 08:45:20 -04:00
Lukasz Maciejonczyk 4185e8e515 modules: hal_nordic: add Kconfig option for frame auth and encryption
New option enables/disables frame encryption module, security writer
module and IE writer module.

The new hal_nordic revision updates the nRF 802.15.4 component.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-06-22 08:22:02 -04:00
Torbjörn Leksell 5a4070953d Tracing: TraceRecorder CMake update
- Fixed some incorrect streamport references that pointed to the
base streamport files instead of those dedicated for Zephyr.
- Updated the source file compilation to match the updated
TraceRecorder module.

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-18 08:08:07 -05:00
Ilya Tagunov 05957b66cb lorawan: update LoRaMac-node and move CMakeLists.txt to the main repo
Update the LoRaMac-node library to the last stable release and fix
the Zephyr glue code to match it. Move CMakeLists.txt to the main
Zephyr repository to simplify loramac-node module maintenance.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-06-18 11:22:03 +02:00
Devaraj Ranganna 29ca4aaba2 modules: trusted-firmware-m: Set TF-M isolation level
The CMake variable `TFM_ISOLATION_LEVEL_ARG` was not properly set when
application configures higher isolation level. This led to isolation
level always being to set 1.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-16 10:02:34 +02:00
NavinSankar Velliangiri c9aa260f0c samples: compression: lz4: lz4 sample application
This PR add sample application for minimal lz4 library.

lz4 library RFC requested here: #28535

Fixes: #26648

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2021-06-12 17:21:55 +02:00
Torsten Rasmussen 7cc52f88c3 cmake: tfm: moving CMake execution of tfm_cmake to a custom command
Fixes: #36101

The move of CMake invocation to a dedicated custom target, see #34868
results in tfm_cmake to always be considered out-of-date, causing CMake
to be reinvoked in the TF-M Binary dir, which again results in the
build command to rebuild.

This commit moves the invocation to a custom command with the
CMakeCache.txt as output. The custom target tfm_cmake is updated to
depend on CMakeCache.txt.

This mean that CMake for TF-M will only be invoked inside the Zephyr
build command if that file is missing.

If the CMakeCache.txt file is updated or TF-M CMake or source code is
modified, then the build command inside the TF-M build folder will
ensure correct re-run of CMake from within the TF-M build folder.

This ensures that TF-M will still rebuild if TF-M code is modified,
while at the same time avoid unnecessary rebuilds of TF-M code.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-06-11 16:37:22 -05:00
Ioannis Glaropoulos ce757d5970 modules: tfm: remove redundant if BUILD_WITH_TFM guard in Kconfig
We do not need the if BUILD_WITH_TFM guard in the main
Kconfig file, as the guards are present insude the respective
Kconfig files that are sourced by the main Kconfig.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-11 16:13:57 +02:00
Håkon Øye Amundsen 207f2ab1e6 modules: tf-m: split TF-M configuration in multiple Kconfig files
The TF-M project is higly configurable and we end up having
a growing number of Kconfig option definitions in the main
Kconfig file. This commit splits out the configuration options
for the TF-M partition and for the crypto partition configuration
into separate Kconfig files, for ease of reading. The commit
does not introduce behavioral changes.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-11 16:13:57 +02:00
Øyvind Rønningstad 382bbacb0a tfm: Put saving of FPU context into its own file so it can be reused
Also, this eases readability.

The new API can be used any time all FP registers must be manually
saved and restored for an operation.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-06-07 15:23:22 +02:00
Ioannis Glaropoulos bf87f98fa4 modules: tf-m: fix NS image selection for regression tests
When running with TFM Regression option set, but without
BL2 (MCUboot) we need to use the TF-M's NS binary, and not
the Zephyr application. This was selected properly for the
case with MCUboot boot already, but not when running the
regression tests without MCUboot.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-04 16:21:42 -05:00
Håkon Øye Amundsen f8a9e0019c modules: tfm: add option for selecting crypto modules
These are needed to disable not needed crypto modules in
the trusted-firmware-m module.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-04 16:21:24 -05:00
Devaraj Ranganna 7273603707 modules: tf-m: Add Crosstool-NG toolchain support
Zephyr SDK is not supported on OS X, however, Zephyr toolchain can be
built on OS X using Crosstool-NG.

Currently, trusted-firmware-m CMakeLists.txt only supports `zephyr` and
`gnuarmemb` toolchains which prohibits building TF-M on OS X using
Zephyr toolchain built with Crosstool-NG.

docs:
https://docs.zephyrproject.org/latest/getting_started/toolchain_3rd_party_x_compilers.html#crosstool-ng

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-04 16:16:05 -05:00
Øyvind Rønningstad c2efcc308c tfm: interface: Fix bug where FPU registers were not restored correctly
The caller saved registers were restored both as caller saved and
callee saved registers, i.e. register 0-15 were restored into
both register 0-15 and 15-31.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-06-04 11:12:49 -05:00
Robert Lubos 6ca92495e5 modules: mbedTLS: Add separate Kconfig entry for MBEDTLS_HAVE_TIME_DATE
Currently the MBEDTLS_HAVE_TIME_DATE mbedTLS option is enabled based on
the CONFIG_POSIX_API option. This doesn't seem right, since the enabling
the POSIX API does not guarantee that there is a valid time source in
the system. This was the case for the qemu_x86 platform, where enabling
POSIX_API caused TLS handshake failures due to certificate validation
errors caused by no valid time avaialble in the system.

Fix this by adding a specific KConfig entry for date/time configuration
in mbedTLS. Applications that need to enforce date verification in
mbedTLS should enable it explicitly instead of relying on the
non-obvious implicit configuration.

Fixes #35401

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-06-01 07:30:15 -05:00
Aurelien Jarno cbb2a9be77 logging: Enable SWO support for nRF SOCs
The nRF SOCs declare support for SWO using the HAS_SWO define. In
addition, the SWO pin has to be configured at runtime, which is done
through the Nordic HAL by defining ENABLE_SWO.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-05-18 12:28:25 -05:00
Torsten Rasmussen 00bd442936 tfm: cmake: added CMAKE_ARGS as argument to trusted_firmware_build
Follow-up: #34868

The CMAKE_ARGS was accidentally lost during work on #34868.
This commit fixes that by re-adding `CMAKE_ARGS` as multi value arg.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-18 16:20:14 +02:00
Torsten Rasmussen 2656e6a682 kconfig: TraceRecorder Kconfig file for undefined symbols
Follow-up: #34843

This commit is a followup to PR #34843.
The Zephyr subsys/tracing/Kconfig file has a
`depends on ZEPHYR_TRACERECORDER_MODULE` but that symbol is only
available when the module is part of the manifest.

This commit adds the second part of the comment:
https://
github.com/zephyrproject-rtos/zephyr/pull/34843#discussion_r628154265

To ensure all Kconfig symbols are defined.

Without this commit, users without TraceRecorder will see following
checkpatch error:
```
ERROR   : Test KconfigBasic failed: Undefined Kconfig symbols:

warning: undefined symbol ZEPHYR_TRACERECORDER_MODULE:

- Referenced at subsys/tracing/Kconfig:35:

config PERCEPIO_TRACERECORDER
        bool "Percepio Tracealyzer support"
        select THREAD_NAME
        select INIT_STACKS
        select THREAD_MONITOR
        depends on ZEPHYR_TRACERECORDER_MODULE && <choice>
```

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-11 13:00:05 -05:00
Ioannis Glaropoulos 81e9ea5cad config: using CONFIG_MBEDTLS_USER_CONFIG_FILE as safeguard
Now using CONFIG_MBEDTLS_USER_CONFIG_FILE instead of
CONFIG_MBEDTLS_USER_CONFIG_ENABLE for inclusion of user config file.

The Kconfig MBEDTLS_USER_CONFIG_ENABLE setting now now determines if
MBEDTLS_USER_CONFIG_FILE is visible.

This removes the problem of MBEDTLS_USER_CONFIG_FILE to be stuck on its
first value.

Users can use MBEDTLS_USER_CONFIG_ENABLE to get the prompt and define
their own value.

As the CONFIG_MBEDTLS_USER_CONFIG_FILE is default promptless then we can
use this setting directly as it will only be defined if another Kconfig
file specifies a default value to use, or user enables:
MBEDTLS_USER_CONFIG_ENABLE.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 15:24:23 -05:00
Torsten Rasmussen 5888428541 mbedtls: kconfig: created MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE
Introducing MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE settings.
The MBEDTLS_PROMPTLESS can be set to true whenever configuration of
mbedTLS is done from a subsystem or module.

Such an example is OpenThread, which selects mbedTLS for some predefined
crypto settings using OPENTHREAD_MBEDTLS=y.

Unfortunately, extensive use of select can easily cause stuck symbol
syndrome making it harder than neccesarry for users to later reconfigure
as they easily get stuck in incompatible configurations.

Providing a MBEDTLS_PROMPTLESS allows such configurations to disable the
MBEDTLS prompt itself when selected but avoid stuck symbol if user
select another security configuration.

Similar with CUSTOM_MBEDTLS_CFG_FILE which ensures that user must
explicitly select this symbol before providing a custom mbedTLS config
file.

Today, other parts the Kconfig tree may set a default value for
MBEDTLS_CFG_FILE but that value is stuck and thus changed Kconfig
selections elsewhere in the tree will not adjust the value.

Introducing CUSTOM_MBEDTLS_CFG_FILE ensures it is known when the user
has provided the value.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 15:24:23 -05:00
Torsten Rasmussen c5097101f3 mbedtls: kconfig: MBEDTLS_USER_CONFIG_FILE default without a prompt
This commit removes the prompt from MBEDTLS_USER_CONFIG_FILE unless
MBEDTLS_USER_CONFIG_ENABLE is true.

This fixes issues where other parts would specify a default value for
MBEDTLS_USER_CONFIG_FILE that would become stuck and not updated if
user re-configured the system using menuconfig.

Disabling the prompt ensures that only when a user specifically enables
MBEDTLS_USER_CONFIG_ENABLE and specify a custom user value in
MBEDTLS_USER_CONFIG_FILE the setting will be fixed.

Also updates the manifest with related change in the mbedtls project.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 15:24:23 -05:00
David Brown 4164b17034 modules: mbedtls: Enable PKCS1 v2.1
This Mbed TLS configuration option was being selected based on a
non-existent Kconfig option, and hence would never be defined.  v2.1 of
PKCS1 was published in 2003.  Use of v1.5 has been deprecated since
2016, and should not be used in new or existing designs.

Enable the v2.1 version in any situation where RSA is used for
signatures.  In the future, we should disable v1.5 entirely, but only
after all uses have been determined and possibly corrected.

No significant weaknesses have been found in v1.5, however v2.1 has a
significant security proof.  However, v2.1 does require an entropy
source, which may be an issue in some embedded device situations (which
likely are problematic for other cryptographic reasons).

Signed-off-by: David Brown <david.brown@linaro.org>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos c5b4094cfb modules: tf-m: do not expose TF-M NS interface include directories publicly
Instead of exposing publicly the TF-M NS interface include
directories, we include them when we build relevant projects.
This is required, as the TF-M include directories contains
psa crypto sources that are also provided by the mbedtls
crypto module. The downside of this solution is that the
TF-M includes need to be added explicitly in each application
that uses TF-M APIs.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos d0073fdf7e modules: trusted-firmware-m: add path for mbedcrypto
Define the MBEDCRYPTO_PATH variable for the TF-M build,
so the latter can used a checked-out version of mbedtls,
instead of pulling an external tree during build time.
This will make Zephyr builds with TF-M must faster.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos 1a7f9598ba modules: mbedtls: updates to reflect module directory restructuring
Updates in CMakeLists.txt to reflect the restructuring
in the module directory. This also bumps mbetls version
to 2.26.0.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos 1eccc71cc2 modules: mbedtls: move the configs into the main tree
Move the mbedtls configs directory in the main tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos 67aadc2ef4 modules: mbedtls: add name for implementation choice symbol
Add a name for the Kconfig choice symbol
indicating the mbedtls implementation.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos c48c50db42 modules: mbedtls: move CMakeLists.txt. into the main tree
We move the Zephyr-specific CMakeLists.txt file into
the main Zephyr tree. We also move the zephyr_init.c
source file.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos 39c917788f Revert "mbedtls: kconfig: created MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE"
This reverts commit 1ad1acd7c9.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos 505b03018c Revert "mbedtls: kconfig: MBEDTLS_USER_CONFIG_FILE default without a prompt"
This reverts commit 47fb09210b.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Anas Nashif 0e3771bc82 modules: add segger module locally, and update to 3.30
Move Zephyr related files into modules/ and update to 3.30

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-08 17:06:24 -04:00
Torsten Rasmussen 47fb09210b mbedtls: kconfig: MBEDTLS_USER_CONFIG_FILE default without a prompt
This commit removes the prompt from MBEDTLS_USER_CONFIG_FILE unless
MBEDTLS_USER_CONFIG_ENABLE is true.

This fixes issues where other parts would specify a default value for
MBEDTLS_USER_CONFIG_FILE that would become stuck and not updated if
user re-configured the system using menuconfig.

Disabling the prompt ensures that only when a user specifically enables
MBEDTLS_USER_CONFIG_ENABLE and specify a custom user value in
MBEDTLS_USER_CONFIG_FILE the setting will be fixed.

Also updates the manifest with related change in the mbedtls project.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-08 07:11:00 +02:00
Torsten Rasmussen 1ad1acd7c9 mbedtls: kconfig: created MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE
Introducing MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE settings.
The MBEDTLS_PROMPTLESS can be set to true whenever configuration of
mbedTLS is done from a subsystem or module.

Such an example is OpenThread, which selects mbedTLS for some predefined
crypto settings using OPENTHREAD_MBEDTLS=y.

Unfortunately, extensive use of select can easily cause stuck symbol
syndrome making it harder than neccesarry for users to later reconfigure
as they easily get stuck in incompatible configurations.

Providing a MBEDTLS_PROMPTLESS allows such configurations to disable the
MBEDTLS prompt itself when selected but avoid stuck symbol if user
select another security configuration.

Similar with CUSTOM_MBEDTLS_CFG_FILE which ensures that user must
explicitly select this symbol before providing a custom mbedTLS config
file.

Today, other parts the Kconfig tree may set a default value for
MBEDTLS_CFG_FILE but that value is stuck and thus changed Kconfig
selections elsewhere in the tree will not adjust the value.

Introducing CUSTOM_MBEDTLS_CFG_FILE ensures it is known when the user
has provided the value.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-08 07:11:00 +02:00
Anas Nashif 1af037f477 modules: enable percepio tracerecorder for tracing
Add support for percepio tracealyzer.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 22:10:21 -04:00
Torsten Rasmussen b671cf7279 cmake: tfm: support for custom CMake args when building TF-M
This commit allows a subsystem to specify additional CMake flags to be
given to the TF-M build.

The additional CMake flags can be provided through the TFM_CMAKE_OPTIONS
property on the zephyr_property_target.
Using the zephyr_property_target allows Zephyr modules to append extra
TFM_CMAKE_OPTIONS regardless of the CMake processing order.

It splits the ExternalProject_Add into a two step process with the CMake
invocation executed using add_custom_target() and the build process
using ExternalProject_Add(). The reason for this split is because CMake
generator expressions passed through ExternalProject_Add to CMake will
quoted so that `$<TARGET_PROPERTY:<tgt>,<prop>>` becomes
`"-DFOO=bar -DBAR=foo"` instead of `-DFOO=bar -DBAR=foo` which again
results in CMake failures.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-07 13:09:54 +02:00
Jamie McCrae f4350a9303 boards: arm: Add Laird Connectivity BL5340 DVK platform
This adds initial support for the Laird Connectivity BL5340
development kit hardware

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-05-07 09:06:27 +02:00
Øyvind Rønningstad 0500d75c3a tfm: Fix cmake library handling
Make tfm_api a proper Zephyr library and add all sources to it.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-05-05 15:36:32 +02:00
Øyvind Rønningstad aed0643705 trusted-firmware-m: Store FP context before entering secure calls
When ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS is enabled, if FPU is
being used (CONTROL.FPCA == 1), store all FP registers before
entering the secure function, and restore them afterwards.

This is needed if any NS thread or ISR that interrupts the secure
function uses FP registers. If they do, a secure UsageFault occurs
unless this change is applied.

This allows k_sched_lock() and k_sched_unlock() to be dropped when
ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS is enabled.

Enable ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS by default when
building TF-M.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-05-05 13:00:31 +02:00
Lauren Murphy a010d9152d modules: add tensorflow
Adds Kconfig option enabling TensorFlow Lite Micro support.
Updates manifest with TensorFlow module.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Mahesh Mahadevan bc0e3492c1 modules: Add OS timer support
OS Timer support

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-21 20:40:24 -04:00
Andreas Vibeto 0cf2753fa3 CMakeLists.txt: Add support for TF-M Non-Secure regression tests
Add new kconfigs
Include the ns-app built by TF-M build system for regression tests
Update tfm_ipc sample to use new kconfig

Signed-off-by: Andreas Vibeto <andreas.vibeto@nordicsemi.no>
2021-04-21 23:18:30 +02:00
Øyvind Rønningstad b220374633 CMakeLists.txt: Add support for running PSA tests
Add necessary libs and files to the build
Add support for new kconfigs
Add Zephyr-only implementations of tfm_log and tfm_ns_interface.
Add zephyr_tfm_psa_test.c for easily running PSA tests.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-20 16:13:40 +02:00
Øyvind Rønningstad a0eecfd7f4 tfm: Kconfig: Add configs for PSA tests
Allow adding a PSA test suite to the NS app.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-20 16:13:40 +02:00
Ioannis Glaropoulos e75ff8f7fb modules: trusted-firmware-m: fix dependencies for isolation level
Do not allow the TFM_ISOLATION_LEVEL to be non-hidden option,
if the TFM_IPC (PSA_API) option is not set, since, in that case,
only Isolation Level 1 is supported.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-16 13:33:32 +02:00
Pieter De Gendt b6979736ca modules: nanopb: introduce new module
Add the nanopb library and generator tools as a module.
Nanopb is a small code-size Protocol Buffers implementation in ansi C.
It is especially suitable for use in microcontrollers,
but fits any memory restricted system.

Nanopb home: https://jpa.kapsi.fi/nanopb/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-08 14:57:55 +02:00
Ioannis Glaropoulos b80ad4c4b3 modules: tf-m: add TF-M profile choice
We add a Kconfig choice for the TF-M profile, in
TF-M's Kconfig file. The reason for that is to be
able to easily enable additional configurations,
depending on the profile type being selected. We
also enhance the documentation of TFM_PROFILE,
stressing that there is now also profile_large
available as an option. TFM_PROFILE is now made
hidden, forcing the users to select one of the
available choice symbols. IF the TFM_PROFILE is
set to something other than "none", then certain
options shall be made hidden, namely, IPC and
isolation level, as they are determined by the
profile setting.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-08 13:26:14 +02:00
Ioannis Glaropoulos 79c1019e85 modules: tf-m: correct dependencies for audit log service
Add a dependency on IPC for the Audit Log secure service,
since the service is not compliant with the IPC model.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-08 13:26:14 +02:00
Ioannis Glaropoulos 70272266f7 Revert "modules: tf-m: disable audit log partition with medium profile"
This reverts commit 6da3d7020e7d2a2ac2d1ed1a6ece9dca3c150339.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-08 13:26:14 +02:00
Jedrzej Ciupis 0a75e0551f modules: hal_nordic: nrf_802154: Fix RADIO IRQ handling configuration
This commit fixes nRF 802.15.4 radio driver IRQ management
configuration.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-04-07 14:17:22 +02:00
Rafał Kuźnia 9638876bde modules: hal_nordic: change the SL type prompt
The SL type choice option prompt was renamed to be short and concise.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-04-01 14:08:08 +02:00
Rafał Kuźnia 859952f590 modules: hal_nordic: add new nrf-802154 glue cmake
Update revision of hal_nordic which introduces new radio driver
integration scheme.

The glue cmake has been updated to use the new integration scheme
for the nrf-802154 component.

Added config option to exclude radio driver in hal_nordic from the
build process. This allows the radio driver to be supplied from
other sources.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-04-01 14:08:08 +02:00
Rafał Kuźnia 88b1d1f047 modules: hal_nordic: Remove default from SL type choice
The default value is not needed because there is only one choice.
This allows the default choice to be set in a different module.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-04-01 14:08:08 +02:00
Ioannis Glaropoulos edd4ab5bf0 modules: tf-m: disable audit log partition with medium profile
When compiling TF-M with profile_medium, disable the support
for Audit Log due to an upstream bug.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Ioannis Glaropoulos 9b9a6a3f52 modules: trusted-firmware-m: lock scheduler around secure calls
Prevent a thread from being preempted, while executing a Secure
function. This is required to prevent system crashes that could
occur if a thead context switch is triggered in the middle of a
Secure call.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Øyvind Rønningstad 6fa608b191 modules: tf-m: Add zephyr native NS interface and logging function
To allow using TFM NS interface without enabling
CMSIS_RTOS V2 support. And to allow using TFM NS
code that uses logging.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Ioannis Glaropoulos e6965b37f0 modules: trusted-firmware-m: initialize the TF-M NS interface
The TF-M NS interface needs to be initialized before
it is used. We add an initialization function that
calls tfm_ns_interface_init(), at boot time, so then
we can use TF-M interface calls (veneers).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Ioannis Glaropoulos 261a659899 trusted-firmware-m: override sys_arch_reboot for non-secure builds
In ARM Non-Secure builds with TF-M it is not, generally,
possible to issue system reset requests from Non-Secure
domain. When the Platform SPM Partition is enabled, the
tfm_platform_system_reset(.) API can be used to request
system resets from TF-M. This commit overrides the weak
sys_arch_reboot() implementation in scb.c so Non-Secure
code is able to issue system resets.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Ioannis Glaropoulos 3fde19ec26 trusted-firmware-m: include interface sources to the build
Instruct CMake to include interface libraries when
building a Non-Secure ARM target with TF-M. In
particular, include the reboot.c source file, which
overrides the sys_arch_reboot implementation.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Øyvind Rønningstad 869978ab0d tfm: Fix TFM_BOARD for MUSCA_B1
Also add it to tfm_ipc so it is built by CI

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-03-26 11:20:10 -05:00
Øyvind Rønningstad 41eedf8ae5 tfm: Adapt to changes upstream
Rename lib.
Disable AUDIT_LOG in regression sample because of a bug upstream.
Update stm32l562e_dk_ns overlay.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-03-26 09:32:56 +01:00
Krzysztof Chruscinski ab49673bc8 drivers: timer: nrf_rtc_timer: Change type of channel argument
There was an inconsistency in the API as z_nrf_rtc_timer_chan_alloc
returned int but other function were using uint32_t for channel
argument. Updated api to use int32_t everywhere.

Update nrf_802154 driver which was using this api to use int32_t.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-25 15:54:49 +01:00
Yestin Sun 46cab056bc boards: stm32l562e_dk: Enable TF-M IPC application
This commit enables the TF-M IPC sample application on stm32l562e_dk
board.
It provides device tree flash partition as an overlay in order to
configure and flash the bl2, secure/non secure firmwares.

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2021-03-18 23:23:39 +01:00
Yestin Sun 4215955e84 modules: trusted-firmware-m: Allow to adjust hex file base address
This commit allows to append an optional --hex-addr argument to
the wrapper script if speficied. This can adjust the base address
of the output hex file when signing the non-secure or secure
firmware images.

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2021-03-18 23:23:39 +01:00
Eduardo Montoya d8932d607d crypto: mbedtls: add enablers for public key layer
Kconfig support for `MBEDTLS_PK_WRITE_C`.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-03-17 09:25:04 +02:00