Skip to contentSkip to conversation

Support pwm driver for aspeed ast26xx

PATCH In review Billy Tsai 4 participants 13 messages Mar 8, 2022 – Mar 26, 2022

Subsystems (5)
lore
Share & tools
lore

Billy Tsai

author reviewer
#0 lore raw

cover Support pwm driver for aspeed ast26xx

This series adds driver support for the PWM controller found in Aspeed's AST2600 BMC SoCs, but isn't compatible with the AST2400 and AST2500.

Billy Tsai (3):
pwm: Add Aspeed ast2600 PWM support
pinctrl: Add the pinctrl setting for PWM.
ARM: dts: ast2600: Add PWM to device tree

 arch/arm/dts/ast2600-evb.dts             |  20 ++
 arch/arm/dts/ast2600.dtsi                |  95 +++++++++
 drivers/pinctrl/aspeed/pinctrl_ast2600.c | 120 +++++++++++
 drivers/pwm/Kconfig                      |   8 +
 drivers/pwm/Makefile                     |   1 +
 drivers/pwm/pwm-aspeed.c                 | 251 +++++++++++++++++++++++
 6 files changed, 495 insertions(+)
 create mode 100644 drivers/pwm/pwm-aspeed.c
Signature · 1 line
2.25.1
author reviewer
#1 lore raw

PATCH 1/3 pwm: Add Aspeed ast2600 PWM support

This patch add the support of PWM controller which can be found at aspeed ast2600 soc. The pwm supoorts up to 16 channels and it's part function of multi-function device "pwm-tach controller".

---
 drivers/pwm/Kconfig      |   8 ++
 drivers/pwm/Makefile     |   1 +
 drivers/pwm/pwm-aspeed.c | 251 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 260 insertions(+)
 create mode 100644 drivers/pwm/pwm-aspeed.c
drivers/pwm/Kconfig +8 -0
index 669d3fa4fc..6be612d58a 100644
@@ -9,6 +9,14 @@ config DM_PWM
 	  frequency/period can be controlled along with the proportion of that
 	  time that the signal is high.
 
+config PWM_ASPEED
+	bool "Enable support for the Aspeed PWM"
+	depends on DM_PWM
+	help
+	  This PWM is found on Ast2600 SoCs. It supports a programmable period
+	  and duty cycle. It provides 16 channels which can be independently
+	  programmed.
+
 config PWM_AT91
 	bool "Enable support for PWM found on AT91 SoC's"
 	depends on DM_PWM && ARCH_AT91
drivers/pwm/Makefile +1 -0
index 55f2bc081d..5d31812d52 100644
@@ -10,6 +10,7 @@
 
 obj-$(CONFIG_DM_PWM)		+= pwm-uclass.o
 
+obj-$(CONFIG_PWM_ASPEED)	+= pwm-aspeed.o
 obj-$(CONFIG_PWM_AT91)		+= pwm-at91.o
 obj-$(CONFIG_PWM_CROS_EC)	+= cros_ec_pwm.o
 obj-$(CONFIG_PWM_EXYNOS)	+= exynos_pwm.o
drivers/pwm/pwm-aspeed.c new file +251 -0

251 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] pwm: Add Aspeed ast2600 PWM support

Quoted 5 lines · Billy Tsai

This patch add the support of PWM controller which can be found at aspeed ast2600 soc. The pwm supoorts up to 16 channels and it's part function of multi-function device "pwm-tach controller".

Quoted 7 lines
---
 drivers/pwm/Kconfig      |   8 ++
 drivers/pwm/Makefile     |   1 +
 drivers/pwm/pwm-aspeed.c | 251 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 260 insertions(+)
 create mode 100644 drivers/pwm/pwm-aspeed.c
Reviewed-by
#3 lore raw

RE: [PATCH 1/3] pwm: Add Aspeed ast2600 PWM support

Quoted 19 lines

From: Simon Glass <[email protected]>
Sent: Saturday, March 12, 2022 10:44 AM

Quoted 6 lines · Billy Tsai

This patch add the support of PWM controller which can be found at aspeed
ast2600 soc. The pwm supoorts up to 16 channels and it's part function of multi-function device "pwm-tach controller".

Quoted 8 lines
---
 drivers/pwm/Kconfig      |   8 ++
 drivers/pwm/Makefile     |   1 +
 drivers/pwm/pwm-aspeed.c | 251
+++++++++++++++++++++++++++++++++++++++
 3 files changed, 260 insertions(+)
 create mode 100644 drivers/pwm/pwm-aspeed.c
Quoted 1 line
#4 lore raw

Re: [PATCH 1/3] pwm: Add Aspeed ast2600 PWM support

In reply to Billy Tsai
Quoted 7 lines · Billy Tsai

This patch add the support of PWM controller which can be found at aspeed ast2600 soc. The pwm supoorts up to 16 channels and it's part function of multi-function device "pwm-tach controller".

Applied to u-boot/next, thanks!

Signature · 1 line
Tom
author reviewer
#5 lore raw

PATCH 2/3 pinctrl: Add the pinctrl setting for PWM.

In reply to Billy Tsai

This patchs add the signal description array for PWM pinctrl settings.

---
 arch/arm/dts/ast2600.dtsi                |  80 +++++++++++++++
 drivers/pinctrl/aspeed/pinctrl_ast2600.c | 120 +++++++++++++++++++++++
 2 files changed, 200 insertions(+)
arch/arm/dts/ast2600.dtsi +80 -0
index 98840ce7b0..ce006a3759 100644
@@ -1626,6 +1626,86 @@
 		groups = "PWM7";
 	};
 
+	pinctrl_pwm8g0_default: pwm8g0_default {
+		function = "PWM8G0";
+		groups = "PWM8G0";
+	};
+
+	pinctrl_pwm8g1_default: pwm8g1_default {
+		function = "PWM8G1";
+		groups = "PWM8G1";
+	};
+
+	pinctrl_pwm9g0_default: pwm9g0_default {
+		function = "PWM9G0";
+		groups = "PWM9G0";
+	};
+
+	pinctrl_pwm9g1_default: pwm9g1_default {
+		function = "PWM9G1";
+		groups = "PWM9G1";
+	};
+
+	pinctrl_pwm10g0_default: pwm10g0_default {
+		function = "PWM10G0";
+		groups = "PWM10G0";
+	};
+
+	pinctrl_pwm10g1_default: pwm10g1_default {
+		function = "PWM10G1";
+		groups = "PWM10G1";
+	};
+
+	pinctrl_pwm11g0_default: pwm11g0_default {
+		function = "PWM11G0";
+		groups = "PWM11G0";
+	};
+
+	pinctrl_pwm11g1_default: pwm11g1_default {
+		function = "PWM11G1";
+		groups = "PWM11G1";
+	};
+
+	pinctrl_pwm12g0_default: pwm12g0_default {
+		function = "PWM12G0";
+		groups = "PWM12G0";
+	};
+
+	pinctrl_pwm12g1_default: pwm12g1_default {
+		function = "PWM12G1";
+		groups = "PWM12G1";
+	};
+
+	pinctrl_pwm13g0_default: pwm13g0_default {
+		function = "PWM13G0";
+		groups = "PWM13G0";
+	};
+
+	pinctrl_pwm13g1_default: pwm13g1_default {
+		function = "PWM13G1";
+		groups = "PWM13G1";
+	};
+
+	pinctrl_pwm14g0_default: pwm14g0_default {
+		function = "PWM14G0";
+		groups = "PWM14G0";
+	};
+
+	pinctrl_pwm14g1_default: pwm14g1_default {
+		function = "PWM14G1";
+		groups = "PWM14G1";
+	};
+
+	pinctrl_pwm15g0_default: pwm15g0_default {
+		function = "PWM15G0";
+		groups = "PWM15G0";
+	};
+
+	pinctrl_pwm15g1_default: pwm15g1_default {
+		function = "PWM15G1";
+		groups = "PWM15G1";
+	};
+
 	pinctrl_rgmii1_default: rgmii1_default {
 		function = "RGMII1";
 		groups = "RGMII1";
drivers/pinctrl/aspeed/pinctrl_ast2600.c +120 -0

132 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] pinctrl: Add the pinctrl setting for PWM.

Quoted 9 lines · Billy Tsai

This patchs add the signal description array for PWM pinctrl settings.

---
 arch/arm/dts/ast2600.dtsi                |  80 +++++++++++++++
 drivers/pinctrl/aspeed/pinctrl_ast2600.c | 120 +++++++++++++++++++++++
 2 files changed, 200 insertions(+)
Reviewed-by
#7 lore raw

RE: [PATCH 2/3] pinctrl: Add the pinctrl setting for PWM.

Quoted 7 lines

From: Simon Glass <[email protected]>
Sent: Saturday, March 12, 2022 10:44 AM

Quoted 3 lines · Billy Tsai

This patchs add the signal description array for PWM pinctrl settings.

Quoted 8 lines
Quoted 6 lines
---
 arch/arm/dts/ast2600.dtsi                |  80 +++++++++++++++
 drivers/pinctrl/aspeed/pinctrl_ast2600.c | 120 +++++++++++++++++++++++
 2 files changed, 200 insertions(+)
author reviewer
#9 lore raw

PATCH 3/3 ARM: dts: ast2600: Add PWM to device tree

In reply to Billy Tsai

Add the PWM node and enable it for AST2600 EVB

---
 arch/arm/dts/ast2600-evb.dts | 20 ++++++++++++++++++++
 arch/arm/dts/ast2600.dtsi    | 15 +++++++++++++++
 2 files changed, 35 insertions(+)
arch/arm/dts/ast2600-evb.dts +20 -0
index c17988ec3c..0d65054313 100644
@@ -37,6 +37,26 @@
 	};
 };
 
+&pwm {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0_default
+			&pinctrl_pwm1_default
+			&pinctrl_pwm2_default
+			&pinctrl_pwm3_default
+			&pinctrl_pwm4_default
+			&pinctrl_pwm5_default
+			&pinctrl_pwm6_default
+			&pinctrl_pwm7_default
+			&pinctrl_pwm8g1_default
+			&pinctrl_pwm9g1_default
+			&pinctrl_pwm10g1_default
+			&pinctrl_pwm11g1_default
+			&pinctrl_pwm12g1_default
+			&pinctrl_pwm13g1_default
+			&pinctrl_pwm14g1_default>;
+};
+
 &uart5 {
 	u-boot,dm-pre-reloc;
 	status = "okay";
arch/arm/dts/ast2600.dtsi +15 -0
index ce006a3759..64074309b7 100644
@@ -113,6 +113,21 @@
 			reg = < 0x1e600000 0x100>;
 		};
 
+		pwm_tach: pwm_tach@1e610000 {
+			compatible = "aspeed,ast2600-pwm-tach", "simple-mfd", "syscon";
+			reg = <0x1e610000 0x100>;
+			clocks = <&scu ASPEED_CLK_AHB>;
+			resets = <&rst ASPEED_RESET_PWM>;
+
+			pwm: pwm {
+				compatible = "aspeed,ast2600-pwm";
+				#pwm-cells = <3>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+		};
+
 		fmc: flash-controller@1e620000 {
 			reg = < 0x1e620000 0xc4
 				0x20000000 0x10000000 >;
Signature · 1 line
2.25.1
Reviewed-by on v1 3/3
#10 lore raw

Re: [PATCH 3/3] ARM: dts: ast2600: Add PWM to device tree

Quoted 9 lines · Billy Tsai

Add the PWM node and enable it for AST2600 EVB

---
 arch/arm/dts/ast2600-evb.dts | 20 ++++++++++++++++++++
 arch/arm/dts/ast2600.dtsi    | 15 +++++++++++++++
 2 files changed, 35 insertions(+)
Reviewed-by
#11 lore raw

RE: [PATCH 3/3] ARM: dts: ast2600: Add PWM to device tree

Quoted 7 lines

From: Simon Glass <[email protected]>
Sent: Saturday, March 12, 2022 10:44 AM

Quoted 3 lines · Billy Tsai

Add the PWM node and enable it for AST2600 EVB

Quoted 8 lines
Quoted 6 lines
---
 arch/arm/dts/ast2600-evb.dts | 20 ++++++++++++++++++++
 arch/arm/dts/ast2600.dtsi    | 15 +++++++++++++++
 2 files changed, 35 insertions(+)