From 9158449c8c305594ae15aca3d1e0424d79fdc557 Mon Sep 17 00:00:00 2001 From: Ha Duong Quang Date: Thu, 29 Aug 2024 10:31:44 +0700 Subject: [PATCH] boards/tests: dma: enable dma for S32Z270 Enable dma boards/test for S32Z270. The non-cacheable memory used for DMA tests (chan_blen_transfer and loop_transfer) is split from the system SRAM. Signed-off-by: Ha Duong Quang --- boards/nxp/s32z2xxdc2/doc/index.rst | 8 +++++ .../s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml | 1 + .../s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml | 1 + .../s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml | 1 + .../s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml | 1 + .../boards/s32z2xxdc2_s32z270_rtu0.conf | 4 +++ .../boards/s32z2xxdc2_s32z270_rtu0.overlay | 29 ++++++++++++++++++ .../boards/s32z2xxdc2_s32z270_rtu1.conf | 4 +++ .../boards/s32z2xxdc2_s32z270_rtu1.overlay | 29 ++++++++++++++++++ .../boards/s32z2xxdc2_s32z270_rtu0.overlay | 11 +++++++ .../boards/s32z2xxdc2_s32z270_rtu1.overlay | 11 +++++++ .../boards/s32z2xxdc2_s32z270_rtu0.conf | 2 ++ .../boards/s32z2xxdc2_s32z270_rtu0.overlay | 29 ++++++++++++++++++ .../boards/s32z2xxdc2_s32z270_rtu1.conf | 2 ++ .../boards/s32z2xxdc2_s32z270_rtu1.overlay | 30 +++++++++++++++++++ .../boards/s32z2xxdc2_s32z270_rtu0.conf | 1 + .../boards/s32z2xxdc2_s32z270_rtu0.overlay | 15 ++++++++++ .../boards/s32z2xxdc2_s32z270_rtu1.conf | 1 + .../boards/s32z2xxdc2_s32z270_rtu1.overlay | 15 ++++++++++ 19 files changed, 195 insertions(+) create mode 100644 tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf create mode 100644 tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay create mode 100644 tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf create mode 100644 tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay create mode 100644 tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay create mode 100644 tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay create mode 100644 tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf create mode 100644 tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay create mode 100644 tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf create mode 100644 tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay create mode 100644 tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.conf create mode 100644 tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.overlay create mode 100644 tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.conf create mode 100644 tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.overlay diff --git a/boards/nxp/s32z2xxdc2/doc/index.rst b/boards/nxp/s32z2xxdc2/doc/index.rst index d864059de00bbfc..9129a9ffba0ff5f 100644 --- a/boards/nxp/s32z2xxdc2/doc/index.rst +++ b/boards/nxp/s32z2xxdc2/doc/index.rst @@ -59,6 +59,8 @@ The boards support the following hardware features: +-----------+------------+-------------------------------------+ | LPI2C | on-chip | i2c | +-----------+------------+-------------------------------------+ +| EDMA | on-chip | dma | ++-----------+------------+-------------------------------------+ Other hardware features are not currently supported by the port. @@ -163,6 +165,12 @@ ADC is provided through ADC SAR controller with 2 instances. Each ADC SAR instan .. note:: All channels of an instance only run on 1 group channel at the same time. +EDMA +==== + +The EDMA modules feature four EDMA3 instances: Instance 0 with 32 channels, +and instances 1, 4, and 5, each with 16 channels. + Programming and Debugging ************************* diff --git a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml index 1ec2dc27de4f34e..070c33e6bfd323c 100644 --- a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml +++ b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml @@ -18,4 +18,5 @@ supported: - counter - adc - i2c + - dma vendor: nxp diff --git a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml index 329e11384c73939..9d692144a76c21f 100644 --- a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml +++ b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml @@ -18,4 +18,5 @@ supported: - counter - adc - i2c + - dma vendor: nxp diff --git a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml index ff384e953beac0b..3de95effa800355 100644 --- a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml +++ b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml @@ -18,4 +18,5 @@ supported: - counter - adc - i2c + - dma vendor: nxp diff --git a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml index 1165ca8019468f1..ef45138807edaee 100644 --- a/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml +++ b/boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml @@ -18,4 +18,5 @@ supported: - counter - adc - i2c + - dma vendor: nxp diff --git a/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf new file mode 100644 index 000000000000000..47cacab34dc9139 --- /dev/null +++ b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf @@ -0,0 +1,4 @@ +CONFIG_DMA_TRANSFER_CHANNEL_NR_0=0 +CONFIG_DMA_TRANSFER_CHANNEL_NR_1=16 +CONFIG_CODE_DATA_RELOCATION=y +CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="SRAMNOCACHE" diff --git a/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay new file mode 100644 index 000000000000000..e0fcca61f9b93bb --- /dev/null +++ b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay @@ -0,0 +1,29 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + soc { + sram_nocache: memory@31870000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x31870000 DT_SIZE_K(64)>; + zephyr,memory-region = "SRAMNOCACHE"; + zephyr,memory-attr = <(DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE))>; + }; + }; +}; + +&sram0 { + compatible = "mmio-sram"; + reg = <0x31780000 DT_SIZE_K(960)>; +}; + +&edma0 { + status = "okay"; +}; + +tst_dma0: &edma0 { }; diff --git a/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf new file mode 100644 index 000000000000000..c3dd70e6ea0af4d --- /dev/null +++ b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf @@ -0,0 +1,4 @@ +CONFIG_DMA_TRANSFER_CHANNEL_NR_0=0 +CONFIG_DMA_TRANSFER_CHANNEL_NR_1=15 +CONFIG_CODE_DATA_RELOCATION=y +CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="SRAMNOCACHE" diff --git a/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay new file mode 100644 index 000000000000000..cc6211a9edcaae0 --- /dev/null +++ b/tests/drivers/dma/chan_blen_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay @@ -0,0 +1,29 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + soc { + sram_nocache: memory@35870000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x35870000 DT_SIZE_K(64)>; + zephyr,memory-region = "SRAMNOCACHE"; + zephyr,memory-attr = <(DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE))>; + }; + }; +}; + +&sram1 { + compatible = "mmio-sram"; + reg = <0x35780000 DT_SIZE_K(960)>; +}; + +&edma5 { + status = "okay"; +}; + +tst_dma0: &edma5 { }; diff --git a/tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay b/tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay new file mode 100644 index 000000000000000..14728cdfb6a354c --- /dev/null +++ b/tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay @@ -0,0 +1,11 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&edma0 { + status = "okay"; +}; + +dma0: &edma0 { }; diff --git a/tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay b/tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay new file mode 100644 index 000000000000000..b2efe980ac82d76 --- /dev/null +++ b/tests/drivers/dma/chan_link_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay @@ -0,0 +1,11 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&edma5 { + status = "okay"; +}; + +dma0: &edma5 { }; diff --git a/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf new file mode 100644 index 000000000000000..757fd26b404e025 --- /dev/null +++ b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.conf @@ -0,0 +1,2 @@ +CONFIG_CODE_DATA_RELOCATION=y +CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="SRAMNOCACHE" diff --git a/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay new file mode 100644 index 000000000000000..e0fcca61f9b93bb --- /dev/null +++ b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu0.overlay @@ -0,0 +1,29 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + soc { + sram_nocache: memory@31870000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x31870000 DT_SIZE_K(64)>; + zephyr,memory-region = "SRAMNOCACHE"; + zephyr,memory-attr = <(DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE))>; + }; + }; +}; + +&sram0 { + compatible = "mmio-sram"; + reg = <0x31780000 DT_SIZE_K(960)>; +}; + +&edma0 { + status = "okay"; +}; + +tst_dma0: &edma0 { }; diff --git a/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf new file mode 100644 index 000000000000000..757fd26b404e025 --- /dev/null +++ b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.conf @@ -0,0 +1,2 @@ +CONFIG_CODE_DATA_RELOCATION=y +CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="SRAMNOCACHE" diff --git a/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay new file mode 100644 index 000000000000000..2d644fc681716d8 --- /dev/null +++ b/tests/drivers/dma/loop_transfer/boards/s32z2xxdc2_s32z270_rtu1.overlay @@ -0,0 +1,30 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + soc { + sram_nocache: memory@35870000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x35870000 DT_SIZE_K(64)>; + zephyr,memory-region = "SRAMNOCACHE"; + zephyr,memory-attr = <(DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE))>; + }; + }; +}; + +&sram1 { + compatible = "mmio-sram"; + reg = <0x35780000 DT_SIZE_K(960)>; +}; + + +&edma5 { + status = "okay"; +}; + +tst_dma0: &edma5 { }; diff --git a/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.conf b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.conf new file mode 100644 index 000000000000000..61f2d18ca3c78f9 --- /dev/null +++ b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.conf @@ -0,0 +1 @@ +CONFIG_DMA_TCD_QUEUE_SIZE=4 diff --git a/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.overlay b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.overlay new file mode 100644 index 000000000000000..a59c0d98eea5788 --- /dev/null +++ b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu0.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + dma0 = &edma0; + }; +}; + +&edma0 { + status = "okay"; +}; diff --git a/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.conf b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.conf new file mode 100644 index 000000000000000..61f2d18ca3c78f9 --- /dev/null +++ b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.conf @@ -0,0 +1 @@ +CONFIG_DMA_TCD_QUEUE_SIZE=4 diff --git a/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.overlay b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.overlay new file mode 100644 index 000000000000000..cfbce273b297a3b --- /dev/null +++ b/tests/drivers/dma/scatter_gather/boards/s32z2xxdc2_s32z270_rtu1.overlay @@ -0,0 +1,15 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + dma0 = &edma5; + }; +}; + +&edma5 { + status = "okay"; +};