Commit graph

796 commits

Author SHA1 Message Date
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
Jason Yu
ed2af53f59 drivers: dma: dma_mcux_lpc: Support power device constraint
Call pm_policy_device_power_lock_put/pm_policy_device_power_lock_get
to coordinate with system level power modes.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2025-12-18 23:37:39 +01:00
Sreeram Tatapudi
0a06f5b91a dts: bindings: Drop cat1 from the infineon binding files
Drop cat1 from the binding files to enable reuse by other
category devices as well.

Fixes #99174

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-17 13:58:09 -05:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00
Zhaoxiang Jin
a58a750336 drivers: dma: nxp: Add support for NXP 4 channel DMA driver
This commit introduces a new DMA driver for NXP platforms,
specifically supporting the MCXC/kinetis series.

Please access https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true
to download MCXC44x Sub-Family Reference Manual for more details.
DMAMUX can be found in Chapter 20 and DMA in Chapter 21.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-12-10 15:46:47 +00:00
Sreeram Tatapudi
5ecf248ba3 drivers: infineon: Drop cat1 from the files names
Drop cat1 from the file names to enable reuse by other
category devices as well

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-07 21:19:38 -05:00
Kevin Chan
bde681d27a drivers: dma: add UART async. logic
- Modified DMA configuration and logic for UART Async.

Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
2025-12-04 17:12:23 -05:00
Martin Hoff
ff3637bf83 soc: silabs: siwx91x: enabled clock control by default for siwx91x soc
Enable clock control by default for siwx91x SoCs. Moreover, most
drivers for siwx91x soc depend on clock control, but didn't declare
it.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-12-02 15:18:53 -05:00
Martin Hoff
8f4f1efc86 drivers: dma: siwx91x: fix interrupt flag reset
This patch fix a reg write that needs to be done before calling the
callback. Since the user can start a new dma transfer in the callback,
it can miss the interrupt from the new transfer if the new transfer is
done before the interrupt bit is cleared.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-12-01 11:11:23 +01:00
Martin Hoff
aa315948dc drivers: dma: siwx91x: replace pm_state with pm_device (udma and gpdma)
Removed unnecessary power management state lock calls since the DMA is
on a power domain that already handles state locking.
It will now managed directly pm_device which will active power_domain
and then block pm_state.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-12-01 11:11:23 +01:00
Pascal Linder
f1e1d91e72 drivers: dma: stm32u5: Configure burst lengths
The source and destination burst lengths can be configured with a value
from 1 to 64. As the appropriate values are available in the DMA
configuration structure provided by Zephyr, these can be set during driver
configuration. Unfortunately, the STM32 DMA LL API does currently not
provide the minimum and maximum values.

Signed-off-by: Pascal Linder <pascal.linder@zuehlke.com>
2025-11-25 13:04:10 +01:00
Camille BAUD
8209c59329 drivers: dma: bflb: Update DMA to properly support device usage
Make it so you can set both address and peripheral via dma_slot

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-11-25 13:04:02 +01:00
John Batch
1d1e2dc140 Drivers: DMA: Infineon PSE84: Adding DMA PDL based driver for pse84
Adds Infineon Cat1 PDL based driver for DMA.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-11-18 17:49:09 -05:00
Josuah Demangeon
30950b888d style: drivers: sort Kconfig and CMake includes
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Etienne Carriere
ef51b23a10 drivers: dma: stm32: clean indentation in instance init macros
Clean indentation in macros used to define DMA instances in STM32
DMA drivers.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Etienne Carriere
b0ccb2295f drivers: stm32: use STM32_CLOCK_INFO_BY_NAME() and friends
Use STM32_CLOCK_INFO(), STM32_DT_INST_CLOCK_INFO(),
STM32_CLOCK_INFO_BY_NAME() and STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macros in STM32 drivers.

Using these macros ensure the clock division factor is properly
populated according to DT information. Prior these changes some
drivers only got the bus and bits position information and missed
the clock division information which is fine only when this division
factor information is 0.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Yanan Yang
928fa39911 drivers: dma: dma_mcux_edma: enable MMIO mapping
Enable MMIO mapping in dma_mcux_edma driver

Signed-off-by: Yanan Yang <yanan.yang@nxp.com>
2025-11-13 20:39:01 -05:00
Arunprasath P
aa6414f09b drivers: dma: microchip: Add G1 DMA Driver
Add G1 DMA driver for Microchip DMA Peripherals.

Signed-off-by: Arunprasath P <arunprasath.p@microchip.com>
2025-11-13 20:35:43 -05:00
Camille BAUD
4b96632e54 drivers: dma: BFLB DMA flush cache also for source
also flush cache for source, not just dest

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-11-05 15:39:02 -05:00
Wenxi Xu
503df3e69e drivers: dma: stm32: add null callback checking
Fix the STM32 DMA driver did not check if the optional dma_callback was
set in dma_stm32_configure(). This could lead to a hard fault when an
interrupt occurs and the callback is NULL, even though the API allows
the callback to be omitted.

Fixes #97454
Signed-off-by: Wenxi Xu <xuwenxi0517@gmail.com>
2025-10-30 18:38:39 -04:00
Qingsong Gou
4bb1c676cc drivers: dma: sf32lb: fix dma compile error
Fix dma clock compile error

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-10-30 15:13:25 +02:00
Jérôme Pouiller
f3e72b094f drivers: dma: siwx91x: Fix DMA_ADDR_ADJ_NO_CHANGE w/ memory destination
GPDMA does not support DMA_ADDR_ADJ_NO_CHANGE with a memory buffer. This
feature is required fro the SPI driver. Hopefully, SPI driver is the only
user of this feature.

Therefore, this commit introduces a hack for SPI. When the user want to
ignore the Rx data (= when he pass a NULL pointer for the Rx buffer),
rather than overwriting the destination in a loop, we just disable the rx
DMA.

This introduce a limitation: since Rx DMA stop early, any following Rx
request will start earlier than expected. Therefore, this patch breaks
cases with interleaved Rx buffers. In other words, the NULL buffer must be
the last one.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
42eff40bdc drivers: dma: siwx91x: Fix DMA_ADDR_ADJ_NO_CHANGE w/ memory source
GPDMA does not support DMA_ADDR_ADJ_NO_CHANGE with a memory buffer. This
feature is required for the SPI driver. Hopefully, SPI driver is the only
user of this feature.

Therefore, this commit introduces a hack for SPI. When the user request an
Rx transaction, rather than copying content of mosi_overrun parameter, it
configures the DMA to fill the destination memory (with either 0s or 1s).
Obviously, this only works if mosi_overrun is 0x00 or 0xFF. Hopefully, none
will need any other value.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
b359d5d29b drivers: dma: siwx91x: Simplify variables naming
Since the single-linked list management is well localized, the variable
names can now be abbreviated a bit.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Jérôme Pouiller
2fa6e07eef drivers: dma: siwx91x: Simplify descriptors list creation
The management of the single-linked list was made in various places:
  - RSI_GPDMA_BuildDescriptors()
  - after sys_mem_blocks_alloc()
  - at the end of the loop

Centralize it at the end of the loop.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-10-28 08:46:48 -07:00
Axel Utech
cf5fc97b06 drivers: dma: stm32: enable isr only if needed
Improve the STM32 DMA driver to only enable transfer and half-transfer
interrupts if the interrupt handler has effects beside clearing the
isr flag. This improves system performance as unnecessary interrupts
are no longer raised by the hardware.

Signed-off-by: Axel Utech <utech@sofiha.de>
2025-10-24 11:35:03 +02:00