Skip to content

Commit a9b9e78

Browse files
committed
tests: drivers: pwm: Add overlay for Milk-V boards
This commit adds an overlay to the PWM driver tests for Milk-V boards. Signed-off-by: Chen Xingyu <[email protected]>
1 parent 61ca49c commit a9b9e78

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
aliases {
8+
pwm-0 = &pwm1;
9+
};
10+
};
11+
12+
&pinctrl {
13+
pwm1_default: pwm1_default {
14+
group1 {
15+
pinmux = <CVI_PINMUX(SD1_D2, PWM_5)>; /* GP4 */
16+
};
17+
};
18+
};
19+
20+
&pwm1 {
21+
status = "okay";
22+
pinctrl-0 = <&pwm1_default>;
23+
pinctrl-names = "default";
24+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2024 Chen Xingyu <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
aliases {
8+
pwm-0 = &pwm1;
9+
};
10+
};
11+
12+
&pinctrl {
13+
pwm1_default: pwm1_default {
14+
group1 {
15+
pinmux = <CVI_PINMUX(SD1_D2, PWM_5)>; /* GP4 */
16+
};
17+
};
18+
};
19+
20+
&pwm1 {
21+
status = "okay";
22+
pinctrl-0 = <&pwm1_default>;
23+
pinctrl-names = "default";
24+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2024 Chen Xingyu <[email protected]>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
aliases {
8+
pwm-0 = &pwm0;
9+
};
10+
};
11+
12+
&pinctrl {
13+
pwm0_default: pwm0_default {
14+
group1 {
15+
pinmux = <CVI_PINMUX(VIVO_D1, PWM_3)>; /* B20 */
16+
};
17+
};
18+
};
19+
20+
&pwm0 {
21+
status = "okay";
22+
pinctrl-0 = <&pwm0_default>;
23+
pinctrl-names = "default";
24+
};

tests/drivers/pwm/pwm_api/src/test_pwm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ DEFINE_FFF_GLOBALS;
9999
#elif defined(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS) || \
100100
defined(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0)
101101
#define DEFAULT_PWM_PORT 2 /* D2 on Arduino connector P18 */
102+
#elif defined CONFIG_BOARD_MILKV_DUO
103+
#define DEFAULT_PWM_PORT 1
104+
#elif defined CONFIG_BOARD_MILKV_DUOS
105+
#define DEFAULT_PWM_PORT 3
102106
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_pwm)
103107
/* Default port should be adapted per board to fit the channel
104108
* associated to the PWM pin. For intsance, for following device,

0 commit comments

Comments
 (0)