[1/4] ARM: dts: aspeed: Add sensors devices for Facebook

Message ID 20181213195319.1333402-1-vijaykhemka@fb.com
State Superseded, archived
Headers show
Series
  • [1/4] ARM: dts: aspeed: Add sensors devices for Facebook
Related show

Commit Message

Vijay Khemka Dec. 13, 2018, 7:53 p.m.
Added ADC and other sensor devices in Facebook Tiogapass device tree.

Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
---
 .../dts/aspeed-bmc-facebook-tiogapass.dts     | 33 +++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

Comments

Joel Stanley Dec. 13, 2018, 10:56 p.m. | #1
On Fri, 14 Dec 2018 at 06:23, Vijay Khemka <vijaykhemka@fb.com> wrote:
>
> Added ADC and other sensor devices in Facebook Tiogapass device tree.
>
> Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
> ---
>  .../dts/aspeed-bmc-facebook-tiogapass.dts     | 33 +++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
> index f8e7b71af7e6..58bbe08d3ba7 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
> @@ -21,6 +21,25 @@
>         memory@80000000 {
>                 reg = <0x80000000 0x20000000>;
>         };
> +
> +       iio-hwmon {
> +               compatible = "iio-hwmon";
> +               oemname0 = "MB_P3V3";
> +               oemname1 = "MB_P5V";
> +               oemname2 = "MB_P12V";
> +               oemname3 = "MB_P1V05";
> +               oemname4 = "MB_PVNN_PCH_STBY";
> +               oemname5 = "MB_P3V3_STBY";
> +               oemname6 = "MB_P5V_STBY";

"oemname" isn't part of the upstream bindings. Is this something you
have patches for?

The other parts of the patch lgtm.

> +               io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
> +                                       <&adc 4>, <&adc 5>, <&adc 6>;
> +       };
> +
> +       iio-hwmon-battery {
> +               oemname0 = "MB_P3V_BAT";
> +               compatible = "iio-hwmon";
> +               io-channels = <&adc 7>;
> +       };
>  };
>
>  &fmc {
> @@ -64,6 +83,10 @@
>         use-ncsi;
>  };
>
> +&adc {
> +       status = "okay";
> +};
> +
>  &i2c0 {
>         status = "okay";
>         //Airmax Conn B, CPU0 PIROM, CPU1 PIROM
> @@ -122,6 +145,10 @@
>
>  &i2c8 {
>         status = "okay";
> +       tmp421@1f {
> +               compatible = "ti,tmp421";
> +               reg = <0x1f>;
> +       };
>         //Mezz Sensor SMBus
>  };
>
> @@ -134,13 +161,15 @@
>         status = "okay";
>         pinctrl-names = "default";
>         pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;
> +       oemname0 = "System_Fan_Connector_1";
> +       oemname1 = "System_Fan_Connector_3";
>         fan@0 {
>                 reg = <0x00>;
>                 aspeed,fan-tach-ch = /bits/ 8 <0x00>;
>         };
>
>         fan@1 {
> -               reg = <0x00>;
> -               aspeed,fan-tach-ch = /bits/ 8 <0x01>;
> +               reg = <0x01>;
> +               aspeed,fan-tach-ch = /bits/ 8 <0x02>;
>         };
>  };
> --
> 2.17.1
>
Vijay Khemka Dec. 14, 2018, 6:11 p.m. | #2
On 12/13/18, 2:56 PM, "Joel Stanley" <joel@jms.id.au> wrote:

    On Fri, 14 Dec 2018 at 06:23, Vijay Khemka <vijaykhemka@fb.com> wrote:
    >
    > Added ADC and other sensor devices in Facebook Tiogapass device tree.
    >
    > Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
    > ---
    >  .../dts/aspeed-bmc-facebook-tiogapass.dts     | 33 +++++++++++++++++--
    >  1 file changed, 31 insertions(+), 2 deletions(-)
    >
    > diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
    > index f8e7b71af7e6..58bbe08d3ba7 100644
    > --- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
    > +++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
    > @@ -21,6 +21,25 @@
    >         memory@80000000 {
    >                 reg = <0x80000000 0x20000000>;
    >         };
    > +
    > +       iio-hwmon {
    > +               compatible = "iio-hwmon";
    > +               oemname0 = "MB_P3V3";
    > +               oemname1 = "MB_P5V";
    > +               oemname2 = "MB_P12V";
    > +               oemname3 = "MB_P1V05";
    > +               oemname4 = "MB_PVNN_PCH_STBY";
    > +               oemname5 = "MB_P3V3_STBY";
    > +               oemname6 = "MB_P5V_STBY";
    
    "oemname" isn't part of the upstream bindings. Is this something you
    have patches for?
This is a workaround field used by dbus-sensors application to avoid overlay for dynamic detection of devices based on json file definition.

Can you please also review other 3 patches in this series.
Jae Hyun Yoo Dec. 14, 2018, 7:18 p.m. | #3
Hi Vijay,

On 12/14/2018 10:11 AM, Vijay Khemka wrote:
> On 12/13/18, 2:56 PM, "Joel Stanley" <joel@jms.id.au> wrote:

<snip>

>      > +               oemname0 = "MB_P3V3";
>      > +               oemname1 = "MB_P5V";
>      > +               oemname2 = "MB_P12V";
>      > +               oemname3 = "MB_P1V05";
>      > +               oemname4 = "MB_PVNN_PCH_STBY";
>      > +               oemname5 = "MB_P3V3_STBY";
>      > +               oemname6 = "MB_P5V_STBY";
>      
>      "oemname" isn't part of the upstream bindings. Is this something you
>      have patches for?
> This is a workaround field used by dbus-sensors application to avoid overlay for dynamic detection of devices based on json file definition.
> 
> Can you please also review other 3 patches in this series.
>      
> 

These oemname settings should not be added into here. You can add these
information into configuration of entity manager which uses overlay
templates for dbus-sensors. Also, as Joel said, "oemname" isn't part of
the upstream bindings.

Cheers,
Jae
Vijay Khemka Dec. 14, 2018, 8:41 p.m. | #4
´╗┐On 12/14/18, 11:22 AM, "openbmc on behalf of Jae Hyun Yoo" <openbmc-bounces+vijaykhemka=fb.com@lists.ozlabs.org on behalf of jae.hyun.yoo@linux.intel.com> wrote:

    Hi Vijay,
    
    On 12/14/2018 10:11 AM, Vijay Khemka wrote:
    > On 12/13/18, 2:56 PM, "Joel Stanley" <joel@jms.id.au> wrote:
    
    <snip>
    
    >      > +               oemname0 = "MB_P3V3";
    >      > +               oemname1 = "MB_P5V";
    >      > +               oemname2 = "MB_P12V";
    >      > +               oemname3 = "MB_P1V05";
    >      > +               oemname4 = "MB_PVNN_PCH_STBY";
    >      > +               oemname5 = "MB_P3V3_STBY";
    >      > +               oemname6 = "MB_P5V_STBY";
    >      
    >      "oemname" isn't part of the upstream bindings. Is this something you
    >      have patches for?
    > This is a workaround field used by dbus-sensors application to avoid overlay for dynamic detection of devices based on json file definition.
    > 
    > Can you please also review other 3 patches in this series.
    >      
    > 
    
    These oemname settings should not be added into here. You can add these
    information into configuration of entity manager which uses overlay
    templates for dbus-sensors. Also, as Joel said, "oemname" isn't part of
    the upstream bindings.

Overlay templates from entity manager is not working for fan and adc sensors that's why it is a workaround suggested by James Feist (Author of dbus-sensors).
    
    Cheers,
    Jae

Patch

diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
index f8e7b71af7e6..58bbe08d3ba7 100644
--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
@@ -21,6 +21,25 @@ 
 	memory@80000000 {
 		reg = <0x80000000 0x20000000>;
 	};
+
+	iio-hwmon {
+		compatible = "iio-hwmon";
+		oemname0 = "MB_P3V3";
+		oemname1 = "MB_P5V";
+		oemname2 = "MB_P12V";
+		oemname3 = "MB_P1V05";
+		oemname4 = "MB_PVNN_PCH_STBY";
+		oemname5 = "MB_P3V3_STBY";
+		oemname6 = "MB_P5V_STBY";
+		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
+					<&adc 4>, <&adc 5>, <&adc 6>;
+	};
+
+	iio-hwmon-battery {
+		oemname0 = "MB_P3V_BAT";
+		compatible = "iio-hwmon";
+		io-channels = <&adc 7>;
+	};
 };
 
 &fmc {
@@ -64,6 +83,10 @@ 
 	use-ncsi;
 };
 
+&adc {
+	status = "okay";
+};
+
 &i2c0 {
 	status = "okay";
 	//Airmax Conn B, CPU0 PIROM, CPU1 PIROM
@@ -122,6 +145,10 @@ 
 
 &i2c8 {
 	status = "okay";
+	tmp421@1f {
+		compatible = "ti,tmp421";
+		reg = <0x1f>;
+	};
 	//Mezz Sensor SMBus
 };
 
@@ -134,13 +161,15 @@ 
 	status = "okay";
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;
+	oemname0 = "System_Fan_Connector_1";
+	oemname1 = "System_Fan_Connector_3";
 	fan@0 {
 		reg = <0x00>;
 		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
 	};
 
 	fan@1 {
-		reg = <0x00>;
-		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
 	};
 };