Commit graph zephyr/drivers/dma
Author SHA1 Message Date
Venkatesh Odela
9021b0ea2f drivers: dma: dma_xilinx_axi_dma: clear reset state on stop
Clear DMA reset state in dma_stop() to allow proper restart during
interface up/down cycle.

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-04-17 10:37:43 +02:00
Pisit Sawangvonganan
531628e57a drivers: fix typo in (disk, display, dma, eeprom, entropy, espi)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/disk`
- `drivers/display`
- `drivers/dma`
- `drivers/eeprom`
- `drivers/entropy`
- `drivers/espi`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-27 20:21:24 -04:00
Mathieu Choplain
13c724de1e drivers: dma: stm32: enable the transfer error interrupt
The driver never enabled the transfer error interrupt. If a transfer error
occurred, the ISR would not be called which could result in a deadlock.

Make sure the transfer error interrupt is enabled.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-03-26 10:44:59 -04:00
Holt Sun
250d291ccb soc: nxp: kinetis: wire LMEM cache support
Wire the Kinetis LMEM-capable SoCs into the generic cache
management path by selecting the LMEM driver, enabling the
available instruction and system-bus cache capabilities, and
defaulting these parts to CACHE_MANAGEMENT with the external
cache backend.

Keep MCUX eDMA descriptors in the default SRAM placement on
SYSMPU-based Kinetis parts. Their SRAM region remains outside
the cached LMEM area, so they do not use the generic
NOCACHE_MEMORY path.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-03-25 07:57:21 -04:00
Francois Ramu
ab88831734 drivers: dma: stm32u5 dma driver use macro to retrieve the channel
Use the STM32_DMA_GET_CHANNEL macro for compatibility with
Stm32Cube HAL V2 model

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2026-03-23 14:57:56 -05:00
Francois Ramu
f9aa853411 drivers: dma: stm32 dma driver for stm32U5 compatible with HPDMA
The dma driver for stm32U5 compatible can support HPDMA instance
on the stm32h7rs series

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2026-03-23 14:57:56 -05:00
Raffael Rostagno
4011077e72 drivers: dma: esp32: PM support
Add Power Management support for GDMA driver.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2026-03-23 10:39:40 -04:00
Francois Ramu
1f4ad5d7d2 drivers: dma: stm32: update driver for stm32 hal2
The LL driver has a different access to the dmax_Channely,
and some macros have been renamed.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2026-03-20 20:44:12 +09:00
Sylvio Alves
be6c878e5c drivers: dma: add esp32c5 support
Extend the ESP32 GDMA driver to support ESP32-C5. Add the C5 SoC to
the AHB GDMA configuration and define the per-channel interrupt
source mappings.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-19 14:53:05 -05:00
Etienne Carriere
e237a97b82 west.yml: update the hal_stm32 modules with new stm32cube packages
stm32wbxx bump to version to 1.24.0
stm32wlxx bump to version 1.4.0

Update dma_stm32.h to sync with HAL new function prototype for
LL_DMA_IsActiveFlag_HT*() functions that now expect a const pointer
on STM32WLX series.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-03-18 15:11:59 -05:00
Hake Huang
e7b61d14f7 drivers: dma: raise TCD queue default for MCUX SAI
Set DMA_TCD_QUEUE_SIZE default to 4 when I2S_MCUX_SAI is enabled.
The MCUX SAI driver preloads 3 RX DMA blocks and requires the TCD
queue size to be greater than 3 to satisfy its BUILD_ASSERT and avoid
build failures in MCUX SAI I2S configurations.

Fixes #103997

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2026-03-17 18:19:38 -04:00
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Qiang Zhang
efe48ea674 drivers: dma: mcux_edma: add EDMA V4 no-DMAMUX m2m support
Add a loop to triggerchannel start for each remaining major loop iteration
to ensure complete data transfer.

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2026-03-12 14:01:27 -05:00
Dharun krithik k
e2fec44a74 drivers: dma: add infineon dma driver
Add a new DMA driver for the Infineon DMAC (Direct Memory Access
Controller) specifically for PSoC4 Series.

Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-03-12 09:19:33 -05:00
Tim Pambor
e7c454caf8 drivers: dma: stm32u5: remove unused function
Remove a unused function that causes a warning when building.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-09 11:09:36 +01:00
Brett Peterson
8a9b6fde49 drivers: dma: infineon driver descriptor config
Adding a way to configure x-loop increments greater than 1.
Fixing an issue where DMA descriptors that were allocated from a shared
pool were never freed.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-03-08 16:36:07 +01:00
Arunprasath P
f7018c171d drivers: dma: microchip: g2: Introduce DMA G2 driver
Add G2 DMA driver for Microchip DMAC Peripherals.
Implement the Zephyr DMA driver APIs, including channel configuration,
start, stop, suspend, and resume operations.

Signed-off-by: Arunprasath P <arunprasath.p@microchip.com>
2026-02-28 21:12:52 +01:00
Brett Peterson
ef44326a03 drivers: dma: infineon driver config update
Modifying DMA configuration to be more specific about when to use
software triggeres and the single elmeent input trigger type.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-02-26 21:24:20 +00:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Ha Duong Quang
adb19db6c1 drivers: dma: mcux_edma: fix IRQ mask width calculation
Correct GET_EDMA_CHANNEL_SHARED_IRQ_MASK_WIDTH to handle cases
where DMA channel count is ≤ 32. The previous implementation used
integer division by 32, returning 0 for counts < 32, which caused
issues in dma_mcux_edma_multi_channels_irq_handler().

New logic:
- Return 1 for ≤ 32 channels (one uint32_t mask)
- Return dma_channels / 32 for > 32 channels

Ensures proper mask width calculation for all supported channel

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
2026-02-11 16:33:50 +01:00
Pieter De Gendt
40cbbd5793 drivers: dma: Put driver APIs into iterable sections
Make sure all DMA drivers are located in their linker sections.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-11 07:59:34 +01:00
Andrej Butok
ff8d194fdd soc: nxp: kinetis: fix SOC_SERIES inconsistency
- Fixes Kconfig SOC_SERIES naming for Kinetis SoCs,
  as required by HWMv2.
- Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/69317

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-02-06 08:58:07 -06:00
Miika Karanki
e43d4b488c drivers: dma: stm32u5: check stream busyness in dma_suspend
Add additional business check to waiting SUSPF to be set so
that the loop cannot be executed forever when the dma stream
is idle.

When the stream is not busy, then there is nothing to suspend.
However, if suspend was attempted for an idle stream, then the
changed loop waited forever SUSPF to be set. This could have
happened at least when serial api tx_abort() is called with
stm32u5 and tx dma transfer becoming ready about the same time
the tx_abort() API is called.

Fixes #103042

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2026-02-05 13:00:42 +00:00
Benjamin Cabé
c64e54e895 drivers: dma: use proper essential type in boolean variables assignments
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-02-05 10:20:22 +00:00
Hoang Nguyen
29ddedd57d drivers: dma: renesas: Initialize p_reg in extended configuration
Initialize p_reg with the register base address from devicetree.

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-02-03 09:29:36 +01:00
John Batch
0a661bd607 drivers: dma: Correcting size calculation in Infineon HAL DMA driver
Corrects an incorrect transfer size calculation when setting up DMA
transfers with a data size other than one byte.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-29 16:13:19 -06:00
John Batch
76737d01d8 drivers: dma: infineon: Fixing DMA configuration size and addresses
* Corrects DMA length calculation when data size is not one byte.
* Corrects incorrect descriptor address assignment in chain operations.

Signed-off-by: John Batch <john.batch@infineon.com>
2026-01-29 16:12:56 -06:00
Kevin Chan
09ffa475c9 drivers: dma: fix channel_state
channelState depends on descriptor count

Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
2026-01-22 14:34:05 -06:00
Daniel Leung
61e9f9ea04 soc: intel_adsp: rename CONFIG_SOC_INTEL_ACE* to CONFIG_SOC_ACE*
Just following guidelines here.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-01-20 20:09:40 -05:00
Razvan Heghedus
8f2b245fe6 dma: mcux_edma: Fix channel gap for edma_reload_loop
`edma_reload_loop` doesn't take into account the DMA possible channel
gap. This is an issue for S32K3 series leading to system crashes when
higher DMA channels are used.

Signed-off-by: Razvan Heghedus <razvan.heghedus@protonmail.com>
2026-01-20 15:33:15 +00:00
Ashirwad Paswan
68b86a15a1 dma: rpi_pico: fix transfer count calculation
The Pico SDK expects a transfer count (items), not a byte count. The
driver incorrectly passed the byte size, causing buffer overflows on
16-bit and 32-bit transfers.Fix this by storing the transfer width in
the channel configuration and dividing the block size by that width
to calculate the correct transfer count.

Fixes #99435

Signed-off-by: Ashirwad Paswan <ashi06712@gmail.com>
2026-01-19 16:19:56 -06:00
Robert Hancock
8b287a6a74 drivers: dma: dma_xilinx_axi_dma: Make descriptors per-instance
Move the descriptor storage into the per-instance data structure rather
than being global, as they should not be shared between instances.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
0345fc9d2a drivers: dma: dma_xilinx_axi_dma: Fix up IRQ locking
The way the driver was storing IRQ numbers for later use in the various
locking modes was not correct, causing the wrong IRQs to potentially be
disabled/enabled in some modes. Refactor the way this is done to be
cleaner, and also the way the different locking modes are implemented in
order to ensure that all modes receive compile test coverage.

Also, ensure that the IRQ for the RX or TX channel is always disabled
during the execution of the corresponding ISR, to prevent it from being
preempted by itself if the DMA core raises another interrupt during the
ISR execution.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
c00f01fb97 drivers: dma: dma_xilinx_axi_dma: Use selective dcache flush/invalidate
This driver has a config option
DMA_XILINX_AXI_DMA_DISABLE_CACHE_WHEN_ACCESSING_SG_DESCRIPTORS to allow
it to be used on platforms where DMA memory access is not automatically
cache coherent. However, fully disabling the dcache when accessing DMA
buffers/descriptors is not necessary and is potentially problematic.
This can be handled more selectively by doing explicit cache invalidate
and/or flush operations on the buffers involved as required.

Note that this does introduce a requirement that RX DMA buffers provided
to the driver are cache line aligned, as otherwise the required cache
invalidate operation could potentially corrupt unrelated data. This is
explicitly checked when a DMA RX operation is started.

Tested on Cortex-R5 with data cache enabled.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
01d089ae02 drivers: dma: dma_xilinx_axi_dma: Remove polling timer
The driver previously had a timer to periodically check for completed
TX/RX transfers in case an interrupt notification was missed. With
previous changes to the driver to avoid lost interrupt wakeups, this
workaround should no longer be required, so remove it.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
dd352c1e5d drivers: dma: dma_xilinx_axi_dma: Fixes for DMA interrupt processing
Fix some issues in the driver's DMA interrupt handling:

-Ensure that interrupts are cleared prior to handling interrupt events,
so that events raised during interrupt processing will cause the
hardware to raise a new interrupt

-Ensure that we do not overwrite existing DMA descriptors which are
incomplete (such as by trying to execute more transfers than there are
slots in the descriptor ring)

-Ensure that error events reported by the DMA engine are reported

-Rename some of the variables to track pending and completed ring
locations for better clarity

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
1874b172b0 drivers: dma: dma_xilinx_axi_dma: Move global reset to init function
Doing a reset of the DMA engine during the dma_configure operation is
problematic when using the DMA core in combination with the Xilinx AXI
Ethernet core, since the DMA core's reset signals are normally
propagated into the Ethernet core. This means that after the Ethernet
core initializes and starts a DMA operation for the first time, the DMA
core is reset, wiping out all of the register settings that the Ethernet
core has made.

To avoid this, move the DMA core reset and other initialization which
only needs to be done once into the init function, so this is done
during initial driver load and not deferred until later.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
36909486e7 drivers: dma: dma_xilinx_axi_dma: Cleanup register access
Instead of using a packed structure to define the register map, just
create an enum for the registers and use that to refer to them. This
avoids the need for repeatedly disabling GCC warnings for taking the
address of packed structure members.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Robert Hancock
e0a268f501 drivers: dma: dma_xilinx_axi_dma: Add dependency for cache disable option
The DMA_XILINX_AXI_DMA_DISABLE_CACHE_WHEN_ACCESSING_SG_DESCRIPTORS
option is not meaningful to enable unless the platform/configuration
actually supports the corresponding cache maintenance operations. Add
dependencies accordingly.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2026-01-19 15:07:05 +01:00
Qiang Zhang
33e71b448b dts: arm: nxp: Update EDMA device tree configurations
Update EDMA device tree nodes for NXP MCXE31B platforms to align
with the unified EDMA driver implementation.

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2026-01-14 13:00:55 -06:00
Qiang Zhang
cdb53ec8aa drivers: dma: mcux_edma: Remove DMA_MCUX_EDMA_V5 configuration
The DMA_MCUX_EDMA_V5 configuration option has been removed and replaced
with DMA_MCUX_EDMA_V4, as both versions share the same register layout
and can use the same driver implementation.

Key changes:
- Remove CONFIG_DMA_MCUX_EDMA_V5 Kconfig option
- Replace DMA_MCUX_EDMA_V5 conditionals with DMA_MCUX_EDMA_V4
- Remove DMAx_Type typedef, use DMA_Type directly
- Update EDMA_HW_TCD macros for V4 to use HAL-provided accessor macros
- Add DMA_MCUX_EDMA_DMAMUX Kconfig option to control DMAMUX support
  based on device tree property
- Update device tree binding to add has-dmamux property
- Update HAL driver selection to use DMA_MCUX_EDMA_DMAMUX instead of
  DMA_MCUX_EDMA for DMAMUX component
- Add SOC_SERIES_MCXE31X to DMA_MCUX_TEST_SLOT_START configuration
- Calculate DMA_TCD_ALIGN_SIZE from edma_tcd_t structure size

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2026-01-14 13:00:55 -06:00
Etienne Carriere
b42b10f89e west.yml: update hal_stm32 module on H7RS/L4/L5/N6 stm32cube releases
stm32h7rsxx bumps to STM32CubeH7RS version 1.3.0.
stm32l4xx bumps to STM32CubeL4 version 1.18.2.
stm32l5xx bumps to STM32CubeL5 version 1.6.0.
stm32n6xx bumps to STM32CubeN6 version 1.3.0.

Update dma_stm32.h to sync with HAL new function prototype for
LL_DMA_IsActiveFlag_HT*() functions that now expect a const pointer
on STM32L4X series. While at it, also update the STM32MP13X series
that expects the same prototypes.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-01-12 12:29:37 -06:00
Gang He
e724188a6f drivers: dma: Add half complete callback for SF32LB chipset
Add callback of half complete in DMA processing, Fix DMA size bug.

Signed-off-by: Gang He <ganghe@sifli.com>
2026-01-11 13:03:33 +01:00
Pisit Sawangvonganan
4f71ba0918 drivers: dma: stm32u5: consolidate callback in dma_stm32_irq_handler
Refactor IRQ handler to set status variable in each branch and invoke
the callback once at the end, reducing code duplication.

Add null check for `dma_callback` in dma_stm32u5.c to match with
dma_stm32.c pattern.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-01-09 14:28:41 -06:00
Pisit Sawangvonganan
fad7535db9 drivers: dma: stm32: consolidate callback in dma_stm32_irq_handler
Refactor IRQ handler to set status variable in each branch and invoke
the callback once at the end, reducing code duplication.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-01-09 14:28:41 -06:00
Benedek Kupper
cdb7debfb7 drivers: dma: stm32: fix data sizes in memory to peripheral direction
This problem didn't surface earlier, as different sizes weren't permitted.

Signed-off-by: Benedek Kupper <kupper.benedek@gmail.com>
2026-01-08 17:35:24 -06:00
Benedek Kupper
4305403fd2 drivers: dma: stm32: the source and destination sizes must only match in v1
Commit e7f222a fixed the bug where a data size mismatch produces unexpected
behavior with the DMA on V1 devices. However, this limitation is only valid
for the STM32 series with V1 DMA, V2 doesn't have this. The STM32CubeMX
configuration tool correctly implements this limitation in the UI,
it is a good way to cross-check.

Signed-off-by: Benedek Kupper <kupper.benedek@gmail.com>
2026-01-06 13:37:31 +00:00
Qingsong Gou
d2b64ae909 drivers: dma: sf32lb: fix get_status
Fix get status interface

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-12-31 11:00:08 +00:00
Lucien Zhao
995d289452 drivers: Kconfig.mcux_edma: add slot value for mcxe24x
set DMA_MCUX_TEST_SLOT_START value as 62 for mcxe24x

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-12-19 10:38:13 +01:00
Jason Yu
24f8ed75cb drivers: dma: dma_mcux_lpc: Add register backup and restore
Add for the case that the registers are not kept in some
low power modes.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2025-12-18 23:37:39 +01:00