Skip to content

Commit 59655d4

Browse files
ankeXiaonashif
authored andcommitted
tests: drivers: add flexio pwm and spi support for ke17z
pwm: pwm_api: update testcase.yaml and add new overlay configuration to support flexio pwm driver. spi: spi_loopback: update testcase.yaml and add new overlay configuration to support flexio spi driver. Signed-off-by: Anke Xiao <[email protected]>
1 parent 594bf68 commit 59655d4

File tree

4 files changed

+102
-0
lines changed

4 files changed

+102
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
pwm-0 = &flexio0_pwm;
10+
};
11+
};
12+
13+
14+
&flexio {
15+
status = "okay";
16+
flexio0_pwm: flexio0_pwm {
17+
compatible = "nxp,flexio-pwm";
18+
#pwm-cells = <3>;
19+
status = "okay";
20+
pinctrl-0 = <&flexio_pwm_default>;
21+
pinctrl-names = "default";
22+
23+
pwm_0 {
24+
pin-id = <3>;
25+
prescaler = <1>;
26+
};
27+
};
28+
};

tests/drivers/pwm/pwm_api/testcase.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@ tests:
88
or dt_alias_exists("pwm-3") or dt_compat_enabled("st,stm32-pwm")
99
or dt_compat_enabled("intel,blinky-pwm") or dt_compat_enabled("nordic,nrf-pwm")
1010
depends_on: pwm
11+
drivers.pwm.ke1xz_pwm_flexio:
12+
tags:
13+
- drivers
14+
- pwm
15+
- userspace
16+
extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_pwm.overlay"
17+
platform_allow:
18+
- frdm_ke17z
19+
- frdm_ke17z512
20+
filter: (dt_alias_exists("pwm-0") or dt_alias_exists("pwm-1") or dt_alias_exists("pwm-2")
21+
or dt_alias_exists("pwm-3")) and CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
22+
CONFIG_DT_HAS_NXP_FLEXIO_PWM_ENABLED
23+
depends_on: pwm
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* To test this sample, connect
8+
* SDO(J2-3) --> SDI(J2-4)
9+
*/
10+
11+
&pinctrl {
12+
pinmux_flexio_spi0: pinmux_flexio_spi0 {
13+
group0 {
14+
pinmux = <FXIO_D6_PTA8>, /* cs */
15+
<FXIO_D4_PTB8>, /* sck */
16+
<FXIO_D7_PTC3>, /* sdo */
17+
<FXIO_D1_PTB11>; /* sdi */
18+
drive-strength = "low";
19+
slew-rate = "slow";
20+
};
21+
};
22+
};
23+
24+
&flexio {
25+
status = "okay";
26+
27+
flexio_spi0: flexio_spi0 {
28+
compatible = "nxp,flexio-spi";
29+
status = "okay";
30+
#address-cells = <1>;
31+
#size-cells = <0>;
32+
cs-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
33+
sdo-pin = <7>;
34+
sdi-pin = <1>;
35+
sck-pin = <4>;
36+
pinctrl-0 = <&pinmux_flexio_spi0>;
37+
pinctrl-names = "default";
38+
slow@0 {
39+
status = "okay";
40+
compatible = "test-spi-loopback-slow";
41+
reg = <0>;
42+
spi-max-frequency = <500000>;
43+
};
44+
fast@0 {
45+
compatible = "test-spi-loopback-fast";
46+
reg = <0>;
47+
spi-max-frequency = <4000000>;
48+
};
49+
};
50+
};
51+
52+
&gpioa {
53+
status = "okay";
54+
};

tests/drivers/spi/spi_loopback/testcase.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,10 @@ tests:
182182
extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
183183
platform_allow:
184184
- nrf54h20dk/nrf54h20/cpuapp
185+
drivers.spi.ke1xz_flexio_spi.loopback:
186+
extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_spi.overlay"
187+
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
188+
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
189+
platform_allow:
190+
- frdm_ke17z
191+
- frdm_ke17z512

0 commit comments

Comments
 (0)