Skip to content

Commit

Permalink
riscv: dts: starfive: jh7100: Add PWM node and pins configuration
Browse files Browse the repository at this point in the history
Add OpenCores PWM controller node and add PWM pins configuration
on VisionFive 1 board.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
  • Loading branch information
littleqyp authored and yuzibo committed Nov 24, 2023
1 parent 363817a commit 0a09099
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions arch/riscv/boot/dts/starfive/jh7100-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@
};
};

pwm_pins: pwm-0 {
pwm-pins {
pinmux = <GPIOMUX(7,
GPO_PWM_PAD_OUT_BIT0,
GPO_PWM_PAD_OE_N_BIT0,
GPI_NONE)>,
<GPIOMUX(5,
GPO_PWM_PAD_OUT_BIT1,
GPO_PWM_PAD_OE_N_BIT1,
GPI_NONE)>;
bias-disable;
drive-strength = <35>;
input-disable;
input-schmitt-disable;
slew-rate = <0>;
};
};

uart3_pins: uart3-0 {
rx-pins {
pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
Expand Down Expand Up @@ -154,6 +172,12 @@
clock-frequency = <27000000>;
};

&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm_pins>;
status = "okay";
};

&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pins>;
Expand Down
9 changes: 9 additions & 0 deletions arch/riscv/boot/dts/starfive/jh7100.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@
<&rstgen JH7100_RSTN_WDT>;
};

pwm: pwm@12490000 {
compatible = "starfive,jh7100-pwm", "opencores,pwm";
reg = <0x0 0x12490000 0x0 0x10000>;
clocks = <&clkgen JH7100_CLK_PWM_APB>;
resets = <&rstgen JH7100_RSTN_PWM_APB>;
#pwm-cells = <3>;
status = "disabled";
};

sfctemp: temperature-sensor@124a0000 {
compatible = "starfive,jh7100-temp";
reg = <0x0 0x124a0000 0x0 0x10000>;
Expand Down

0 comments on commit 0a09099

Please sign in to comment.