Skip to contentSkip to conversation

Add SAMA5D2 PWM Support

PATCH In review Dan Sneddon 2 participants 5 messages Sep 20, 2021 – Oct 12, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add SAMA5D2 PWM Support

Add support for the PWM found on SAMA5D2 SoCs.

Dan Sneddon (3):
pwm: Add PWM driver for SAMA5D2
dt-bindings: pwm: pwm-at91: Add PWM bindings for A5D2 ARM:dts: sama5d2: Add pwm definition

 arch/arm/dts/sama5d2.dtsi                 |   8 +
 doc/device-tree-bindings/pwm/pwm-at91.txt |  16 ++
 drivers/pwm/Kconfig                       |   6 +
 drivers/pwm/Makefile                      |   1 +
 drivers/pwm/pwm-at91.c                    | 207 ++++++++++++++++++++++
 5 files changed, 238 insertions(+)
 create mode 100644 doc/device-tree-bindings/pwm/pwm-at91.txt
 create mode 100644 drivers/pwm/pwm-at91.c
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 pwm: Add PWM driver for SAMA5D2

Add support for the PWM found on the SAMA5D2 family of devices.

---
 drivers/pwm/Kconfig    |   6 ++
 drivers/pwm/Makefile   |   1 +
 drivers/pwm/pwm-at91.c | 207 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 214 insertions(+)
 create mode 100644 drivers/pwm/pwm-at91.c
drivers/pwm/Kconfig +6 -0
index cf7f4c6840..691bbcd469 100644
@@ -91,3 +91,9 @@ config PWM_TI_EHRPWM
 	default y
 	help
 	  PWM driver support for the EHRPWM controller found on TI SOCs.
+
+config PWM_AT91
+	bool "Enable support for PWM found on AT91 SoC's"
+	depends on DM_PWM && ARCH_AT91
+	help
+	  Support for PWM hardware on AT91 based SoC.
drivers/pwm/Makefile +1 -0
index 10d244bfb7..6cdcbdb996 100644
@@ -21,3 +21,4 @@ obj-$(CONFIG_PWM_SIFIVE)	+= pwm-sifive.o
 obj-$(CONFIG_PWM_TEGRA)		+= tegra_pwm.o
 obj-$(CONFIG_PWM_SUNXI)		+= sunxi_pwm.o
 obj-$(CONFIG_PWM_TI_EHRPWM)	+= pwm-ti-ehrpwm.o
+obj-$(CONFIG_PWM_AT91)		+= pwm-at91.o
drivers/pwm/pwm-at91.c new file +207 -0

207 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 dt-bindings: pwm: pwm-at91: Add PWM bindings for A5D2

In reply to Dan Sneddon

Document the bindings needed for the PWM device on the SAMA5D2.

---
 doc/device-tree-bindings/pwm/pwm-at91.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 doc/device-tree-bindings/pwm/pwm-at91.txt
doc/device-tree-bindings/pwm/pwm-at91.txt new file +16 -0
new file mode 100644
index 0000000000..a03da404f5
@@ -0,0 +1,16 @@
+Microchip AT91 PWM controller for SAMA5D2
+
+Required properties:
+  - compatible: Should be "atmel,sama5d2-pwm"
+  - reg: Physical base address and length of the controller's registers.
+  - clocks: Should contain a clock identifier for the PWM's parent clock.
+  - #pwm-cells: Should be 3.
+
+Example:
+
+pwm0: pwm@f802c000 {
+	compatible = "atmel,sama5d2-pwm";
+	reg = <0xf802c000 0x4000>;
+	clocks = <&pwm_clk>;
+	#pwm-cells = <3>;
+};
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/3 ARM:dts: sama5d2: Add pwm definition

In reply to Dan Sneddon

Add the PWM on the SAMA5D2.

---
 arch/arm/dts/sama5d2.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/sama5d2.dtsi +8 -0
index 6fb2cb25f9..ba1b69e629 100644
@@ -671,6 +671,14 @@
 				status = "disabled";
 			};
 
+			pwm0: pwm@f802c000 {
+				compatible = "atmel,sama5d2-pwm";
+				reg = <0xf802c000 0x4000>;
+				clocks = <&pwm_clk>;
+				#pwm-cells = <3>;
+				status = "disabled";
+			};
+
 			rstc@f8048000 {
 				compatible = "atmel,sama5d3-rstc";
 				reg = <0xf8048000 0x10>;
Signature · 1 line
2.17.1
#4 lore raw
In reply to Dan Sneddon
Quoted 13 lines · Dan Sneddon

Add support for the PWM found on SAMA5D2 SoCs.

Dan Sneddon (3):
pwm: Add PWM driver for SAMA5D2
dt-bindings: pwm: pwm-at91: Add PWM bindings for A5D2 ARM:dts: sama5d2: Add pwm definition

  arch/arm/dts/sama5d2.dtsi                 |   8 +
  doc/device-tree-bindings/pwm/pwm-at91.txt |  16 ++
  drivers/pwm/Kconfig                       |   6 +
  drivers/pwm/Makefile                      |   1 +
  drivers/pwm/pwm-at91.c                    | 207 ++++++++++++++++++++++
  5 files changed, 238 insertions(+)
Quoted 6 lines

create mode 100644 doc/device-tree-bindings/pwm/pwm-at91.txt create mode 100644 drivers/pwm/pwm-at91.c

--
2.17.1

Applied to u-boot-at91/master, thanks !