Skip to content

Commit

Permalink
tests: drivers: spi: nordic: add device PM runtime
Browse files Browse the repository at this point in the history
Add configuration for testing SPI with device runtime PM enabled
for nRF platforms.

Signed-off-by: Adam Kondraciuk <[email protected]>
Signed-off-by: Nikodem Kastelik <[email protected]>
  • Loading branch information
adamkondraciuk authored and kartben committed Dec 16, 2024
1 parent e8a3273 commit 7635455
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
cs-gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
dut_spi_dt: test-spi-dev@0 {
compatible = "vnd,spi-device";
spi-max-frequency = <DT_FREQ_M(8)>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
dut_spi_dt: test-spi-dev@0 {
compatible = "vnd,spi-device";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
overrun-character = <0x00>;
memory-regions = <&dma_fast_region>;
cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
dut_spi_dt: test-spi-dev@0 {
compatible = "vnd,spi-device";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
dut_spi_dt: test-spi-dev@0 {
compatible = "vnd,spi-device";
reg = <0>;
spi-max-frequency = <DT_FREQ_M(16)>;
};
};

Expand Down
6 changes: 6 additions & 0 deletions tests/drivers/spi/spi_controller_peripheral/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ tests:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54h20dk/nrf54h20/cpurad
- nrf54h20dk/nrf54h20/cpuppr

drivers.spi.pm_runtime:
extra_configs:
- CONFIG_PM_DEVICE=y
- CONFIG_PM_DEVICE_RUNTIME=y
filter: CONFIG_SOC_FAMILY_NORDIC_NRF
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
&spi1 {
overrun-character = <0x00>;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
overrun-character = <0x00>;
rx-delay = <1>;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
&spi1 {
overrun-character = <0x00>;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@

&spi130 {
memory-regions = <&cpuapp_dma_region>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <DT_FREQ_K(500)>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <DT_FREQ_M(8)>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
memory-regions = <&dma_fast_region>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
pinctrl-1 = <&spi00_sleep>;
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
&spi3 {
overrun-character = <0x00>;
cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
zephyr,pm-device-runtime-auto;
slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
Expand Down
5 changes: 5 additions & 0 deletions tests/drivers/spi/spi_loopback/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,8 @@ tests:
filter: CONFIG_SOC_FAMILY_MAX32
platform_allow:
- apard32690/max32690/m4
drivers.spi.nrf_pm_runtime:
extra_configs:
- CONFIG_PM_DEVICE=y
- CONFIG_PM_DEVICE_RUNTIME=y
filter: CONFIG_SOC_FAMILY_NORDIC_NRF

0 comments on commit 7635455

Please sign in to comment.