Skip to contentSkip to conversation

Update the device tree for Ampere's BMC platform

PATCH Superseded Chanh Nguyen 4 participants 11 messages Aug 1, 2024 – Aug 6, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Update the device tree for Ampere's BMC platform

Updates the device tree to support some features on Ampere's Mt.Mitchell BMC and Ampere's Mt.Jade BMC.

Chanh Nguyen (6):
ARM: dts: aspeed: mtjade, mtmitchell: Add OCP temperature sensors
ARM: dts: aspeed: mtmitchell: Add I2C temperature sensor alias ports
ARM: dts: aspeed: mtmitchell: Add I2C Riser card alias ports
ARM: dts: aspeed: mtmitchell: Enable i2c10 and i2c15
ARM: dts: aspeed: mtmitchell: Add LEDs
ARM: dts: aspeed: mtmitchell: Add I2C FAN controllers

 .../dts/aspeed/aspeed-bmc-ampere-mtjade.dts   |  16 ++
 .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 152 ++++++++++++++++++
 2 files changed, 168 insertions(+)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/6 ARM: dts: aspeed: mtjade, mtmitchell: Add OCP temperature sensors

Define I2C alias ports from I2C Switch 0x70 at BMC I2C5.

Add the tmp421 sensors via the I2C alias ports as OCP device temperature sensors.

---
 .../dts/aspeed/aspeed-bmc-ampere-mtjade.dts   | 16 +++++++++++
 .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 28 +++++++++++++++++++
 2 files changed, 44 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtjade.dts +16 -0
index 8ab5f301f926..8102f41d1d15 100644
@@ -49,6 +49,11 @@ aliases {
 		 */
 		i2c80 = &nvme_m2_0;
 		i2c81 = &nvme_m2_1;
+
+		/*
+		 *  i2c bus 82 assigned to OCP slot
+		 */
+		i2c82 = &ocpslot;
 	};
 
 	chosen {
@@ -420,6 +425,17 @@ i2c-mux at 70 {
 		reg = <0x70>;
 		i2c-mux-idle-disconnect;
 
+		ocpslot: i2c at 0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x0>;
+
+			ocpslot_temp: temperature-sensor at 1f {
+				compatible = "ti,tmp421";
+				reg = <0x1f>;
+			};
+		};
+
 		nvmeslot_0_7: i2c at 3 {
 			#address-cells = <1>;
 			#size-cells = <0>;
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts +28 -0
index 3c8925034a8c..3a97e88278d5 100644
@@ -15,6 +15,12 @@ aliases {
 		serial7 = &uart8;
 		serial8 = &uart9;
 
+		/*
+		 *  i2c bus 30-31 assigned to OCP slot 0-1
+		 */
+		i2c30 = &ocpslot_0;
+		i2c31 = &ocpslot_1;
+
 		/*
 		 *  I2C NVMe alias port
 		 */
@@ -515,6 +521,28 @@ i2c-mux at 70 {
 		#size-cells = <0>;
 		reg = <0x70>;
 		i2c-mux-idle-disconnect;
+
+		ocpslot_0: i2c at 0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x0>;
+
+			ocpslot_0_temp: temperature-sensor at 1f {
+				compatible = "ti,tmp421";
+				reg = <0x1f>;
+			};
+		};
+
+		ocpslot_1: i2c at 1 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x1>;
+
+			ocpslot_1_temp: temperature-sensor at 1f {
+				compatible = "ti,tmp421";
+				reg = <0x1f>;
+			};
+		};
 	};
 };
 
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/6 ARM: dts: aspeed: mtmitchell: Add I2C temperature sensor alias ports

In reply to Chanh Nguyen

Add the I2C alias ports to read temperature sensors via channels of the I2C muxes.

---
 arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts +8 -0
index 3a97e88278d5..1679911e4fd8 100644
@@ -15,6 +15,14 @@ aliases {
 		serial7 = &uart8;
 		serial8 = &uart9;
 
+		/*
+		 * I2C temperature alias port
+		 */
+		i2c20 = &i2c4_bus70_chn0;
+		i2c21 = &i2c4_bus70_chn1;
+		i2c22 = &i2c4_bus70_chn2;
+		i2c23 = &i2c4_bus70_chn3;
+
 		/*
 		 *  i2c bus 30-31 assigned to OCP slot 0-1
 		 */
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/6 ARM: dts: aspeed: mtmitchell: Add I2C Riser card alias ports

In reply to Chanh Nguyen

Define the I2C alias ports for the riser cards.

Besides that, it also adds the i2c muxes to switch to the i2c alias ports.

---
 .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts +52 -0
index 1679911e4fd8..0703b77e438b 100644
@@ -29,6 +29,18 @@ aliases {
 		i2c30 = &ocpslot_0;
 		i2c31 = &ocpslot_1;
 
+		/*
+		 *  i2c bus 32-33 assigned to Riser slot 0-1
+		 */
+		i2c32 = &i2c_riser0;
+		i2c33 = &i2c_riser1;
+
+		/*
+		 *  i2c bus 38-39 assigned to FRU on Riser slot 0-1
+		 */
+		i2c38 = &i2c_riser0_chn_0;
+		i2c39 = &i2c_riser1_chn_0;
+
 		/*
 		 *  I2C NVMe alias port
 		 */
@@ -551,6 +563,46 @@ ocpslot_1_temp: temperature-sensor at 1f {
 				reg = <0x1f>;
 			};
 		};
+
+		i2c_riser0: i2c at 2 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x2>;
+
+			i2c-mux at 72 {
+				compatible = "nxp,pca9546";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x72>;
+				i2c-mux-idle-disconnect;
+
+				i2c_riser0_chn_0: i2c at 0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x0>;
+				};
+			};
+		};
+
+		i2c_riser1: i2c at 3 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x3>;
+
+			i2c-mux at 72 {
+				compatible = "nxp,pca9546";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x72>;
+				i2c-mux-idle-disconnect;
+
+				i2c_riser1_chn_0: i2c at 0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x0>;
+				};
+			};
+		};
 	};
 };
 
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/6 ARM: dts: aspeed: mtmitchell: Enable i2c10 and i2c15

In reply to Chanh Nguyen

Enable the BMC I2C10.
Enable the BMC I2C15 and add the GPIO Expander as a child node.

---
 .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts +23 -0
index 0703b77e438b..119e82637023 100644
@@ -878,6 +878,10 @@ nvme_m2_1: i2c at 1 {
 	};
 };
 
+&i2c10 {
+	status = "okay";
+};
+
 &i2c11 {
 	status = "okay";
 	ssif-bmc at 10 {
@@ -900,6 +904,25 @@ bmc_ast2600_cpu: temperature-sensor at 35 {
 	};
 };
 
+&i2c15 {
+	status = "okay";
+	gpio_expander1: gpio-expander at 22 {
+		compatible = "nxp,pca9535";
+		reg = <0x22>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpio-line-names =
+			"fan-fault","psu-fault",
+			"","",
+			"","",
+			"","",
+			"","",
+			"","",
+			"","",
+			"","";
+	};
+};
+
 &adc0 {
 	status = "okay";
 
Signature · 1 line
2.43.0
#5 lore raw

PATCH 5/6 ARM: dts: aspeed: mtmitchell: Add LEDs

In reply to Chanh Nguyen

Add LED nodes as the gpio-leds devices. They are led-bmc-ready, led-sw-heartbeat, led-identify, led-fault, led-fan-fault, led-psu-fault

---
 .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts +31 -0
index 119e82637023..093b746c010f 100644
@@ -113,6 +113,37 @@ vga_memory: region at bf000000 {
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		/*
+		 * Use gpio-leds to configure GPIOW5 (bmc-ready) pin to be reseted when
+		 * watchdog timeout.
+		 */
+		led-bmc-ready {
+			gpios = <&gpio0 ASPEED_GPIO(W, 5) (GPIO_ACTIVE_HIGH | GPIO_TRANSITORY)>;
+		};
+
+		led-sw-heartbeat {
+			gpios = <&gpio0 ASPEED_GPIO(N, 3) GPIO_ACTIVE_HIGH>;
+		};
+
+		led-identify {
+			gpios = <&gpio0 ASPEED_GPIO(S, 3) GPIO_ACTIVE_HIGH>;
+		};
+
+		led-fault {
+			gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_HIGH>;
+		};
+
+		led-fan-fault {
+			gpios = <&gpio_expander1 0 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-psu-fault {
+			gpios = <&gpio_expander1 1 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
 	voltage_mon_reg: voltage-mon-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "ltc2497_reg";
Signature · 1 line
2.43.0
#6 lore raw

PATCH 6/6 ARM: dts: aspeed: mtmitchell: Add I2C FAN controllers

In reply to Chanh Nguyen

Add the MAX31790 nodes as fan I2C controllers.

---
 .../boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dts +10 -0
index 093b746c010f..b3e7a306901b 100644
@@ -672,6 +672,16 @@ bmc-ocp0-en-hog {
 			line-name = "bmc-ocp0-en-n";
 		};
 	};
+
+	fan-controller0 at 20 {
+		compatible = "maxim,max31790";
+		reg = <0x20>;
+	};
+
+	fan-controller1 at 2f {
+		compatible = "maxim,max31790";
+		reg = <0x2f>;
+	};
 };
 
 &i2c9 {
Signature · 1 line
2.43.0
#7 lore raw
In reply to Chanh Nguyen
Quoted 11 lines · Chanh Nguyen

Updates the device tree to support some features on Ampere's Mt.Mitchell BMC and Ampere's Mt.Jade BMC.

Chanh Nguyen (6):
ARM: dts: aspeed: mtjade, mtmitchell: Add OCP temperature sensors
ARM: dts: aspeed: mtmitchell: Add I2C temperature sensor alias ports
ARM: dts: aspeed: mtmitchell: Add I2C Riser card alias ports
ARM: dts: aspeed: mtmitchell: Enable i2c10 and i2c15
ARM: dts: aspeed: mtmitchell: Add LEDs
ARM: dts: aspeed: mtmitchell: Add I2C FAN controllers

Quoted 9 lines
 .../dts/aspeed/aspeed-bmc-ampere-mtjade.dts   |  16 ++
 .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 152 ++++++++++++++++++
 2 files changed, 168 insertions(+)

--
2.43.0

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

  pip3 install dtschema --upgrade

New warnings running 'make CHECK_DTBS=y aspeed/aspeed-bmc-ampere-mtjade.dtb aspeed/aspeed-bmc-ampere-mtmitchell.dtb' for 20240801091217.1408809-1-chanh at os.amperecomputing.com:

arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller0 at 20: failed to match any schema with compatible: ['maxim,max31790'] arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller1 at 2f: failed to match any schema with compatible: ['maxim,max31790']

#8 lore raw
Quoted 35 lines · Rob Herring (Arm)
Quoted 11 lines · Chanh Nguyen

Updates the device tree to support some features on Ampere's Mt.Mitchell BMC and Ampere's Mt.Jade BMC.

Chanh Nguyen (6):
ARM: dts: aspeed: mtjade, mtmitchell: Add OCP temperature sensors
ARM: dts: aspeed: mtmitchell: Add I2C temperature sensor alias ports
ARM: dts: aspeed: mtmitchell: Add I2C Riser card alias ports
ARM: dts: aspeed: mtmitchell: Enable i2c10 and i2c15
ARM: dts: aspeed: mtmitchell: Add LEDs
ARM: dts: aspeed: mtmitchell: Add I2C FAN controllers

Quoted 9 lines
  .../dts/aspeed/aspeed-bmc-ampere-mtjade.dts   |  16 ++
  .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 152 ++++++++++++++++++
  2 files changed, 168 insertions(+)

--
2.43.0

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

Quoted 9 lines
   pip3 install dtschema --upgrade

New warnings running 'make CHECK_DTBS=y aspeed/aspeed-bmc-ampere-mtjade.dtb aspeed/aspeed-bmc-ampere-mtmitchell.dtb' for 20240801091217.1408809-1-chanh at os.amperecomputing.com:

arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller0 at 20: failed to match any schema with compatible: ['maxim,max31790'] arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller1 at 2f: failed to match any schema with compatible: ['maxim,max31790']

Thank Rob for your review!

I am aware of the new warnings you mentioned. For more information, the schema binding of "maxim,max31790" is being progressed by other series?
https://lore.kernel.org/lkml/20240414042246.8681-2-chanh at os.amperecomputing.com/

Best regards,
Chanh

Quoted 3 lines
maintainer
#9 lore raw
Quoted 47 lines · Chanh Nguyen
Quoted 35 lines · Rob Herring (Arm)
Quoted 11 lines · Chanh Nguyen

Updates the device tree to support some features on Ampere's Mt.Mitchell BMC and Ampere's Mt.Jade BMC.

Chanh Nguyen (6):
ARM: dts: aspeed: mtjade, mtmitchell: Add OCP temperature sensors
ARM: dts: aspeed: mtmitchell: Add I2C temperature sensor alias ports
ARM: dts: aspeed: mtmitchell: Add I2C Riser card alias ports
ARM: dts: aspeed: mtmitchell: Enable i2c10 and i2c15
ARM: dts: aspeed: mtmitchell: Add LEDs
ARM: dts: aspeed: mtmitchell: Add I2C FAN controllers

Quoted 9 lines
  .../dts/aspeed/aspeed-bmc-ampere-mtjade.dts   |  16 ++
  .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 152 ++++++++++++++++++
  2 files changed, 168 insertions(+)

--
2.43.0

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

Quoted 9 lines
   pip3 install dtschema --upgrade

New warnings running 'make CHECK_DTBS=y aspeed/aspeed-bmc-ampere-mtjade.dtb aspeed/aspeed-bmc-ampere-mtmitchell.dtb' for 20240801091217.1408809-1-chanh at os.amperecomputing.com:

arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller0 at 20: failed to match any schema with compatible: ['maxim,max31790'] arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller1 at 2f: failed to match any schema with compatible: ['maxim,max31790']

Quoted 6 lines

Thank Rob for your review!

I am aware of the new warnings you mentioned. For more information, the schema binding of "maxim,max31790" is being progressed by other series?
https://lore.kernel.org/lkml/20240414042246.8681-2-chanh at os.amperecomputing.com/

For now can you please remove the maxim,max31790 nodes from your devicetree and re-send? As it stands you've been asked to rework what you proposed in the thread that you linked, and a quick look at the hwmon trees suggests support for the max31790 hasn't been merged.

You can send a follow-up patch adding the nodes to your devicetree once the binding has been merged.

Andrew

#10 lore raw
Quoted 63 lines · Andrew Jeffery

[EXTERNAL EMAIL NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]

Quoted 47 lines · Chanh Nguyen
Quoted 35 lines · Rob Herring (Arm)
Quoted 11 lines · Chanh Nguyen

Updates the device tree to support some features on Ampere's Mt.Mitchell BMC and Ampere's Mt.Jade BMC.

Chanh Nguyen (6):
ARM: dts: aspeed: mtjade, mtmitchell: Add OCP temperature sensors
ARM: dts: aspeed: mtmitchell: Add I2C temperature sensor alias ports
ARM: dts: aspeed: mtmitchell: Add I2C Riser card alias ports
ARM: dts: aspeed: mtmitchell: Enable i2c10 and i2c15
ARM: dts: aspeed: mtmitchell: Add LEDs
ARM: dts: aspeed: mtmitchell: Add I2C FAN controllers

Quoted 9 lines
   .../dts/aspeed/aspeed-bmc-ampere-mtjade.dts   |  16 ++
   .../aspeed/aspeed-bmc-ampere-mtmitchell.dts   | 152 ++++++++++++++++++
   2 files changed, 168 insertions(+)

--
2.43.0

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

Quoted 9 lines
    pip3 install dtschema --upgrade

New warnings running 'make CHECK_DTBS=y aspeed/aspeed-bmc-ampere-mtjade.dtb aspeed/aspeed-bmc-ampere-mtmitchell.dtb' for 20240801091217.1408809-1-chanh at os.amperecomputing.com:

arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller0 at 20: failed to match any schema with compatible: ['maxim,max31790'] arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtmitchell.dtb: /ahb/apb/bus at 1e78a000/i2c at 480/fan-controller1 at 2f: failed to match any schema with compatible: ['maxim,max31790']

Quoted 6 lines

Thank Rob for your review!

I am aware of the new warnings you mentioned. For more information, the schema binding of "maxim,max31790" is being progressed by other series
https://lore.kernel.org/lkml/20240414042246.8681-2-chanh at os.amperecomputing.com/

For now can you please remove the maxim,max31790 nodes from your devicetree and re-send? As it stands you've been asked to rework what you proposed in the thread that you linked, and a quick look at the hwmon trees suggests support for the max31790 hasn't been merged.

Quoted 4 lines

You can send a follow-up patch adding the nodes to your devicetree once the binding has been merged.

Andrew

Thank Andrew for your comment!

I'll remove the maxim,max31790 nodes and send the patch v2

Chanh