Commit Graph

171 Commits

Author SHA1 Message Date
Dat Nguyen Duy
11f5eb5913 tests: drivers: dma: enable dma test for mr_canhubk3
Add devicetree overlay for enabling dma test for mr_canhubk3 board

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-27 14:02:09 -05:00
Anas Nashif
8eedef6f94 tests: dma/chan_blen_transfer: fix hardware dependency and syntax
Removed 'drivers' from supported field and fix syntax.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-25 18:42:05 -04:00
YuLong Yao
23253ab503 tests: drivers: dma: add esp32s3_luatos_core
add overlay and conf for esp32s3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-22 15:58:11 +02:00
YuLong Yao
a553ab97bf tests: drivers: dma: add esp32s3_luatos_core
add overlay and conf for esp32s3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-22 15:58:11 +02:00
YuLong Yao
bd7db23a0a tests: drivers: dma: add esp32c3_luatos_core
add overlay and conf for esp32c3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-15 14:17:50 +02:00
YuLong Yao
8283e639a1 tests: drivers: dma: add esp32c3_luatos_core
add overlay and conf for esp32c3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-15 14:17:50 +02:00
Carlo Caione
e4a125b6a4 dt: Make zephyr,memory-attr a capabilities bitmask
This is the final step in making the `zephyr,memory-attr` property
actually useful.

The problem with the current implementation is that `zephyr,memory-attr`
is an enum type, this is making very difficult to use that to actually
describe the memory capabilities. The solution proposed in this PR is to
use the `zephyr,memory-attr` property as an OR-ed bitmask of memory
attributes.

With the change proposed in this PR it is possible in the DeviceTree to
mark the memory regions with a bitmask of attributes by using the
`zephyr,memory-attr` property. This property and the related memory
region can then be retrieved at run-time by leveraging a provided helper
library or the usual DT helpers.

The set of general attributes that can be specified in the property are
defined and explained in
`include/zephyr/dt-bindings/memory-attr/memory-attr.h` (the list can be
extended when needed).

For example, to mark a memory region in the DeviceTree as volatile,
non-cacheable, out-of-order:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_VOLATILE |
			       DT_MEM_NON_CACHEABLE |
			       DT_MEM_OOO )>;
   };

The `zephyr,memory-attr` property can also be used to set
architecture-specific custom attributes that can be interpreted at run
time. This is leveraged, among other things, to create MPU regions out
of DeviceTree defined memory regions on ARM, for example:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-region = "NOCACHE_REGION";
       zephyr,memory-attr = <( DT_ARM_MPU(ATTR_MPU_RAM_NOCACHE) )>;
   };

See `include/zephyr/dt-bindings/memory-attr/memory-attr-mpu.h` to see
how an architecture can define its own special memory attributes (in
this case ARM MPU).

The property can also be used to set custom software-specific
attributes. For example we can think of marking a memory region as
available to be used for memory allocation (not yet implemented):

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_NON_CACHEABLE |
			       DT_MEM_SW_ALLOCATABLE )>;
   };

Or maybe we can leverage the property to specify some alignment
requirements for the region:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_CACHEABLE |
			       DT_MEM_SW_ALIGN(32) )>;
   };

The conventional and recommended way to deal and manage with memory
regions marked with attributes is by using the provided `mem-attr`
helper library by enabling `CONFIG_MEM_ATTR` (or by using the usual DT
helpers).

When this option is enabled the list of memory regions and their
attributes are compiled in a user-accessible array and a set of
functions is made available that can be used to query, probe and act on
regions and attributes, see `include/zephyr/mem_mgmt/mem_attr.h`

Note that the `zephyr,memory-attr` property is only a descriptive
property of the capabilities of the associated memory  region, but it
does not result in any actual setting for the memory to be set. The
user, code or subsystem willing to use this information to do some work
(for example creating an MPU region out of the property) must use either
the provided `mem-attr` library or the usual DeviceTree helpers to
perform the required work / setting.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-09-15 12:46:54 +02:00
Tom Burdick
4067cf5973 tests: dma_sg: Small log message update
It bothered me that most of the log messages started with the first
letter in the message capitalized when this one did not. Fix it!

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-08-04 10:41:27 +02:00
Tom Burdick
42ca64d60c tests: dma_sg: intel_adsp_ace15 specific config
A small Kconfig option change to increase the descriptor pool size as
well as a dts overlay to select which gpdma to test with is needed for
the test case.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-08-04 10:41:27 +02:00
Carlo Caione
15e84cbfac dts: Move to 'zephyr,memory-attr'
Move to 'zephyr,memory-attr' and use the newly introduced helpers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-07-25 11:22:10 +02:00
Emilio Benavente
0798b68c64 tests: drivers: dma: scatter_gather: Added Overlay file.
Added an overlay file for the LPC55S36 to demonstrate
the DMA Support with the scatter_gather test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-07-21 08:58:27 -05:00
Emilio Benavente
e8495d7668 tests: drivers: dma: loop_transfer: Added Overlay file.
Added an overlay file for the LPC55S36 to demonstrate
the DMA Support with the loop_transfer test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-07-21 08:58:27 -05:00
Emilio Benavente
7059b433ae tests: drivers: dma: chan_blen_transfer: Added Overlay file.
Added an overlay file for the LPC55S36 to demonstrate
the DMA Support with the chan_blen_transfer test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-07-21 08:58:27 -05:00
Emilio Benavente
0d2127317b tests: drivers: dma: Added the 595 to chan link testcase.yml
Added the mimxrt595_evk into the testcase.yml
for the channel chaining test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-07-18 16:20:21 +02:00
Declan Snyder
9e855347be tests: dma loop_transfer: Ex of LPC DMA Kconfig
Show an example of the LPC DMA Kconfig to reduce RAM based on the number
of DMA channels expected to be used. In this test, only one DMA channel
is needed, so we can show an example of how to reduce RAM usage of the
driver by configuring this value appropriately.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-07-17 13:06:01 -05:00
Hake Huang
616561de7f dma: fix the DMA_TCD_QUEUE_SIZE setting issue in test
this test need more queue size, so set to
CONFIG_DMA_TCD_QUEUE_SIZE=4

fixing: #60196

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2023-07-14 09:38:26 +02:00
Emilio Benavente
28b6c36fc5 tests: drivers: dma: Added channel chaining support to mimxrt1050
Added test case support for the mimxrt1050_evk

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-07-04 09:29:39 +02:00
Daniel DeGrasse
968ba5190d boards: arm: mimxrt1170_evkb: add support for DMA test
Enable DMA test for RT1170 EVKB

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-06-29 21:05:56 +02:00
Lucas Tamborrino
4090b50d2e tests: drivers: dma: Add transfer size config
Set transfer size config to the max dma buffer size
for espressif boards.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-01 09:06:35 -04:00
Lucas Tamborrino
676f3fa5bf tests: drivers: dma: loop_transfer: Put tranfer size as config option
Each SoC may have different limitation regarding DMA buffer size.
This commit places the test transfer size in Kconfig so it can
be modified accordingly.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-01 09:06:35 -04:00
Benjamin Björnsson
44f4946d28 tests: drivers: dma: chan_blen_transfer: Add low footprint test variant
The nucleo c031c6 was filtered due to small ram size. However, the
application did fit when builed and run with west. We add a low footprint
variant of the test to also test on platforms with smaller size but where
the application fits.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2023-05-27 06:21:39 -04:00
Emilio Benavente
150df95816 tests: drivers: dma: chan_link_transfer: Added LPC55S69 to Testcase
Added the LPC55S69 to the test case file for
dma_channel_chaining test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-05-26 17:22:43 -05:00
Tom Burdick
137c44118e tests: dma: Update LLI pool size for sg test
The scatter gather test now does a transfer list of 4 and the LLI pool
config needs to be updated to match the new test requirement.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-05-26 10:05:24 -04:00
Mahesh Mahadevan
b406ec9133 tests: dma: Enable scatter_gather test on RT595 EVK
Enable scatter gather test on NXP RT595 EVK

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-05-26 10:05:24 -04:00
Mahesh Mahadevan
4dd6331a9b tests: dma: Enable scatter_gather test on RT685 EVK
Enable scatter gather test on NXP RT685 EVK

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-05-26 10:05:24 -04:00
Mahesh Mahadevan
625232b2c6 tests: dma: Increase data transferred in loop_transfer test
Increase the amount of data to be transferred.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-05-26 10:05:24 -04:00
Mahesh Mahadevan
8eeb3554b0 tests: dma: Increase data transferred in scatter_gather test
Increase the amount of data to be transferred and the
number of blocks to transfer.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2023-05-26 10:05:24 -04:00
Emilio Benavente
47c651d612 tests: drivers: dma: mimxrt1024 dma chaining support
Added an overlay and updated the testcase.yml file
to support the mimxrt1024_evk.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-05-25 08:22:53 +00:00
Lucas Tamborrino
9431e6195f tests: drivers: dma: add esp32s3 support
Add esp32s3 overlays for dma tests.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-05-10 10:15:05 +02:00
Gerard Marull-Paretas
93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Cyril Fougeray
1be72d9888 dma: callback with 2 status codes for successful transfers
Make use of positive status values in the DMA callback to pass
info to the DMA client after a successful DMA operation.
A completed DMA transfer uses the status 0 while a reached
water mark uses the status 1.

Signed-off-by: Cyril Fougeray <cyril.fougeray@worldcoin.org>
2023-05-08 09:57:32 +02:00
Chris Friedt
bacc8d9293 tests: drivers: dma: chan_blen: correct nodelabel filter
When attempting to add a new platform and run the suite with
`twister`, it seemed to be resulting in being statically
filtered-out. Likely, the correct filter is `test_dma0`,
assuming that `test_dma*` nodes should be enumerated starting
at 0.

Verified the fix by adding `dma` as `supported` to
`boards/arm64/bcm958402m2_a72/bcm958402m2_a72.yaml` and by
adding the `test_dma0` node to
`chan_blen_transfer/boards/bcm958402m2_a72.overlay`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
59b69b917d tests: drivers: dma: sg: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
8c6c96715f tests: drivers: dma: loop: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
7f6d976916 tests: drivers: dma: chan_link: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Chris Friedt
5afcac5e14 tests: drivers: dma: chan_blen: support 64-bit dma
The test does not appear to support 64-bit DMA
* mitigate compiler warning
* support 64-bit addressing mode with `CONFIG_DMA_64BIT`

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-05-01 09:26:58 -04:00
Tomasz Leman
3d6e9ee7db tests: dma: loop_transfer: add mtl board
Adding meteorlake board overlay.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-25 16:19:45 +02:00
Tomasz Leman
86648fa4c5 tests: drivers: dma: loop_transfer: power state check
This patch modifies the existing loop transfer test to allow testing for
device power state changes when starting and stopping a transfer.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-25 16:19:45 +02:00
Kamil Serwus
71d0394752 sam: atsamc2x: dmac enable, fix uart-async
Enable dmac driver for C2x in dtsi file.
Fix tests for atsamc21n_xpro board by adding
overlay.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>
2023-04-07 18:58:24 +02:00
Anas Nashif
fcefc27823 tests: remove intel adsp cavs platforms from filters
Remove all filters related to dropped platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-06 18:51:56 +02:00
Francois Ramu
c36622daa5 tests: drivers: dma testing on the stm32h573i_dk board
Configure the tests/drivers/dma/loop_transfer
and the tests/drivers/dma//chan_blen_transfer
to run on the stm32h573i_dk : use gpdma1 or gpdma2.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-03-31 14:02:15 +02:00
Hein Wessels
b208fc52c7 tests: drivers: dma: stm32h7: use auto generated linker section
Change this test to use the automatically generated linker section
to place the buffer in SRAM4, instead of using the manually created
region added in 088d38f. This is in preperation of removing the
manually created section.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-03-24 17:37:06 +00:00
TOKITA Hiroshi
774affe2e9 tests: dma: loop_transfer: add overlay for RaspberryPi Pico
Add overlay file for rpi_pico target.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-03-22 09:33:52 +01:00
Hein Wessels
6a5a2534a0 tests: drivers: dma: chen_blen_transfer: add bdma test to nucleo_h743zi
Add unit tests for BDMA driver.

Also requires adding additional kconfig options to allocate
the memory buffers in a specific SRAM section, because
the BDMA only has access to SRAM4.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-03-01 15:58:27 +01:00
Hein Wessels
aa3783ff24 tests: drivers: dma: chen_blen_transfer: support testing multiple dmas
Some devices contain multiple dmas

which requires multiple tests

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-03-01 15:58:27 +01:00
Hein Wessels
775f602ce4 tests: drivers: dma: loop_transfer: add bdma test to nucleo_h743zi
Add DMA unit tests for BDMA driver.

Also requires adding additional kconfig options to allocate
the memory buffers in a specific SRAM section, because
the BDMA only has access to SRAM4.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-03-01 15:58:27 +01:00
Hein Wessels
96e7f94e99 tests: drivers: dma: loop_transfer: support testing multiple dmas
Some devices contain multiple dmas

which requires multiple tests

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-03-01 15:58:27 +01:00
Jay Vasanth
c504e1e5cd drivers: dma: Add Microchip XEC DMA driver
The Microchip XEC family of microcontrollers includes a
simple DMA block implementing multiple channels. DMA supports
memory to memory, memory to peripheral, and peripheral to
memory transfers. Peripheral support is limited by each
chip to I2C and SPI controllers. DMA hardware does not support
scatter-gather or linked transactions.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2023-02-19 20:38:21 -05:00
Tom Burdick
b1e1b5e7b4 dma: Test repeatedly calling start/stop
Ensures that the documented behavior of the API is met by implementations
through testing. By calling stop on a stopped channel the expectation is no
error occurs and is checked.

Calling start after a channel has been started is difficult to test for
as there is transfer timing involved. A once shot transfer may have
completed and the channel transition to an inactive state by itself by
the time the second start call is performed. This isn't supported by at
least gpdma today and isn't documented behaviorally so should not be
tested.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-01-23 11:51:21 -08:00
Lucas Tamborrino
e919123fd6 tests: dma: add esp32c3
Add esp32c3 support to DMA tests

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-01-12 19:09:01 +01:00