Commit Graph

103487 Commits

Author SHA1 Message Date
Benjamin Cabé a5ecd339d7 doc: boards: extensions: update code comment for consistency
Very minor fix for having consistent style in the coment

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-11 13:14:29 -04:00
Carles Cufi b0f6f1d33a Revert "lib: fix ubsan errors in cbvprintf_package"
This reverts commit 6f95a50553.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-10-11 13:13:49 -04:00
Quy Tran 4793e00ae8 boards: renesas: Add configurations to support pwm on EK-RA8D1
Add support for PWM driver on EK-RA8D1

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2024-10-11 09:28:29 +02:00
Quy Tran 1391355ac4 boards: renesas: Add configurations to support pwm on MCK-RA8T1
Add support for PWM driver on MCK-RA8T1

Signed-off-by: Quy Tran <quy.tran.pz@renesas.com>
2024-10-11 09:28:29 +02:00
Duy Phuong Hoang. Nguyen 59dbbb347d drivers: pwm: Initial support for PWM driver on RA8
Add PWM driver code support for RA8. This support is using
GPT HW

Signed-off-by: Duy Phuong Hoang. Nguyen <duy.nguyen.xa@renesas.com>
2024-10-11 09:28:29 +02:00
Curtis Malainey 6f95a50553 lib: fix ubsan errors in cbvprintf_package
It is undefined behaviour to shift / add offsets to a null pointer.

Move to direct offset tracking to satisfy UBSAN.

Simple translation of code:
buf0 -> buf
buf +=/++ -> offset +=/++
buf = -> buf+offset =

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-10-11 09:28:21 +02:00
Lucas Dietrich d056455fce dts: Enable AES node in nucleo_l4a6zg.dts
Activate AES node in nucleo_l4a6zg.dts to enable testing of the
st,stm32l4-aes driver in CI.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich 1d9af414d6 dts: stm32l4: Update AES node for stm32l4 series
The stm32l4 devices were previously assigned the generic STM32 AES driver,
which turned out to be incompatible with the stm32l4 series. This commit
updates the nodes to use the new driver specifically designed for this
series.

Add missing node for stm32l4a6, stm32l4q5, stm32l4s5 and stm32l486 socs.

It appears stm32l4p5 and stm32l496 socs do not have the AES accelerator
present, so the nodes are removed from the dts files.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich 11abb5e4fc drivers: crypto: Fix pointer type warnings in STM32 AES driver
This patch resolves compiler warnings related to mismatched pointer types
between the STM32L4 and generic STM32 AES HAL by introducing CAST_VEC
macro.

Fix github CI warning

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich ad431dcc23 drivers: crypto: Add support for STM32L4 AES accelerator
This patch completes the addition of support for the STM32L4 AES
accelerator by introducing conditional handling for different STM32 AES
HAL variants. Key changes include:

- Created device tree bindings `st,stm32l4-aes` for STM32L4 AES
- Replaced `copy_reverse_words` with `copy_words_adjust_endianness`
to handle endianness conversion for different variants.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Lucas Dietrich 8f0de8455d drivers: crypto: Refactor encryption and decryption functions for STM32 AES
This patch introduces a unified function pointer approach to handle
encryption and decryption operations for the STM32 AES accelerator.

- Replace separate `do_encrypt` and `do_decrypt` functions with a generic
`do_aes` function, using function pointers to AES HAL functions.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2024-10-11 09:28:12 +02:00
Alexander Kozhinov fbeda5959d drivers: ethernet: eth_stm32_hal_priv.h
Remove unused missleading definition.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-10-11 09:28:05 +02:00
Alexander Kozhinov 0036b8bf21 drivers: ethernet: eth_stm32_hal
Drop preprocessor redefinitions

Some preprocessor defines were redefined to follow
stm32 hal naming conventions.
People seems to be confused by redefines and use
them with alternating names.
This PR does not change code behaviour,
but shall increase it's readability.

Signed-off-by: Alexander Kozhinov <ak.alexander.kozhinov@gmail.com>
2024-10-11 09:28:05 +02:00
Laurentiu Mihalcea 2fcd6c0ae4 boards: nxp: imx8{qm/qxp}_mek: enable PDs and runtime PM
Enable support for device runtime PM and power domains.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea fdbf4d23df dts: xtensa: nxp_imx8: add power domain for irqsteer
Add power domain DT node for the irqsteer and a reference to
it in irqsteer's DT node.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea 202794273d drivers: intc: irqstr: add PM support
Add support for PM. The strategy is as follows:

	1) For level 1 interrupts: don't care, these don't
	require the PM domain of irqsteer to be turned on
	since they are, well, direct.

	2) For level 2 interrupts: use the reference count
	of the dispatchers.

Upon doing a get() on a dispatcher with its reference count
set to 0, before enabling the IRQ (meaning accessing the
reg. space) increment the reference count of the irqstr device
(which will result in the PM domain being enabled if 0).

Upon doin a put() on a dispatcher with its reference count
set to 1, after disabling the IRQ (meaning accessing the
reg. space) decrement the reference count of the irqstr device
(which will result in the PM domain being disabled if 0).

In summary, the PM domain of the device will be enabled if
at least one dispatcher is in use. On the other hand, the
PM domain of the device will be disabled if there's no
dispatchers in use (assuming there's no other dependencies).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea 4fba1d4642 drivers: power_domain: add driver for NXP's SCU-managed PDs
Add driver for NXP's SCU-managed power domains.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea 6b6443f11f include: dt-bindings: power: add IMX SCU resource header
Add header file containing definitions of IDs for all resources
managed by NXP's SCU.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea fb84f4f53f dts: bindings: power-domain: add binding for NXP's SCU-managed PDs
Add DT binding for NXP's SCU-managed PDs. This binding describes
exactly _one_ power domain.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea e8d28bfdfd drivers: dai: sai: disable IRQs when not needed
IRQs are currently only enabled during the driver
initialization function (i.e: sai_init()). As such,
even though they're not needed (i.e: after a TRIGGER_STOP
operation) they remain enabled. Fix this by enabling IRQs
after during the TRIGGER_START operation and disabling them
during the TRIGGER_STOP operation.

This change is required by irq chips (i.e: irqsteer) which
perform PM operations during irq_enable()/irq_disable(). If
interrupts are left enabled all the time that means the irq
chip's PM resources might also remain enabled.

To make this change possible, the irq will have to be stored
inside the SAI's configuration structure.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea 48b98a9284 drivers: dma: dma_nxp_edma: disable IRQs when not needed
IRQs are currently only enabled during channel setup
and never disabled. As such, even though they're not
needed (i.e: after a channel has been suspended or stopped)
they remain enabled. Fix this by enabling IRQs during the
channel start() operation and disabling them during the
channel stop() operation.

This change is required by irq chips (i.e: irqsteer) which
perform PM operations during irq_enable()/irq_disable(). If
interrupts are left enabled all the time that means the irq
chip's PM resources might also remain enabled when not needed.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea c7be48aae4 drivers: intc: irqstr: manage dispatchers dynamically
Currently, all dispatcher interrupts are enabled during
the driver init() function, which will cause a bus fault
unless the PM domain associated with irqsteer is powered on.

Since PM will be done during irq_enable()/irq_disable(),
add support for dynamically enabling/disabling dispatchers.
This way, the reg. space of the dispatchers will be accessed
when the PM domain is powered on.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Laurentiu Mihalcea d274cabf83 drivers: intc: irqstr: add reference count for IRQs
Currently, shared interrupts pose a big problem because
irq_disable() doesn't keep track of the number of clients
using that interrupt line. As such, add a reference count
mechanism which will stop the interrupt from being disabled
if there's still clients using it.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Ioannis Damigos 7455bf50d2 twister: Fix reported testcase execution time
Testcase execution time doesn't match between twister.xml and
twister.log. Testcase execution time is the sum of the previous
testcases' execution time plus its own execution time in
twister.xml.

This patch fixes the issue above.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-10-11 09:27:51 +02:00
Jun Lin b05e23cbf0 dts: npcx: remove unnecessary sub-power state for npcx4
NPCX9 and former chips defines two kinds of sub-power-states to support:
1. Standard wake-up time: if the chip needs to stay in the deep sleep
   state more than 200 ms.
2. Instant wake-up time: if the chip needs to stay in the deep sleep
   state less than 200 ms.

As NPCX4 can stay in the deep sleep state at more than 200 ms with the
instant wake-up capability, we can define only one sub-power state.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-10-11 09:27:45 +02:00
Phi Bang Nguyen 6acad9bd91 include: drivers: video: Remove unused video-controls header
Remove the unnecessary video-controls header included in video.h.
Drivers, applications should explicitly include it when needed.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-11 09:27:38 +02:00
Phi Bang Nguyen d29ef14bcf include: drivers: video: Run clang-format
Run clang format before making changes

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-11 09:27:38 +02:00
Bjarki Arge Andreasen e40fa8914f MAINTAINERS: add entry for comparator drivers
Add entry for comparator drivers

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 43f88ca8e1 doc: release notes: added comparator release notes
Added comparator support to release notes for release 4.0

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 183e58b190 docs: hardware: peripherals: add comparator docs
Add documentation for the comparator peripheral and shell.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 4ff9886e48 tests: drivers: comparator: add shell test suite
Add test suite for comparator device driver shell.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 2fbe105a47 drivers: comparator: add fake comparator
Add fake comparator driver and bindings for use with testing.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen b7648f89c4 drivers: comparator: add shell
Add shell for comparator device drivers.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 6ed855a53f tests: drivers: build_all: comparator: add mcux_acmp
Add mcux_acmp device driver to build_all test suite.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen d37f844104 drivers: comparator: add mcux acmp device driver
Add mcux SDK based kinetis acmp device driver implementing the
comparator device driver API.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 3b08a08c7f doc: releases: migration-guide: deprecated nxp,kinetis-acmp props
Add entyr mentioning the deprecation of the nxp, prefixed properties
in the nxp,kinetis-acmp dts binding.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 4e55597527 drivers: sensor: mcux_acmp: update dts binding and adapt driver
Update the devicetree binding for the nxp,kinetis-acmp comparator and
move the binding to dts/bindings/comparator.

The update to the binding includes:
- Remove unused io-channel-cells property
- Remove unused sensor-device include
- Adding missing properties dac config, discrete mode config, and
  input configs.
- Rename properties to exclude redundant vendor prefix since props in
  this binding are not inhereted, and as such, don't need to be
  namespaced.
- Deprecate the old names of the renamed properties

The sensor based device driver has been updated to support both the
deprecated and new property names. This allows it to use both
nxp,enable-sample and filter-enable-sample for example.

Additionally, remove the unused io-channel-cells properties from
in-tree nodes of compatible = "nxp,kinetis-acmp"

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen e0363f252d sensor: mcux_acmp: namespace driver and kconfigs
The mcux_acmp will get support by the comparator subsystem. To avoid
namespace clashes, namespace the driver, kconfigs and use the
MCUX_ACMP config solely to select the MCUX SDK driver.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen a4fce338ac tests: drivers: build_all: comparator: add nrf_lpcomp
Add nrf_lpcomp to build_all comparator test suite.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 04e70ab96c drivers: comparator: add nRF LPCOMP device driver
Add nRF LPCOMP device driver.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 13af5ca0dc tests: drivers: build_all: add comparator test suite
Add comparator build_all test suite designed to test multiple
devicetree overlays and boards for each comparator device driver.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 4adc92475d drivers: comparator: Add nRF COMP device driver
Add nRF COMP device driver and remove deprecated bindings from
dts/bindings/sensor.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen ffbda1b0f8 dts: common: nordic: adjust comparator nodes
Adjust comparator nodes of nrf SoCs to exclude the unused
io-channel-cells property and simplify the comment describing how
to configure the comparator hardware block as COMP or LPCOMP for
SoCs which support this.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 211bdd935c drivers: comparator: Add initial files
Add top level CMakeLists.txt entry and Kconfig options along with
userspace handlers for comparator API.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 00cefa15ff drivers: Add comparator API
Add comparator API header.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Jordan Yates 97db13dc09 scripts: west_commands: runners: propagate arguments
Provide a mechanism to propagate useful arguments from one runner to the
next. The primary use case for this is to propagate a JLink serial
number, so that if it is queried from the terminal the user only needs
to make the choice once.

Implements #76077.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-10 20:24:35 -04:00
Nerijus Bendžiūnas c591994b4f docs: settings: clarify conditions for csi_save_start and csi_save_end
Clarify that the actual calls to these backend functions are made
from `settings_save_subtree()`, which is called by `settings_save()`
or can be used directly.

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@astrolightspace.com>
2024-10-10 20:24:21 -04:00
Bernardo Perez Priego 1cc93810d0 ec_host_cmd: Fix generating multiple Port80 notifications
Port80 notifications are continously generated as long as NOT_EMPTY
bit inside of Data Attributes register is set. This register was only
read once prior entering loop and its value was not checked on each
iteration.

This patch will include reading Data Attributes register on each
iteration, this way we can exit loop when no more data is available.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2024-10-10 20:24:06 -04:00
Vinayak Kariappa Chettimada ad6c0512ad Bluetooth: Controller: Fix CIS payload count under skipped events
Fix CIS payload count calculation under skipped events that
caused CIS disconnection with reason MIC failure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-10 20:23:36 -04:00
Kevin ORourke 3399e0614a shell: backend: telnet: Don't assert if connection closed
The code in shell_ops.c that calls telnet_write will assert if it
returns non-zero. For a telnet shell it's normal that the
network might disconnect unexepectedly, so that should not
trigger an assert.

Fixes #67637

Link: https://github.com/zephyrproject-rtos/zephyr/issues/67637

Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
2024-10-10 20:23:18 -04:00