Commit graph

796 commits

Author SHA1 Message Date
Kate Wang
566862d149 dma: mcux: edma: preserve burst length for peripheral-triggered transfers
When a DMA channel is routed through the channel mux (dma_slot != 0), each
minor loop is paced by the peripheral request signal. In this case, the
caller-chosen burst length must be preserved to ensure correct operation.

Previously, the driver would collapse the minor loop into the whole block
for all memory-to-memory transfers without source chaining, but this logic
should only apply to genuine software-triggered transfers. Peripheral-
triggered transfers (e.g., FlexIO LCDIF) expect one minor loop per shifter
round, and collapsing the loop breaks this requirement.

Add a check for dma_slot == 0 to ensure burst length collapsing only occurs
for software-triggered transfers, not peripheral-triggered ones.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2026-05-21 15:13:51 +02:00
Sunil Abraham
e9621a8008 drivers: dma: microchip: add g3 driver for PIC32CZ_CA family
Add DMA g3 driver support.

Signed-off-by: Sunil Abraham <Sunil.Abraham@microchip.com>
2026-05-21 06:32:09 -04:00
Sylvio Alves
26bcd68a40 drivers: esp32: use zephyr cache api for dma coherency
Replace direct esp_cache_msync() calls in the ESP32 GDMA and
SPI master drivers with the portable sys_cache_data_*() API.

Zephyr's API is a compile-time no-op when CACHE_MANAGEMENT is
disabled, so the same source compiles cleanly on every ESP32
SoC and stays cost-free where there is no writeback cache.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-05-20 19:22:10 -07:00
Peter van der Perk
5a0ee3f0fb dma: mcux_edma: Fix SG for use with SPI
Adds support for no increment needed to support the LPSPI and other
peripherals with a FIFO buffer.
Furthermore we disable interrupts on each major loop on SG, instead
only do an interrupt on the final TCD.
Also a small optimization in dma_mcux_edma_reset_channel, where TCD
got zeroed twice.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-05-20 20:04:45 -04:00
Sylvio Alves
a2cedb9fc2 drivers: dma: esp32: derive shared irq config from devicetree
The GDMA_LL_AHB_TX_RX_SHARE_INTERRUPT macro used to gate the
shared rx/tx interrupt handler is no longer defined in the HAL,
so the guard always evaluates false and breaks the IRQ wiring
on ESP32-C2 and ESP32-C3.

Replace it with a check derived from devicetree that compares
the declared interrupt count against the channel pair count.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-05-20 14:08:52 +02:00
minyuan xue
53689933c5 drivers: dma: add ameba dma driver support
Add realtek ameba dma driver.

Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>

drivers: dma: ameba: use IF_ENABLED instead of COND_CODE_1 with empty else

Replace COND_CODE_1(CONFIG_DMA_AMEBA_LLI, (...), ()) with the cleaner
IF_ENABLED(CONFIG_DMA_AMEBA_LLI, (...)) idiom in the DMA_AMEBA_INIT
macro. The two forms are semantically identical; IF_ENABLED avoids the
superfluous empty else argument.

Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
2026-05-15 10:40:11 +02:00
Abin Joseph
47b751133d drivers: dma: dma_xilinx_axi_dma: rename misnamed cache-coherency Kconfig
DMA_XILINX_AXI_DMA_DISABLE_CACHE_WHEN_ACCESSING_SG_DESCRIPTORS describes
a specific implementation strategy rather than the underlying intent:
manage cache coherency manually because the platform doesn't provide
hardware coherency for DMA accesses. Tying the symbol name to the
mechanism makes it harder to evolve the driver to a different coherency
strategy without breaking existing user configurations.

Introduce DMA_XILINX_AXI_DMA_MANUAL_CACHE_COHERENCY with the same
semantics and update the driver's #ifdef sites to use it. Keep the
original symbol around as an invisible alias that selects DEPRECATED
and the new symbol so existing out-of-tree configs continue to work
and produce a deprecation warning at build time instead of silently
losing the behaviour.

Signed-off-by: Abin Joseph <abin.joseph@amd.com>
2026-05-14 15:14:03 +02:00
Abin Joseph
32475163e0 drivers: dma: dma_xilinx_axi_dma: use WAIT_FOR() for soft-reset polling
The Xilinx PG021 spec requires the DMA to clear DMACR.RESET before any
further DMACR writes are honored. Use Zephyr's WAIT_FOR() helper from
<zephyr/sys/util.h> to spin on DMACR.RESET clearing after the soft-reset
write, with an XILINX_AXI_DMA_RESET_TIMEOUT_MS ceiling. On timeout, log
an error and return -EIO so the failure surfaces immediately instead of
being absorbed by silently dropped subsequent register writes.

Signed-off-by: Abin Joseph <abin.joseph@amd.com>
2026-05-14 15:14:03 +02:00
Abin Joseph
0d7474d5dc drivers: dma: dma_xilinx_axi_dma: name magic constants in IRQ lock helpers
The IRQ lock/unlock helpers used bare 0x1 / 0x2 bit literals in the lock
key returned to the caller, and indexed the per-channel array with bare
0 and 1. Both required a "TX is 0, RX is 1" comment to read.

Replace the bit literals with named constants
XILINX_AXI_DMA_LOCK_KEY_TX_ENABLED / _RX_ENABLED, derived from the
existing channel index defines via BIT(), and replace the bare channel
indices with XILINX_AXI_DMA_TX_CHANNEL_NUM / _RX_CHANNEL_NUM. The
"TX/RX is N" / "TX/RX was enabled" comments become redundant and are
removed.

Signed-off-by: Abin Joseph <abin.joseph@amd.com>
2026-05-14 15:14:03 +02:00
Yuzhuo Liu
cae44d367a drivers: dma: add Realtek Bee series driver
Add DMA driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.

This driver supports:
- Memory to Memory transfer
- Peripheral to Memory transfer
- Memory to Peripheral transfer

Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
2026-05-14 15:12:57 +02:00
Davide Di Lello
82741b2614 drivers: infineon: Update copyright for Infineon
Update structure of the copyright

Signed-off-by: Davide Di Lello <Davide.Dilello@Infineon.com>
2026-05-12 22:19:02 +02:00
Arunprasath P
013c5af00e drivers: dma: mchp_dmac_g1: fix callback invocation and status reporting
Fix two issues in DMA driver:

1. ISR was invoking callback for all interrupts including suspend.
   Add check to invoke callback only for transfer complete (TCMPL)
   or transfer error (TERR) interrupts.

2. dma_get_status returned stale pending_length after config/reload
   because write-back descriptor was not synced with base descriptor.
   Sync write-back in dma_mchp_config and dmac_desc_reload_block.

Also improve type safety by changing void* to dmac_descriptor_registers_t*
in descriptor setup functions.

Signed-off-by: Arunprasath P <arunprasath.p@microchip.com>
2026-05-11 10:56:23 +02:00
Zhaoxiang Jin
112be6371c dma: mcux_edma: enable clocks from devicetree
Enable the optional clock described in devicetree during eDMA
driver initialization.

Keep RT7xx request-enable programming in board init so this
branch only moves the clock-control portion into the driver.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-05-11 08:47:17 +02:00
Zhaoxiang Jin
bde70f9bfc dma: mcux_edma: add reset controller support
Add optional devicetree reset support to the MCUX eDMA
driver and deassert the reset line during initialization
when a reset specifier is provided.

Boards which do not describe a reset remain unchanged.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-05-11 08:47:17 +02:00
Egill Sigurdur
a23abac549 kernel: sys_mem_blocks: add SYS_MEM_BLOCKS_DEFINE_TYPE for alignment
Introduces SYS_MEM_BLOCKS_DEFINE_TYPE() and
SYS_MEM_BLOCKS_DEFINE_STATIC_TYPE() helpers to allow the user to declare
mem blocks without having to manually ensure the alignment is correct,
which was very error-prone.

Matches the new K_MEM_SLAB_DEFINE_TYPE.

Signed-off-by: Egill Sigurdur <egill@egill.xyz>
2026-05-07 18:09:41 -05:00
Egill Sigurdur
16ac4a5b78 kernel: mem_slab: add K_MEM_SLAB_DEFINE_TYPE for automatic alignment
Introduces K_MEM_SLAB_DEFINE_TYPE() and K_MEM_SLAB_DEFINE_STATIC_TYPE()
helpers to allow the user to declare slabs for types without having to
manually ensure the alignment is correct.

Manual slab alignment was very error-prone and this change fixes several
instances of misalignment that would be trapped by the undefined
behavior sanitizer when running on 64-bit targets.

Signed-off-by: Egill Sigurdur <egill@egill.xyz>
2026-05-07 18:09:41 -05:00
Karthikeyan Krishnasamy
a416d1f89b drivers: dma: add ti mspm0 dma driver support
Add DMA driver support for Texas Instruments MSPM0 Family Series.

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2026-05-05 15:59:28 +01:00
Tien Nguyen
32c506176d drivers: dma: update to support for Renesas RZ/V2x
- Handles IRQSEL
- Update p_extend->external_detection_mode for common use

Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2026-05-04 08:58:09 +02:00
Mathieu Choplain
280ee68dc1 drivers: dma: stm32u5: don't clear flags when overridden by HAL
Don't clear DMA status flags when DMA controller is managed by the HAL.
The same logic was introduced in the dmav1/dmav2 driver by commit
110c61bfea.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-04-29 16:33:16 -04:00
Daniel Baluta
e1cae133a1 drivers: sdma: Fix SDMA compilation error
There is a typo in the DT_INST_IRQ_ macro. SDMA was used
until now only with HIFI4 DSP (xtensa) and for this arch
priority parameter is ignored.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2026-04-29 09:56:47 +02:00
Siva Subramanian Ravi Saravanan
56cec1b755 drivers: dma: add AMD ACP host and SoundWire DMA
Add DMA drivers for AMD ACP 7.0 audio DSP:
- Host DMA driver for memory transfers between system memory
  and ACP audio processing units
- SoundWire DMA driver for audio streaming over SoundWire bus

Signed-off-by: Siva Subramanian Ravi Saravanan <sravisar@amd.com>
2026-04-28 15:22:12 +02:00
William Markezana
2b7f32de58 drivers: share BL61x drivers with BL808
Rename BL61x GPIO and pinctrl drivers to bl61x_808 variants since
BL808 shares identical register layouts. Update compatible strings,
Kconfig, CMakeLists, and BL61x device tree accordingly. Extend the
DMA and IR receiver drivers' BL61x guards to also cover BL808.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-04-28 00:25:43 +01:00
Haoran Jiang
c64977b722 drivers: sf32lb: fix DMA completion polling
SF32LB DMA cleared its software busy bit on half-complete.
The QSPI NOR write path polled that bit while holding the flash lock.

Clear the DMA status bit only on completion or error.
Derive busy from the active state plus pending_length.
Poll pending_length until the flash DMA transfer reaches zero.

Signed-off-by: Haoran Jiang <halfsweet@halfsweet.cn>
2026-04-24 13:02:05 +02:00
Qiang Zhang
4bb97ebe90 drivers: dma: add NXP GDMA driver
Add driver support for NXP GDMA (General DMA) controller.

Adds GDMA peripheral reset initialization in the NXP RW SoC
initialization code.

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2026-04-22 12:50:50 +02:00
Venkatesh Odela
8d2b1e308b drivers: dma: dma_xilinx_axi_dma: fix unsigned hex constant literals
Replace literal 0xffffffff hex constants with UINT32_MAX.
This improves readability.

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-04-17 10:37:43 +02:00
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