Commit graph

1783 commits

Author SHA1 Message Date
Aaron Ye
d84874309e drivers: spi: create Ambiq SPI BLEIF driver
Some Ambiq Apollox Blue SOC (e.g. Apollo3 Blue) uses internal designed
BLEIF module which is different from the general IOM module for SPI
transceiver. The called HAL API will also be independent. This driver is
implemented for the BLEIF module usage scenarios.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-05-27 03:27:43 -07:00
Krzysztof Chruściński
59415697c4 modules: hal_nordic: nrfx: nrfx_config: Fix SPIS137 config
Fixing a bug where wrong instance was enabled when SPIS137 was supposed
to be used.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-27 02:09:34 -07:00
Axel Le Bourhis
6ffbcd4990 modules: Add Kconfig to Kconfig.mcux for BLE support
Added NXP_FW_LOADER for NXP platforms.
Added NXP_RF_IMU for NXP platforms.
Added MONOLITHIC Flags for NXP platforms.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2024-05-25 11:23:04 +03:00
Sreeram Tatapudi
f96e6ccbc0 boards: arm: Introduce Infineon CYW920829M2EVK-02 board
- Add initial version of CYW920829M2EVK-02 board
- [drivers: clock_control] Make it possible to set up both iho and imo
  clocks instead of just one or the other

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-05-24 18:05:11 -04:00
Andrzej Głąbek
2e8f104425 modules: hal_nordic: nrfx_glue: Remove NRFX_GPIOTE_CHANNELS_USED
This definition is no longer supported by the nrfx_gpiote driver (since
nrfx 3.2.0, reserved channels need to be defined per GPIOTE instance),
so remove it to not mislead users.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-05-24 07:47:15 -04:00
Valerio Setti
11920e35a0 mbedtls: reduce heap usage when building PSA crypto
By default PSA crypto library copies all the buffers that are passed
in into the heap before further processing them. This is required
when the PSA crypto library is on the secure side and it accepts
buffers from a non-secure code. However this case in Zephyr
is already handled by TF-M, so when the PSA crypto library is
built (CONFIG_MBEDTLS_PSA_CRYPTO_C) then it will be on the
non-secure side. Therefore this malloc copy is useless and
it consumes heap memory. Setting MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
at Mbed TLS build time helps in removing this mechanism and
it saves heap memory.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 09:03:20 -07:00
Valerio Setti
210e08be5d bluetooth: mesh: update BT_MESH_USES_MBEDTLS_PSA selected symbols
Instead of selecting legacy MBEDTLS symbols, use corresponding
PSA_WANT ones when possible (note: some legacy symbols do not
have a PSA correspondance).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti
a1a7c9081a mbedtls: add new source file from MbedTLS 3.6 release
Add "sha3.c" source file that was previously missing from
CMakeLists.txt and that has been added in MbedTLS 3.6 release.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti
12ff947568 mbedtls: add new PSA_CRYPTO_CLIENT config
Using MBEDTLS_PSA_CRYPTO_CLIENT to guard all PSA_WANT symbols is
not completely correct because:

1. the prefix MBEDTLS suggests that it's something related to
   MbedTLS, while actually PSA APIs can be provided also
   by other implementations (ex: TFM)

2. there might applications which are willing to use PSA APIs
   without using MbedTLS at all. For example computing an hash
   can be as simple as writing psa_hash_compute() and, if the
   PSA function is provided thorugh TFM, then MbedTLS is not
   required at all

Therefore this commit:

- moves MBEDTLS_PSA_CRYPTO_CLIENT to Kconfig.tls-generic since
  that symbol belongs to MbedTLS

- adds a new symbol named PSA_CRYPTO_CLIENT as a generic way
  to state that there is "some" PSA crypto API provider

- let MBEDTLS_PSA_CRYPTO_CLIENT automatically select
  PSA_CRYPTO_CLIENT, since the former is an implementation of
  the latter.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti
2adb4cac17 mbedtls: default enable USE_PSA_CRYPTO when CRYPTO_C
Now that support for all PSA_WANT symbols is in place, we can
enable MBEDTLS_USE_PSA_CRYPTO when MBEDTLS_PSA_CRYPTO_C is
enabled as well.

Note: this commit also moves USE_PSA_CRYPTO out of CRYPTO_C
dependency in config-tls-generic.h because TLS/DTLS/X509 modules
of MbedTLS can rely on *any* implementation of PSA crypto APIs
not only the MbedTLS one. TFM is for example an alternative
to this.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti
c4e1b56ef9 mbedtls: add the python script used to generate PSA Kconfigs
Since PSA has several different symbols defined and since it's
better to keep them aligned with the current MbedTLS release,
a python script is used to generate both:
- Kconfig.psa
- config-psa-generic.h

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti
e58ebe12f4 mbedtls: add configuration file for PSA features
Adding a Kconfig and a header file to control which PSA features
are to be used from MbedTLS:

- new kconfig symbols are placed in a separate header file
  (Kconfig.psa) and are guarded by MBEDTLS_PSA_CRYPTO_CLIENT. The
  reason for this is that TLS/X509 can either rely on PSA functions
  provided by MbedTLS (when MBEDTLS_PSA_CRYPTO_C is defined) or
  TFM (when BUILD_WITH_TFM is selected). Therefore we could
  not make these new Kconfigs depending on MBEDTLS_PSA_CRYPTO_C.

- by default all PSA symbols are enabled, but they can be
  disabled by respective Kconfigs in order to reduce the image
  size.

- the new header file (config-psa-generic.h) mimics what
  config-tls-generic.h does for MbedTLS builtin symbols: it
  enables a build symbol for every Kconfig one. The name is
  kept identical in the 2 cases (a part from the initial CONFIG_
  in order to simplify the mechanism).

- MBEDTLS_PSA_CRYPTO_CONFIG is finally enabled whenever there
  is any PSA crypto provider (either MBEDTLS_PSA_CRYPTO_C or
  TFM)

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Tomi Fontanilles
d830446c91 modules: tf-m: nordic: remove problematic include path
It made the build of
`samples/tfm_integration/tfm_psa_test/sample.tfm.psa_test_crypto`
break since the update of Mbed TLS to 3.6.0 (#71118), apparently because
`${ZEPHYR_BASE}` wasn't set, and the include doesn't seem to be needed.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-23 08:22:47 -04:00
Scott Worley
c6e3bc3252 soc: microchip: mec: Add new HAL based MEC5 family chips
Add new Microchip MEC chips using the new MEC5 HAL and
add a HAL version of a legacy chip named MECH172x.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2024-05-21 16:45:30 -04:00
Nazar Palamar
879c10d818 soc: infineon: port Infineon SOC to HWMv2
Port Infineon SOC to HWMv2.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-05-21 11:29:49 +01:00
Joel Guittet
b876bd26fd modules: mbedtls: fix pk ecc functions undefined references
Fix undefined reference to mbedtls_pk_ecc_xxx functions following update
to latest mbedtls version.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2024-05-20 14:43:31 +03:00
Alberto Escolar Piedras
c9753f5cf6 modules hal_nordic: Handle appropiately new kconfig options
The new kconfig options intend to represent a final
nRF54L product, let's handle them appropriately.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-16 15:19:08 +01:00
Valerio Setti
dfae5ba7de mbedtls: fix entropy module enablement
- Do not set CONFIG_MBEDTLS_ZEPHYR_ENTROPY in
  tests/crypto/mbedtls because this can cause test failure on
  real devices in which test thread do not have access to
  drivers.
- make MBEDTLS_PSA_CRYPTO_RND_SOURCE depending on
  MBEDTLS_PSA_CRYPTO_C because it only makes sense when the
  latter is defined

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-15 14:55:16 +02:00
Rafal Dyla
13aa26eac2 manifest: Adding nRF Services library
Adding nRF Services library to the hal-nordic repo

Signed-off-by: Rafal Dyla <rafal.dyla@nordicsemi.no>
2024-05-15 09:25:30 +01:00
Grzegorz Swiderski
24ce3f4182 drivers: serial: nrfx: Update Kconfig dependencies for RX cache
Two Kconfig symbols were tied to a board-specific DT nodelabel - namely
the `NRFX_UARTE_CONFIG_RX_CACHE_ENABLED` and `UART_<n>_RX_CACHE_SIZE`
were tied to `shared_ram3x_region` - but this is not necessary.

That DT node is where the UARTE driver RX/TX cache buffers are placed
in the default nRF54H20 DK memory map, but on another board, they could
be located somewhere else.

The exact memory sub-regions used for this purpose are indicated using
the `memory-regions` property on each UARTE instance, which should be
generic enough already, so let's use that instead.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-05-13 16:05:39 -04:00
Jędrzej Ciupis
ba1102c97d modules: hal_nordic: add missing glue for nRF54H20
Add missing #ifdef in nrfx_glue for nRF54H20.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-05-13 10:21:08 +02:00
Tomi Fontanilles
2d61db9a60 mbedtls: introduce PSA-specific Kconfig file
It is meant specifically for configuration of the PSA crypto library.

The underlying PSA configuration items are guarded by the condition
that a PSA crypto provider must be present, which is the case when
either TF-M is in use or MbedTLS's PSA core is built as part of
the application image.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-10 18:24:38 -04:00
Phi Bang Nguyen
f621407d50 modules: mcux: Drop HAS_MCUX_CSI config
The HAS_MCUX_CSI (as well as all the HAS_MCUX_XXX) config was obsolete
and has been replaced by the DT_HAS_NXP_IMX_CSI_ENABLED (i.e.
DT_HAS_XXX_ENABLED). Drop it as well as all the dependencies on it.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-05-10 18:09:44 -04:00
Richard Wheatley
e1e78a5f08 drivers: hwinfo: Adds Ambiq hwinfo support
This commit adds support for the hwinfo for Apollo4P SoCs

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-05-10 12:32:02 +02:00
Jędrzej Ciupis
fe4f101a99 modules: hal_nordic: request nRF5340 network CPU in 802.15.4 init
The network CPU must be requested explicitly by the 802.15.4 driver for
the sharing mechanism to work correctly.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-05-09 15:44:47 +02:00
Sebastian Głąb
2f17c46fb1 drivers: wdt: nrf: Add WDT instances that exist in nrf54h20
Add WDT instances no. 010, 011, 131, 132.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-09 15:44:40 +02:00
Valerio Setti
f539b661d6 mbedtls: add specific Kconfig option for MBEDTLS_USE_PSA_CRYPTO
MBEDTLS_PSA_CRYPTO_C and MBEDTLS_USE_PSA_CRYPTO are 2 different
things and the former should not automatically enable the
latter. The reson is that the user might want the MbedTLS
PSA crypto toolbox to be built, but at the same time he/she
does not want TLS/DTLS (and other intermediate modules such
as PK, MD and Cipher) to use PSA APIs.

For this reason this commit introduces a new Kconfig option
named CONFIG_MBEDTLS_USE_PSA_CRYPTO to enable the corresponding
build symbol. By default USE_PSA_CRYPTO is disabled. It is
only explicilty enabled in tests/samples that were previously
setting CRYPTO_C (since in those cases USE_PSA was set).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-09 10:27:30 +02:00
Valerio Setti
9d5021befd mbedtls: do not include PSA ITS when using PICOLIBC
PICOLIBC misses the dirent.h header which is required
to emulate ITS (internal trusted storage) in PSA APIs.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-09 10:27:30 +02:00
Valerio Setti
a364fc8a41 mbedtls: add option to use CSPRNG as random source for PSA_CRYPTO_C
Add a choice to select between legacy modules
(i.e. ENTROPY + CTR_DRBG/HMAC_DRBG) and CSPRNG as random generators
for PSA_CRYPTO_C.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-09 10:27:30 +02:00
Valerio Setti
7e2f06cbc2 mbedtls: add Kconfig option for PSA_WANT_ALG_SHA_256
Create a new Kconfig named CONFIG_PSA_WANT_ALG_SHA_256 which allows to
enable PSA_WANT_ALG_SHA_256. This allows to use PSA functions to
compute SHA256 hashes. When PSA is provided by TFM this allows also
to remove legacy mbedtls_sha256() support and therefore reduce
footprint for the NS side.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-08 22:14:19 -07:00
Dominik Ermel
e2d9f09b70 modules: hal_nordic: nrfx: Add NRFX_RRAMC
Add Kconfig option for RRAM controller, NRFX_RRAMC.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-05-08 14:59:56 -05:00
Abram Early
61bb304c69 mcuboot: Remove OVERWRITE_ONLY from DIRECT_XIP modes.
Fixes #71111

Signed-off-by: Abram Early <abram.early@gmail.com>
2024-05-08 12:04:45 +02:00
Pieter De Gendt
9910f1ef77 modules: nanopb: Pull upstream fixes
Update nanopb with upstream fixes for selecting the correct protoc
executable.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-07 21:22:43 -04:00
Sebastian Bøe
ad6e7298a5 tfm: cmake: Delete dead CMake code
This code appears to be dead so we delete it.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2024-05-07 17:57:40 -04:00
Jordan Yates
586882f003 mbedtls: compile FFDH support in PSA mode
Include `psa_crypto_ffdh.c` when compiling MbedTLS with PSA support, as
`MBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_PUBLIC_KEY` references the included
functions.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-07 17:55:56 -04:00
Hao Luo
a0b07212e9 soc: arm: ambiq: apollo3: Add support for Apollo3 Blue Plus SoC
Add all required parts (new SoC family/series, device tree) for
the Ambiq Apollo3 Blue Plus SoC.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-05-07 18:57:19 +02:00
Jukka Rissanen
ce75cd1c09 hostap: Fix the function name to be more descriptive
The wpas_to_wifi_mgmt_diconn_status() was missing "s" char,
so name it to wpas_to_wifi_mgmt_disconn_status() as that is
more descriptive.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-06 14:55:09 +01:00
Jukka Rissanen
16eed4e367 hostap: Handle CTRL-EVENT-SCAN-RESULTS event
Handle scan results event in order to avoid warning print
for unhandled event. The event is not used for anything atm,
this just prevents unknown event printout.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-06 14:55:09 +01:00
Jukka Rissanen
b03cb04411 hostap: Enable suitable mbedtls options
Enable all needed mbedtls options to allow crypto support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-06 14:55:09 +01:00
Ravi Dondaputi
fd88b09b1a hostap: Support BSSID configuration for connect command
Support BSSID configuration while setting up the network information
as part of the connect command processing.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-06 14:55:09 +01:00
Chaitanya Tata
0fb4320f9e hostap: Fix handling channel 14
Channel 14 in JP is still allowed (though OFDM is disabled), this wasn't
handled by operating class 81, so, add 82 to the list.

We still need to full implement regulatory support in the WPA
supplicant but that is handled in separate fix.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-06 14:55:09 +01:00
Chaitanya Tata
c8a8c94186 hostap: Convert channel to frequency conversion to a loop
This makes it readable and also scalable for upcoming extension of
operating classes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-06 14:55:09 +01:00
Tomi Fontanilles
6c68068c38 modules: mbedtls: remove default-enabling of hash algorithms
Do not enable hash algorithms except SHA-256 by default.
This unnecessarily inflates the final code size even if not all the
enabled hash algorithms are actually used.

SHA-256 is (for now) kept enabled by default because many configurations
across the code base assume that there is some hash algorithm
available without needing to enable it.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-03 14:47:52 -07:00
Tomi Fontanilles
43651979fc drivers: entropy: fix TF-M enabled build with MbedTLS 3.6.0
This fixes the compilation of entropy_psa_crypto.c that failed
when trying to include the MbedTLS configuration.

Inherit the needed include folders and definitions from tfm_api.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles
e49033ac1e modules: tf-m: make CONFIG_BUILD_WITH_TFM imply CONFIG_MBEDTLS
This fixes NS compilation on certain app/board combinations
where TF-M is used but CONFIG_MBEDTLS was not set to y.

With the update to MbedTLS 3.6.0, the compilation failed in
(at least) interface/src/tfm_crypto_api.c when trying to
include MbedTLS configuration file because the MbedTLS Kconfigs
were not defined due to CONFIG_MBEDTLS being n (and the default
MbedTLS configuration file not being found).

TF-M's dependency on MbedTLS is pretty much a given.
This change ensures that the configuration for MbedTLS
is properly defined at all times when TF-M is in use.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles
94404589d4 modules: tf-m: fix tfm_api's configuration of MbedTLS
The configuration file was not passed down to tfm_api, which
made the compilation of (at least) interface/src/tfm_crypto_api.c
fail when updating MbedTLS to 3.6.0.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles
5416e76d3b modules: mbedtls: force NS-side config to client-only when using TF-M
When building with TF-M (CONFIG_BUILD_WITH_TFM),
force MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C
so that no NS code tries to act like the MbedTLS core
is built on this side.

This fixes compilation errors in (at least)
interface/src/tfm_crypto_api.c after the
update of MbedTLS to 3.6.0.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Tomi Fontanilles
8d3c5efc33 modules: mbedtls: fix RSA's dependency on ASN1
With MbedTLS updated to 3.6.0 the RSA module does not
depend on PK anymore. However, it is now dependent on ASN1.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-02 09:42:34 -07:00
Martin Jäger
f3e41c6a25 lorawan: services: add Fragmented Data Block Transport
This service receives fragmented data (usually firmware images) and
stores them in the slot1_partition in the flash.

Also update CMakeLists.txt in loramac-node module to be able to use
FragDecoder.c

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-05-02 16:54:43 +02:00
cyliang tw
183edd2549 drivers: rtc: support for Nuvoton numaker m46x
Add Nuvoton numaker RTC driver including RTC alarm feature.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-04-30 14:31:29 -04:00