Commit graph

670 commits

Author SHA1 Message Date
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
Paul Wedeck
1cfec8c19a drivers: dma_wch: add support for the WCH DMA controller
This patch adds an initial driver for the WCH DMA
controller. All hardware features and most interface
features are implemented.

Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
2025-03-10 21:32:27 +01:00
Martin Hoff
5efaf9d8c1 drivers: dma: silabs: fix warning when compiling without assert
Fix warning compilation when CONFIG_ASSERT is set to no.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-28 18:30:19 +01:00
David Leach
3fb8a94a79 dma: dma_mcux_lpc: fix scatter/gather src/dst increment
The logic for setting the src_inc and dst_inc would improperly set
these to zero when gatter/scatter was enabled but the respective
gatther_interval/scatter_interval was zero (which would imply
continuous operation).

Fixes: #85403

Signed-off-by: David Leach <david.leach@nxp.com>
2025-02-20 21:04:17 +01:00
Sai Santhosh Malae
6a0efa1647 drivers: dma: siwx917: dma_rom_buff variable rename
Rename dma_rom_buff to udma_handle

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
1d5b72458f drivers: dma: siwx917: Updated device instantiation
Placed instance numbers at end of names

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
020cae49cb drivers: dma: siwx917: siwx917_channel_config prototype change
Remove chan_info as input argument for siwx917_channel_config()

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
b9f5010a80 drivers: dma: siwx917: peripheral req & burst length function changes
- siwx917_is_peripheral_request -> siwx917_transfer_direction
- siwx917_burst_length -> siwx917_is_burst_length_valid
- siwx917_burst_length return type changed to bool
- Added enum for siwx917_transfer_direction return values

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
41e8df7afe drivers: dma: siwx917: Uniform function naming conventions
-Prefixed Zephyr driver functions with 'siwx917_dma' for consistency
-Added 'siwx917_' prefix to local functions
-Removed inline declaration for param validation functions

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
984b0ea255 drivers: dma: siwx917: Declare config parameters as const
Marked DMA configuration parameters(passed from application) as `const`

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
3071190f20 drivers: dma: siwx917: Apply cosmetic changes
1. Updated multi-line comments
2. Grouping logical blocks by adding vertical spaces

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
b1ec724e14 drivers: dma: siwx917: Use accessors for HW reg access
Replaced direct hardware register access with appropriate accessors

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Sai Santhosh Malae
a5501575f7 drivers: dma: siwx917: Fix bug in registering application callbacks
Resolved an issue where application callbacks were not being properly
registered in the DMA driver.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-02-20 15:10:16 +00:00
Tom Hughes
538b525ef1 drivers: dma: Remove unused function
Building with clang warns:

drivers/dma/dma_emul.c:73:20: error: unused function
'dma_emul_xfer_is_error_status' [-Werror,-Wunused-function]
static inline bool dma_emul_xfer_is_error_status(int status)
                   ^

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-13 03:27:32 +01:00
Martin Hoff
b8272cc348 drivers: dma: silabs: implementation of chan_filter and chan_release
Implementation of chan_filter and chan_release allows to maintain
synchronization about DMA channel allocation between hal DMA driver and
zephyr DMA driver.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-02-12 16:03:39 +01:00
Andriy Gelman
00c3528515 drivers: dma: dma_xmc4xxx: Add cyclic support
Adds cyclic support, where a multi-block transfer is automatically
reloaded to the first block after the multi-block transfer completes.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2025-02-12 02:26:20 +01:00
Andriy Gelman
51f3422192 drivers: dma: dma_xmc4xxx: Add multi-block support
Adds dma multi-block support xmc4xxx SoCs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2025-02-12 02:26:20 +01:00
Andriy Gelman
57d77ac03e drivers: dma_xmc4xxx: Fix pending_length in stat when source_data_size > 1
Block_ts stores the number of transfers from DMA source, not the
transferred length in bytes.

Regression from 9c4cd3057d.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2025-02-12 02:26:20 +01:00
Andriy Gelman
ccdf23a941 drivers: dma: xmc4xxx: Add support for enabling fifo_mode_control
Adds fifo_mode_control option.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2025-02-12 02:26:20 +01:00
Jérôme Pouiller
124c79dd23 drivers: dma: Introduce support for SiWx91x
Implement DMA driver for siwx917 using UDMA peripheral. For now,
Scatter/Gather DMA is not yet supported.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00