Add pinctrl configurations for PWM0 to PWM19 in the SpacemiT K1
device tree source file. Each PWM instance is assigned multiple
pinmux configurations corresponding to different GPIOs and
function modes.
Configurations include:
- Mapping GPIOs to appropriate pinctrl nodes for PWM functionality
- Specifying bias-pull-up and drive-strength attributes
These updates ensure proper pin multiplexing and drive strength
settings for PWM signals on the SpacemiT K1 SoC when selected.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 +++++++++++++++++++
1 file changed, 315 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
index 283663647a86..294e05409933 100644
--- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
@@ -20,4 +20,319 @@ uart0-2-pins {
drive-strength = <32>;
};
};
+ pwm0_0_cfg: pwm0-0-cfg {
+ pwm0-0-pins {
+ pinmux = <K1_PADCONF(104, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm0_1_cfg: pwm0-1-cfg {
+ pwm0-1-pins {
+ pinmux = <K1_PADCONF(14, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm0_2_cfg: pwm0-2-cfg {
+ pwm0-2-pins {
+ pinmux = <K1_PADCONF(22, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm1_0_cfg: pwm1-0-cfg {
+ pwm1-0-pins {
+ pinmux = <K1_PADCONF(105, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm1_1_cfg: pwm1-1-cfg {
+ pwm1-1-pins {
+ pinmux = <K1_PADCONF(29, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm1_2_cfg: pwm1-2-cfg {
+ pwm1-2-pins {
+ pinmux = <K1_PADCONF(23, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm2_0_cfg: pwm2-0-cfg {
+ pwm2-0-pins {
+ pinmux = <K1_PADCONF(106, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm2_1_cfg: pwm2-1-cfg {
+ pwm2-1-pins {
+ pinmux = <K1_PADCONF(22, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm2_2_cfg: pwm2-2-cfg {
+ pwm2-2-pins {
+ pinmux = <K1_PADCONF(30, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm2_3_cfg: pwm2-3-cfg {
+ pwm2-3-pins {
+ pinmux = <K1_PADCONF(24, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm3_0_cfg: pwm3-0-cfg {
+ pwm3-0-pins {
+ pinmux = <K1_PADCONF(107, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm3_1_cfg: pwm3-1-cfg {
+ pwm3-1-pins {
+ pinmux = <K1_PADCONF(33, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm3_2_cfg: pwm3-2-cfg {
+ pwm3-2-pins {
+ pinmux = <K1_PADCONF(25, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm4_0_cfg: pwm4-0-cfg {
+ pwm4-0-pins {
+ pinmux = <K1_PADCONF(108, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm4_1_cfg: pwm4-1-cfg {
+ pwm4-1-pins {
+ pinmux = <K1_PADCONF(34, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm5_0_cfg: pwm5-0-cfg {
+ pwm5-0-pins {
+ pinmux = <K1_PADCONF(109, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm5_1_cfg: pwm5-1-cfg {
+ pwm5-1-pins {
+ pinmux = <K1_PADCONF(35, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm6_0_cfg: pwm6-0-cfg {
+ pwm6-0-pins {
+ pinmux = <K1_PADCONF(88, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm6_1_cfg: pwm6-1-cfg {
+ pwm6-1-pins {
+ pinmux = <K1_PADCONF(36, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm7_0_cfg: pwm7-0-cfg {
+ pwm7-0-pins {
+ pinmux = <K1_PADCONF(92, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm7_1_cfg: pwm7-1-cfg {
+ pwm7-1-pins {
+ pinmux = <K1_PADCONF(37, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm8_0_cfg: pwm8-0-cfg {
+ pwm8-0-pins {
+ pinmux = <K1_PADCONF(0, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm8_1_cfg: pwm8-1-cfg {
+ pwm8-1-pins {
+ pinmux = <K1_PADCONF(38, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm9_0_cfg: pwm9-0-cfg {
+ pwm9-0-pins {
+ pinmux = <K1_PADCONF(1, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm9_1_cfg: pwm9-1-cfg {
+ pwm9-1-pins {
+ pinmux = <K1_PADCONF(39, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm10_0_cfg: pwm10-0-cfg {
+ pwm10-0-pins {
+ pinmux = <K1_PADCONF(2, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm10_1_cfg: pwm10-1-cfg {
+ pwm10-1-pins {
+ pinmux = <K1_PADCONF(40, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm11_0_cfg: pwm11-0-cfg {
+ pwm11-0-pins {
+ pinmux = <K1_PADCONF(3, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm11_1_cfg: pwm11-1-cfg {
+ pwm11-1-pins {
+ pinmux = <K1_PADCONF(41, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm12_0_cfg: pwm12-0-cfg {
+ pwm12-0-pins {
+ pinmux = <K1_PADCONF(4, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm12_1_cfg: pwm12-1-cfg {
+ pwm12-1-pins {
+ pinmux = <K1_PADCONF(42, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm13_0_cfg: pwm13-0-cfg {
+ pwm13-0-pins {
+ pinmux = <K1_PADCONF(5, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm13_1_cfg: pwm13-1-cfg {
+ pwm13-1-pins {
+ pinmux = <K1_PADCONF(43, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm14_0_cfg: pwm14-0-cfg {
+ pwm14-0-pins {
+ pinmux = <K1_PADCONF(6, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm14_1_cfg: pwm14-1-cfg {
+ pwm14-1-pins {
+ pinmux = <K1_PADCONF(44, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm15_0_cfg: pwm15-0-cfg {
+ pwm15-0-pins {
+ pinmux = <K1_PADCONF(7, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm15_1_cfg: pwm15-1-cfg {
+ pwm15-1-pins {
+ pinmux = <K1_PADCONF(45, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm16_0_cfg: pwm16-0-cfg {
+ pwm16-0-pins {
+ pinmux = <K1_PADCONF(9, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm16_1_cfg: pwm16-1-cfg {
+ pwm16-1-pins {
+ pinmux = <K1_PADCONF(46, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm17_0_cfg: pwm17-0-cfg {
+ pwm17-0-pins {
+ pinmux = <K1_PADCONF(10, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm17_1_cfg: pwm17-1-cfg {
+ pwm17-1-pins {
+ pinmux = <K1_PADCONF(53, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm18_0_cfg: pwm18-0-cfg {
+ pwm18-0-pins {
+ pinmux = <K1_PADCONF(11, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm18_1_cfg: pwm18-1-cfg {
+ pwm18-1-pins {
+ pinmux = <K1_PADCONF(57, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm19_0_cfg: pwm19-0-cfg {
+ pwm19-0-pins {
+ pinmux = <K1_PADCONF(13, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm19_1_cfg: pwm19-1-cfg {
+ pwm19-1-pins {
+ pinmux = <K1_PADCONF(63, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
};
--
2.43.0
On Fri, Apr 11, 2025 at 09:14:20PM +0800, Guodong Xu wrote: > Add pinctrl configurations for PWM0 to PWM19 in the SpacemiT K1 > device tree source file. Each PWM instance is assigned multiple > pinmux configurations corresponding to different GPIOs and > function modes. > > Configurations include: > - Mapping GPIOs to appropriate pinctrl nodes for PWM functionality > - Specifying bias-pull-up and drive-strength attributes > > These updates ensure proper pin multiplexing and drive strength > settings for PWM signals on the SpacemiT K1 SoC when selected. > > Signed-off-by: Guodong Xu <guodong@riscstar.com> > --- > arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 +++++++++++++++++++ > 1 file changed, 315 insertions(+) > I think this is too much, I think it is necessary to leave already used one. Regards, Inochi
Hi Inochi, On 2025-04-11 5:50 PM, Inochi Amaoto wrote: > On Fri, Apr 11, 2025 at 09:14:20PM +0800, Guodong Xu wrote: >> Add pinctrl configurations for PWM0 to PWM19 in the SpacemiT K1 >> device tree source file. Each PWM instance is assigned multiple >> pinmux configurations corresponding to different GPIOs and >> function modes. >> >> Configurations include: >> - Mapping GPIOs to appropriate pinctrl nodes for PWM functionality >> - Specifying bias-pull-up and drive-strength attributes >> >> These updates ensure proper pin multiplexing and drive strength >> settings for PWM signals on the SpacemiT K1 SoC when selected. >> >> Signed-off-by: Guodong Xu <guodong@riscstar.com> >> --- >> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 +++++++++++++++++++ >> 1 file changed, 315 insertions(+) >> > > I think this is too much, I think it is necessary to leave > already used one. If your concern is about compiled DTB size, you can use /omit-if-no-ref/ for each of these nodes, so only the pinmux nodes actually referenced by a controller are included in the DTB. Regards, Samuel
© 2016 - 2025 Red Hat, Inc.