diff mbox series

[FOR,TESTING,ONLY,RFC,4/4] sunxi-d1s-t113: Add D1 and T113 PWM node

Message ID 20240518-pwm_d1-v1-4-311fc5fe2248@jookia.org
State RFC
Delegated to: Andre Przywara
Headers show
Series pwm: sunxi: Add support Allwinner D1 PWM | expand

Commit Message

John Watts May 18, 2024, 3:54 a.m. UTC
This is based on the binding from the as yet unmerged kernel series:

https://lore.kernel.org/linux-kernel/20240131125920.2879433-2-privatesub2@gmail.com/

Signed-off-by: John Watts <contact@jookia.org>
---
 arch/riscv/dts/sunxi-d1s-t113.dtsi                   | 12 ++++++++++++
 dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi | 12 ++++++++++++
 2 files changed, 24 insertions(+)

Comments

Sumit Garg May 20, 2024, 10:28 a.m. UTC | #1
On Sat, 18 May 2024 at 09:25, John Watts <contact@jookia.org> wrote:
>
> This is based on the binding from the as yet unmerged kernel series:
>
> https://lore.kernel.org/linux-kernel/20240131125920.2879433-2-privatesub2@gmail.com/
>
> Signed-off-by: John Watts <contact@jookia.org>
> ---
>  arch/riscv/dts/sunxi-d1s-t113.dtsi                   | 12 ++++++++++++
>  dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi | 12 ++++++++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/arch/riscv/dts/sunxi-d1s-t113.dtsi b/arch/riscv/dts/sunxi-d1s-t113.dtsi
> index 822f022eec..92b6432f77 100644
> --- a/arch/riscv/dts/sunxi-d1s-t113.dtsi
> +++ b/arch/riscv/dts/sunxi-d1s-t113.dtsi
> @@ -145,6 +145,18 @@
>                         };
>                 };
>
> +               pwm: pwm@2000c00 {
> +                       compatible = "allwinner,sun20i-d1-pwm";
> +                       reg = <0x02000c00 0x400>;
> +                       clocks = <&ccu CLK_BUS_PWM>,
> +                                <&dcxo>,
> +                                <&ccu CLK_APB0>;
> +                       clock-names = "bus", "hosc", "apb0";
> +                       resets = <&ccu RST_BUS_PWM>;
> +                       status = "disabled";
> +                       #pwm-cells = <0x3>;
> +               };
> +
>                 ccu: clock-controller@2001000 {
>                         compatible = "allwinner,sun20i-d1-ccu";
>                         reg = <0x2001000 0x1000>;
> diff --git a/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi b/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi
> index 5a9d7f5a75..435a1e66aa 100644
> --- a/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi
> +++ b/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi
> @@ -145,6 +145,18 @@
>                         };
>                 };
>
> +               pwm: pwm@2000c00 {
> +                       compatible = "allwinner,sun20i-d1-pwm";
> +                       reg = <0x02000c00 0x400>;
> +                       clocks = <&ccu CLK_BUS_PWM>,
> +                                <&dcxo>,
> +                                <&ccu CLK_APB0>;
> +                       clock-names = "bus", "hosc", "apb0";
> +                       resets = <&ccu RST_BUS_PWM>;
> +                       status = "disabled";
> +                       #pwm-cells = <0x3>;
> +               };
> +

This change shouldn't be needed for your testing purposes too. It only
comes into picture once you enable OF_UPSTREAM. BTW, DT source files
in dts/upstream are strictly following/syncing against Linux kernel DT
sources. So all the custom U-Boot specific DT stuff belongs to
arch/${ARCH}/dts/.

-Sumit

>                 ccu: clock-controller@2001000 {
>                         compatible = "allwinner,sun20i-d1-ccu";
>                         reg = <0x2001000 0x1000>;
>
> --
> 2.45.1
>
John Watts May 20, 2024, 11:24 p.m. UTC | #2
On Mon, May 20, 2024 at 03:58:12PM +0530, Sumit Garg wrote:
> This change shouldn't be needed for your testing purposes too. It only
> comes into picture once you enable OF_UPSTREAM. BTW, DT source files
> in dts/upstream are strictly following/syncing against Linux kernel DT
> sources. So all the custom U-Boot specific DT stuff belongs to
> arch/${ARCH}/dts/.
> 
> -Sumit

Hi,

I use OF_UPSTREAM.

John.
diff mbox series

Patch

diff --git a/arch/riscv/dts/sunxi-d1s-t113.dtsi b/arch/riscv/dts/sunxi-d1s-t113.dtsi
index 822f022eec..92b6432f77 100644
--- a/arch/riscv/dts/sunxi-d1s-t113.dtsi
+++ b/arch/riscv/dts/sunxi-d1s-t113.dtsi
@@ -145,6 +145,18 @@ 
 			};
 		};
 
+		pwm: pwm@2000c00 {
+			compatible = "allwinner,sun20i-d1-pwm";
+			reg = <0x02000c00 0x400>;
+			clocks = <&ccu CLK_BUS_PWM>,
+				 <&dcxo>,
+				 <&ccu CLK_APB0>;
+			clock-names = "bus", "hosc", "apb0";
+			resets = <&ccu RST_BUS_PWM>;
+			status = "disabled";
+			#pwm-cells = <0x3>;
+		};
+
 		ccu: clock-controller@2001000 {
 			compatible = "allwinner,sun20i-d1-ccu";
 			reg = <0x2001000 0x1000>;
diff --git a/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi b/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi
index 5a9d7f5a75..435a1e66aa 100644
--- a/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi
+++ b/dts/upstream/src/riscv/allwinner/sunxi-d1s-t113.dtsi
@@ -145,6 +145,18 @@ 
 			};
 		};
 
+		pwm: pwm@2000c00 {
+			compatible = "allwinner,sun20i-d1-pwm";
+			reg = <0x02000c00 0x400>;
+			clocks = <&ccu CLK_BUS_PWM>,
+				 <&dcxo>,
+				 <&ccu CLK_APB0>;
+			clock-names = "bus", "hosc", "apb0";
+			resets = <&ccu RST_BUS_PWM>;
+			status = "disabled";
+			#pwm-cells = <0x3>;
+		};
+
 		ccu: clock-controller@2001000 {
 			compatible = "allwinner,sun20i-d1-ccu";
 			reg = <0x2001000 0x1000>;