tests: drivers: spi: nordic: add fast SPI to overlays
SPIM12x have more capabilities than SPIM13x, so it should be tested separately. Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
This commit is contained in:
parent
b1506dfda8
commit
23b4706e47
12 changed files with 346 additions and 22 deletions
|
@ -52,7 +52,7 @@
|
|||
owned-channels = <7>;
|
||||
};
|
||||
|
||||
dut_spi: &spi130 {
|
||||
&spi130 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi130_default_alt>;
|
||||
|
@ -63,6 +63,7 @@ dut_spi: &spi130 {
|
|||
dut_spi_dt: test-spi-dev@0 {
|
||||
compatible = "vnd,spi-device";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <DT_FREQ_M(8)>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
#include "nrf54h20dk_nrf54h20_common.dtsi"
|
||||
|
||||
&dut_spi {
|
||||
&spi130 {
|
||||
memory-regions = <&cpuapp_dma_region>;
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Nordic Semiconductor
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi121_default_alt: spi121_default_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 7, 2)>,
|
||||
<NRF_PSEL(SPIM_MISO, 7, 0)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 7, 1)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi121_sleep_alt: spi121_sleep_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 7, 2)>,
|
||||
<NRF_PSEL(SPIM_MISO, 7, 0)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 7, 1)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
spis131_default_alt: spis131_default_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIS_SCK, 1, 0)>,
|
||||
<NRF_PSEL(SPIS_MISO, 1, 9)>,
|
||||
<NRF_PSEL(SPIS_MOSI, 1, 5)>,
|
||||
<NRF_PSEL(SPIS_CSN, 0, 11)>;
|
||||
};
|
||||
};
|
||||
|
||||
spis131_sleep_alt: spis131_sleep_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIS_SCK, 1, 0)>,
|
||||
<NRF_PSEL(SPIS_MISO, 1, 9)>,
|
||||
<NRF_PSEL(SPIS_MOSI, 1, 5)>,
|
||||
<NRF_PSEL(SPIS_CSN, 0, 11)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi121 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi121_default_alt>;
|
||||
pinctrl-1 = <&spi121_sleep_alt>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
overrun-character = <0x00>;
|
||||
memory-regions = <&dma_fast_region>;
|
||||
cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
dut_spi_dt: test-spi-dev@0 {
|
||||
compatible = "vnd,spi-device";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <DT_FREQ_M(8)>;
|
||||
};
|
||||
};
|
||||
|
||||
dut_spis: &spi131 {
|
||||
compatible = "nordic,nrf-spis";
|
||||
status = "okay";
|
||||
def-char = <0x00>;
|
||||
pinctrl-0 = <&spis131_default_alt>;
|
||||
pinctrl-1 = <&spis131_sleep_alt>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
memory-regions = <&cpuapp_dma_region>;
|
||||
/delete-property/rx-delay-supported;
|
||||
/delete-property/rx-delay;
|
||||
};
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
#include "nrf54h20dk_nrf54h20_common.dtsi"
|
||||
|
||||
&dut_spi {
|
||||
&spi130 {
|
||||
memory-regions = <&cpurad_dma_region>;
|
||||
};
|
||||
|
||||
|
|
|
@ -7,36 +7,53 @@ common:
|
|||
platform_allow: |
|
||||
nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp
|
||||
nrf54h20dk/nrf54h20/cpurad
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
tests:
|
||||
drivers.spi.spi_mode0:
|
||||
extra_configs:
|
||||
- CONFIG_TESTED_SPI_MODE=0
|
||||
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/250khz.overlay"
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
drivers.spi.spi_mode1:
|
||||
extra_configs:
|
||||
- CONFIG_TESTED_SPI_MODE=1
|
||||
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/500khz.overlay"
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
drivers.spi.spi_mode2:
|
||||
extra_configs:
|
||||
- CONFIG_TESTED_SPI_MODE=2
|
||||
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/1mhz.overlay"
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
drivers.spi.spi_mode3:
|
||||
extra_configs:
|
||||
- CONFIG_TESTED_SPI_MODE=3
|
||||
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/2mhz.overlay"
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
drivers.spi.spi_4MHz:
|
||||
extra_configs:
|
||||
- CONFIG_TESTED_SPI_MODE=2
|
||||
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/4mhz.overlay"
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
drivers.spi.spi_8MHz:
|
||||
extra_configs:
|
||||
- CONFIG_TESTED_SPI_MODE=1
|
||||
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/8mhz.overlay"
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
|
||||
drivers.spi.spi_fast:
|
||||
extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
|
||||
platform_exclude:
|
||||
- nrf52840dk/nrf52840
|
||||
- nrf54l15pdk/nrf54l15/cpuapp
|
||||
- nrf54h20dk/nrf54h20/cpurad
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Nordic Semiconductor
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi121_default_alt: spi121_default_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 7, 2)>,
|
||||
<NRF_PSEL(SPIM_MISO, 7, 0)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 7, 1)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi121_sleep_alt: spi121_sleep_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 7, 2)>,
|
||||
<NRF_PSEL(SPIM_MISO, 7, 0)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 7, 1)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
spis131_default_alt: spis131_default_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIS_SCK, 1, 0)>,
|
||||
<NRF_PSEL(SPIS_MISO, 1, 9)>,
|
||||
<NRF_PSEL(SPIS_MOSI, 1, 5)>,
|
||||
<NRF_PSEL(SPIS_CSN, 0, 11)>;
|
||||
};
|
||||
};
|
||||
|
||||
spis131_sleep_alt: spis131_sleep_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIS_SCK, 1, 0)>,
|
||||
<NRF_PSEL(SPIS_MISO, 1, 9)>,
|
||||
<NRF_PSEL(SPIS_MOSI, 1, 5)>,
|
||||
<NRF_PSEL(SPIS_CSN, 0, 11)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi121 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi121_default_alt>;
|
||||
pinctrl-1 = <&spi121_sleep_alt>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
overrun-character = <0x00>;
|
||||
memory-regions = <&dma_fast_region>;
|
||||
cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
dut_spi_dt: test-spi-dev@0 {
|
||||
compatible = "vnd,spi-device";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <DT_FREQ_M(8)>;
|
||||
};
|
||||
};
|
||||
|
||||
dut_spis: &spi131 {
|
||||
compatible = "nordic,nrf-spis";
|
||||
status = "okay";
|
||||
def-char = <0x00>;
|
||||
pinctrl-0 = <&spis131_default_alt>;
|
||||
pinctrl-1 = <&spis131_sleep_alt>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
memory-regions = <&cpuapp_dma_region>;
|
||||
/delete-property/rx-delay-supported;
|
||||
/delete-property/rx-delay;
|
||||
};
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Nordic Semiconductor
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi130_default_alt: spi130_default_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
|
||||
<NRF_PSEL(SPIM_MISO, 0, 6)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 8)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi130_sleep_alt: spi130_sleep_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
|
||||
<NRF_PSEL(SPIM_MISO, 0, 6)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 8)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
spis131_default_alt: spis131_default_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIS_SCK, 0, 1)>,
|
||||
<NRF_PSEL(SPIS_MISO, 0, 7)>,
|
||||
<NRF_PSEL(SPIS_MOSI, 0, 9)>,
|
||||
<NRF_PSEL(SPIS_CSN, 0, 11)>;
|
||||
};
|
||||
};
|
||||
|
||||
spis131_sleep_alt: spis131_sleep_alt {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIS_SCK, 0, 1)>,
|
||||
<NRF_PSEL(SPIS_MISO, 0, 7)>,
|
||||
<NRF_PSEL(SPIS_MOSI, 0, 9)>,
|
||||
<NRF_PSEL(SPIS_CSN, 0, 11)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote130 {
|
||||
status = "okay";
|
||||
owned-channels = <7>;
|
||||
};
|
||||
|
||||
&cpuapp_dma_region {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi130 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi130_default_alt>;
|
||||
pinctrl-1 = <&spi130_sleep_alt>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
overrun-character = <0x00>;
|
||||
cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
dut_spi_dt: test-spi-dev@0 {
|
||||
compatible = "vnd,spi-device";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
memory-regions = <&cpuapp_dma_region>;
|
||||
};
|
||||
|
||||
dut_spis: &spi131 {
|
||||
compatible = "nordic,nrf-spis";
|
||||
status = "okay";
|
||||
def-char = <0x00>;
|
||||
pinctrl-0 = <&spis131_default_alt>;
|
||||
pinctrl-1 = <&spis131_sleep_alt>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
memory-regions = <&cpuapp_dma_region>;
|
||||
/delete-property/rx-delay-supported;
|
||||
/delete-property/rx-delay;
|
||||
};
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&spi130 {
|
||||
status = "reserved";
|
||||
interrupt-parent = <&cpuppr_clic>;
|
||||
};
|
||||
|
||||
&spi131 {
|
||||
status = "reserved";
|
||||
interrupt-parent = <&cpuppr_clic>;
|
||||
};
|
||||
|
||||
&shared_ram3x_region {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "reserved";
|
||||
};
|
|
@ -176,18 +176,6 @@ ZTEST(spi_error_cases, test_unsupported_frequency)
|
|||
zassert_equal(rv, -EINVAL, "Got %d instead", rv);
|
||||
}
|
||||
|
||||
ZTEST(spi_error_cases, test_CS_unsupported_on_slave)
|
||||
{
|
||||
int slave_rv;
|
||||
struct spi_config spis_config_invalid = spis_config;
|
||||
struct gpio_dt_spec test_gpio = { DEVICE_DT_GET(DT_NODELABEL(gpio0)), 10, GPIO_ACTIVE_LOW };
|
||||
|
||||
spis_config_invalid.cs.gpio = test_gpio;
|
||||
|
||||
slave_rv = spi_transceive(spis_dev, &spis_config_invalid, tdata.stx_set, tdata.srx_set);
|
||||
zassert_equal(slave_rv, -EINVAL, "Got %d instead", slave_rv);
|
||||
}
|
||||
|
||||
ZTEST(spi_error_cases, test_spis_scattered_tx_buf_not_supported)
|
||||
{
|
||||
int slave_rv;
|
||||
|
|
|
@ -1,13 +1,26 @@
|
|||
common:
|
||||
depends_on: spi
|
||||
tags: drivers spi
|
||||
harness: ztest
|
||||
harness_config:
|
||||
fixture: gpio_spi_loopback
|
||||
tests:
|
||||
drivers.spi.spi_error_cases:
|
||||
depends_on: spi
|
||||
tags: drivers spi
|
||||
harness: ztest
|
||||
harness_config:
|
||||
fixture: gpio_spi_loopback
|
||||
platform_allow:
|
||||
- nrf52840dk/nrf52840
|
||||
- nrf54l15pdk/nrf54l15/cpuapp
|
||||
- nrf54h20dk/nrf54h20/cpuapp
|
||||
integration_platforms:
|
||||
- nrf52840dk/nrf52840
|
||||
drivers.spi.spi_error_cases.fast:
|
||||
extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
|
||||
platform_allow:
|
||||
- nrf54h20dk/nrf54h20/cpuapp
|
||||
drivers.spi.spi_error_cases.nrf54h20_cpuppr:
|
||||
platform_allow: nrf54h20dk/nrf54h20/cpuppr
|
||||
sysbuild: true
|
||||
extra_args:
|
||||
- vpr_launcher_DTC_OVERLAY_FILE="../../../tests/drivers/spi/spi_error_cases/boards/nrf54h20dk_nrf54h20_cpuppr_launcher.overlay"
|
||||
- SB_CONFIG_VPR_LAUNCHER=y
|
||||
# Disable asserts to fit in limited code memory
|
||||
- CONFIG_ASSERT=n
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
spi120_default: spi120_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
|
||||
<NRF_PSEL(SPIM_MISO, 7, 6)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi120_sleep: spi120_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
|
||||
<NRF_PSEL(SPIM_MISO, 7, 6)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi120 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&spi120_default>;
|
||||
pinctrl-1 = <&spi120_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
overrun-character = <0x00>;
|
||||
memory-regions = <&dma_fast_region>;
|
||||
slow@0 {
|
||||
compatible = "test-spi-loopback-slow";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <DT_FREQ_M(4)>;
|
||||
};
|
||||
fast@0 {
|
||||
compatible = "test-spi-loopback-fast";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <DT_FREQ_M(8)>;
|
||||
};
|
||||
};
|
|
@ -169,3 +169,7 @@ tests:
|
|||
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
|
||||
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
|
||||
platform_allow: mimxrt1064_evk
|
||||
drivers.spi.nrf_fast:
|
||||
extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
|
||||
platform_allow:
|
||||
- nrf54h20dk/nrf54h20/cpuapp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue