Skip to content

Commit 6711ad5

Browse files
Danh Doankhoa-nguyen-18
authored andcommitted
tests: drivers: pwm: Support RA2, RA4, RA6 to test pwm_loopback
Add overlay to support test pwm_loopback on boards: ek_ra2a1, ek_ra4e2, ek_ra4m2, ek_ra4m3, ek_ra4w1, ek_ra6e2, ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4, ek_ra6m5, fpb_ra6e1, fpb_ra6e2. Signed-off-by: Danh Doan <[email protected]>
1 parent 7f4bbd0 commit 6711ad5

File tree

13 files changed

+455
-0
lines changed

13 files changed

+455
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm0 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm6 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm6_default: pwm6_default {
21+
group1 {
22+
/* GTIOC6A GTIOC6B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 4)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 3)>;
25+
};
26+
};
27+
};
28+
29+
&pwm6 {
30+
pinctrl-0 = <&pwm6_default>;
31+
pinctrl-names = "default";
32+
interrupts = <20 1>, <21 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
14+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&pinctrl {
19+
pwm4_default: pwm4_default {
20+
group1 {
21+
/* GTIOC4A GTIOC4B */
22+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
23+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
24+
};
25+
};
26+
};
27+
28+
&pwm4 {
29+
pinctrl-0 = <&pwm4_default>;
30+
pinctrl-names = "default";
31+
interrupts = <65 1>, <66 1>;
32+
interrupt-names = "gtioca", "overflow";
33+
divider = <RA_PWM_SOURCE_DIV_256>;
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <65 1>, <66 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <65 1>, <66 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 2, 5)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 2, 4)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <10 1>, <11 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
14+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&pinctrl {
19+
pwm4_default: pwm4_default {
20+
group1 {
21+
/* GTIOC4A GTIOC4B */
22+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
23+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
24+
};
25+
};
26+
};
27+
28+
&pwm4 {
29+
pinctrl-0 = <&pwm4_default>;
30+
pinctrl-names = "default";
31+
interrupts = <65 1>, <66 1>;
32+
interrupt-names = "gtioca", "overflow";
33+
divider = <RA_PWM_SOURCE_DIV_256>;
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <65 1>, <66 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <65 1>, <66 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <65 1>, <66 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
/* first index must be a 32-Bit timer */
14+
pwms = <&pwm1 0 0 PWM_POLARITY_NORMAL>,
15+
<&pwm4 0 0 PWM_POLARITY_NORMAL>;
16+
};
17+
};
18+
19+
&pinctrl {
20+
pwm4_default: pwm4_default {
21+
group1 {
22+
/* GTIOC4A GTIOC4B */
23+
psels = <RA_PSEL(RA_PSEL_GPT1, 3, 2)>,
24+
<RA_PSEL(RA_PSEL_GPT1, 3, 1)>;
25+
};
26+
};
27+
};
28+
29+
&pwm4 {
30+
pinctrl-0 = <&pwm4_default>;
31+
pinctrl-names = "default";
32+
interrupts = <65 1>, <66 1>;
33+
interrupt-names = "gtioca", "overflow";
34+
status = "okay";
35+
};

0 commit comments

Comments
 (0)