-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: drivers: spi: stm32h7: Run 16-bit frames tests for DMA
Run 16-bit frames tests also when DMA is enabled. In addition, remove the extra code required for the mentioned tests in favor of config. files, and add test cases for nocache regions defined in devicetree. (cherry picked from commit 382eaf7) Original-Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com> GitOrigin-RevId: 382eaf7 Change-Id: Id22d1cf86b3b546453c54176d65532ec3d64a2da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4878876 Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Commit-Queue: Al Semjonovs <asemjonovs@google.com> Tested-by: Al Semjonovs <asemjonovs@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com>
- Loading branch information
1 parent
d55e5c5
commit 41c3c8a
Showing
10 changed files
with
172 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma-no-nocache.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Copyright (c) 2023 Graphcore Ltd, All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# enable DMA mode for SPI loopback test | ||
CONFIG_SPI_STM32_DMA=y | ||
CONFIG_SPI_STM32_INTERRUPT=n | ||
CONFIG_SPI_ASYNC=n | ||
CONFIG_NOCACHE_MEMORY=n | ||
CONFIG_DT_DEFINED_NOCACHE=y | ||
CONFIG_DT_DEFINED_NOCACHE_NAME="SRAM2" | ||
CONFIG_SPI_LOOPBACK_16BITS_FRAMES=y |
11 changes: 11 additions & 0 deletions
11
tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits-dma.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (c) 2023 Graphcore Ltd, All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# enable DMA mode for SPI loopback test | ||
CONFIG_SPI_STM32_DMA=y | ||
CONFIG_SPI_STM32_INTERRUPT=n | ||
CONFIG_SPI_ASYNC=n | ||
CONFIG_SPI_LOOPBACK_16BITS_FRAMES=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright (c) 2023 Graphcore Ltd, All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
CONFIG_SPI_LOOPBACK_16BITS_FRAMES=y |
37 changes: 37 additions & 0 deletions
37
tests/drivers/spi/spi_loopback/overlay-stm32-spi-16bits.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2023 Graphcore Ltd, All rights reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&sram2 { | ||
zephyr,memory-attr = < DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) >; | ||
}; | ||
|
||
&spi1 { | ||
dmas = <&dmamux1 0 38 (STM32_DMA_PERIPH_TX | STM32_DMA_PRIORITY_HIGH | STM32_DMA_MEM_16BITS | STM32_DMA_PERIPH_16BITS) | ||
&dmamux1 1 37 (STM32_DMA_PERIPH_RX | STM32_DMA_PRIORITY_HIGH | STM32_DMA_MEM_16BITS | STM32_DMA_PERIPH_16BITS)>; | ||
dma-names = "tx", "rx"; | ||
slow@0 { | ||
compatible = "test-spi-loopback-slow"; | ||
reg = <0>; | ||
spi-max-frequency = <500000>; | ||
}; | ||
fast@0 { | ||
compatible = "test-spi-loopback-fast"; | ||
reg = <0>; | ||
spi-max-frequency = <16000000>; | ||
}; | ||
}; | ||
|
||
&dma1 { | ||
status = "okay"; | ||
}; | ||
|
||
&dma2 { | ||
status = "okay"; | ||
}; | ||
|
||
&dmamux1 { | ||
status = "okay"; | ||
}; |
7 changes: 7 additions & 0 deletions
7
tests/drivers/spi/spi_loopback/overlay-stm32-spi-dma-no-nocache.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# enable DMA mode for SPI loopback test | ||
CONFIG_SPI_STM32_DMA=y | ||
CONFIG_SPI_STM32_INTERRUPT=n | ||
CONFIG_SPI_ASYNC=n | ||
CONFIG_NOCACHE_MEMORY=n | ||
CONFIG_DT_DEFINED_NOCACHE=y | ||
CONFIG_DT_DEFINED_NOCACHE_NAME="SRAM2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters