[PATCH v5 05/10] ARM: dts: aspeed: catalina: Add second source fan controller support

Potin Lai posted 10 patches 9 months ago
There is a newer version of this series
[PATCH v5 05/10] ARM: dts: aspeed: catalina: Add second source fan controller support
Posted by Potin Lai 9 months ago
Add device tree nodes for the NCT7363 fan controllers on the second-source
Power Distribution Board (PDB).

Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
---
 .../dts/aspeed/aspeed-bmc-facebook-catalina.dts    | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts
index fd22add90449..9cbb296dcd9e 100644
--- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts
+++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts
@@ -467,6 +467,82 @@ i2c1mux0ch2: i2c@2 {
 			#size-cells = <0>;
 			reg = <0x2>;
 
+			hwmon0: hwmon@1 {
+				compatible = "nuvoton,nct7363";
+				reg = <0x01>;
+				#pwm-cells = <2>;
+
+				fan-9 {
+					pwms = <&hwmon0 0 40000>;
+					tach-ch = /bits/ 8 <0x09>;
+				};
+				fan-11 {
+					pwms = <&hwmon0 0 40000>;
+					tach-ch = /bits/ 8 <0x0b>;
+				};
+				fan-10 {
+					pwms = <&hwmon0 4 40000>;
+					tach-ch = /bits/ 8 <0x0a>;
+				};
+				fan-13 {
+					pwms = <&hwmon0 4 40000>;
+					tach-ch = /bits/ 8 <0x0d>;
+				};
+				fan-15 {
+					pwms = <&hwmon0 6 40000>;
+					tach-ch = /bits/ 8 <0x0f>;
+				};
+				fan-1 {
+					pwms = <&hwmon0 6 40000>;
+					tach-ch = /bits/ 8 <0x01>;
+				};
+				fan-0 {
+					pwms = <&hwmon0 10 40000>;
+					tach-ch = /bits/ 8 <0x00>;
+				};
+				fan-3 {
+					pwms = <&hwmon0 10 40000>;
+					tach-ch = /bits/ 8 <0x03>;
+				};
+			};
+			hwmon1: hwmon@2 {
+				compatible = "nuvoton,nct7363";
+				reg = <0x02>;
+				#pwm-cells = <2>;
+
+				fan-9 {
+					pwms = <&hwmon1 0 40000>;
+					tach-ch = /bits/ 8 <0x09>;
+				};
+				fan-11 {
+					pwms = <&hwmon1 0 40000>;
+					tach-ch = /bits/ 8 <0x0b>;
+				};
+				fan-10 {
+					pwms = <&hwmon1 4 40000>;
+					tach-ch = /bits/ 8 <0x0a>;
+				};
+				fan-13 {
+					pwms = <&hwmon1 4 40000>;
+					tach-ch = /bits/ 8 <0x0d>;
+				};
+				fan-15 {
+					pwms = <&hwmon1 6 40000>;
+					tach-ch = /bits/ 8 <0x0f>;
+				};
+				fan-1 {
+					pwms = <&hwmon1 6 40000>;
+					tach-ch = /bits/ 8 <0x01>;
+				};
+				fan-0 {
+					pwms = <&hwmon1 10 40000>;
+					tach-ch = /bits/ 8 <0x00>;
+				};
+				fan-3 {
+					pwms = <&hwmon1 10 40000>;
+					tach-ch = /bits/ 8 <0x03>;
+				};
+			};
 			pwm@21{
 				compatible = "maxim,max31790";
 				reg = <0x21>;

-- 
2.31.1
Re: [PATCH v5 05/10] ARM: dts: aspeed: catalina: Add second source fan controller support
Posted by Andrew Jeffery 9 months ago
Hi Potin,

On Thu, 2025-03-20 at 23:21 +0800, Potin Lai wrote:
> Add device tree nodes for the NCT7363 fan controllers on the second-
> source
> Power Distribution Board (PDB).
> 
> Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
> ---
>  .../dts/aspeed/aspeed-bmc-facebook-catalina.dts    | 76
> ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-
> catalina.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-
> catalina.dts
> index fd22add90449..9cbb296dcd9e 100644
> --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts
> +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts
> @@ -467,6 +467,82 @@ i2c1mux0ch2: i2c@2 {
>                         #size-cells = <0>;
>                         reg = <0x2>;
>  
> +                       hwmon0: hwmon@1 {

There might be instances of calling nodes and labels 'hwmon' in other
(BMC) devicetrees, but I don't think we should continue that practice.
I think in this case it should be 'fan-controller'.

hwmon is the name of a kernel subsystem, not a class of hardware. The
devicetrees should describe the hardware (and not concepts from the
kernel).


> +                               compatible = "nuvoton,nct7363";
> +                               reg = <0x01>;
> +                               #pwm-cells = <2>;
> +
> +                               fan-9 {
> +                                       pwms = <&hwmon0 0 40000>;
> +                                       tach-ch = /bits/ 8 <0x09>;
> +                               };
> +                               fan-11 {
> +                                       pwms = <&hwmon0 0 40000>;
> +                                       tach-ch = /bits/ 8 <0x0b>;
> +                               };
> +                               fan-10 {
> +                                       pwms = <&hwmon0 4 40000>;
> +                                       tach-ch = /bits/ 8 <0x0a>;
> +                               };
> +                               fan-13 {
> +                                       pwms = <&hwmon0 4 40000>;
> +                                       tach-ch = /bits/ 8 <0x0d>;
> +                               };
> +                               fan-15 {
> +                                       pwms = <&hwmon0 6 40000>;
> +                                       tach-ch = /bits/ 8 <0x0f>;
> +                               };
> +                               fan-1 {
> +                                       pwms = <&hwmon0 6 40000>;
> +                                       tach-ch = /bits/ 8 <0x01>;
> +                               };
> +                               fan-0 {
> +                                       pwms = <&hwmon0 10 40000>;
> +                                       tach-ch = /bits/ 8 <0x00>;
> +                               };
> +                               fan-3 {
> +                                       pwms = <&hwmon0 10 40000>;
> +                                       tach-ch = /bits/ 8 <0x03>;
> +                               };
> +                       };
> +                       hwmon1: hwmon@2 {

As above.

Andrew