Skip to contentSkip to conversation

ARM: dts: aspeed: romulus: Add aspeed fan tach

PATCH Applied Lei YU 2 participants 3 messages Oct 30, 2017 – Oct 31, 2017

Subsystems (2)
lore
Share & tools
lore

Lei YU

author
#0 lore raw

PATCH 1/1 ARM: dts: aspeed: romulus: Add aspeed fan tach

Romulus uses aspeed fan tach instead of max31785:
* Pass1's max31785 is always reset by CPLD;
* Pass2's max31785 is not connected.

The board has 7 fan taches connected to BMC_FANTACH8~14, and controlled by two PWMs.

This commit also change "enabled" to "okay" for the i2c devices.

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 138 +++++++++------------------
 1 file changed, 47 insertions(+), 91 deletions(-)
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +47 -91
index dea556f..86f7927 100644
@@ -68,6 +68,47 @@
 
 #include "ibm-power9-cfam.dtsi"
 
+&pwm_tacho {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;
+
+	fan@0 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x08>;
+	};
+
+	fan@1 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x09>;
+	};
+
+	fan@2 {
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0a>;
+	};
+
+	fan@3 {
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0b>;
+	};
+
+	fan@4 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0c>;
+	};
+
+	fan@5 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0d>;
+	};
+
+	fan@6 {
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0e>;
+	};
+};
+
 &fmc {
 	status = "okay";
 	flash@0 {
@@ -132,7 +173,7 @@
 };
 
 &i2c1 {
-	status = "enabled";
+	status = "okay";
 
 	/* CPU1 */
 };
@@ -173,27 +214,27 @@
 
 &i2c6 {
 	/* PCIe slot 1 (x8) */
-	status = "enabled";
+	status = "okay";
 };
 
 &i2c7 {
 	/* PCIe slot 2 (x16) */
-	status = "enabled";
+	status = "okay";
 };
 
 &i2c8 {
 	/* PCIe slot 3 (x16) */
-	status = "enabled";
+	status = "okay";
 };
 
 &i2c9 {
 	/* PCIe slot 4 (x16) */
-	status = "enabled";
+	status = "okay";
 };
 
 &i2c10 {
 	/* PCIe slot 5 (x8) */
-	status = "enabled";
+	status = "okay";
 };
 
 &i2c11 {
@@ -211,91 +252,6 @@
 	status = "okay";
 
 	/* Fan Controller */
-	max31785@52 {
-		compatible = "maxim,max31785";
-		reg = <0x52>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		fan@0 {
-			compatible = "pmbus-fan";
-			reg = <0>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@1 {
-			compatible = "pmbus-fan";
-			reg = <1>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@2 {
-			compatible = "pmbus-fan";
-			reg = <2>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@3 {
-			compatible = "pmbus-fan";
-			reg = <3>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@4 {
-			compatible = "pmbus-fan";
-			reg = <4>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@5 {
-			compatible = "pmbus-fan";
-			reg = <5>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-	};
-
 	/* CPLD */
 	/* Power Supply */
 	/* Temp Sensor */
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Lei YU

Romulus uses aspeed fan tach instead of max31785:
* Pass1's max31785 is always reset by CPLD;
* Pass2's max31785 is not connected.

The board has 7 fan taches connected to BMC_FANTACH8~14, and controlled by two PWMs.

This commit also change "enabled" to "okay" for the i2c devices.

I would prefer unrelated changes like the I2C fix are split out into a separate commit in the future. Don't worry about it now though.

Cheers,

Andrew

Quoted 192 lines

---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 138 +++++++++------------------

 1 file changed, 47 insertions(+), 91 deletions(-)

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +0 -0
index dea556f..86f7927 100644
@@ -68,6 +68,47 @@


 #include "ibm-power9-cfam.dtsi"

+&pwm_tacho {

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +40 -0
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;
+
+	fan@0 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x08>;
+	};
+
+	fan@1 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x09>;
+	};
+
+	fan@2 {
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0a>;
+	};
+
+	fan@3 {
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0b>;
+	};
+
+	fan@4 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0c>;
+	};
+
+	fan@5 {
+		reg = <0x00>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0d>;
+	};
+
+	fan@6 {
+		reg = <0x01>;
+		aspeed,fan-tach-ch = /bits/ 8 <0x0e>;
+	};
+};
+

 &fmc {
  status = "okay";
  flash@0 {

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +0 -0
@@ -132,7 +173,7 @@
  };


 &i2c1 {

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
-	status = "enabled";
+	status = "okay";


  /* CPU1 */
 };

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +0 -0
@@ -173,27 +214,27 @@


 &i2c6 {
  /* PCIe slot 1 (x8) */

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
-	status = "enabled";
+	status = "okay";

 };

 &i2c7 {
  /* PCIe slot 2 (x16) */

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
-	status = "enabled";
+	status = "okay";

 };

 &i2c8 {
  /* PCIe slot 3 (x16) */

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
-	status = "enabled";
+	status = "okay";

 };

 &i2c9 {
  /* PCIe slot 4 (x16) */

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
-	status = "enabled";
+	status = "okay";

 };

 &i2c10 {
  /* PCIe slot 5 (x8) */

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +1 -1
-	status = "enabled";
+	status = "okay";

 };

 &i2c11 {

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +0 -0
@@ -211,91 +252,6 @@
  	status = "okay";


  /* Fan Controller */

arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts +0 -85
-	max31785@52 {
-		compatible = "maxim,max31785";
-		reg = <0x52>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		fan@0 {
-			compatible = "pmbus-fan";
-			reg = <0>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@1 {
-			compatible = "pmbus-fan";
-			reg = <1>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@2 {
-			compatible = "pmbus-fan";
-			reg = <2>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@3 {
-			compatible = "pmbus-fan";
-			reg = <3>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@4 {
-			compatible = "pmbus-fan";
-			reg = <4>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-
-		fan@5 {
-			compatible = "pmbus-fan";
-			reg = <5>;
-			tach-pulses = <2>;
-			maxim,fan-rotor-input = "tach";
-			maxim,fan-pwm-freq = <25000>;
-			maxim,fan-dual-tach;
-			maxim,fan-no-watchdog;
-			maxim,fan-no-fault-ramp;
-			maxim,fan-ramp = <2>;
-			maxim,fan-fault-pin-mon;
-		};
-	};
-

  /* CPLD */
  /* Power Supply */
  /* Temp Sensor */

#2 lore raw
In reply to Lei YU
Quoted 10 lines · Lei YU

Romulus uses aspeed fan tach instead of max31785:
* Pass1's max31785 is always reset by CPLD;
* Pass2's max31785 is not connected.

The board has 7 fan taches connected to BMC_FANTACH8~14, and controlled by two PWMs.

This commit also change "enabled" to "okay" for the i2c devices.

Applied to dev-4.10.

Thanks,

Andrew