Commit graph

106227 commits

Author SHA1 Message Date
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
Andrej Butok
cc152e3be3 boards: frdm_mcxn947: fix MCUBoot USB Serial Recovery build
- Fixes MCUBoot build error when enabled Serial Recovery via USB CDC ACM.
- Increases MCUBoot partition size.

Signed-off-by: Andrej Butok <Andrey.Butok@nxp.com>
2024-11-27 21:07:14 +00:00
Neil Chen
bd31ffa22c boards: nxp: frdm_mcxa156: support mcxa156 uart rx
Add input-enable in uart pin_mux initialization

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-11-27 21:07:03 +00:00
Sylvio Alves
36d41181be soc: esp32c3: add FH4X type and SoC revision
FH4X SoC type contains improvements in ROM code that
can save up to 35kB of memory.

Update hal_espressif in order to select proper linker
file based on upon SoC model.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-27 21:06:51 +00:00
Sylvio Alves
4101401dd7 boards: esp32c3-based: update soc type info
This updates a few esp32c3-based boards accordingly to
its oficial SoC model.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-27 21:06:51 +00:00
Armando Visconti
a867dbdc47 sensors: lsm6dsv16x: add RTIO async and fifo stream
Add RTIO async and RTIO stream functionalities that enables,
among all the other things, the sensor data streaming from FIFO.

RTIO stream is using both SENSOR_TRIG_FIFO_WATERMARK and
SENSOR_TRIG_FIFO_FULL triggers. The decoder currently only supports
following FIFO tags:

  - LSM6DSV16X_XL_NC_TAG
  - LSM6DSV16X_GY_NC_TAG
  - LSM6DSV16X_TEMP_NC_TAG

Following FIFO parameters has to be defined in device tree to
correctly stream sensor data:

  - fifo-watermark (defaults to 32)
  - accel-fifo-batch-rate (defaults to LSM6DSV16X_DT_XL_NOT_BATCHED)
  - gyro-fifo-batch-rate (defaults to LSM6DSV16X_DT_GY_NOT_BATCHED)
  - temp-fifo-batch-rate (defaults to LSM6DSV16X_DT_TEMP_NOT_BATCHED)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-27 21:06:30 +00:00
Armando Visconti
01c1e1173f sensors: lsm6dsv16x: add attr_get driver API
Add attr_get() driver API

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-27 21:06:30 +00:00
Armando Visconti
5bdde779c1 sensors: lsm6dsv16x: save gyro_fs in data
Save gyroscope range set from DT or SENSOR_ATTR in data
structure.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-27 21:06:30 +00:00
Adam Kondraciuk
2e4cf197c1 drivers: timer: grtc: Add LFPRC as the source of GRTC
This commit allows to switch the GRTC clock source to an RC oscillator.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-27 21:06:20 +00:00
Andrej Butok
03628a4102 soc: kinetis: disable on reset NMI and EzPort
- Disables on reset NMI and EzPort.
- Fixes possible reset and power-on issues.
- Already applied for K64, now applying for the rest of Kinetis.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-11-27 21:06:09 +00:00
Anas Nashif
318492b5bf ci: testsplan: skip module handling with no west changes
In cases were west modules did not change, skip. This happens when
manifest layout changes, but without SHA changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-27 10:59:11 -05:00
Abe Kohandel
5d5407ee7a drivers: timer: Disable prescalar for TI DM Timer
The timer count calculations are done with the assumption that the
prescalar is disabled. When using u-boot's SPL as an early boot stage,
the omap timer driver enables the prescalar leaving this driver to
calculate incorrect counts. So explicitly disable the prescalar to match
the driver expectation.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2024-11-27 10:39:21 -05:00
Adam Kondraciuk
db290a62f9 drivers: spi: nrfx_spim: set/clear pins retention
Add pins retention control when GPD is enabled for SPIM.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-27 10:39:00 -05:00
Michał Stasiak
02bb624c31 tests: drivers: watchdog: disable DCACHE for nRF54H20dk
Disabled data caching for nRF54H20dk in wdt_basic_api test.
It caused variables stored in noinit section to be cached,
resulting in reset loop.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2024-11-27 10:38:52 -05:00
Sylvio Alves
ac253fe6fa boards: m5stack_core2: fix regulator entry region
BUS_5V regulator is placed in the i2c peripheral, where it does
not belong. Move 5V bus regulator to board common definitions.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-27 10:38:44 -05:00
Sylvio Alves
198f9907e2 dtsi: espressif: add missing address-cell entries
Add address-cell field into interrupt allocator entry
to overcome build warnings.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-27 10:38:44 -05:00
Rubin Gerritsen
56a22cbccb Bluetooth: Host: Log when connecting while scanning may give bad params
The API documentation already states that the controller may require
the scan interval and window used for scanning and connection
establishment to be equal to obtain the best performance.

This commit prints out a warning when this is not the case. The code
size is unchanged when `CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL=n`.

This makes application developers aware that using the parameters
`BT_LE_SCAN_ACTIVE_CONTINUOUS` with `BT_CONN_LE_CREATE_CONN` may not
give the best performance.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-11-27 10:38:27 -05:00
Jukka Rissanen
9332c2813e tests: net: socket: udp: Add min_flash to the test config
Add minimum flash requirement to the tests. This will effectively
exclude nrf5340dk/nrf5340/cpuapp/ns as it does not have
enough flash for the application.

Fixes #81862

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-27 10:38:15 -05:00
Andy Ross
7cdf40541b kernel/sched: Eliminate PRESTART thread state
Traditionally threads have been initialized with a PRESTART flag set,
which gets cleared when the thread runs for the first time via either
its timeout or the k_thread_start() API.

But if you think about it, this is no different, semantically, than
SUSPENDED: the thread is prevented from running until the flag is
cleared.

So unify the two.  Start threads in the SUSPENDED state, point
everyone looking at the PRESTART bit to the SUSPENDED flag, and make
k_thread_start() be a synonym for k_thread_resume().

There is some mild code size savings from the eliminated duplication,
but the real win here is that we make space in the thread flags byte,
which had run out.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-27 10:38:05 -05:00
Andy Ross
6877b6d8e5 kernel/thread: Fix assumptions in k_thread_state_str()
This table just blindly assumed that the values of _THREAD_xxx state
bits wouldn't change.  That's dangerous.  (That's right, I tried to
change them and broke it.)

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-27 10:38:05 -05:00
Benjamin Cabé
bbca807f3a doc: css: boards: fix font size for board name
The board name should have the same size as all the other attributes
in the board's "Wikipedia card".

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-27 10:37:54 -05:00
David Leach
a690d6c831 doc: LICENSING: Add BSD-3-clause for OpenThread files
Update the licensing list to include the BSD-3-clause OpenThread
files.

Approved by TSC #79882

Signed-off-by: David Leach <david.leach@nxp.com>
2024-11-27 10:37:21 -05:00