Commit graph

639 commits

Author SHA1 Message Date
Declan Snyder
b070da7c33 dts: nxp,mcux-edma: Convert compats to prop
Convert the numerous revision compatibles to a DT property for the
revision called nxp,version (inspired from a linux DT property from
st called st,version on their DMA).

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-11-19 09:52:57 -05:00
Eric Ackermann
c9ce311aaa drivers: dma: Add Xilinx AXI DMA driver
The Xilinx AXI DMA Controller is commonly used in FPGA designs.
For example, it is a part of the 1G/2.5G AXI Ethernet subsystem.
This patch adds a driver for the Xilinx AXI DMA that supports
single MM2S and S2MM channels as well as the control and status
streams used by the AXI Ethernet subsystem.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2024-11-18 19:31:20 -05:00
Laurentiu Mihalcea
f754e09dcd dma: dma_nxp_edma: drop the hal-cfg-index property
The HAL configuration binding can be done dynamically based on the
IP's address space. The `hal-cfg-index` property is more tied to
software rather than hardware so remove it as an attempt to clean
up the binding.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-11-16 15:07:45 -05:00
Peter Ujfalusi
a8ac02f9ad drivers: dma: intel-adsp-gpdma: Account for LLPL wrapping
In case the LLP wraps we need to re-read the LLPU to make sure we return
the correct value.

Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-11-16 14:02:35 -05:00
Ioannis Damigos
135214d844 driver/dma_smartbond: Fix driver initialization when PM_DEVICE is set
Fix DMA driver initialization when PM_DEVICE is set.
Don't put PM policy state lock if it is not active.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-11-12 15:49:26 -06:00
Dat Nguyen Duy
65511eacf9 drivers: dma_mcux_edma: utilize correct macros for edma v3
Utilize correct macros for edma v3

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2024-11-11 17:53:07 -06:00
Raymond Lei
a6466249a9 drivers: dma: edma: Put the TCD pool in DTCM by default
To reduce the latency of CPU accessing/modifying SW TCD content, it
better to put TCD pool to DTCM by default.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Raymond Lei
dfb1652dec drivers: dma: edma: eDMA loop SG mode support
Existing dynamic SG mode have some issues which cause uart sync api and
I2S speed test failed.

These issues are: a wrong "Done" bit issue found on UART async api
test. An invalid destination address issue found on I2S speed
test. By introducing loop SG mode, these issues are all fixed.

Some data structures are different between eDMA and eDMA V4, use
different macros defined in SDK driver for each of them.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Raymond Lei
fddc009f58 drivers: dma: edma: Pending length calculation incorrect
Pending length should be mainloop count multiply NBYTES of minor loops.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2024-11-08 13:57:29 -06:00
Sylvio Alves
a70741bc82 west.yml: update hal_espressif to latest version
- Update GDMA and ADC drivers and remove deprecated entries.
- Rebased hal_espressif to latest bump sync.
- Added ESP Timer and Radio common config values

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Mathieu Choplain
764ce97b2f drivers: dma: stm32: add support for STM32WB0
Add support for STM32WB0 series in the relevant drivers and Kconfig.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-25 14:22:06 +02:00
Mathieu Choplain
c532702d76 drivers: dma: dmamux_stm32: remove unused SO and RGO functions
Functions related to synchronization inputs and request generators were
present in the DMAMUX driver, despite being completely unused.
Remove them for compatibility with WB0 which lacks this hardware.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-25 14:22:06 +02:00
Reto Schneider
67cb174241 drivers: dma: si32: Prevent configuration of in-use DMA channel
As per Zephyr DMA documentation, dma_config() must not be done on a
running channel.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-24 14:07:03 +02:00
Reto Schneider
4d3f6a3145 drivers: dma: si32: Improve start and stop logic
As per dma_stop() documentation, the implementation has to not just stop
the transfer, but also to disable the channel. Before this commit, only
the transfer has been stopped.

Same goes for dma_start(). This also allows the enabling of a channel to
be removed from dma_si32_config().

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-24 14:07:03 +02:00
Jerzy Kasenberg
0575c1a976 drivers: dma: smartbond: Fix power policy handling
Function dma_smartbond_set_channel_status() used incorrect
condition to release state lock.
In initialization function dma_smartbond_init() function
dma_smartbond_set_channel_status() was called for each DMA
channel and tried to release lock that was never taken.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-10-22 20:41:55 +02:00
Ha Duong Quang
12bb3fb9b1 soc: nxp: s32ze: add support eDMA3 for S32Z270
Enable support EDMA for S32Z270.
Add eDMA3 instance 0, 1, 4 and 5 for S32Z270 devices.

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
2024-10-18 14:16:05 +02:00
Ha Duong Quang
a685d1143d drivers: dma: support multiple instances
Support multiple instances for dma.

Memset struct data and tcdpool on initialization is not necessary.
Therefore remove it.

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
2024-10-18 14:16:05 +02:00
Daniel DeGrasse
126306981d drivers: dma: dma_mcux_smartdma: update interface to support custom FW
The SMARTDMA is a programmable DMA engine, and supports custom firmware
in order to run complex DMA operations. Update the driver to increase
the flexibility users have when configuring the SMARTDMA with
custom firmware, and remove the RT500 display firmware specific
definitions and functionality from the driver.

This display setup is now handled from the MIPI DSI driver, since the
firmware used for this case is specific to the MIPI DSI IP.

This change also requires an update to the RT500 devicetree, as the
register definition for the SMARTDMA has changed, so the base address
must as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-15 04:10:50 -04:00
Guillaume Gautier
ded9e11d59 drivers: dma: stm32 dmamux: fix for c0 hal update
Fix the DMAMUX driver for the STM32C0 HAL update. Typedef used in function
is now const.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-10-11 13:18:01 -04:00
Laurentiu Mihalcea
48b98a9284 drivers: dma: dma_nxp_edma: disable IRQs when not needed
IRQs are currently only enabled during channel setup
and never disabled. As such, even though they're not
needed (i.e: after a channel has been suspended or stopped)
they remain enabled. Fix this by enabling IRQs during the
channel start() operation and disabling them during the
channel stop() operation.

This change is required by irq chips (i.e: irqsteer) which
perform PM operations during irq_enable()/irq_disable(). If
interrupts are left enabled all the time that means the irq
chip's PM resources might also remain enabled when not needed.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-11 09:27:57 +02:00
Abderrahmane Jarmouni
8173acad11 drivers: dma: stm32_bdma: fix regression
Fix regression introduced by 1e1c14cfee
undefined variable name is used.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
2024-10-08 18:09:47 -04:00
Yong Cong Sin
52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Dominik Lau
1e1c14cfee drivers: dma: stm32: fix dma_stop stream busy handling for HAL override
For DMA channels overridden by HAL DMA, there was no way of
resetting stream busy variable.

Co-authored-by: Maciej Sobkowski <msobkowski@antmicro.com>
Signed-off-by: Dominik Lau <dlau@internships.antmicro.com>
2024-09-30 17:10:56 +01:00
Abderrahmane Jarmouni
e71b50244e drivers: dma: stm32_bdma: fix comments
Some comments were not updated following the change in how uncached
memory regions are defined in devicetree.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
2024-09-25 04:03:18 -04:00
Carson Green
f698fd525e drivers: dma: stm32: only clear busy flag when transfer is complete
The STM32 DMA driver can provide interrupts for transfers not yet complete.

However, the current implementation will clear the busy flag for all
interrupts when CONFIG_DMAMUX_STM32 is not enabled. The previous fix for
when CONFIG_DMAMUX_STM32 is enabled should also apply when not enabled.
Also if CONFIG_DMAMUX_STM32 is enabled busy flag will not be cleared when
error interrupts occur.

With this change, the busy flag is only cleared when completion interrupts
in non-cyclic mode or error interrupts occur. These are the cases where
transfer will not continue.

Signed-off-by: Carson Green <cgreen@tuta.com>
2024-09-24 14:24:28 -05:00
Grzegorz Bernat
a654bfbdfa soc: intel: renamed soc from ace30_ptl to ace30
Renamed soc from ace30_ptl to ace30.
We were previously using the wrong soc name.
The correct name is ace30.

There is only one ptl platform, but there can be several ace30 platforms.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-09-24 10:10:37 +02:00
Laurentiu Mihalcea
b26d21fcfd drivers: dma: dma_nxp_edma: support 64-bit TCD
On some EDMA versions, some TCD registers (e.g: SADDR, DADDR,
SLAST, DLAST, etc...) are extended to 64 bits via adding a new
HIGH register holding the value of bits [63:32]. Since, for now,
the driver doesn't support 64-bit addresses, this scenario is
supported by sign-extending the 32-bit value written to SLAST/DLAST.
SADDR and DADDR are taken care of on HAL side.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-09-19 18:02:42 -04:00
Laurentiu Mihalcea
7eb07479eb drivers: dma: dma_nxp_edma: support MUX register in MP space
Some EDMA versions may have the channel MUX register in the MP
region. To support this scenario, use the `EDMA_HAS_MP_MUX_FLAG`
flag to figure out which channel MUX register to use (TCD or MP).

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-09-19 18:02:42 -04:00
Pisit Sawangvonganan
847a4eaad2 style: drivers: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-11 07:40:35 -04:00
Reto Schneider
9d3ac80429 drivers: dma: Add initial SiM3U1xx support
This supports the minimum of what is required to allow the AES hardware
to be used (memory to peripheral, peripheral to memory).

In addition, to pass some of the existing unit tests, it also supports
memory to memory operators.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-09-10 12:38:36 -04:00
Sylvio Alves
8233b70ece espressif: clean up unused code
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-09 13:55:39 -04:00
Andriy Gelman
e9fd49f180 drivers: dma_xmc4xxx: Clear request before callback when overrun happens
If an overrun happens the user may decide to stop the dma which
unsets the DMA line. Currently, the line is always re-enabled after the
callback.

Switch the order around to fix the problem. Also, always reset the line
even if the user doesn't provide a callback.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2024-09-04 19:09:49 -04:00
Peter Ujfalusi
9fd2e11944 drivers: dma: intel-adsp-hda: Report total_copied bytes on ACE2/3
With ACE2/3 the HDA DMA includes registers to read the Linear Link
Position.
Previous platforms (CAVS, ACE1) was able to report the LLP for GPDMA. Since
ACE2 all links are handled with HD-DMA, hence the new register has been
added for the firmware to report the LLP to the host.

Set the total_copied to 0 for older ACE1/CAVS platforms and in case of
host DMA on ACE2/3 since the informatiojn is not available.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-09-03 10:42:25 +02:00
Adrian Bonislawski
b9a4900c30 drivers: dma: intel_adsp_hda: change L1 exit defaults
DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT should be set by default
for all  Intel ACE platforms

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-09-02 09:09:07 +02:00
Lucas Tamborrino
ff36d10333 drivers: dma: esp32: Handle Rx water mark interrupt
Remove water mark configuration and handle its interrupt
instead, since it is only present in ESP32S3.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-08-28 13:59:42 -04:00
Laurentiu Mihalcea
2b96bfb2e5 drivers: dma: dma_nxp_sof_host_dma: do cache WB after HOST_TO_MEMORY copy
SOF is designed with the idea that the data transfer
between the host memory and local memory is performed via
DMA. This is not true for imx platform in which the DSP
performs this operation.

Because of the aforementioned design, SOF performs a
cache invalidation operation on the destination memory
region before data is copied further down the pipeline.

For some imx platforms, the destination memory region is
cacheable. As such, some of the data transferred from the
host memory region is held entirely in cache, which means
the RAM and the cache have different data for the same
memory region.

In such cases, performing cache invalidation forces
the DSP to fetch data from RAM instead of the cache, which
means the DSP will read stale data and propagate it further
down the pipeline.

Although not optimal and mostly as a workaround to this issue,
perform a cache WB operation on the destination memory region
to make sure that the cache and the RAM hold the same data.
During the data read operation (to copy it further down the
pipeline) after the aforemention cache invalidation, the DSP
will no longer end up reading stale data.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-08-26 17:06:20 +02:00
Lucas Tamborrino
3c91c408a4 drivers: dma: esp32: Add psram support
Add support for external ram access in DMA.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-08-24 07:14:48 -04:00
Raffael Rostagno
90c6106926 drivers: esp32: Interrupts flags configuration
Allows configuring interrupts flags in the device tree for
ESP32 devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-22 14:25:25 -04:00
Raffael Rostagno
0b3a34cdca drivers: esp32: Interrupts priority configuration
Allows configuring interrupts priority in the device tree for
ESP32 devices.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-22 14:25:25 -04:00
Pisit Sawangvonganan
1bcae0ea9f style: drivers: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-20 10:33:51 +02:00
Balsundar Ponnusamy
3ab212c1db drivers: dma: add dma driver for designware axi DMA controller
Adding dma driver source for designware axi dma controller

Signed-off-by: Balsundar Ponnusamy <balsundar.ponnusamy@intel.com>
2024-08-19 10:02:53 -04:00
Flavio Ceolin
b9a0f0039f dma: emul: Fix pm action signature
The signature for dma_emul pm action callback is wrong.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-08-13 18:18:44 -04:00
Armin Kessler
237c49acb8 drivers: dma: esp32: added support for multiple descriptors
Previously, configuring the GDMA was limited to a single descriptor,
restricting memory transfers to a maximum of 4kB.
This update introduces support for multiple descriptors, enabling users
to define multiple dma_blocks. The maximum number of descriptors can be
configured via the CONFIG_DMA_ESP32_DESCRIPTOR_NUM option.
Additionally, the dma_get_status() function now reports the index of the
currently processed descriptor
through the status.read_position and status.write_position fields.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-08-12 19:23:38 -04:00
Derek Snell
2b601fa3a0 drivers: dma: dma_mcux_pxp: Add flip feature
PXP can flip an image in input buffer horizontally, vertically, or both.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2024-08-07 07:14:20 -04:00
Jason Murphy
364af34de0 drivers: dma: Add MAX32655 DMA driver
Add DMA driver for MAX32655 MCU

Co-authored-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Signed-off-by: Jason Murphy <jason.murphy@analog.com>
2024-08-06 17:16:35 -04:00
Raffael Rostagno
f4802dd7bd gdma: esp32: Modulate interrupts with low level calls
Use LL calls to enable/disable interrupts rather than make calls to the
interrupt controller.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-02 18:48:37 -05:00
Raffael Rostagno
1b72ec0329 dma: esp32c6: Added support to GDMA
Added support of GDMA driver for C6

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-08-02 18:48:37 -05:00
Lingao Meng
302422ad9d everywhere: replace double words
import os
import re

common_words = set([
    'about', 'after', 'all', 'also', 'an', 'and',
     'any', 'are', 'as', 'at',
    'be', 'because', 'but', 'by', 'can', 'come',
    'could', 'day', 'do', 'even',
    'first', 'for', 'get', 'give', 'go', 'has',
    'have', 'he', 'her',
    'him', 'his', 'how', 'I', 'in', 'into', 'it',
    'its', 'just',
    'know', 'like', 'look', 'make', 'man', 'many',
    'me', 'more', 'my', 'new',
    'no', 'not', 'now', 'of', 'one', 'only', 'or',
    'other', 'our', 'out',
    'over', 'people', 'say', 'see', 'she', 'so',
    'some', 'take', 'tell', 'than',
    'their', 'them', 'then', 'there', 'these',
    'they', 'think',
    'this', 'time', 'two', 'up', 'use', 'very',
    'want', 'was', 'way',
    'we', 'well', 'what', 'when', 'which', 'who',
    'will', 'with', 'would',
    'year', 'you', 'your'
])

valid_extensions = set([
    'c', 'h', 'yaml', 'cmake', 'conf', 'txt', 'overlay',
    'rst', 'dtsi',
    'Kconfig', 'dts', 'defconfig', 'yml', 'ld', 'sh', 'py',
    'soc', 'cfg'
])

def filter_repeated_words(text):
    # Split the text into lines
    lines = text.split('\n')

    # Combine lines into a single string with unique separator
    combined_text = '/*sep*/'.join(lines)

    # Replace repeated words within a line
    def replace_within_line(match):
        return match.group(1)

    # Regex for matching repeated words within a line
    within_line_pattern =
	re.compile(r'\b(' +
		'|'.join(map(re.escape, common_words)) +
		r')\b\s+\b\1\b')
    combined_text = within_line_pattern.
		sub(replace_within_line, combined_text)

    # Replace repeated words across line boundaries
    def replace_across_lines(match):
        return match.group(1) + match.group(2)

    # Regex for matching repeated words across line boundaries
    across_lines_pattern = re.
		compile(r'\b(' + '|'.join(
			map(re.escape, common_words)) +
			r')\b(\s*[*\/\n\s]*)\b\1\b')
    combined_text = across_lines_pattern.
		sub(replace_across_lines, combined_text)

    # Split the text back into lines
    filtered_text = combined_text.split('/*sep*/')

    return '\n'.join(filtered_text)

def process_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        text = file.read()

    new_text = filter_repeated_words(text)

    with open(file_path, 'w', encoding='utf-8') as file:
        file.write(new_text)

def process_directory(directory_path):
    for root, dirs, files in os.walk(directory_path):
        dirs[:] = [d for d in dirs if not d.startswith('.')]
        for file in files:
            # Filter out hidden files
            if file.startswith('.'):
                continue
            file_extension = file.split('.')[-1]
            if
	file_extension in valid_extensions:  # 只处理指定后缀的文件
                file_path = os.path.join(root, file)
                print(f"Processed file: {file_path}")
                process_file(file_path)

directory_to_process = "/home/mi/works/github/zephyrproject/zephyr"
process_directory(directory_to_process)

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-25 06:05:35 -04:00
Ioannis Karachalios
1bcff4130c drivers: dma: smartbond: Fix pending length
This commit should deal with fixing
the pending length value returned
upon requesting the status of a channel.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-24 12:43:12 -04:00
Ioannis Damigos
b9dab49b13 drivers/smartbond: Remove atomic flags from drivers
Remove atomic flags from drivers that use balanced calls
for PM locking.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-21 08:45:10 -04:00