2018-12-13 19:54:51

by Vijay Khemka

[permalink] [raw]
Subject: [PATCH 1/4] ARM: dts: aspeed: Add sensors devices for Facebook

Added ADC and other sensor devices in Facebook Tiogapass device tree.

Signed-off-by: Vijay Khemka <[email protected]>
---
.../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";
+ 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



2018-12-13 19:56:06

by Vijay Khemka

[permalink] [raw]
Subject: [PATCH 2/4] ARM: dts: aspeed: Add KCS support for LPC BMC

Added kcs device support for lpc BMC.

Signed-off-by: Vijay Khemka <[email protected]>
---
arch/arm/boot/dts/aspeed-g5.dtsi | 33 +++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi
index d107459fc0f8..2743f400aa29 100644
--- a/arch/arm/boot/dts/aspeed-g5.dtsi
+++ b/arch/arm/boot/dts/aspeed-g5.dtsi
@@ -330,8 +330,32 @@
ranges = <0x0 0x1e789000 0x1000>;

lpc_bmc: lpc-bmc@0 {
- compatible = "aspeed,ast2500-lpc-bmc";
+ compatible = "aspeed,ast2500-lpc-bmc", "simple-mfd", "syscon";
reg = <0x0 0x80>;
+ reg-io-width = <4>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0x0 0x0 0x80>;
+
+ kcs1: kcs1@0 {
+ compatible = "aspeed,ast2500-kcs-bmc";
+ interrupts = <8>;
+ kcs_chan = <1>;
+ status = "disabled";
+ };
+ kcs2: kcs2@0 {
+ compatible = "aspeed,ast2500-kcs-bmc";
+ interrupts = <8>;
+ kcs_chan = <2>;
+ status = "disabled";
+ };
+ kcs3: kcs3@0 {
+ compatible = "aspeed,ast2500-kcs-bmc";
+ interrupts = <8>;
+ kcs_chan = <3>;
+ status = "disabled";
+ };
};

lpc_host: lpc-host@80 {
@@ -343,6 +367,13 @@
#size-cells = <1>;
ranges = <0x0 0x80 0x1e0>;

+ kcs4: kcs4@0 {
+ compatible = "aspeed,ast2500-kcs-bmc";
+ interrupts = <8>;
+ kcs_chan = <4>;
+ status = "disabled";
+ };
+
lpc_ctrl: lpc-ctrl@0 {
compatible = "aspeed,ast2500-lpc-ctrl";
reg = <0x0 0x80>;
--
2.17.1


2018-12-13 19:56:39

by Vijay Khemka

[permalink] [raw]
Subject: [PATCH 3/4] ARM: dts: aspeed: Add KCS for Facebook

Added kcs device in Facebook Tiogapass device tree.

Signed-off-by: Vijay Khemka <[email protected]>
---
arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
index 58bbe08d3ba7..b99751b3e080 100644
--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
@@ -75,6 +75,18 @@
status = "okay";
};

+&kcs2 {
+ // BMC KCS channel 2
+ status = "okay";
+ kcs_addr = <0xca8>;
+};
+
+&kcs3 {
+ // BMC KCS channel 3
+ status = "okay";
+ kcs_addr = <0xca2>;
+};
+
&mac0 {
status = "okay";

--
2.17.1


2018-12-13 19:56:52

by Vijay Khemka

[permalink] [raw]
Subject: [PATCH 4/4] ARM: dts: aspeed: Add lpc ctrl for Facebook

Added lpc ctrl device to enable LPC clock in Facebook
Tiogapass device tree.

Signed-off-by: Vijay Khemka <[email protected]>
---
.../boot/dts/aspeed-bmc-facebook-tiogapass.dts | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
index b99751b3e080..084110007f5d 100644
--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
@@ -22,6 +22,17 @@
reg = <0x80000000 0x20000000>;
};

+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ flash_memory: region@98000000 {
+ no-map;
+ reg = <0x98000000 0x00001000>; /* 4K */
+ };
+ };
+
iio-hwmon {
compatible = "iio-hwmon";
oemname0 = "MB_P3V3";
@@ -62,6 +73,12 @@
};
};

+&lpc_ctrl {
+ status = "okay";
+ memory-region = <&flash_memory>;
+ flash = <&spi1>;
+};
+
&uart1 {
// Host Console
status = "okay";
--
2.17.1


2018-12-13 22:57:50

by Joel Stanley

[permalink] [raw]
Subject: Re: [PATCH 1/4] ARM: dts: aspeed: Add sensors devices for Facebook

On Fri, 14 Dec 2018 at 06:23, Vijay Khemka <[email protected]> wrote:
>
> Added ADC and other sensor devices in Facebook Tiogapass device tree.
>
> Signed-off-by: Vijay Khemka <[email protected]>
> ---
> .../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
>

2018-12-14 18:14:30

by Vijay Khemka

[permalink] [raw]
Subject: Re: [PATCH 1/4] ARM: dts: aspeed: Add sensors devices for Facebook

On 12/13/18, 2:56 PM, "Joel Stanley" <[email protected]> wrote:

On Fri, 14 Dec 2018 at 06:23, Vijay Khemka <[email protected]> wrote:
>
> Added ADC and other sensor devices in Facebook Tiogapass device tree.
>
> Signed-off-by: Vijay Khemka <[email protected]>
> ---
> .../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.


2018-12-14 19:19:16

by Jae Hyun Yoo

[permalink] [raw]
Subject: Re: [PATCH 1/4] ARM: dts: aspeed: Add sensors devices for Facebook

Hi Vijay,

On 12/14/2018 10:11 AM, Vijay Khemka wrote:
> On 12/13/18, 2:56 PM, "Joel Stanley" <[email protected]> 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

2018-12-14 20:44:43

by Vijay Khemka

[permalink] [raw]
Subject: Re: [PATCH 1/4] ARM: dts: aspeed: Add sensors devices for Facebook



On 12/14/18, 11:22 AM, "openbmc on behalf of Jae Hyun Yoo" <[email protected] on behalf of [email protected]> wrote:

Hi Vijay,

On 12/14/2018 10:11 AM, Vijay Khemka wrote:
> On 12/13/18, 2:56 PM, "Joel Stanley" <[email protected]> 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