Commit graph

639 commits

Author SHA1 Message Date
Benjamin Cabé
e936d7759c drivers: dma: dma_iproc_pax_v1: fix variable name in logging macro
Corrected the variable name from 'xfer_size' to 'xfer_sz' in
iproc-pax-dma-v1 driver.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-18 09:30:55 -04:00
Anuj Pathak
2af6adc745 drivers: dma: max32: check if bit other than status is set
we iterate over all the channels, and if more than one channel is
active at a time. interrupt on any one of active channel was
triggering callback for other active channel, because flags value
is 1 (enabled). this is commit handle this behaviour and only
trigger callback if bits other than status is set

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2025-06-17 17:46:05 +02:00
Yicheng Li
dea8cd3fcf dma_mcux_lpc: Fix descriptor address conversion when used by DSP
The SDK FSL DMA driver converts descriptor addresses to DMA's address
space when linking descriptors. The Zephyr dma_mcux_lpc driver is
missing the inverse conversion when dereferencing the linked next
descriptor pointer.

This isn't a problem when this driver is used on the M33 core
of the MIMXRT595S because the M33 can access the address space
of the DMA (0x20000000+). But when the Fusion F1 DSP core uses
this driver, the DSP cannot access the DMA's address space
so the inverse conversion is needed.

Signed-off-by: Yicheng Li <yichengli@google.com>
2025-06-17 07:23:31 +02:00
c37abf115d drivers: dma: fix the WCH DMA transfer width
The driver treats the `source_data_size` and `dest_data_size` as a
width in bits and converts 8 bits to 1, 16 bits to 2, and 32 bits to 3.

This should be a width in bytes with 1 byte mapping to 0, 2 bytes to
1, and 4 bytes to 3.

Note that this preserves the current behaviour of silently accepting
invalid transfer bit widths.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-06-16 14:01:54 -04:00
Benjamin Cabé
bc03f23d50 drivers: dma: fix off-by-one error in silabs LDMA
Channel numbers are 0-based so a channel number equal to the number of
channels is invalid.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-16 10:43:00 -04:00
Tahsin Mutlugun
f7d315cf49 drivers: dma: max32: Handle channel index conversion in HAL
Handle SoC-level differences in channel numbering logic in HAL.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-06-10 08:47:42 +02:00
Furkan Akkiz
85ef719eb2 drivers: dma: Add a wrapper function to fix build error
For MAX32657, 'MXC_DMA_EnableInt' function requires DMA instance
and this causes build error. To fix this, created wrapper version
of this function and update driver with it.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2025-06-10 08:47:42 +02:00
jacob kung
2fe357a592 drivers: dma: atcdmac300: add flush chain_block when Data cache is enabled
Add cache flush to ensure dma_chain is written back to memory
for DMA coherence

Signed-off-by: jacob kung <jacob.kung@egistec.com>
2025-06-10 08:47:34 +02:00
Mike J. Chen
9564a5e07b drivers: dma_mcux_lpc: fix bug using INPUTMUX
The typical way of calling INPUTMUX_AttachSignal() is to
bracket it around INPUTMUX_Init() and INPUTMUX_Deinit()
calls because we can reduce power consumption by not
keeping the interface powered when not changing INPUTMUX.

This driver was violating that convention, which caused
it to not coexist well with other code that followed the
usage convention because the INPUTMUX might be initialized
or not depending on execution order with the other modules.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-06-06 08:44:54 +02:00
Manuel Argüelles
77c2c454f7 drivers: dma: esp32: guard driver's kconfig options
Wrap the driver's options to prevent them from showing up in the global
Kconfig menu.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2025-06-03 09:15:28 +02:00
Daniel Baluta
85b6ff0b0b drivers: dma: sdma: Make access to DMA channel stats atomic
DMA channel stats like pending_length or free is not protected
and can be modified in parallel by a consumer and a producer.

This can result in non-atomic updates which in turn will result
in using stale data.

Fix this by making regions of code accessing dma stats atomic.

Fixes: e94c86f395 ("drivers: dma: Add initial support for NXP SDMA")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-05-28 20:02:31 +02:00
Daniel Baluta
312ff1c904 drivers: dma: sdma: Fix noise issue with pause/resume
Each time we configure an SDMA channel we also compute the total
allocated DMA buffer length but we assume is initialized with zero.

This is true each time a channel is requested. But if there are
multiple calls to configure without releasing the channel the buffer
length is not correctly computed.

So, we need to initialize it with zero each time we reconfigure the dma
channel.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-05-28 20:02:31 +02:00
5c2e2b7edc drivers: wch: fix the ch32vfun.h path after the recent HAL update
https://github.com/zephyrproject-rtos/zephyr/pull/87125 renamed the
`ch32vfun.h` header but missed some of the drivers. Fix.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2025-05-28 05:54:28 +02:00
Mahesh Mahadevan
6698f3b4e8 drivers: dma: Add PM handler for NXP LPC DMA driver
Add the PM handler. Reinitialize the DMA block in the
TURN_ON action, this is needed for some SoC's after the system
exits certain power modes.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-05-19 21:54:55 +02:00
Anas Nashif
2aacbcaab5 style: add missing curly braces in if/while/for statements.
Add missing curly braces in if/while/for statements.

This is a style guideline we have that was not enforced in CI. All
issues fixed here were detected by sonarqube SCA.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-17 14:10:33 +02:00
Hake Huang
0c5f13a599 tests: dma: enable dma test setting for NXP KE1XZ
NXP Ke1xz series need using mux starting from 60

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2025-05-16 19:00:17 +02:00
Kai Vehmanen
d411288bda dma: intel_adsp_hda: re-enable interrupts upon resume
Commit fa4a9db7a3 ("dma: intel_adsp_hda: Fix invalid init sequence and
register use") moved intel_adsp_hda_channels_init() out from resume
path. This causes a regression to CONFIG_DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT
as without irq_config() call the interrupt configuration may be partial.

Address this by calling irq_config() unconditionally on resume path.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2025-05-14 15:19:06 +02:00
Sai Santhosh Malae
5572e49bc9 drivers: dma: siwx91x: DMA reload bug fix
Current DMA driver reload function only works for 8-bit
data. This is due to incorrect interpretation of size
argument. Added changes to support other xfer sizes.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-05-13 22:21:30 -04:00
Vit Stanicek
eeaf860dfa dma_mcux_lpc: add host directions, DMA driver ctx, getter func
Add support for HOST_TO_MEMORY, MEMORY_TO_HOST directions (aliases of
MEMORY_TO_MEMORY). Implement dma_mcux_lpc_get_attribute function. Fix
missing DMA driver context.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2025-05-05 18:07:15 +02:00
Pisit Sawangvonganan
96325ad3e1 drivers: dma: remove '&' when assigning dma_xxx_init
Remove address-of operator ('&') when assigning `dma_xxx_init`
function pointer in `DEVICE_DT_INST_DEFINE` macro.

This change aims to maintain consistency among the drivers in
`drivers/dma`, ensuring that all function pointer assignments
follow the same pattern.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-05-04 19:55:44 +02:00
Sylvio Alves
a831122029 drivers: uart/dma: esp32: revert to PRE_KERNEL_1
printf is failing in hello_world sample due to current
uart driver init level. This reverts back to PRE_KERNEL_1.
As uart depends on GDMA, set it also to same level.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-04-28 16:40:20 +02:00
Pieter De Gendt
7b1d748e8b drivers: Wrap device driver APIs using DEVICE_API macro
Put the device APIs in their respective linker sections with the
DEVICE_API wrapper macro.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-04-28 13:41:03 +02:00
Sai Santhosh Malae
0d547d4e8a drivers: dma: siwx91x: SRAM desc alignment bug fix
Addressed an issue where alignment of dma desc varaible
of dma0 is corrected to 1024 instead of 512.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-22 16:54:11 +02:00
Sai Santhosh Malae
19e4c56e23 drivers: dma: siwx91x: Bug fix for regular DMA transfers
Addressed an issue where regular/non-scatter-gather DMA
transfers were not explicitly using the primary DMA descriptor
structure. This ensures a smooth regular DMA transfer after
any scatter gather transfer.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-22 16:54:11 +02:00
Sai Santhosh Malae
a7c06773fe drivers: dma: siwx91x: distinguishing mem to mem transfers
Introduced a new variable in the `dma_siwx91x_channel_info`
structure to provide a clean way to differentiate transfer
directions. This enhancement is utilized to trigger software
requests specifically for memory-to-memory transfers

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-22 16:54:11 +02:00
Jérôme Pouiller
8e5c95ed4b drivers: dma: siwx91x: Allow static allocation of DMA channel descriptors
Some instances of DMA (dma0) can use the normal sram to store their
descriptors. In this case, it makes sense to allow the linker to
allocate the memory rather than tweaking the memory layout.

So, if the attribute silabs,sram-region is not defined, use a statically
allocated buffer.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-04-17 17:23:32 +02:00
Jérôme Pouiller
832a006806 drivers: dma: siwx91x: Early init is not required
DMA can be initialized with the other devices. The user only need to the
ensure CONFIG_DMA_INIT_PRIORITY is less than the DMA consumers.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-04-17 17:23:32 +02:00
Jérôme Pouiller
164bbdf294 drivers: dma: siwx91x: Use DT to declare descriptors
Silabs siwx91x hardware use specific memory areas to store descriptors
for DMA requests. These areas are tightly coupled between the CPU and
the hardware. This helps in reducing the wait cycles.

Until now these addresses was also hard coded in the DT and in the
linker script. This patch leverage the zephyr,memory-region driver to
centralize the information in the DT.

Then, with this new implementation, the memory mapping is easier to
understand for the reader.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-04-17 17:23:32 +02:00
Fabrice DJIATSA
f8d1d354c5 drivers: dma: stm32: update function prototype after hal update
New HAL update changed the prototype of the check DMA flag functions.
C0 use a const parameter for these functions.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-04-11 17:32:01 +02:00
Adam Berlinger
457b6cb427 driver: dma: stm32u5 Optimize circular mode
This removes big structures allocated on stack.
It also moves linked list node to dedicated buffer.

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
2025-04-08 17:37:24 +02:00
Adam Berlinger
a4b819f953 driver: dma: stm32u5 Optimize stack consumption
Remove InitStructs of LL driver, since they take a lot of space on stack.
This can cause stack overflow in some scenarios.

Signed-off-by: Adam Berlinger <adam.berlinger@st.com>
2025-04-08 17:37:24 +02:00
Daniel Baluta
8bdf533d76 dma: nxp: sdma: Initialize channel capacity with zero
DMA channel capacity wasn't properly initialized and the computation
relies on it being zeroed.

This only works fine only when requesting channel the first time
causing problems when we have multiple cycles of channel
request/release.

Fix this by properly initializing the capacity when requesting the
channel.

Fixes 43a48d4630 ("drivers: dma: sdma: Update buffer descriptor")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-04-07 21:14:16 +02:00
Serhiy Katsyuba
7f818b5e72 Revert "drivers: dma: intel_adsp_hda: change L1_EXIT defaults"
This reverts commit c2f02533a6.

DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT should be enabled for all ACE platforms.
Any new platform in the ACE series will likely need it as well.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2025-04-04 12:07:08 +02:00
Andrew Featherstone
a2aa0a3e2b docs: raspberrrypi: Correct names of products
Replace occurrences of "RaspberryPi" with "Raspberry Pi" in
documentation, comment blocks etc. Correct the name of "PicoW" to
"Pico W", matching Raspberry Pi's documentation at
https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html .

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-04-03 15:27:50 -07:00
Sai Santhosh Malae
9594af85f0 drivers: dma: siwx91x: Enable scatter-gather transfer support
Implement support for scatter-gather DMA transfers in the siwx917 driver.
This enhancement allows the driver to handle multiple non-contiguous memory
buffers in a single DMA transaction

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-03 11:07:12 +02:00
Sai Santhosh Malae
6c9ec8d1c0 drivers: dma: siwx91x: Fix callback assignment for each DMA channel
Updated the driver to ensure that each DMA channel can properly
assign and handle individual callbacks.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-03 11:07:12 +02:00
Sai Santhosh Malae
8d3bb53495 drivers: dma: siwx91x: Add chan_filter API for DMA channel assignment
This new API allows the assignment of desired DMA channels for
peripheral transfers, enhancing flexibility and control over DMA
operations.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-03 11:07:12 +02:00
Sai Santhosh Malae
8930aed8d4 drivers: dma: siwx91x: Integrate dma_context features
Refactored the driver code to ensure compatibility with the
dma_context API, improving maintainability and consistency
with other DMA drivers in the Zephyr project.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-03 11:07:12 +02:00
Sai Santhosh Malae
ab57d54bb0 drivers: dma: siwx91x: Fix burst length processing
1. Corrected the burst length processing to be handled in bytes
   for the siwx917 DMA drivers.
2. Removed overlay and configuration files associated with the
   chan_blen_transfer test application. The chan_blen_transfer
   test application attempted to use 8 and 16 byte bursts, which
   are not supported by the siwx91x UDMA.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-04-03 11:07:12 +02:00
Tom Hughes
d5d12f43f8 drivers: dma_wch: Add __used instead of disabling unused function warning
#84065 replaced diagnostic pragmas with TOOLCHAIN_* macros, but we don't
need to use that here since __used is a cleaner way to indicate that the
function is used and will also prevent it from being optimized away at
link time if LTO is enabled.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-04-03 06:24:44 +02:00
Raffael Rostagno
fa6a9aef7b drivers: dma: esp32: Update for interrupt allocator
Update driver for unified interrupt allocator (Xtensa/RISCV),
to allow using shared interrupts.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-04-02 19:02:27 +02:00
Raffael Rostagno
4b8dc5f3ff drivers: esp32: Update for shared intc
Drivers update to use shared interrupt allocator for Xtensa
and RISCV devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-04-02 19:02:27 +02:00
Julien Panis
d8dbf5653e drivers: dma: Add support for cc23x0 DMA
Add support for 8-channel configurable DMA controller. The driver
supports the following features:
- memory to peripheral (ch0 to ch5)
- peripheral to memory (ch0 to ch5)
- memory to memory (ch6 and ch7)

Each DMA channel is multiplexed between two or more trigger sources:
- ch0 -> SPI0_TX or UART0_RX
- ch1 -> SPI0_RX or UART0_TX
- ch2 -> LRFD or UART0_TX
- ch3 -> ADC0 or UART0_RX
- ch4 -> AES_A or LRFD
- ch5 -> AES_B or ADC0
- ch6 -> Software Event Channel 0
- ch7 -> Software Event Channel 1

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2025-03-31 08:05:52 +02:00
Zhaoxiang Jin
7ed7cd191a modules: hal_nxp: Move hal_nxp glue layer to zephyr repo
Move hal_nxp glue layer to zephyr repo.
Fix build warnings and failures caused by hal_nxp upgrade.
Update manifest to contain hal_nxp changes.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-03-26 16:26:34 +01:00
Mahesh Mahadevan
d4d81637fb drivers: nxp: Fix selection of NOCACHE_MEMORY
Update how NOCACHE_MEMORY Kconfig is selected to
be based on CPU_HAS_DCACHE Kconfig.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-03-21 06:31:56 +01:00
Tom Hughes
11d70c61e5 everywhere: Replace diagnostic pragmas with TOOLCHAIN_* macros
The TOOLCHAIN_DISABLE_WARNING/TOOLCHAIN_ENABLE_WARNING macros are easier
to read and compiler agnostic.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-20 21:57:47 +01:00
Daniel Baluta
43a48d4630 drivers: dma: sdma: Update buffer descriptor count
Some SDMA scripts (e.g multi-fifo) updates the buffer descriptor
count field after a transfer is complete.

Re-initialize the buffer descriptor to point to the correct
transfer size for the next transfer.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-03-14 17:53:37 +01:00
Daniel Baluta
380ce33b2d dma: nxp: sdma: Enable multi fifo config for PDM
With PDM device NXP HAL uses multi-fifo script. In order
for this script to properly work we need to initialize
multi fifo and SW done configuration.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2025-03-14 17:53:37 +01:00
Tien Nguyen
342d2d7954 drivers: dma: Initial support for RZ/G3S
Add DMA driver support for Renesas RZ/G3S

Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-03-14 09:16:42 +01:00
Marcio Ribeiro
233d6b1bf5 drivers: dma: esp32: remove block size limitation
Removes block size limitation from dma rx and tx configuration

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2025-03-12 07:13:06 +01:00