All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
@ 2017-06-30 11:48 Mykola Kostenok
  2017-07-03  6:14 ` Joel Stanley
  0 siblings, 1 reply; 7+ messages in thread
From: Mykola Kostenok @ 2017-06-30 11:48 UTC (permalink / raw)
  To: Joel Stanley, openbmc; +Cc: Mykola Kostenok

Add aspeed,ast2500-pwm-tacho to dtsi.
Enable aspeed,ast2500-pwm-tacho for msn.

Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
---
 arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45 +++++++++++++++++++++++++++
 arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
 2 files changed, 61 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
index c71a6dbe1410..55d5dc15d136 100644
--- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
@@ -144,3 +144,48 @@
 	status = "okay";
 };
 
+&pwm_tacho {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0_default>;
+
+	fan@0 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
+	};
+
+	fan@1 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
+	};
+
+	fan@2 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
+	};
+
+	fan@3 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x03>;
+	};
+
+	fan@4 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x04>;
+	};
+
+	fan@5 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x05>;
+	};
+
+	fan@6 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x06>;
+	};
+
+	fan@7 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x07>;
+	};
+};
diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index 992242d3b22e..01c86bb71932 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -35,6 +35,14 @@
 		i2c13 = &i2c13;
 	};
 
+	clocks {
+		pwm_tacho_fixed_clk: fixedclk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <24000000>;
+		};
+	};
+
 	ahb {
 		compatible = "simple-bus";
 		#address-cells = <1>;
@@ -366,6 +374,14 @@
 				#size-cells = <1>;
 				ranges = <0 0x1e78a000 0x1000>;
 			};
+			pwm_tacho: pwm-tacho-controller@1e786000 {
+				compatible = "aspeed,ast2500-pwm-tacho";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x1e786000 0x1000>;
+				clocks = <&pwm_tacho_fixed_clk>;
+				status = "disabled";
+			};
 		};
 	};
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
  2017-06-30 11:48 [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho Mykola Kostenok
@ 2017-07-03  6:14 ` Joel Stanley
  2017-07-03 14:53   ` Patrick Venture
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Stanley @ 2017-07-03  6:14 UTC (permalink / raw)
  To: Mykola Kostenok, Patrick Venture; +Cc: OpenBMC Maillist

On Fri, Jun 30, 2017 at 9:18 PM, Mykola Kostenok <c_mykolak@mellanox.com> wrote:
> Add aspeed,ast2500-pwm-tacho to dtsi.
> Enable aspeed,ast2500-pwm-tacho for msn.
>
> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>

Patrick, you're our pwm/tach expert. Can you please review this one?

Cheers,

Joel

> ---
>  arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45 +++++++++++++++++++++++++++
>  arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
>  2 files changed, 61 insertions(+)
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> index c71a6dbe1410..55d5dc15d136 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> @@ -144,3 +144,48 @@
>         status = "okay";
>  };
>
> +&pwm_tacho {
> +       status = "okay";
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pinctrl_pwm0_default>;
> +
> +       fan@0 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x00>;
> +       };
> +
> +       fan@1 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
> +       };
> +
> +       fan@2 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
> +       };
> +
> +       fan@3 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x03>;
> +       };
> +
> +       fan@4 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x04>;
> +       };
> +
> +       fan@5 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x05>;
> +       };
> +
> +       fan@6 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x06>;
> +       };
> +
> +       fan@7 {
> +               reg = <0x00>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x07>;
> +       };
> +};
> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
> index 992242d3b22e..01c86bb71932 100644
> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
> @@ -35,6 +35,14 @@
>                 i2c13 = &i2c13;
>         };
>
> +       clocks {
> +               pwm_tacho_fixed_clk: fixedclk {
> +                       compatible = "fixed-clock";
> +                       #clock-cells = <0>;
> +                       clock-frequency = <24000000>;
> +               };
> +       };
> +
>         ahb {
>                 compatible = "simple-bus";
>                 #address-cells = <1>;
> @@ -366,6 +374,14 @@
>                                 #size-cells = <1>;
>                                 ranges = <0 0x1e78a000 0x1000>;
>                         };
> +                       pwm_tacho: pwm-tacho-controller@1e786000 {
> +                               compatible = "aspeed,ast2500-pwm-tacho";
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               reg = <0x1e786000 0x1000>;
> +                               clocks = <&pwm_tacho_fixed_clk>;
> +                               status = "disabled";
> +                       };
>                 };
>         };
>  };
> --
> 2.11.0
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
  2017-07-03  6:14 ` Joel Stanley
@ 2017-07-03 14:53   ` Patrick Venture
  2017-07-03 15:19     ` Mykola Kostenok
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Venture @ 2017-07-03 14:53 UTC (permalink / raw)
  To: Joel Stanley; +Cc: Mykola Kostenok, OpenBMC Maillist

On Sun, Jul 2, 2017 at 11:14 PM, Joel Stanley <joel@jms.id.au> wrote:
> On Fri, Jun 30, 2017 at 9:18 PM, Mykola Kostenok <c_mykolak@mellanox.com> wrote:
>> Add aspeed,ast2500-pwm-tacho to dtsi.
>> Enable aspeed,ast2500-pwm-tacho for msn.
>>
>> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
>
> Patrick, you're our pwm/tach expert. Can you please review this one?
>
> Cheers,
>
> Joel
>
>> ---
>>  arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45 +++++++++++++++++++++++++++
>>  arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
>>  2 files changed, 61 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> index c71a6dbe1410..55d5dc15d136 100644
>> --- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> +++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> @@ -144,3 +144,48 @@
>>         status = "okay";
>>  };
>>
>> +&pwm_tacho {
>> +       status = "okay";
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <&pinctrl_pwm0_default>;
>> +
>> +       fan@0 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x00>;
>> +       };
>> +
>> +       fan@1 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
>> +       };
>> +
>> +       fan@2 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
>> +       };
>> +
>> +       fan@3 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x03>;
>> +       };
>> +
>> +       fan@4 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x04>;
>> +       };
>> +
>> +       fan@5 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x05>;
>> +       };
>> +
>> +       fan@6 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x06>;
>> +       };
>> +
>> +       fan@7 {
>> +               reg = <0x00>;
>> +               aspeed,fan-tach-ch = /bits/ 8 <0x07>;
>> +       };
>> +};

These all use the same pwm? Is that deliberate?

>> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
>> index 992242d3b22e..01c86bb71932 100644
>> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
>> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
>> @@ -35,6 +35,14 @@
>>                 i2c13 = &i2c13;
>>         };
>>
>> +       clocks {
>> +               pwm_tacho_fixed_clk: fixedclk {
>> +                       compatible = "fixed-clock";
>> +                       #clock-cells = <0>;
>> +                       clock-frequency = <24000000>;
>> +               };
>> +       };
>> +
>>         ahb {
>>                 compatible = "simple-bus";
>>                 #address-cells = <1>;
>> @@ -366,6 +374,14 @@
>>                                 #size-cells = <1>;
>>                                 ranges = <0 0x1e78a000 0x1000>;
>>                         };

I didn't put mine behind the ahb.  I am still learning device-tree-fu.
this likely isn't an issue at all.

>> +                       pwm_tacho: pwm-tacho-controller@1e786000 {
>> +                               compatible = "aspeed,ast2500-pwm-tacho";
>> +                               #address-cells = <1>;
>> +                               #size-cells = <0>;
>> +                               reg = <0x1e786000 0x1000>;
>> +                               clocks = <&pwm_tacho_fixed_clk>;
>> +                               status = "disabled";
>> +                       };
>>                 };
>>         };
>>  };
>> --
>> 2.11.0
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
  2017-07-03 14:53   ` Patrick Venture
@ 2017-07-03 15:19     ` Mykola Kostenok
  2017-07-03 15:23       ` Patrick Venture
  0 siblings, 1 reply; 7+ messages in thread
From: Mykola Kostenok @ 2017-07-03 15:19 UTC (permalink / raw)
  To: Patrick Venture, Joel Stanley; +Cc: OpenBMC Maillist

Thanks.

Best regards. Mykola Kostenok.

> -----Original Message-----
> From: Patrick Venture [mailto:venture@google.com]
> Sent: Monday, July 3, 2017 5:54 PM
> To: Joel Stanley <joel@jms.id.au>
> Cc: Mykola Kostenok <c_mykolak@mellanox.com>; OpenBMC Maillist
> <openbmc@lists.ozlabs.org>
> Subject: Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-
> tacho.
> 
> On Sun, Jul 2, 2017 at 11:14 PM, Joel Stanley <joel@jms.id.au> wrote:
> > On Fri, Jun 30, 2017 at 9:18 PM, Mykola Kostenok
> <c_mykolak@mellanox.com> wrote:
> >> Add aspeed,ast2500-pwm-tacho to dtsi.
> >> Enable aspeed,ast2500-pwm-tacho for msn.
> >>
> >> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
> >
> > Patrick, you're our pwm/tach expert. Can you please review this one?
> >
> > Cheers,
> >
> > Joel
> >
> >> ---
> >>  arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45
> +++++++++++++++++++++++++++
> >>  arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
> >>  2 files changed, 61 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> index c71a6dbe1410..55d5dc15d136 100644
> >> --- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> +++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> @@ -144,3 +144,48 @@
> >>         status = "okay";
> >>  };
> >>
> >> +&pwm_tacho {
> >> +       status = "okay";
> >> +       pinctrl-names = "default";
> >> +       pinctrl-0 = <&pinctrl_pwm0_default>;
> >> +
> >> +       fan@0 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x00>;
> >> +       };
> >> +
> >> +       fan@1 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
> >> +       };
> >> +
> >> +       fan@2 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
> >> +       };
> >> +
> >> +       fan@3 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x03>;
> >> +       };
> >> +
> >> +       fan@4 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x04>;
> >> +       };
> >> +
> >> +       fan@5 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x05>;
> >> +       };
> >> +
> >> +       fan@6 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x06>;
> >> +       };
> >> +
> >> +       fan@7 {
> >> +               reg = <0x00>;
> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x07>;
> >> +       };
> >> +};
> 
> These all use the same pwm? Is that deliberate?
> 

Yes, we have so.

> >> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi
> >> b/arch/arm/boot/dts/aspeed-g5.dtsi
> >> index 992242d3b22e..01c86bb71932 100644
> >> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
> >> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
> >> @@ -35,6 +35,14 @@
> >>                 i2c13 = &i2c13;
> >>         };
> >>
> >> +       clocks {
> >> +               pwm_tacho_fixed_clk: fixedclk {
> >> +                       compatible = "fixed-clock";
> >> +                       #clock-cells = <0>;
> >> +                       clock-frequency = <24000000>;
> >> +               };
> >> +       };
> >> +
> >>         ahb {
> >>                 compatible = "simple-bus";
> >>                 #address-cells = <1>; @@ -366,6 +374,14 @@
> >>                                 #size-cells = <1>;
> >>                                 ranges = <0 0x1e78a000 0x1000>;
> >>                         };
> 
> I didn't put mine behind the ahb.  I am still learning device-tree-fu.
> this likely isn't an issue at all.
> 

Actually It's under apb. 

> >> +                       pwm_tacho: pwm-tacho-controller@1e786000 {
> >> +                               compatible = "aspeed,ast2500-pwm-tacho";
> >> +                               #address-cells = <1>;
> >> +                               #size-cells = <0>;
> >> +                               reg = <0x1e786000 0x1000>;
> >> +                               clocks = <&pwm_tacho_fixed_clk>;
> >> +                               status = "disabled";
> >> +                       };
> >>                 };
> >>         };
> >>  };
> >> --
> >> 2.11.0
> >>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
  2017-07-03 15:19     ` Mykola Kostenok
@ 2017-07-03 15:23       ` Patrick Venture
  2017-07-03 17:19         ` Vadim Pasternak
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Venture @ 2017-07-03 15:23 UTC (permalink / raw)
  To: Mykola Kostenok; +Cc: Joel Stanley, OpenBMC Maillist

On Mon, Jul 3, 2017 at 8:19 AM, Mykola Kostenok <c_mykolak@mellanox.com> wrote:
> Thanks.
>
> Best regards. Mykola Kostenok.
>
>> -----Original Message-----
>> From: Patrick Venture [mailto:venture@google.com]
>> Sent: Monday, July 3, 2017 5:54 PM
>> To: Joel Stanley <joel@jms.id.au>
>> Cc: Mykola Kostenok <c_mykolak@mellanox.com>; OpenBMC Maillist
>> <openbmc@lists.ozlabs.org>
>> Subject: Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-
>> tacho.
>>
>> On Sun, Jul 2, 2017 at 11:14 PM, Joel Stanley <joel@jms.id.au> wrote:
>> > On Fri, Jun 30, 2017 at 9:18 PM, Mykola Kostenok
>> <c_mykolak@mellanox.com> wrote:
>> >> Add aspeed,ast2500-pwm-tacho to dtsi.
>> >> Enable aspeed,ast2500-pwm-tacho for msn.
>> >>
>> >> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
>> >
>> > Patrick, you're our pwm/tach expert. Can you please review this one?
>> >
>> > Cheers,
>> >
>> > Joel
>> >
>> >> ---
>> >>  arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45
>> +++++++++++++++++++++++++++
>> >>  arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
>> >>  2 files changed, 61 insertions(+)
>> >>
>> >> diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> index c71a6dbe1410..55d5dc15d136 100644
>> >> --- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> +++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> @@ -144,3 +144,48 @@
>> >>         status = "okay";
>> >>  };
>> >>
>> >> +&pwm_tacho {
>> >> +       status = "okay";
>> >> +       pinctrl-names = "default";
>> >> +       pinctrl-0 = <&pinctrl_pwm0_default>;
>> >> +
>> >> +       fan@0 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x00>;
>> >> +       };
>> >> +
>> >> +       fan@1 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
>> >> +       };
>> >> +
>> >> +       fan@2 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
>> >> +       };
>> >> +
>> >> +       fan@3 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x03>;
>> >> +       };
>> >> +
>> >> +       fan@4 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x04>;
>> >> +       };
>> >> +
>> >> +       fan@5 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x05>;
>> >> +       };
>> >> +
>> >> +       fan@6 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x06>;
>> >> +       };
>> >> +
>> >> +       fan@7 {
>> >> +               reg = <0x00>;
>> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x07>;
>> >> +       };
>> >> +};
>>
>> These all use the same pwm? Is that deliberate?
>>
>
> Yes, we have so.

Oh, ok.  Well, then that looks fine.

>
>> >> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> b/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> index 992242d3b22e..01c86bb71932 100644
>> >> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> @@ -35,6 +35,14 @@
>> >>                 i2c13 = &i2c13;
>> >>         };
>> >>
>> >> +       clocks {
>> >> +               pwm_tacho_fixed_clk: fixedclk {
>> >> +                       compatible = "fixed-clock";
>> >> +                       #clock-cells = <0>;
>> >> +                       clock-frequency = <24000000>;
>> >> +               };
>> >> +       };
>> >> +
>> >>         ahb {
>> >>                 compatible = "simple-bus";
>> >>                 #address-cells = <1>; @@ -366,6 +374,14 @@
>> >>                                 #size-cells = <1>;
>> >>                                 ranges = <0 0x1e78a000 0x1000>;
>> >>                         };
>>
>> I didn't put mine behind the ahb.  I am still learning device-tree-fu.
>> this likely isn't an issue at all.
>>
>
> Actually It's under apb.

In the diagram of the aspeed part, it is under the apb.  I meant in
the device tree layout, at least in my version; I don't think I placed
it under that parent.  So yours is _more_ correct.

>
>> >> +                       pwm_tacho: pwm-tacho-controller@1e786000 {
>> >> +                               compatible = "aspeed,ast2500-pwm-tacho";
>> >> +                               #address-cells = <1>;
>> >> +                               #size-cells = <0>;
>> >> +                               reg = <0x1e786000 0x1000>;
>> >> +                               clocks = <&pwm_tacho_fixed_clk>;
>> >> +                               status = "disabled";
>> >> +                       };
>> >>                 };
>> >>         };
>> >>  };
>> >> --
>> >> 2.11.0
>> >>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
  2017-07-03 15:23       ` Patrick Venture
@ 2017-07-03 17:19         ` Vadim Pasternak
  2017-07-04  4:02           ` Patrick Venture
  0 siblings, 1 reply; 7+ messages in thread
From: Vadim Pasternak @ 2017-07-03 17:19 UTC (permalink / raw)
  To: Patrick Venture, Mykola Kostenok; +Cc: OpenBMC Maillist



> -----Original Message-----
> From: openbmc [mailto:openbmc-
> bounces+yanivab=mellanox.com@lists.ozlabs.org] On Behalf Of Patrick
> Venture
> Sent: Monday, July 03, 2017 6:23 PM
> To: Mykola Kostenok <c_mykolak@mellanox.com>
> Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
> Subject: Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-
> tacho.
> 
> On Mon, Jul 3, 2017 at 8:19 AM, Mykola Kostenok
> <c_mykolak@mellanox.com> wrote:
> > Thanks.
> >
> > Best regards. Mykola Kostenok.
> >
> >> -----Original Message-----
> >> From: Patrick Venture [mailto:venture@google.com]
> >> Sent: Monday, July 3, 2017 5:54 PM
> >> To: Joel Stanley <joel@jms.id.au>
> >> Cc: Mykola Kostenok <c_mykolak@mellanox.com>; OpenBMC Maillist
> >> <openbmc@lists.ozlabs.org>
> >> Subject: Re: [PATCH linux dev-4.10] aspeed-g5: add
> >> aspeed,ast2500-pwm- tacho.
> >>
> >> On Sun, Jul 2, 2017 at 11:14 PM, Joel Stanley <joel@jms.id.au> wrote:
> >> > On Fri, Jun 30, 2017 at 9:18 PM, Mykola Kostenok
> >> <c_mykolak@mellanox.com> wrote:
> >> >> Add aspeed,ast2500-pwm-tacho to dtsi.
> >> >> Enable aspeed,ast2500-pwm-tacho for msn.
> >> >>
> >> >> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
> >> >
> >> > Patrick, you're our pwm/tach expert. Can you please review this one?
> >> >
> >> > Cheers,
> >> >
> >> > Joel
> >> >
> >> >> ---
> >> >>  arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45
> >> +++++++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
> >> >>  2 files changed, 61 insertions(+)
> >> >>
> >> >> diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> >> b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> >> index c71a6dbe1410..55d5dc15d136 100644
> >> >> --- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> >> +++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
> >> >> @@ -144,3 +144,48 @@
> >> >>         status = "okay";
> >> >>  };
> >> >>
> >> >> +&pwm_tacho {
> >> >> +       status = "okay";
> >> >> +       pinctrl-names = "default";
> >> >> +       pinctrl-0 = <&pinctrl_pwm0_default>;
> >> >> +
> >> >> +       fan@0 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x00>;
> >> >> +       };
> >> >> +
> >> >> +       fan@1 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
> >> >> +       };
> >> >> +
> >> >> +       fan@2 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
> >> >> +       };
> >> >> +
> >> >> +       fan@3 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x03>;
> >> >> +       };
> >> >> +
> >> >> +       fan@4 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x04>;
> >> >> +       };
> >> >> +
> >> >> +       fan@5 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x05>;
> >> >> +       };
> >> >> +
> >> >> +       fan@6 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x06>;
> >> >> +       };
> >> >> +
> >> >> +       fan@7 {
> >> >> +               reg = <0x00>;
> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x07>;
> >> >> +       };
> >> >> +};
> >>
> >> These all use the same pwm? Is that deliberate?
> >>
> >
> > Yes, we have so.
> 
> Oh, ok.  Well, then that looks fine.

Guys,
We would like to send a patch which added pwm as a cooling device.
But this change requires some changes in dts, like:

&pwm_tacho {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm0_default>;

	tach-channels {
		#address-cells = <1>;
		#size-cells = <0>;

		fan@0 {
			reg = <0x00>;
			aspeed,fan-tach-ch = /bits/ 8 <0x00>;
		};
..
	pwm-channels {
		#address-cells = <1>;
		#size-cells = <0>;
		#cooling-cells = <2>;

		pwm@0 {
			reg = <0x00>;
			cooling-levels = /bits/ 8 <125 151 177 203 229 255>;
		};
...
	};
};

Would it be acceptable to modify pwm layout in dts?

Thanks,
Vadim.

> 
> >
> >> >> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi
> >> >> b/arch/arm/boot/dts/aspeed-g5.dtsi
> >> >> index 992242d3b22e..01c86bb71932 100644
> >> >> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
> >> >> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
> >> >> @@ -35,6 +35,14 @@
> >> >>                 i2c13 = &i2c13;
> >> >>         };
> >> >>
> >> >> +       clocks {
> >> >> +               pwm_tacho_fixed_clk: fixedclk {
> >> >> +                       compatible = "fixed-clock";
> >> >> +                       #clock-cells = <0>;
> >> >> +                       clock-frequency = <24000000>;
> >> >> +               };
> >> >> +       };
> >> >> +
> >> >>         ahb {
> >> >>                 compatible = "simple-bus";
> >> >>                 #address-cells = <1>; @@ -366,6 +374,14 @@
> >> >>                                 #size-cells = <1>;
> >> >>                                 ranges = <0 0x1e78a000 0x1000>;
> >> >>                         };
> >>
> >> I didn't put mine behind the ahb.  I am still learning device-tree-fu.
> >> this likely isn't an issue at all.
> >>
> >
> > Actually It's under apb.
> 
> In the diagram of the aspeed part, it is under the apb.  I meant in the device
> tree layout, at least in my version; I don't think I placed it under that parent.
> So yours is _more_ correct.
> 
> >
> >> >> +                       pwm_tacho: pwm-tacho-controller@1e786000 {
> >> >> +                               compatible = "aspeed,ast2500-pwm-tacho";
> >> >> +                               #address-cells = <1>;
> >> >> +                               #size-cells = <0>;
> >> >> +                               reg = <0x1e786000 0x1000>;
> >> >> +                               clocks = <&pwm_tacho_fixed_clk>;
> >> >> +                               status = "disabled";
> >> >> +                       };
> >> >>                 };
> >> >>         };
> >> >>  };
> >> >> --
> >> >> 2.11.0
> >> >>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho.
  2017-07-03 17:19         ` Vadim Pasternak
@ 2017-07-04  4:02           ` Patrick Venture
  0 siblings, 0 replies; 7+ messages in thread
From: Patrick Venture @ 2017-07-04  4:02 UTC (permalink / raw)
  To: Vadim Pasternak; +Cc: Mykola Kostenok, OpenBMC Maillist

On Mon, Jul 3, 2017 at 10:19 AM, Vadim Pasternak <vadimp@mellanox.com> wrote:
>
>
>> -----Original Message-----
>> From: openbmc [mailto:openbmc-
>> bounces+yanivab=mellanox.com@lists.ozlabs.org] On Behalf Of Patrick
>> Venture
>> Sent: Monday, July 03, 2017 6:23 PM
>> To: Mykola Kostenok <c_mykolak@mellanox.com>
>> Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>
>> Subject: Re: [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-
>> tacho.
>>
>> On Mon, Jul 3, 2017 at 8:19 AM, Mykola Kostenok
>> <c_mykolak@mellanox.com> wrote:
>> > Thanks.
>> >
>> > Best regards. Mykola Kostenok.
>> >
>> >> -----Original Message-----
>> >> From: Patrick Venture [mailto:venture@google.com]
>> >> Sent: Monday, July 3, 2017 5:54 PM
>> >> To: Joel Stanley <joel@jms.id.au>
>> >> Cc: Mykola Kostenok <c_mykolak@mellanox.com>; OpenBMC Maillist
>> >> <openbmc@lists.ozlabs.org>
>> >> Subject: Re: [PATCH linux dev-4.10] aspeed-g5: add
>> >> aspeed,ast2500-pwm- tacho.
>> >>
>> >> On Sun, Jul 2, 2017 at 11:14 PM, Joel Stanley <joel@jms.id.au> wrote:
>> >> > On Fri, Jun 30, 2017 at 9:18 PM, Mykola Kostenok
>> >> <c_mykolak@mellanox.com> wrote:
>> >> >> Add aspeed,ast2500-pwm-tacho to dtsi.
>> >> >> Enable aspeed,ast2500-pwm-tacho for msn.
>> >> >>
>> >> >> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
>> >> >
>> >> > Patrick, you're our pwm/tach expert. Can you please review this one?
>> >> >
>> >> > Cheers,
>> >> >
>> >> > Joel
>> >> >
>> >> >> ---
>> >> >>  arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts | 45
>> >> +++++++++++++++++++++++++++
>> >> >>  arch/arm/boot/dts/aspeed-g5.dtsi              | 16 ++++++++++
>> >> >>  2 files changed, 61 insertions(+)
>> >> >>
>> >> >> diff --git a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> >> b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> >> index c71a6dbe1410..55d5dc15d136 100644
>> >> >> --- a/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> >> +++ b/arch/arm/boot/dts/aspeed-bmc-mellanox-msn.dts
>> >> >> @@ -144,3 +144,48 @@
>> >> >>         status = "okay";
>> >> >>  };
>> >> >>
>> >> >> +&pwm_tacho {
>> >> >> +       status = "okay";
>> >> >> +       pinctrl-names = "default";
>> >> >> +       pinctrl-0 = <&pinctrl_pwm0_default>;
>> >> >> +
>> >> >> +       fan@0 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x00>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@1 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@2 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@3 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x03>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@4 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x04>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@5 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x05>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@6 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x06>;
>> >> >> +       };
>> >> >> +
>> >> >> +       fan@7 {
>> >> >> +               reg = <0x00>;
>> >> >> +               aspeed,fan-tach-ch = /bits/ 8 <0x07>;
>> >> >> +       };
>> >> >> +};
>> >>
>> >> These all use the same pwm? Is that deliberate?
>> >>
>> >
>> > Yes, we have so.
>>
>> Oh, ok.  Well, then that looks fine.
>
> Guys,
> We would like to send a patch which added pwm as a cooling device.
> But this change requires some changes in dts, like:
>
> &pwm_tacho {
>         status = "okay";
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_pwm0_default>;
>
>         tach-channels {
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>
>                 fan@0 {
>                         reg = <0x00>;
>                         aspeed,fan-tach-ch = /bits/ 8 <0x00>;
>                 };
> ..

I had a version of the dts that was like this in a way, where it
grouped them together as such a while ago and it was fine.  I have no
problem with re-organizing the layout with groups.

>         pwm-channels {
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>                 #cooling-cells = <2>;
>
>                 pwm@0 {
>                         reg = <0x00>;
>                         cooling-levels = /bits/ 8 <125 151 177 203 229 255>;
>                 };
> ...
>         };
> };
>
> Would it be acceptable to modify pwm layout in dts?
>

I think I'd like to hear from Joel on this change.  From the recent
activity, I get the impression this pwm-tacho controller is now being
used by multiple platforms so we'll converge on a stable layout
shortly if not immediately.

> Thanks,
> Vadim.
>
>>
>> >
>> >> >> diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> >> b/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> >> index 992242d3b22e..01c86bb71932 100644
>> >> >> --- a/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> >> +++ b/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> >> @@ -35,6 +35,14 @@
>> >> >>                 i2c13 = &i2c13;
>> >> >>         };
>> >> >>
>> >> >> +       clocks {
>> >> >> +               pwm_tacho_fixed_clk: fixedclk {
>> >> >> +                       compatible = "fixed-clock";
>> >> >> +                       #clock-cells = <0>;
>> >> >> +                       clock-frequency = <24000000>;
>> >> >> +               };
>> >> >> +       };
>> >> >> +
>> >> >>         ahb {
>> >> >>                 compatible = "simple-bus";
>> >> >>                 #address-cells = <1>; @@ -366,6 +374,14 @@
>> >> >>                                 #size-cells = <1>;
>> >> >>                                 ranges = <0 0x1e78a000 0x1000>;
>> >> >>                         };
>> >>
>> >> I didn't put mine behind the ahb.  I am still learning device-tree-fu.
>> >> this likely isn't an issue at all.
>> >>
>> >
>> > Actually It's under apb.
>>
>> In the diagram of the aspeed part, it is under the apb.  I meant in the device
>> tree layout, at least in my version; I don't think I placed it under that parent.
>> So yours is _more_ correct.
>>
>> >
>> >> >> +                       pwm_tacho: pwm-tacho-controller@1e786000 {
>> >> >> +                               compatible = "aspeed,ast2500-pwm-tacho";
>> >> >> +                               #address-cells = <1>;
>> >> >> +                               #size-cells = <0>;
>> >> >> +                               reg = <0x1e786000 0x1000>;
>> >> >> +                               clocks = <&pwm_tacho_fixed_clk>;
>> >> >> +                               status = "disabled";
>> >> >> +                       };
>> >> >>                 };
>> >> >>         };
>> >> >>  };
>> >> >> --
>> >> >> 2.11.0
>> >> >>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-07-04  4:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 11:48 [PATCH linux dev-4.10] aspeed-g5: add aspeed,ast2500-pwm-tacho Mykola Kostenok
2017-07-03  6:14 ` Joel Stanley
2017-07-03 14:53   ` Patrick Venture
2017-07-03 15:19     ` Mykola Kostenok
2017-07-03 15:23       ` Patrick Venture
2017-07-03 17:19         ` Vadim Pasternak
2017-07-04  4:02           ` Patrick Venture

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.