Skip to content

Commit 5a1650c

Browse files
Dat-NguyenDuymmahadevan108
authored andcommitted
boards: s32z2xxdc2: add support PWM eMIOS
Add support PWM eMIOS for s32z2xxdc2 board. There is no LED on-board dedicated for PWM, so no sample is supported. Only enabling some pwm tests Signed-off-by: Dat Nguyen Duy <[email protected]>
1 parent 36d4e54 commit 5a1650c

File tree

9 files changed

+186
-0
lines changed

9 files changed

+186
-0
lines changed

boards/nxp/s32z2xxdc2/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ The boards support the following hardware features:
6060
+-----------+------------+-------------------------------------+
6161
| DSPI | on-chip | spi |
6262
+-----------+------------+-------------------------------------+
63+
| eMIOS | on-chip | pwm |
64+
+-----------+------------+-------------------------------------+
6365

6466
Other hardware features are not currently supported by the port.
6567

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ supported:
1919
- adc
2020
- i2c
2121
- dma
22+
- pwm
2223
vendor: nxp

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu0_D.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ supported:
1919
- adc
2020
- i2c
2121
- dma
22+
- pwm
2223
vendor: nxp

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ supported:
1919
- adc
2020
- i2c
2121
- dma
22+
- pwm
2223
vendor: nxp

boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_rtu1_D.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ supported:
1919
- adc
2020
- i2c
2121
- dma
22+
- pwm
2223
vendor: nxp
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <nxp/s32/S32Z27-BGA594-pinctrl.h>
8+
9+
/ {
10+
aliases {
11+
pwm-0 = &emios0_pwm;
12+
};
13+
};
14+
15+
&pinctrl {
16+
emios0_default: emios0_default {
17+
group0 {
18+
pinmux = <PK0_EMIOS_0_CH24_O>;
19+
output-enable;
20+
};
21+
};
22+
};
23+
24+
&emios0 {
25+
clock-divider = <133>;
26+
status = "okay";
27+
28+
emios0_pwm: pwm {
29+
pinctrl-0 = <&emios0_default>;
30+
pinctrl-names = "default";
31+
status = "okay";
32+
33+
pwm_24 {
34+
channel = <24>;
35+
prescaler = <16>;
36+
pwm-mode = "OPWFMB";
37+
};
38+
};
39+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <nxp/s32/S32Z27-BGA594-pinctrl.h>
8+
9+
/ {
10+
aliases {
11+
pwm-0 = &emios0_pwm;
12+
};
13+
};
14+
15+
&pinctrl {
16+
emios0_default: emios0_default {
17+
group0 {
18+
pinmux = <PK0_EMIOS_0_CH24_O>;
19+
output-enable;
20+
};
21+
};
22+
};
23+
24+
&emios0 {
25+
clock-divider = <133>;
26+
status = "okay";
27+
28+
emios0_pwm: pwm {
29+
pinctrl-0 = <&emios0_default>;
30+
pinctrl-names = "default";
31+
status = "okay";
32+
33+
pwm_24 {
34+
channel = <24>;
35+
prescaler = <16>;
36+
pwm-mode = "OPWFMB";
37+
};
38+
};
39+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
9+
/ {
10+
pwm_loopback_0 {
11+
compatible = "test-pwm-loopback";
12+
pwms = <&emios0_pwm 24 0 PWM_POLARITY_NORMAL>,
13+
<&emios0_pwm 25 0 PWM_POLARITY_NORMAL>;
14+
};
15+
};
16+
17+
&pinctrl {
18+
emios0_default: emios0_default {
19+
group0 {
20+
pinmux = <PK0_EMIOS_0_CH24_O>;
21+
output-enable;
22+
};
23+
group1 {
24+
pinmux = <PJ15_EMIOS_0_CH25_I>;
25+
input-enable;
26+
};
27+
};
28+
};
29+
30+
&emios0 {
31+
clock-divider = <200>;
32+
status = "okay";
33+
34+
emios0_pwm: pwm {
35+
pinctrl-0 = <&emios0_default>;
36+
pinctrl-names = "default";
37+
status = "okay";
38+
39+
pwm_24 {
40+
channel = <24>;
41+
prescaler = <16>;
42+
pwm-mode = "OPWFMB";
43+
};
44+
45+
pwm_25 {
46+
channel = <25>;
47+
pwm-mode = "SAIC";
48+
prescaler = <16>;
49+
};
50+
};
51+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
9+
/ {
10+
pwm_loopback_0 {
11+
compatible = "test-pwm-loopback";
12+
pwms = <&emios0_pwm 24 0 PWM_POLARITY_NORMAL>,
13+
<&emios0_pwm 25 0 PWM_POLARITY_NORMAL>;
14+
};
15+
};
16+
17+
&pinctrl {
18+
emios0_default: emios0_default {
19+
group0 {
20+
pinmux = <PK0_EMIOS_0_CH24_O>;
21+
output-enable;
22+
};
23+
group1 {
24+
pinmux = <PJ15_EMIOS_0_CH25_I>;
25+
input-enable;
26+
};
27+
};
28+
};
29+
30+
&emios0 {
31+
clock-divider = <200>;
32+
status = "okay";
33+
34+
emios0_pwm: pwm {
35+
pinctrl-0 = <&emios0_default>;
36+
pinctrl-names = "default";
37+
status = "okay";
38+
39+
pwm_24 {
40+
channel = <24>;
41+
prescaler = <16>;
42+
pwm-mode = "OPWFMB";
43+
};
44+
45+
pwm_25 {
46+
channel = <25>;
47+
pwm-mode = "SAIC";
48+
prescaler = <16>;
49+
};
50+
};
51+
};

0 commit comments

Comments
 (0)