Skip to content

Commit 9baa321

Browse files
henrikbrixandersenkartben
authored andcommitted
boards: others: neorv32: enable PWM controller
Enable the NEORV32 PWM controller in both the MinimalBoot and UP5Kdemo board variants. Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent bbfa777 commit 9baa321

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

boards/others/neorv32/doc/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ supporting the GPIOs, support can be enabled by setting the ``status`` property
9797
devicetree node to ``okay``. The number of supported GPIOs can be set via the ``ngpios`` devicetree
9898
property.
9999

100+
Pulse-Width Modulation
101+
======================
102+
103+
The NEORV32 PWM controller is supported but disabled by default. For NEORV32 SoC implementations
104+
supporting PWM, support can be enabled by setting the ``status`` property of the ``pwm`` devicetree
105+
node to ``okay``.
106+
100107
True Random-Number Generator
101108
============================
102109

boards/others/neorv32/neorv32_neorv32_minimalboot.dts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
led1 = &led1;
1919
led2 = &led2;
2020
led3 = &led3;
21+
pwm-led0 = &pwm_led0;
22+
pwm-led1 = &pwm_led1;
23+
pwm-led2 = &pwm_led2;
2124
};
2225

2326
chosen {
@@ -51,6 +54,25 @@
5154
label = "LED_3";
5255
};
5356
};
57+
58+
pwmleds {
59+
compatible = "pwm-leds";
60+
61+
pwm_led0: pwm_led0 {
62+
pwms = <&pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
63+
label = "PWM_LED_0";
64+
};
65+
66+
pwm_led1: pwm_led1 {
67+
pwms = <&pwm 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
68+
label = "PWM_LED_1";
69+
};
70+
71+
pwm_led2: pwm_led2 {
72+
pwms = <&pwm 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
73+
label = "PWM_LED_2";
74+
};
75+
};
5476
};
5577

5678
&cpu0 {
@@ -88,3 +110,7 @@
88110
status = "okay";
89111
ngpios = <4>;
90112
};
113+
114+
&pwm {
115+
status = "okay";
116+
};

boards/others/neorv32/neorv32_neorv32_minimalboot.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ ram: 64
99
flash: 64
1010
supported:
1111
- gpio
12+
- pwm

boards/others/neorv32/neorv32_neorv32_up5kdemo.dts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
led1 = &led1;
1919
led2 = &led2;
2020
led3 = &led3;
21+
pwm-led0 = &pwm_led0;
22+
pwm-led1 = &pwm_led1;
23+
pwm-led2 = &pwm_led2;
2124
};
2225

2326
chosen {
@@ -51,6 +54,25 @@
5154
label = "LED_3";
5255
};
5356
};
57+
58+
pwmleds {
59+
compatible = "pwm-leds";
60+
61+
pwm_led0: pwm_led0 {
62+
pwms = <&pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
63+
label = "PWM_LED_0";
64+
};
65+
66+
pwm_led1: pwm_led1 {
67+
pwms = <&pwm 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
68+
label = "PWM_LED_1";
69+
};
70+
71+
pwm_led2: pwm_led2 {
72+
pwms = <&pwm 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
73+
label = "PWM_LED_2";
74+
};
75+
};
5476
};
5577

5678
&cpu0 {
@@ -88,3 +110,7 @@
88110
status = "okay";
89111
ngpios = <32>;
90112
};
113+
114+
&pwm {
115+
status = "okay";
116+
};

boards/others/neorv32/neorv32_neorv32_up5kdemo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ ram: 64
99
flash: 64
1010
supported:
1111
- gpio
12+
- pwm

0 commit comments

Comments
 (0)