Skip to content

Commit

Permalink
drivers: dma: siwx917: Add additional test for DMA driver
Browse files Browse the repository at this point in the history
chan_blen_transfer test case in Zephyr upstream can be used to
validate the siwx917 DMA driver. This test transfers a simple
48-byte of characters on two different channels. The added test
(udma_tests) leverages the existing chan_blen_transfer test case.
This additional test transfers large amounts of data with different
data sizes (8-bit, 16-bit, and 32-bit) and verifies the reload
function. This test case does not need to be pushed upstream.
It can only reside in Downstream.

Signed-off-by: Sai Santhosh Malae <[email protected]>
  • Loading branch information
smalae committed Nov 25, 2024
1 parent dbc6332 commit 5a0c8e4
Show file tree
Hide file tree
Showing 8 changed files with 466 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/drivers/dma/udma_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(chan_blen_transfer)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
18 changes: 18 additions & 0 deletions tests/drivers/dma/udma_tests/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#Copyright (c) 2024 Silicon Laboratories Inc.
#SPDX-License-Identifier: Apache-2.0

mainmenu "DMA Loop Transfer Test"

source "Kconfig.zephyr"

config DMA_TRANSFER_CHANNEL_NR_0
int "first DMA channel to use"
default 0

config DMA_TRANSFER_CHANNEL_NR_1
int "second DMA channel to use"
default 1

config DMA_LOOP_TRANSFER_NUMBER_OF_DMAS
int "Number of DMAs to test"
default 1
2 changes: 2 additions & 0 deletions tests/drivers/dma/udma_tests/boards/siwx917_rb4338a.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_DMA_TRANSFER_CHANNEL_NR_0=1
CONFIG_DMA_TRANSFER_CHANNEL_NR_1=2
12 changes: 12 additions & 0 deletions tests/drivers/dma/udma_tests/boards/siwx917_rb4338a.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&udma0
{
status = "okay";
};

tst_dma0: &udma0{};
4 changes: 4 additions & 0 deletions tests/drivers/dma/udma_tests/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_DMA=y
CONFIG_ZTEST=y
CONFIG_LOG=y
CONFIG_DMA_LOG_LEVEL_INF=y
10 changes: 10 additions & 0 deletions tests/drivers/dma/udma_tests/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2024 Silicon Laboratories Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/kernel.h>
#include <zephyr/ztest.h>

ZTEST_SUITE(dma_m2m, NULL, NULL, NULL, NULL, NULL);
Loading

0 comments on commit 5a0c8e4

Please sign in to comment.