From nobody Fri Sep 5 07:59:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B448FEB64DC for ; Tue, 18 Jul 2023 03:50:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231173AbjGRDt5 convert rfc822-to-8bit (ORCPT ); Mon, 17 Jul 2023 23:49:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbjGRDts (ORCPT ); Mon, 17 Jul 2023 23:49:48 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93B37132; Mon, 17 Jul 2023 20:49:47 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 4FFFF24E26C; Tue, 18 Jul 2023 11:49:39 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Jul 2023 11:49:39 +0800 Received: from ubuntu.localdomain (113.72.147.86) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Jul 2023 11:49:38 +0800 From: Hal Feng To: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou CC: Emil Renner Berthing , Hal Feng , , , Subject: [PATCH v1 1/3] riscv: dts: starfive: jh7100: Add temperature sensor node and thermal-zones Date: Tue, 18 Jul 2023 11:49:35 +0800 Message-ID: <20230718034937.92999-2-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718034937.92999-1-hal.feng@starfivetech.com> References: <20230718034937.92999-1-hal.feng@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [113.72.147.86] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add temperature sensor and thermal-zones support for the StarFive JH7100 SoC. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Hal Feng --- arch/riscv/boot/dts/starfive/jh7100.dtsi | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts= /starfive/jh7100.dtsi index 4218621ea3b9..35ab54fb235f 100644 --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi @@ -80,6 +80,31 @@ core1 { }; }; =20 + thermal-zones { + cpu-thermal { + polling-delay-passive =3D <250>; + polling-delay =3D <15000>; + + thermal-sensors =3D <&sfctemp>; + + trips { + cpu_alert0 { + /* milliCelsius */ + temperature =3D <75000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + cpu_crit { + /* milliCelsius */ + temperature =3D <90000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + }; + osc_sys: osc_sys { compatible =3D "fixed-clock"; #clock-cells =3D <0>; @@ -248,5 +273,17 @@ watchdog@12480000 { resets =3D <&rstgen JH7100_RSTN_WDTIMER_APB>, <&rstgen JH7100_RSTN_WDT>; }; + + sfctemp: temperature-sensor@124a0000 { + compatible =3D "starfive,jh7100-temp"; + reg =3D <0x0 0x124a0000 0x0 0x10000>; + clocks =3D <&clkgen JH7100_CLK_TEMP_SENSE>, + <&clkgen JH7100_CLK_TEMP_APB>; + clock-names =3D "sense", "bus"; + resets =3D <&rstgen JH7100_RSTN_TEMP_SENSE>, + <&rstgen JH7100_RSTN_TEMP_APB>; + reset-names =3D "sense", "bus"; + #thermal-sensor-cells =3D <0>; + }; }; }; --=20 2.38.1 From nobody Fri Sep 5 07:59:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99F76EB64DC for ; Tue, 18 Jul 2023 03:49:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231144AbjGRDty convert rfc822-to-8bit (ORCPT ); Mon, 17 Jul 2023 23:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbjGRDts (ORCPT ); Mon, 17 Jul 2023 23:49:48 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E117C130; Mon, 17 Jul 2023 20:49:46 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id F30E824DDBE; Tue, 18 Jul 2023 11:49:39 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Jul 2023 11:49:39 +0800 Received: from ubuntu.localdomain (113.72.147.86) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Jul 2023 11:49:39 +0800 From: Hal Feng To: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou CC: Emil Renner Berthing , Hal Feng , , , Subject: [PATCH v1 2/3] riscv: dts: starfive: jh7110: Add temperature sensor node and thermal-zones Date: Tue, 18 Jul 2023 11:49:36 +0800 Message-ID: <20230718034937.92999-3-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718034937.92999-1-hal.feng@starfivetech.com> References: <20230718034937.92999-1-hal.feng@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [113.72.147.86] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add temperature sensor and thermal-zones support for the StarFive JH7110 SoC. CPUFreq cooling is supported in thermal-zones. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Hal Feng --- arch/riscv/boot/dts/starfive/jh7110.dtsi | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts= /starfive/jh7110.dtsi index ec2e70011a73..2315acd560a3 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -7,6 +7,7 @@ /dts-v1/; #include #include +#include =20 / { compatible =3D "starfive,jh7110"; @@ -56,6 +57,7 @@ U74_1: cpu@1 { operating-points-v2 =3D <&cpu_opp>; clocks =3D <&syscrg JH7110_SYSCLK_CPU_CORE>; clock-names =3D "cpu"; + #cooling-cells =3D <2>; =20 cpu1_intc: interrupt-controller { compatible =3D "riscv,cpu-intc"; @@ -85,6 +87,7 @@ U74_2: cpu@2 { operating-points-v2 =3D <&cpu_opp>; clocks =3D <&syscrg JH7110_SYSCLK_CPU_CORE>; clock-names =3D "cpu"; + #cooling-cells =3D <2>; =20 cpu2_intc: interrupt-controller { compatible =3D "riscv,cpu-intc"; @@ -114,6 +117,7 @@ U74_3: cpu@3 { operating-points-v2 =3D <&cpu_opp>; clocks =3D <&syscrg JH7110_SYSCLK_CPU_CORE>; clock-names =3D "cpu"; + #cooling-cells =3D <2>; =20 cpu3_intc: interrupt-controller { compatible =3D "riscv,cpu-intc"; @@ -143,6 +147,7 @@ U74_4: cpu@4 { operating-points-v2 =3D <&cpu_opp>; clocks =3D <&syscrg JH7110_SYSCLK_CPU_CORE>; clock-names =3D "cpu"; + #cooling-cells =3D <2>; =20 cpu4_intc: interrupt-controller { compatible =3D "riscv,cpu-intc"; @@ -197,6 +202,42 @@ opp-1500000000 { }; }; =20 + thermal-zones { + cpu-thermal { + polling-delay-passive =3D <250>; + polling-delay =3D <15000>; + + thermal-sensors =3D <&sfctemp>; + + cooling-maps { + map0 { + trip =3D <&cpu_alert0>; + cooling-device =3D + <&U74_1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&U74_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&U74_3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&U74_4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + + trips { + cpu_alert0: cpu_alert0 { + /* milliCelsius */ + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + cpu_crit { + /* milliCelsius */ + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + }; + gmac0_rgmii_rxin: gmac0-rgmii-rxin-clock { compatible =3D "fixed-clock"; clock-output-names =3D "gmac0_rgmii_rxin"; @@ -473,6 +514,18 @@ i2c6: i2c@12060000 { status =3D "disabled"; }; =20 + sfctemp: temperature-sensor@120e0000 { + compatible =3D "starfive,jh7110-temp"; + reg =3D <0x0 0x120e0000 0x0 0x10000>; + clocks =3D <&syscrg JH7110_SYSCLK_TEMP_CORE>, + <&syscrg JH7110_SYSCLK_TEMP_APB>; + clock-names =3D "sense", "bus"; + resets =3D <&syscrg JH7110_SYSRST_TEMP_CORE>, + <&syscrg JH7110_SYSRST_TEMP_APB>; + reset-names =3D "sense", "bus"; + #thermal-sensor-cells =3D <0>; + }; + syscrg: clock-controller@13020000 { compatible =3D "starfive,jh7110-syscrg"; reg =3D <0x0 0x13020000 0x0 0x10000>; --=20 2.38.1 From nobody Fri Sep 5 07:59:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A0A9EB64DC for ; Tue, 18 Jul 2023 03:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231133AbjGRDtv convert rfc822-to-8bit (ORCPT ); Mon, 17 Jul 2023 23:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbjGRDtn (ORCPT ); Mon, 17 Jul 2023 23:49:43 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 275B810C8; Mon, 17 Jul 2023 20:49:42 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id A0E3724E1C6; Tue, 18 Jul 2023 11:49:40 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Jul 2023 11:49:40 +0800 Received: from ubuntu.localdomain (113.72.147.86) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 18 Jul 2023 11:49:39 +0800 From: Hal Feng To: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou CC: Emil Renner Berthing , Hal Feng , , , Subject: [PATCH v1 3/3] MAINTAINERS: Add Hal as a maintainer of SFCTEMP HWMON DRIVER Date: Tue, 18 Jul 2023 11:49:37 +0800 Message-ID: <20230718034937.92999-4-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718034937.92999-1-hal.feng@starfivetech.com> References: <20230718034937.92999-1-hal.feng@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [113.72.147.86] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" As he is the submitter of this driver, add his mail so he can maintain the driver and easily reply in the mailing list. Signed-off-by: Hal Feng Acked-by: Emil Renner Berthing --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index aee340630eca..5056079ade77 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19256,6 +19256,7 @@ F: drivers/net/ethernet/sfc/ =20 SFCTEMP HWMON DRIVER M: Emil Renner Berthing +M: Hal Feng L: linux-hwmon@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/hwmon/starfive,jh71x0-temp.yaml --=20 2.38.1