Skip to content

Commit

Permalink
boards/tests: dma: enable dma for S32Z270
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
haduongquang committed Oct 18, 2024
1 parent ecced51 commit 9158449
Show file tree
Hide file tree
Showing 19 changed files with 195 additions and 0 deletions.
8 changes: 8 additions & 0 deletions boards/nxp/s32z2xxdc2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
*************************

Expand Down
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- counter
- adc
- i2c
- dma
vendor: nxp
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- counter
- adc
- i2c
- dma
vendor: nxp
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- counter
- adc
- i2c
- dma
vendor: nxp
1 change: 1 addition & 0 deletions boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ supported:
- counter
- adc
- i2c
- dma
vendor: nxp
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>

/ {
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 { };
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>

/ {
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 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&edma0 {
status = "okay";
};

dma0: &edma0 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&edma5 {
status = "okay";
};

dma0: &edma5 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_CODE_DATA_RELOCATION=y
CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="SRAMNOCACHE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>

/ {
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 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_CODE_DATA_RELOCATION=y
CONFIG_DMA_LOOP_TRANSFER_RELOCATE_SECTION="SRAMNOCACHE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>

/ {
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 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_DMA_TCD_QUEUE_SIZE=4
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
dma0 = &edma0;
};
};

&edma0 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_DMA_TCD_QUEUE_SIZE=4
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
dma0 = &edma5;
};
};

&edma5 {
status = "okay";
};

0 comments on commit 9158449

Please sign in to comment.