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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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#79490Fixes#79470
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
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>
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>
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>
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>
`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>
`_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>
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>
SAADC peripheral for nRF54L Series allows to choose internal
voltages as positive inputs.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
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>
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>
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>
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>
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>
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>