Commit graph

835 commits

Author SHA1 Message Date
Aksel Skauge Mellbye
2b54dfa8aa soc: silabs: Select PM implementation per family directly
The indirection through a backend symbol for PM implementation
isn't necessary. Define symbol for PM HAL in HAL Kconfig, and
leverage it at SoC level.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-10-22 09:03:15 +02:00
Alessandro Manganaro
6ceeb56d53 drivers: bluetooth: hci: fix a typo in stm32wbax ble hci driver
Typo fix in assert condition used by stm32wbax ble hci driver.

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2025-10-21 22:52:02 +03:00
David Boullie
a040028412 modules: hal_silabs: Add config for SiSDK Protocol Crypto
A Kconfig options for the SiSDK Protocol Crypto library, which provides
accelerated cryptographic primitives using the RADIOAES peripherals for
Series-2 devices.

Signed-off-by: David Boullie <David.Boullie@silabs.com>
2025-10-19 20:51:44 -04:00
Martin Hoff
ccd505ffdc drivers: bluetooth: hci: siwx91x: create dependency with nwp
The bluetooth hci on silabs siwx91x depends on the nwp
(network coprocessor). This patch allows to check for the correct
initialization of the nwp before using bt hci on siwx91x.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-17 11:17:30 +02:00
Martin Hoff
ba1d267c62 soc: silabs: siwx91x: transform nwp soc files into a driver
The goal of this patch is to switch from the nwp.c and nwp.h soc files
to the new nwp driver. During this transition, we also renamed
CONFIG_WISECONNECT_NETWORK_STACK to CONFIG_SILABS_SIWX91X_NWP which are
a better naming to let the user knows that the network coprocessor files
will be added to the compilation.

The switch from a soc file to a driver device introduce a notion of nwp
device that allows us to check for good initialization and ressources
allocation.

Before this patch, it is not possible to know if the nwp have booted
successfully or not. We can now check if the device driver is ready
or not before trying to do operation related to the nwp.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-10-17 11:17:30 +02:00
Valerio Setti
1bc2db575f modules: mbedtls: add new helper Kconfig symbol PSA_CRYPTO
The goal of new Kconfig PSA_CRYPTO_PROVIDER is to automatically enable
any of the PSA Crypto API provider available for the platform without
having the user to manually pick the proper one. This provider can be
either TF-M, if that's enabled in the build, or Mbed TLS otherwise.

PSA_CRYPTO_PROVIDER simplifies also modules/subsystem Kconfigs removing
blocks as:
	select MBEDTLS if !BUILD_WITH_TFM
	select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM

Kconfig PSA_CRYPTO_PROVIDER_CUSTOM is also added to allow the end user
to add a custom implementation of PSA Crypto API instead of TF-M or
Mbed TLS ones.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Valerio Setti
7b7b4fcde2 drivers: bluetooth: hci: do not select MBEDTLS_ENTROPY_C in BT_SILABS_EFR32
The driver only uses psa_generate_random() so ENTROPY_C is not required.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Valerio Setti
76037cec36 drivers: bluetooth: esp32: remove selection of MBEDTLS_PSA_CRYPTO_C
The driver code only relies on legacy Mbed TLS crypto, not on PSA API, so
enabling MBEDTLS_PSA_CRYPTO_C is not needed here.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Alessandro Manganaro
25e91c8df2 drivers: bluetooth: hci: STM32WBA cube fw 1.7.0 updates
Changes required to update STM32WBA bluetooth HCI driver
according STM32WBA Cube FW 1.7.0 version.

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2025-10-16 12:16:31 -04:00
David Boullie
8249ca582a soc: silabs: s2: Move RAIL interrupts installer
Move the RAIL interrupts installer from the Bluetooth HCI driver
to the SoC layer so that it can be used by other subsystems
as well.

Signed-off-by: David Boullie <David.Boullie@silabs.com>
2025-10-14 18:51:57 +02:00
Declan Snyder
bba57b2f1e drivers: bluetooth: hci spi: Add missing semicolon
Adds a missing semicolon.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-10 20:49:39 -04:00
Szymon Janc
a2af19bae1 bluetooth: hci: userchan: Improve RX allocation handling
This makes userchan transport behavior similar to other HCI
transports (eg IPC). Improved logging gives clear overview
of what RX events are discarded helping for configuration
tuning.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-09 12:38:49 -04:00
Ali Hozhabri
51fc4405ac drivers: bluetooth: hci: Add PM support to the STM32WB0x HCI driver
Add PM support to the STM32WB0x Bluetooth HCI driver.

Implement PM event register to wake up the device for its BLE events.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
bdb41c0ebd drivers: timer: Enable STM32WB0_RADIO_TIMER Kconfig parameter
Use radio timer as the system timer when Bluetooth is used.

Modify CMakeLists.txt to compile radio timer driver when
STM32WB0_RADIO_TIMER is enabled.

Remove the common parts from hci_stm32wb0.c that are present
in the radio timer driver.

Set and retrieve the appropriate value for SYS_CLOCK_TICKS_PER_SEC and
SYS_CLOCK_HW_CYCLES_PER_SEC respectively.

Define radio_timer node and its properties.

Enable radio_timer node in nucleo_wb0x boards.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 21:15:08 -04:00
Ali Hozhabri
9a440ec18f drivers: bluetooth: hci: Introduce bt_spi_close to support bt_disable
Introduce bt_spi_close function to support bt_disable implementation
in applications.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-10-03 12:52:30 +03:00
Szymon Janc
9985a090fc bluetooth: hci: userchan: Implement close callback
This allows to use bt_disable() also in native_sim build.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-02 16:49:16 +02:00
Declan Snyder
570b445a61 drivers: Convert to use SPI macro without delay parameters
Convert all drivers and other consumers to use SPI macros without the
delay parameters.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-01 14:39:36 +03:00
Raffael Rostagno
f4cdf08e28 drivers: bt: esp32h2: Add support
Add BT-HCI support to ESP32-H2.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-09-30 19:37:19 +02:00
Szymon Janc
893f90f042 bluetooth: hci: userchan: Improve discardable events handling
This mimics IPC transport behavior where BR/EDR Inquiry events as
well as LE Extended Advertising Report (carring legacy PDU) are
considered discardable.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-09-22 13:34:59 -04:00
Jordan Yates
9f44b011de bluetooth: hci: h4: optional reset pin
Add an optional reset pin for H4 HCI driver.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-09 20:39:59 -04:00
Evgenii Kosenko
8ef809f43c drivers: bluetooth: silabs_efr32: Declares periodic sync feature
Adds declaration for Periodic Advertising Synchronization Establishment
procedure supported by controller.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2025-09-09 10:32:05 +02:00
Alessandro Manganaro
d808d9e2f9 drivers: bluetooth: hci: stm32wba driver update for pm
Reworking  pm implementation in stm32wba ble hci driver.
Enabling "no-reset" quirk for stm32wba ble hci driver to
maintain specific configuration required for pm.

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2025-09-06 08:40:02 +02:00
Aaron Ye
0d46a93417 drivers: bluetooth: hci: stop rx thread when closes the HCI
Stops the RX thread when closes the HCI for Ambiq HCI driver

Signed-off-by: Aaron Ye <aye@ambiq.com>
2025-08-28 06:24:49 +02:00
Aaron Ye
2c63115f51 drivers: bluetooth: hci: add close function for Ambiq Apollo4 series
This commit adds close function support for Ambiq Apollo4 series SoC
so the bt_disable() API can be used.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2025-08-28 06:24:49 +02:00
Sylvio Alves
7305e109fb bluetooth: esp32: make LE discardability length-safe
Determine event discardability after parsing the HCI header and require
at least one byte before reading the LE subevent. This removes a possible
OOB read on malformed/short LE Meta events. Also mark LE Extended
Advertising Report as discardable, matching legacy Advertising Report to
reduce RX pool pressure during heavy scanning.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-08-23 05:11:05 +02:00
Sylvio Alves
089df60140 bluetooth: esp32: fix VHCI semaphore misuse in HCI send path
The TX flow control semaphore was initialized with a count of 1 and
released again after every bt_esp32_send() call. This broke the VHCI
flow control contract and could allow sending more packets than the
controller advertised.

This prevents host/controller overruns and ensures proper synchronization
with the ESP32 VHCI interface.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-08-23 05:11:05 +02:00
Pavel Vasilyev
8de6705ec3 drivers: bluetooth: Align bt_hci_send behavior on error
This change alignes HCI drivers behavior with Host expectation. That is:
if an HCI driver managed to send a packet to Controller, the HCI driver
also unreferences it. If the HCI driver didn't manage to send the
packet to Controller and returns an error code, it does not unreferences
buffer.

This change aligns the behavior of HCI drivers with the Host's
expectations. Specifically:
- If an HCI driver successfully sends a packet to the Controller, the
  HCI driver also unreferences it.
- If the HCI driver fails to send the packet to the Controller and
  returns an error code, it does not unreference the buffer.

Fixes #94445

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-08-18 22:01:15 +02:00
Raffael Rostagno
99b8333b8e drivers: bt: esp32c2: Add support
Add BT-HCI support to ESP32-C2 and ESP8684.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-08-06 12:10:59 +03:00
James Smith
6e344ba19e drivers: bluetooth: hci: silabs: Implement hci_close
Implements HCI close support for the silabs efr32 HCI driver.

Calling `bt_disable()` now works as expected, which is particularly
important for multiprotocol applications.

Signed-off-by: James Smith <james@loopj.com>
2025-08-05 10:25:24 +01:00
Bas van Loon
4a09047b0e drivers: bluetooth: hci_nxp_setup: Prevent re-init of CRC table.
The CRC32 table only needs to be generated once, so prevent it from
regenerating every time as it only required once.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-08-02 13:17:58 +02:00
Dmitrii Sharshakov
a610e0ec82 bluetooth: hci: userchan: support connecting over UNIX socket
Can be used with Bluez btvirt

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-08-01 19:36:43 +01:00
Jordan Yates
def2ec8590 bluetooth: hci: spi: configurable CS delay
Make the common SPI CS delay property configurable from devicetree. This
can be required for using a nRF54L as a Bluetooth controller, since it
has an additional delay after waking up from the CS assertion until it
is ready to accept and transmit data (see OPS t_START_HFINT).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-07-29 22:50:23 -04:00
Alberto Escolar Piedras
0acebf7135 drivers/bluetooth/userchan: Remove NATIVE_APPLICATION support
It is not possible to build anymore in that mode, so we do not
need to support it in this driver cmake files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Petri Pitkanen
808ee1713d drivers: bluetooth: silabs: Fix indicating support for 2M phy
Previously we always had driver to support 2M PHY regardless of
configuration. As this was fixed the missing support statemenent
caused 2M support to miss regardless of configuration.

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-07-08 13:44:51 -05:00
Pisit Sawangvonganan
b8a8173c1f drivers: kconfig: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `drivers` directory.
Additionally, incorporates a fix recommended by the reviewer.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-07-01 10:58:54 -10:00
Sylvio Alves
1df3403393 soc: esp32c6: add BLE support
Add BLE support to ESP32-C6 series.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-06-27 18:27:15 -05:00
Sylvio Alves
9952180987 soc: espressif: sync hal to latest updates
1) Bring latest hal_espressif updates/sync to latest v5.1 branch.
2) Update RF libraries for bug fixes and improvements
3) Add necessary BLE Kconfig entries to support latest changes.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-06-26 10:51:45 -10:00
Romain Jayles
684b90e6b3 bluetooth: stm32wbax: add temperature calibration of linklayer
This patch allows to link the request of the linklayer for a
temperature calibration to the temperature driver.
The linklayer will then adapt and trigger its calibration related to
the current temperature.

Signed-off-by: Romain Jayles <romain.jayles@st.com>
2025-06-26 10:59:31 -05:00
Romain Jayles
94b82655fa drivers: bluetooth: dedicated Kconfig for the STM32WBA configuration
Adds a Kconfig for the STM32WBA associated BT configuration

The first configuration added is the possibility to activate the
calibration of the radio using the temperature

Signed-off-by: Romain Jayles <romain.jayles@st.com>
2025-06-26 10:59:31 -05:00
Johan Hedberg
c186a3110c Bluetooth: drivers: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Dmitrii Sharshakov
639bccf969 Bluetooth: drivers: make H4 and H5 follow CONFIG_BT_HCI_INIT_PRIORITY
In some cases UART drivers might have too high init priorities
so HCI must be initialized even later if used with those.

One example is zephyr,native-tty-uart.

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2025-06-21 13:14:45 +02:00
Jori Rintahaka
0d5ed7c306 drivers: bluetooth: hci: silabs: fix radio IRQ priorities
Fix radio IRQ priorities. With the Controller update from SiSDK,
its behavior changed so that it overwrites the IRQ priorities.

Reconfigure the priorities after the Controller is initialized.
Source interrupt numbers and priorities from devicetree.

Also set the SYNTH IRQ priority on all HW, and set either the
RDMAILBOX or HOSTMAILBOX IRQ depending on which one exists.

Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-06-18 17:45:51 -04:00
Jori Rintahaka
133f5bc3c2 drivers: bluetooth: hci: refactor silabs controller init
Refactor the controller init to use the new init routines the
controller now provides. Instead of using a hardcoded set of
features, the features are now initialized based on Kconfig
values that the application selects.

Add config files under modules/hal_silabs, used by the controller
init routines in the external module hal_silabs to determine which
features to enable based on Kconfig options. This brings the
controller feature configurability to roughly parity with the
Simplicity SDK.

Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-06-18 17:45:51 -04:00
Nirav Agrawal
ffe8daa767 drivers: bluetooth: add BT-CAL data load for NXP IW612/IW416 SoC
- Add support for default Annex-55 Bluetooth calibration data load
 for both IW612 and IW416 SoC.
- Add support for default Annex-100 Bluetooth calibration data load
 for both IW612 and IW416 SoC.

Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
2025-06-13 10:36:28 -04:00
Ali Hozhabri
ecf795f0f1 drivers: bluetooth: hci: Use TRNG peripheral for BLE purpose on WB0x
Call entropy APIs to use TRNG peripheral on STM32WB0x devices for BLE
purposes.

Enable RNG node on Nucleo-WB0x boards.

Remove RNG initialization as it's done in the entropy driver.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2025-06-12 09:32:41 -07:00
Matthias Ringwald
b67b5c5dc1 bluetooth: cyw43xxx: support newer PatchRAM files
The CYW43xxx for Infineon Controllers stops after the first LauncRAM
command. Newer Controllers like the CYW5557x update the firmware in
multiple stages, which is supported by this commit.

Signed-off-by: Matthias Ringwald <matthias@ringwald.ch>
2025-06-11 16:04:56 -07:00
Matthias Ringwald
e50f03404e bluetooth: cyw43xxx: support autobaud feature
Newer AIROC controllers like the CYW55573 don't support changing the
baudrate in Download Mode. However, a higher baud rate can be used
directly to sent HCI Reset.

This commit adds the KConfig flag CONFIG_AIROC_DOWNLOAD_MODE to enable
the new behaviour.

Signed-off-by: Matthias Ringwald <matthias@ringwald.ch>
2025-06-11 10:12:24 -07:00
Guotao Zhang
b2c4397185 drivers: bluetooth: hci: nxp: add Kconfig for IW610
Add Kconfig BT_NXP_IW610.

Signed-off-by: Guotao Zhang <guotao.zhang@nxp.com>
2025-06-09 14:30:04 -07:00
Axel Le Bourhis
928aa4a196 drivers: bluetooth: hci_nxp: fix discarding multi part adv reports
In case of extended advertising, advertising data can be reported in
parts, so we shouldn't discard them.
Instead, only discard the legacy advertising reports.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2025-06-06 08:45:33 +02:00
Lyle Zhu
71ef6c6979 Drivers: Bluetooth: H4: Use a semaphore to wake up HCI RX thread
There is an issue that the buffer cannot be allocated by the function
`read_payload()` in UART ISR context. Then the UART RX will be
disabled. The H4 driver hopes to get the receive buffer in the HCI RX
thread and then open the UART RX again. However, there is a situation
where the HCI RX thread is blocked in getting the received data
buffer. However, since the UARt RX has been disabled, the HCI RX
thread cannot get the received data buffer. Therefore, the RX thread
is always blocked here, causing the Bluetooth host to not work
properly.

Add a semaphore `rx.ready` to notify new received data buffer has
been added to H4 RX queue.

Wait for the semaphore `rx.ready` instead of H4 RX queue in HCI RX
thread.

Wake up the HCI RX thread when failing to allocate the RX buffer.

Fixes #89879.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-05-26 11:54:09 +02:00