Skip to content

Commit d61236d

Browse files
lucien-nxpjhedberg
authored andcommitted
tests: driver: pwm: pwm_api: Enable flexio_pwm function on pwm_api case
Enable flexio clock in soc.c file Add mimxrt1180_evk_flexio_pwm.overlay: - Configure flexio2_d2 pins - enable flexio2_pwm - disable default watchdog tpm5 Signed-off-by: Lucien Zhao <[email protected]>
1 parent be0a862 commit d61236d

File tree

3 files changed

+68
-13
lines changed

3 files changed

+68
-13
lines changed

soc/nxp/imxrt/imxrt118x/soc.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,24 @@ __weak void clock_init(void)
481481

482482
#endif /* CONFIG_CAN_MCUX_FLEXCAN */
483483

484+
#ifdef CONFIG_MCUX_FLEXIO
485+
486+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexio1), okay)
487+
/* Configure FLEXIO1 using SYS_PLL3_DIV2_CLK */
488+
rootCfg.mux = kCLOCK_FLEXIO1_ClockRoot_MuxSysPll3Div2;
489+
rootCfg.div = 2;
490+
CLOCK_SetRootClock(kCLOCK_Root_Flexio1, &rootCfg);
491+
#endif
492+
493+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(flexio2), okay)
494+
/* Configure FLEXIO2 using SYS_PLL3_DIV2_CLK */
495+
rootCfg.mux = kCLOCK_FLEXIO2_ClockRoot_MuxSysPll3Div2;
496+
rootCfg.div = 1;
497+
CLOCK_SetRootClock(kCLOCK_Root_Flexio2, &rootCfg);
498+
#endif
499+
500+
#endif /* CONFIG_MCUX_FLEXIO */
501+
484502
#if defined(CONFIG_MCUX_LPTMR_TIMER) || defined(CONFIG_COUNTER_MCUX_LPTMR)
485503

486504
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lptmr1), okay)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
pwm-0 = &flexio2_pwm;
10+
};
11+
};
12+
13+
&tpm5 {
14+
status = "disabled";
15+
};
16+
17+
&pinctrl {
18+
pinmux_flexio2_pwm_default: pinmux_flexio2_pwm_default {
19+
group0 {
20+
pinmux = <&iomuxc_gpio_ad_02_flexio2_d02>;
21+
drive-strength = "normal";
22+
slew-rate = "slow";
23+
};
24+
};
25+
};
26+
27+
&flexio2 {
28+
status = "okay";
29+
flexio2_pwm: flexio2_pwm {
30+
compatible = "nxp,flexio-pwm";
31+
#pwm-cells = <3>;
32+
status = "okay";
33+
pinctrl-0 = <&pinmux_flexio2_pwm_default>;
34+
pinctrl-names = "default";
35+
pwm_0 {
36+
pin-id = <2>;
37+
prescaler = <1>;
38+
};
39+
};
40+
};

tests/drivers/pwm/pwm_api/testcase.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,24 @@ 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:
11+
drivers.pwm.pwm_flexio:
1212
tags:
1313
- drivers
1414
- pwm
1515
- userspace
16-
extra_args: DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_pwm.overlay"
16+
17+
extra_args:
18+
- platform:frdm_ke17z:DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_pwm.overlay"
19+
- platform:frdm_ke17z512:DTC_OVERLAY_FILE="boards/frdm_ke1xz_flexio_pwm.overlay"
20+
- platform:mimxrt700_evk/mimxrt798s/cm33_cpu0:DTC_OVERLAY_FILE="boards/mimxrt700_evk_mimxrt798s_cm33_cpu0_flexio_pwm.overlay"
21+
- platform:mimxrt1180_evk/mimxrt1189/cm33:DTC_OVERLAY_FILE="boards/mimxrt1180_evk_flexio_pwm.overlay"
22+
- platform:mimxrt1180_evk/mimxrt1189/cm7:DTC_OVERLAY_FILE="boards/mimxrt1180_evk_flexio_pwm.overlay"
1723
platform_allow:
1824
- frdm_ke17z
1925
- 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
24-
drivers.pwm.mimxrt700_evk_mimxrt798s_cm33_cpu0_flexio_pwm:
25-
tags:
26-
- drivers
27-
- pwm
28-
- userspace
29-
extra_args: DTC_OVERLAY_FILE="boards/mimxrt700_evk_mimxrt798s_cm33_cpu0_flexio_pwm.overlay"
30-
platform_allow:
3126
- mimxrt700_evk/mimxrt798s/cm33_cpu0
27+
- mimxrt1180_evk/mimxrt1189/cm33
28+
- mimxrt1180_evk/mimxrt1189/cm7
3229
filter: (dt_alias_exists("pwm-0") or dt_alias_exists("pwm-1") or dt_alias_exists("pwm-2")
3330
or dt_alias_exists("pwm-3")) and CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
3431
CONFIG_DT_HAS_NXP_FLEXIO_PWM_ENABLED

0 commit comments

Comments
 (0)