Commit Graph

104 Commits

Author SHA1 Message Date
Tom Burdick
f0326f7249 tests: dma_loopback: Intel ADSP ACE15 disable PM
Disable power management for this particular test case as it expects a
particular pattern of pm get/puts that isn't matched by the driver and
usage in SoF.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-10-23 10:01:09 -05:00
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Kevin Wang
d3a73cdb0e drivers: dma: Add Andestech atcdmac300 driver.
Support the Andes atcdmac300 dma driver.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2023-10-20 14:51:08 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
TOKITA Hiroshi
1b93f036d7 tests: dma: loop_transfer: add overlay for GD32 boards
Add overlay file for gd32_e507z_eval, gd32f407v_start,
gd32f450v_start, gd32f450v_start and longan_nano_lite.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-22 13:43:49 +01:00
TOKITA Hiroshi
6dc1187e44 tests: dma: loop_transfer: Correct DMA definition of gd32f350r_eval
The overlay file overrides not existing node `dma0`.
Correct it to `dma`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-22 13:43:49 +01:00
Francois Ramu
4d5c99060a tests: drivers: dma: test the DMA drivers on the stm32MP157 disco kit
Define configuration to run the tests/drivers/dma
on the stm32mp157c_dk2 disco platform

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-04 10:16:56 +01:00
Michał Barnaś
dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Gerard Marull-Paretas
79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Francois Ramu
60bb584301 tests/drivers/dma: testing mem-to-mem DMA transfer on stm32u5
Add the testcase to run on the stm32u5x5 disco kit
and nucleo_u575zi_q boards.
The DMA instance is the GPDMA (up to 16 channels).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-08-24 10:05:32 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
TOKITA Hiroshi
d5ab3ee0b0 tests: dma: loop_transfer: Add GD32 series to loop_transfer test
Add configuration file for GD32 boards.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-08-02 09:13:21 +02:00
Kumar Gala
37fded7d37 tests: dma: Add FRDM-K64F to test platforms
Add overlays that enables FRDM-K64F for several dma tests.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 11:36:08 -05:00
Kumar Gala
0100dc5e3c tests: dma: loop_transfer: Add filter to limit platforms
Add testcase filter based on devicetree nodelabel test_dma being set.
This is needed since the testcase requires it to build.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 11:36:08 -05:00
Hake Huang
54094809d6 tests: dma: upgrade dma test to new ztest api
1. config ztest_new_api and update the testcase defines

2. remove shell interactive test cases, twister has another plan

3. add sg case support for kinetis and rt10xx platfrom

related: #47002

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-07-29 09:31:34 -05:00
Kumar Gala
b1a8246b56 tests: dma: loop_transfer: Convert to DEVICE_DT_GET
Convert test to use DEVICE_DT_GET via a nodelabel.

Introduce a test_dma devicetree nodelabel to reference the DMA
controller the test should use.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-27 09:47:59 +02:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Tom Burdick
f8250c9813 dma: Better suspend/resume testing
Make the test data larger to help slow down the transfer long enough
to get suspend to work. Then attempt to spin on suspend. Suspending any
of the test transfers is a success.

Previous suspend resume test would always fail on DesignWare DMA
as it was seemingly already done by the time dma_suspend would be
called in the ISR.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-03-24 10:44:50 +01:00
Hake Huang
3b576fc688 tests: dma: fix loopback suspend and resume issue
update dma loop test to resolve call sequence issue,
and avoid randum failure due to
dma finished fast than the dma status check. which cause suspend fails.

fixing #43739

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-03-18 12:14:05 -04:00
Tomasz Bursztyka
c94b341a54 tests: constify all device instances
Run cocci script to constify device instances.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-03-16 12:33:12 +01:00
Francois Ramu
d91bdc0f51 tests: drivers: dma test running on the nucleo_wl55 board
enable the dma and dmamux to the nucleo_wl55jc
so that dma testcases can run on that target

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-04 09:11:38 -06:00
Tom Burdick
0e96f59e83 dma: Add suspend resume implementation for edma
Implement the suspend and resume transfer api calls for NXP's eDMA.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-01-12 17:33:48 -05:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Francois Ramu
c47d573175 tests: drivers: dma testing on the stm32f103 nucleo board
This adds the configuration to pass the testcases
dma/loop_transfer and the dma/chan_blen_transfer
on the nucleo_f103rb board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-07-29 11:48:23 -04:00
Francois Ramu
a5cca19386 tests: drivers: dma testing on the stm32f429 nucleo board
This adds the configuration and set the DTS to pass
the dma/loop_transfer and the dma/chan_blen_transfer
on the nucleo_f429zi board.
The DMA2 instance supports mem2mem transfers.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-07-29 11:48:23 -04:00