Commit graph

106248 commits

Author SHA1 Message Date
Piotr Kosycarz
5ae4f11c93 tests: drivers: enable more tests for nrf54l10 and nrf54l05
counter_basic_api, i2s_api, i2s_speed, uart_async_api

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-11-28 09:42:58 +01:00
Håkon Amundsen
8a82b078a4 boards: nrf54h20: increase size of cpuapp and cpurad partitions
This is possible due to the memory map changes introduced in
26603cefaf

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2024-11-28 09:42:46 +01:00
Dominik Ermel
71fe68cab8 tests/stream_flash: Remove CONFIG_MPU_ALLOW_FLASH_WRITE=y
The commit removes storage.stream_flash.mpu_allow_flash_write as it was
pointless, and moves nrf52840, as integration platform, to
storage.stream_flash.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-11-28 09:39:17 +01:00
Jamie McCrae
5437ded36c mgmt: mcumgr: grp: img_mgmt: Fix misplaced #endif
Fixes a misplaced endif which wrongly excluded functions

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-11-28 09:38:49 +01:00
Declan Snyder
7271000fe5 drivers: spi_mcux_lpspi: Clean up DMA path
Clean up DMA path of code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
2c884a9274 drivers: spi_mcux_lpspi: Optimize dma callback
Optimize DMA callback by cleaning up the code and storing less debug
logging strings.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
5dbe322c9b drivers: spi_mcux_lpspi: Clean up configure func
Do all input validation etc BEFORE setting up configuration,
instead of mixing these things everywhere. Also condense the formatting
of the code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
b7c35fb569 drivers: spi_mcux_lpspi: Remove rtio prepare_start
Remove unneeded prepare_start function since all uses of it are paired
with the start function. Also, probably should not mess with chip select
before deciding to do the transfer. And just return on some error like
the rest of the driver does instead of assert.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
d6a6b11aac drivers: spi_mcux_lpspi: ErrLog dev in iodev_start
Log the device name and status if the transfer could not start,
same way as in non-RTIO path.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
47115e3afe drivers: spi_mcux_lpspi: Macro for master cfg flag
All the master transfer seemed to use the same config flags,
reuse with a macro.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
561b4347d7 drivers: spi_mcux_lpspi: Clean up next_packet func
Next packet function is way more complicated than it needs to be. Clean
it up by simplifying the code and making readable helper functions.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
af3c25a1f8 drivers: spi_mcux_lpspi: Remove commented code
Remove lines of code that are commented out.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
fa82ec0602 drivers: spi_mcux_lpspi: Remove duplicate bufsetup
This line doesn't need to be in multiple places.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
830c0a9e3c drivers: spi_mcux_lpspi: clean up transceive calls
Move transceive funtions next to each other and clean up the wrapping of
functions to eliminate the ifdefs.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
810b563ea7 drivers: spi_mcux_lpspi: Group API functions
Group the actual API functions to be next to each other.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
595e16caf6 drivers: spi_mcux_lpspi: Consolidate IRQ handle
Small change to consolidate the amount of lines of code in
the spi_mcux_isr by making a macro for the argument and removing
a line of code that was commented out.

Also move the ISR to be the first function in the file which is
common in many other drivers, instead of randomly in the middle of the
file. And move the isr callback to be next to the isr.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
e21bf37f13 drivers: spi_mcux_lpspi: Minor RTIO cleanup
Add closing comment for #ifdef and remove unnecessary
indentation of an else block. Also move the transcieve_rtio
function to be near the other rtio functions. And move function
prototypes to top of file.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
5d081c98fb drivers: spi_mcux_lpspi: Create DMA dev helpers
Create helper functions for duplicated code related to
checking for DMA devices, with readable names.

Also remove unneeded function prototype.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
d76ccdbdea drivers: spi_mcux_lpspi: Clean up init function
Do initializations in a more logical order,
remove unnecessarily duplicated code,
reorder stack variables to be in reverse christmas tree order.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
5a0d9831b1 drivers: spi_mcux_lpspi: Move init to end of file
Move init function to bottom of file by custom.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
0727566c4a drivers: spi_mcux_lpspi: Remove parent_dev field
Remove parent_dev from config struct, and simplify code for the
definition and use of the irq config function.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Declan Snyder
6607976a55 drivers: spi_mcux_lpspi: Organize top of file
Organize #includes and #defines for less redundancy
and more readability.

Shorten some macros to avoid multi line statements.

Add some comments.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 22:54:09 -05:00
Marvin Ouma
69e8152fc1 tests: posix: common: separate posix spinlock tests into standalone test
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves spinlock into a singular
testsuite at tests/posix/spinlocks app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-27 22:52:56 -05:00
Aksel Skauge Mellbye
6d38b24d32 drivers: pinctrl: gecko: Remove cases now handled by DBUS driver
Remove implementation of pin configuration for Series 2 devices.
The silabs,dbus-pinctrl driver should be used instead.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Aksel Skauge Mellbye
1f7507ef50 doc: release-notes-4.1: Add new silabs pinctrl driver
Add release note and migration guide for silabs pinctrl driver
for digital bus (dbus).

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Aksel Skauge Mellbye
26215a7d3b boards: silabs: Remove usage of no-op pin number macro
The GECKO_PIN() macro does not do anything except pass the
argument through unaltered. It only serves to make DeviceTree
files more verbose. It was inconsistently used, make the .dts
files consistent by never using it.

The DBUS pinctrl driver doesn't use the port or location macros
from the gpio_gecko.h header. The pin number macro is the only
other thing defined in this header. Stop including the header on
Series 2 based boards.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Aksel Skauge Mellbye
a40a26db32 boards: silabs: Use DBUS pinctrl driver for Series 2 boards
Swap from silabs,gecko-pinctrl to silabs,dbus-pinctrl for all boards
with Series 2 SoCs. Explicitly declare pin properties as part of
pinctrl pinout configuration.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Aksel Skauge Mellbye
f3246cda17 drivers: pinctrl: silabs: Add pinctrl driver for digital bus
Silicon Labs Series 2 and newer devices do alternate function
configuration fundamentally differently from Series 0 and 1. Pin routing
is done in a centralized fashion in the GPIO peripheral, as opposed to
having ROUTE registers in every peripheral. The concept of alternate
function location numbers also does not exist, functions are directly
assigned to GPIOs by their port and pin number.

This commit adds a new pinctrl driver for devices that use DBUS. It fully
makes use of pinctrl design principles as outlined in the Zephyr
documentation. The previous driver hard-codes pin properties such as filter
and pull-up/down in the driver itself, while the new driver leaves this up
to the user as configurable DeviceTree properties. The previous driver has
hard-coded support for UART, SPI and I2C, while the new driver has generic
support for all DBUS signals.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-11-27 22:51:55 -05:00
Pavel Vasilyev
f5409bd3de bluetooth: mesh: proxy_msg: Fix extracting role from k_work
Fix extracting role from k_work.
Hot fix for #78914

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-11-27 22:51:40 -05:00
Pavel Vasilyev
684c94e469 bluetooth: mesh: gatt: Move generic GATT related defines to gatt.h
This moves GATT releated defines that are used by both Mesh Proxy
Service and Mesh Provisioning Service implementations to a common
header file.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-11-27 22:51:29 -05:00
Pavel Vasilyev
ab346a1dd0 bluetooth: mesh: Use bt_get_name to get device name
By default if CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME
or CONFIG_BT_MESH_PB_GATT_USE_DEVICE_NAME is enabled, the mesh stack
will add BT_DATA_NAME_COMPLETE AD Type along with the Mesh Proxy Service
or Mesh Provisioning Service advertisements accordingly.

When BT_LE_ADV_OPT_USE_NAME was present and
CONFIG_BT_DEVICE_NAME_DYNAMIC is enabled, the advertised name was
automatically updated by the host. This turned out to be a side-effect
rather than expected behavior and after #71700 this behavior waa
changed.

But customers use dynamic name feature.

This commit makes the mesh stack use bt_get_name to get the device name,
which returns runtime name if CONFIG_BT_DEVICE_NAME_DYNAMIC is enabled.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-11-27 22:51:29 -05:00
Fabio Baltieri
48cb3a2272 input: ili2132a: check i2c_read_dt return value
Check i2c_read_dt return value in ili2132a_process, fixes a coverity
warning.

Link: https://github.com/zephyrproject-rtos/zephyr/issues/81965
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-27 22:51:16 -05:00
Valerio Setti
184c0f9e9d samples: bt: reduce system heap memory for the hci_ipc sample
Moving from TinyCrypt to PSA Crypto API caused failures in the cpu_net
build due to RAM being overflowed. It turned out that 8192 bytes were
allocated for system heap memory, but Mbed TLS is the only user
of that memory (I found this though puncover) for AES purposes.
We reduce that to 1024 bytes because this should be enough for
this purpose.

Note: albeit this is also a standalone example, it's used extensively
in other samples/tests and babblesim, so a failure in building it
propagates in a lot of other failures.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
ba34d602fa tests: bt_crypto: fix kconfig for qemu_cortex_m3
Increase test and main stack sizes for the qemu_cortex_m3 platform
in order to be able to successfully run the test.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
18119e8f6e test: bsim: bt: fix test scripts
This commit fixes
tests/bsim/bluetooth/ll/multiple_id/tests_scripts/multiple.sh.
The reason is that this test seems to depend on random number
sequence in order to have the proper scheduling.

It also fixes some AC tests by commenting out failing test
cases. The reason of the failure is still unknown and needs
to be investigated in future work.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
55c0b2ea45 tests: bt: enable entropy sources where missing
Moving from TinyCrypt to PSA Crypto API caused an entropy source
to be always required, so this commit adds it in tests where
necessary.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
72555fabb4 board: enable random/entropy generators if BT
BT uses PSA Crypto API to perform crypto operations and, on this
platform, these APIs are implemented through Mbed TLS. In order
to properly initialize this library, a random number generator
is required.

* If the platform supports an HW entropy generator (ex: native_sim,
  nrf), then ENTROPY_GENERATOR must be used;
* Otherwise (ex: qemu_cortex_m3) test random generator can be
  enabled.

Enabling the proper option at board Kconfig level allows for
a more compact code change instead of manually editing _all_
the samples/tests that required this fix.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
1e560e0a45 drivers: entropy: ease runtime requirements on BT HCI
On platforms like nrf5340 there are 2 CPUs:
- one is the cpu_net which takes care of the radio stuff and
  owns the HW random generator
- one is the cpu_app which holds application data and polls
  cpu_net through HCI commands when it needs some random data.

The PSA core implemented in Mbed TLS needs random data at initialization
time, which happens early in the boot process. If we wait for BT to
be ready before issuing the HCI command, then PSA core intialization
will fail. In facts there is no need for the BT to be completely
initialized just to ask for some random data from the cpu_app to
the cpu_net since the HW random generator will likely be already
functional in the cpu_net.
So let's just try the HCI command and, if something is not right,
it will fail anyway. There's no need to anticipate the failure.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
22faaee268 tests: bt: increase PSA key slots count when necessary
Increase the number of key slots in the PSA Crypto core
for some tests using more keys than the default (16).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
65751c1c33 tests: bt: add Mbed TLS headers to the build
Include Mbed TLS headers to the build system. This is required
because these tests do not follow the "standard build pattern"
of Mbed TLS in Zephyr, otherwise include files would be already
available after the library has been linked. In these examples
some BT source files and Kconfigs are manually added to the
CmakeLists.txt file bypassing the standard library build pattern,
so Mbed TLS headers must also be added manually.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
7c1b5059ca tests: bluetooth: replace TinyCrypt with PSA in unit tests
Replace all references to TinyCrypt with PSA Crypto API in BT unit
tests.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
524ed20dc8 samples: bt: some RAM footprint reductions
As part of the work of deprecating TinyCrypt in favor of
PSA crypto API, this commit fixes some kconfigs in order to
reduce the RAM footprint. In all involved samples RAM usage
was extremely high even with TinyCrypt (usually > 98%) and
of course it got overflowed once TinyCrypt got replaced by
Mbed TLS's PSA Crypto API.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
1b672491f1 bt: change dependencies for BT_RPA
Since the TinyCrypt library is being deprecated in Zephyr, this
commit modified the dependencies of BT_RPA. Instead of selecting
TinyCrypt, it relies on BT_HOST_CRYPTO or BT_CTLR_CRYPTO. This
helps both in the deprecation process of TinyCrypt, but also this
is more correct dependency since these 2 symbols are extensively
used in the rpa.c source code.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
0f4875b7d0 bt-mesh: deprecate BT_MESH_USES_TINYCRYPT
Since the TinyCrypt library is being deprecated in Zephyr, this
commit set TinyCrypt usage in BT mesh as deprecated and it sets
Mbed TLS PSA Crypto API as the default option (when TF-M is not
available).
Tests are also updated in this commit.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
f4592382bb bt: use PSA for HCI ECC and rename BT_TINYCRYPT_ECC
This commit sets PSA Crypto API as the default library to perform
ECC-DH in HCI, replacing TinyCrypt (which is being deprecated).
Therefore the symbol BT_TINYCRYPT_ECC is renamed as BT_SEND_ECC_EMULATION.
References in samples/tests are also fixed.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Valerio Setti
da9ab6f593 bt: crypto/host: remove CONFIG_BT_USE_PSA_API symbol
CONFIG_BT_USE_PSA_API was used in BT crypto/host modules to select
PSA crypto API over TinyCrypt (which was the default until now).
Since TinyCrypt is being deprecated and PSA crypto API is the new
standard library for crypto operations, CONFIG_BT_USE_PSA_API is
no more needed.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Pavel Vasilyev
4b6683cca1 test: bluetooth: bsim: mesh: test_access: Increase timeout between proc
Increase timeout between procedures in access_tx_transmitt test to avoid
packet loss.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-11-27 16:40:47 -05:00
Valerio Setti
e4f1cc92af manifest: tf-m: update revision to include a fix
Update TF-M revision to include a fix for crypto_sizes.h header
which is no more aligned to the Mbed TLS one and this causes
build failures in tests.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-27 16:40:47 -05:00
Marcio Ribeiro
63ed84240f driver: wdt: esp32: remove incorrect status check inside isr
Reverts incorrect changes introduced by #79821

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-11-27 21:08:07 +00:00
Declan Snyder
826c7445f2 dts: nxp_mcxw71: Flash node is not peripheral
Flash node should not be under the peripheral bus, it is not a
peripheral. The base address of the flash was getting set correctly by
accident due to the fmu node mapping it out of the range of the
peripheral node by coincidence.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-27 21:07:48 +00:00