Commit graph

23353 commits

Author SHA1 Message Date
Yassine El Aissaoui
89709ee382 drivers: hci: Update NXP HCI driver
Add updates to support MCXW71
Add support if RX data are received in ISR context
Add support to set BT address using Vendor command

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-10-17 09:45:42 +02:00
Chaitanya Tata
9eedb6d7c8 drivers: nrfwifi: Fix build error
This crept-in due to bad merge conflict resolution.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
cd736558ef drivers: nrfwifi: Fix build errors when Util is enabled
This path is disabled by default.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
d30161cd8b drivers: wifi: Fix mutex re-initialization
The mutex is used to protect RPU zephyr context which gets modified for
every interface down and up (including recovery), so, it was being
re-initialized but also used to protect down and up which is a bug.

Move the re-initialization to the driver entry so that it happens only
once and we can properly use the mutext for down and up protection.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
ce9d71c476 drivers: wifi: Fix missing unlock for stats
The RPU context lock is not unlocked this is causing recovery to be
stuck waiting for the lock.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
67216f1b5a drivers: wifi: Fix crash when recovery is triggered
There is a race condition when recovery is in progress and in parallel
Wi-Fi util commands are being executed (CTF), where the RPU context is
de-initialized as part of recovery but no checks are present in the
Wi-Fi util command processing causing a crash.

This needs a proper fix for all commands, but for maintenance branch
fix is added only for commonly used commands.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Ajay Parida
fe920fc9c9 drivers: wifi: Add PS exit strategy runtime configuration
Dynamically set power save exit strategy runtime configuration that
allows to switch b/w stratgies depending on conserving power and
low-latency traffic download.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
d0d659b675 drivers: wifi: Use mutex for spinlock
Ideally we should be using Zephyr spinlock APIs but that requires
changes to shim API, so, for this maintenance release just replace with
mutex to keep the context same and no API changes.

This solves the locking issue that we see when control and data path are
excited concurrently due to locking semantics of semaphores, the issue
is not root caused but mutex enforce strict locking semantics for
multiple threads and solve the issue.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
5f6dca377a drivers: wifi: Fix shell hang
Add a null check for HAL context in the interrupt handler, this was
causing locking issue operating on null. The root cause of null is not
known, but this solves the locking issue when data and control paths are
excited in parallel.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
7c3d342796 drivers: wifi: Add support for keepalive
To handle interoperability issue with few APs, add a feature to keep
sending keepalive frames periodically to avoid AP disconnecting the STA.

This is disabled by default to avoid unnecessary power consumption as
it's only seen with few old APs.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
94f9fb95d9 drivers: wifi: Increase default PS active timeout interval
In crowded environments RPU is active for more than 10s due to too many
retries and this triggers a false RPU recovery. To avoid this, increase
the default to 50s to handle corner cases, as this will only impact the
recovery triggered case, higher timeout doesn't have any impact in
normal cases.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
dbda09d3e5 drivers: wifi: Enable management buffers offload
With this offload, host doesn't need to manage RX buffers for management
frames, and this saves Host-RPU comms and thus giving RPU to sleep more
often and is essential to test RPU recovery.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
a4537a7eea drivers: wifi: Add PS state debugs
These are very frequent, so, a separate debug is added for debugging
host RPU recovery logic.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
9c36d97646 drivers: wifi: Fix TX buffers leak
During interface down in case TX has pending buffers in either TXQ or
Pending_Q then they are not freed instead the Q itself is freed.

Fix by traversing the Q and freeing all members.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
5c8f1807c1 drivers: wifi: Fix RPU recovery disabled build failures
Fix RPU recovery protection to solve build failures when RPU recovery is
disabled.

As recovery is primarily based on power-management, add a Kconfig
dependency to enforce, this simplies the macros to protect the code.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
9b105698ed drivers: wifi: Add RPU recovery retry mechanism
In case RPU is stuck in consecutive recovery over a time period then
that means it's not recoverable through RPU recovery, only thing left to
do is to trigger a system reboot. This feature is disabled by default,
so, either application can do their own implementatio or enable this
feature in the driver along with configurable retries and window period.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
6f7fbf8451 drivers: wifi: Fix the NULL check
Check for RPU context as well.

To fix this properly we need more fixes to be backported, but this
should suffice for now.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
ed7c10ead3 drivers: wifi: Add quiet period for RPU recovery
This is to avoid successive recoveries in case we get successive
watchdog interrupts from the RPU.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
ce521b89ee drivers: wifi: Ignore parallel recovery requests
During recovery we might get further watchdog interrupts causing
multiple recovery requests, ignore them if a recovery is already in
progress.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
c1afe97e94 drivers: wifi: Increase the propogation delay
In order for the interface down to propagate and cleanup it needs more
time, using Shell 10ms was working due to human delay, but
programatically this needs higher delay.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
1e5db78afc drivers: wifi: Add support for separate debugs for RPU recovery
These are helpful for debugging RPU recovery only.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
a23184c473 drivers: wifi: Add a sanity check for RPU comms
Before proceeding with RPU bringup, do a sanity check by reading a known
signature to make sure the Host-RPU comms are operational.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
04ddd6d2b0 drivers: wifi: nrf700x: Ignore all failures in iface down
In case RPU is stuck and need a recovery, the failures in interface down
should be ignored as they are expected and we should proceed with device
removal that in turn removes power to the RPU.

TODO: This works for single VIF, but needs more thought for multi-VIF.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
5ad7339311 drivers: wifi: Fix RPU recovery not being triggered
During watchdog (or any) interrupt processing, RPU accesses are being
made and they assert the wakeup_now flag this causes RPU recovery to not
trigger.

New false or true recovery detection algo:

 Check the time difference b/w last de-assert and assert, and if it
 exceeds minimum time needed for RPU to enter sleep, then not the
 timestamp. This timestamp will be used to compare when a watchdog
 interrupt is received and see if during the last window if host has
 given a chance for RPU to attempt sleep, if yes, then attempt recovery
 else ignore watchdog.

Also, add a Kconfig for the 10s active time that triggers recovery, this
needs to be passed to the FW (once we have enough patch memory).

Also, add a Kconfig for the minimum time needed for RPU to attempt sleep
in positive case.

Also, add a new _ms API for time stamp fetch, this is to avoid
precision loss when converting to and from ms to us and also makes code
readable by avoiding *1000 and /1000.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Sylvio Alves
59f0418d2e soc: esp32: unify runtime heap usage
This commit applies several changes in the way "heap_runtime"
feature is used. It can't be split due to bisectability issues.

Whenever the feature is enabled, a new heap is created and
custom malloc/calloc/free functions are added into the build
system. Those functions are currently used for internal Wi-Fi and BLE
drivers only.

Such changes are described below:

1) Rename heap.c to esp_heap_runtime.c for better readability.
2) Rename RUNTIME_HEAP to HEAP_RUNTIME to make it similar to what is
available in Zephyr.
3) Add runtime heap to BT as such as Wi-Fi.

Fixes #79490
Fixes #79470

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-17 09:45:02 +02:00
Sylvio Alves
882ac1d088 drivers: esp32: wifi/bt: modify init call return error
Update both Wi-FI and BLE init codes to return proper
error code and logging when it is missing heap.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-17 09:45:02 +02:00
Tom Chang
cbb322937f drivers: espi: npcx: support espi taf rpmc request
This commit adds support for handling espi taf rpmc requests.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-10-17 09:44:39 +02:00
Fabio Baltieri
b23fea114d input: gpio_keys: add a no-disconnect property
Add a no-disconnect property that skips the call to disconnect the pin
during suspend, this is useful as not all gpio controllers supports pin
disconnection, and right now using the gpio-keys driver on one of those
results in a failed initialization if PM runtime is enabled.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-10-17 09:43:25 +02:00
Aleksander Strzebonski
18fb3f9a32 usb: dwc2: Allow for enabling USB if the cable is disconnected
Adds CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT_MS that allows
for waiting for a USBHS VBUS ready event for a specified
amount of time. Earlier it waited forever and because of that,
the udc_enable() was blocked forever if the USB cable was
disconnected. Now the function returns error on timeout.

Signed-off-by: Aleksander Strzebonski <aleksander.strzebonski@nordicsemi.no>
2024-10-16 16:37:31 +01:00
Andrzej Głąbek
edc4f75b61 soc: nordic: Fix the way of enabling clock control for nRF54H Series
This is a follow-up to commit 7a2ce2882a.

Do not enable clock control by default on nRF54H Series SoCs when
the system timer is present, because clock control is not needed
for this purpose there.

Add missing `default y` in the CLOCK_CONTROL_NRF2 Kconfig option that
enables compilation of clock control drivers for nRF54H Series.
This way modules that actually require clock control (like drivers
that use radio) will be able to enable it using the generic option
(CLOCK_CONTROL), not the above one that is specific for nRF54H.

Update accordingly applications that referenced the CLOCK_CONTROL_NRF2
option.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-10-16 16:36:51 +01:00
TOKITA Hiroshi
3c4789aca3 drivers: wifi: eswifi: Resolve the dependency on RING_BUFFER
`eswifi-uart` uses the ring buffer library, but the dependency is
not indicated.
Specify `select RING_BUFFER` to resolve the dependency.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-16 12:27:05 +02:00
TOKITA Hiroshi
01f4c20fdc drivers: wifi: eswifi: Specify POSIX-2008 to use strnlen()
`_POSIX_C_SOURCE` must be specified to use the `strnlen()` function
in string.h. Make sure to specify this explicitly.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-16 12:27:05 +02:00
Hao Luo
e7a64f74a8 drivers: i2c: add runtime put for error path
The previous error path incorrectly returned without
calling runtime put async

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-10-16 12:26:17 +02:00
Yangbo Lu
6a8cdf42b5 drivers: clock_control_mcux_ccm_rev2: add NETC clock support
Added NETC clock support for clock_control_mcux_ccm_rev2.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-10-16 10:00:32 +02:00
Yangbo Lu
553079350c drivers: ethernet: add NXP i.MX NETC driver
Added NXP i.MX NETC driver based on NXP MCUX SDK driver APIs.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-10-16 10:00:32 +02:00
Yangbo Lu
4986809581 drivers: mdio: add NXP i.MX NETC MDIO driver
Added NXP i.MX NETC MDIO driver based on NXP MCUX SDK driver APIs.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-10-16 10:00:32 +02:00
Armin Kessler
9564a3b431 drivers: video: esp32s3: Add set_signal video api function
This PR implements the set_signal callback from the video API.
A signal registered on VIDEO_EP_OUT raises once a new image has
been received completely.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-10-16 10:00:01 +02:00
Nikodem Kastelik
ece7da5947 drivers: adc: nrf: add support for nrf54l internal SAADC inputs
SAADC peripheral for nRF54L Series allows to choose internal
voltages as positive inputs.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-10-16 09:59:16 +02:00
Nikodem Kastelik
d494769948 dts: nordic: refactor bindings helper symbols for SAADC
Split header files containing symbols denoting SAADC inputs
so that only supported inputs can be used for given device.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-10-16 09:59:16 +02:00
Sylvio Alves
7668a4d27e drivers: counter: esp32: force capture to read value
Force capture call so that timer counter value is updated
accordingly.

This also adds get_value_64 counter API function.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-16 09:58:47 +02:00
Chaitanya Tata
cb1ea80c02 drivers: nrfwifi: Add provision to handle FW blobs externally
The FW blobs are contentious topic in OSS, so, add a provision to use
external tooling (e.g., NCS) to handle FW blobs for advanced usecases
(e.g., storing in external flash).

This won't be used upstream, only built-in or build-only are supported.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-16 09:57:39 +02:00
Chang Feng
2e93bcf2d7 driver: serial: gd32: add irq_update
Add missing api irq_update for gd32.

Signed-off-by: Chang Feng <chang_196700@hotmail.com>
2024-10-16 09:57:05 +02:00
Maochen Wang
d916d7287d drivers: wifi: nxp: fix build error
Fix build error of undefined 'nxp_wifi_ret_t'.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-10-16 09:56:04 +02:00
Emilio Benavente
82a192c8a9 boards: nxp: Removing CONFIG_PINCTRL from the boards defconfig
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-10-15 19:09:45 -04:00
Hake Huang
fb1ffff7d3 driver: uart: uart_mcux_lpuart fix issues in async api
1. optimized the logic for buffer usage in async api
2. skip timeout flush when the remaining counts is 0,
   as this will trigger dma_callback to process.
3. remove scatter mode, as we are not using this mode
4. trigger after dma_reload.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-10-15 19:09:19 -04:00
Jordan Yates
1637443dc0 sensor: current_amp: request calibration
Request calibration on ADC samples to improve the accuracy of the ADC
outputs and therefore the final measured current.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-15 19:07:21 +01:00
Kapil Bhatt
28b74947e0 wifi: Add wrapper APIs for offloaded raw TX feature
Add wrapper APIs for the offloaded raw TX feature supported
by nRF70 devices.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-10-15 19:06:52 +01:00
Kapil Bhatt
5c3cc3730a drivers: nrfwifi: Create separate offloaded raw tx mode
Create separate offloaded raw tx mode which will work
as stand-alone compile-time mode.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-10-15 19:06:52 +01:00
Krzysztof Chruściński
b773306a56 drivers: sensor: nordic: qdec: Add runtime PM
Add runtime PM to the driver.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-15 19:06:01 +01:00
Romain Pelletant
8ee66a151e drivers: i2c: i2c_gecko: add exclusive access
- Add exclusive and atomic access to resource

Fixes #79110

Signed-off-by: Romain Pelletant <romainp@kickmaker.net>
2024-10-15 19:05:24 +01:00