From patchwork Fri Jun 16 11:50:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13282687 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CDB6EB64D8 for ; Fri, 16 Jun 2023 11:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fhPV0RFrpidSuVMlA46pg433z215HiccSNhsbPeGtM8=; b=LHzKcCic+3o0R0 E1QuX8Rx+oU0XZoS44iv2zh4nBsWVdccpd4NhSFboomhG960+vCesksXmK9lOMBtftBwvY8EVCwvW XfrP/XUK32O2w6gWIYVrAcqrO+NWscI25RHNvclG9LlJMgW4aFaSMP/1iGC6an+1yQC5ixdYqwhZY i3XS1LltNAkou+iSXbGyxKukaga00lw0N8TT2IC8LxS37FTVHGBawopL8NB6V9pOlCANROuxqsLtn OJXUIpxbUCCQedpKJ9IRv0WIN86LAM89UgI0Gtlsbd3XuT4AW9Od3HW8yGq8IjMblhtlAt6SuhZBk CrJO2HzwUWXc0v4xinGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA7yW-000Sbn-0a; Fri, 16 Jun 2023 11:50:44 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA7yS-000Say-2i for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 11:50:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zF7xNAIZVyD+SHJ7ElUd/V4yfLSKIRVfGcSZbSIiZHU=; b=ZYSyTn+vawQRG09DHEa6aEUqCk j5WQuEaX3feZ4Ubfvxh2ri6l6WMfCkxj8IBSz5rE65Hv8Ha2YynlVhtKKjYmQ//V23wLSBTpFAQNL jomY+k6+wMGUNBLwOiwugW9CJD4QPN6jmUE0fGjBi6DACHKcww4Etwx23bjHOq2wsFm5078jZMgNM FYdqx44+PBXIJpRfBYsFowTLQgOtM9db90ZO8DdPX8WJvZsQvXnxKCS9osC5NSvsGSc7VkLEE5e6t lDBaZAUn0SIL1+WN3UxDIy672QpstyezVZ/4b4KOPnZXUbPEii/iMCESN+T0H4CSS5/pNkbq8Rvsw 8qG5TmeA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:48892 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qA7yQ-0004xw-3x; Fri, 16 Jun 2023 12:50:38 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qA7yP-00Ea4o-FS; Fri, 16 Jun 2023 12:50:37 +0100 In-Reply-To: References: From: Russell King (Oracle) To: Amit Kucheria , Andrew Lunn , Daniel Lezcano , Gregory Clement , Krzysztof Kozlowski , Miquel Raynal , "Rafael J. Wysocki" , Rob Herring , Sebastian Hesselbarth , Zhang Rui Cc: Josua Mayer , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 1/3] dt-bindings: armada-thermal: add armada-ap807-thermal compatible MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 16 Jun 2023 12:50:37 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_045041_826867_35DD5E8A X-CRM114-Status: UNSURE ( 9.01 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Leibovich Add marvell,armada-ap807-thermal compatible for the AP807 die. Signed-off-by: Alex Leibovich Tested-by: sa_ip-sw-jenkins Reviewed-by: Stefan Chulski Signed-off-by: Russell King (Oracle) Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/thermal/armada-thermal.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/thermal/armada-thermal.txt b/Documentation/devicetree/bindings/thermal/armada-thermal.txt index b0bee7e42038..ab8b8fccc7af 100644 --- a/Documentation/devicetree/bindings/thermal/armada-thermal.txt +++ b/Documentation/devicetree/bindings/thermal/armada-thermal.txt @@ -8,6 +8,7 @@ * marvell,armada380-thermal * marvell,armadaxp-thermal * marvell,armada-ap806-thermal + * marvell,armada-ap807-thermal * marvell,armada-cp110-thermal Note: these bindings are deprecated for AP806/CP110 and should instead From patchwork Fri Jun 16 11:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13282688 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C77DEB64D7 for ; Fri, 16 Jun 2023 11:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wDrUMKg0o31dHajHHPlnHEF18RKEkM6V5KniqZZwjnc=; b=Oo3n7CGY5QHnLT /Bbm+4MVh86pPctFNFNE6rtUnAyHw8M9IhRh3unbuJBPmo62umYbqUMsCEtPPn7nXQWbisgC9VdGT 9jCoPz7N/OX+YKDQp1C9cRHpY7CllVb0O1t9DDoyc32nR8RMeOPuV2//CZwmwVywET25pBJV9/43/ y/m0jHfly7GQSGQ3ZxF9k2Zy4vbHlLB3yFoZP76hburhNVi45nMJB38+C5EAN4icZqFPTH06IUmpx e2RhqquHzCVxasDVIpJWAWU3OvhF8yu1N+jypry7IfqJlzHLyxnKhJWgVcLC/GfVebWP+yBuTxWpV mNEOl39S2jivpe0OSroA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA7yc-000Scw-2l; Fri, 16 Jun 2023 11:50:50 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA7yX-000Sbq-0T for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 11:50:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=USThQHd+r+y3fIZdDT3tkPIUoOuMjXqSY6LcqwbJs08=; b=Nr6oo5pwCggvc3nB7cNoOXqCVe RLs7rF7A+zjOX0kqtJVxapS66/IGF9MaO0YtNgktm0kmpeWfSd7/8O4Q0G3i/2oTxBv/AhS4Nhj5H Opz62XtBu3Rbnyrqb8gvMOUb2QU2Ul1CxQinhLjHCCfcRCjFt59x2KLGuRaz82vm4TDcdZ7w/khPm 4EJEXYgYbY+iIasyY+8EOJU51OMMtb4dZ6fvr0TBmXTiYucD684gnk9BN2xxBglkbkqpdSu5en+6A hdTCRgyg0KR7GvBPE/tpvu7vOWU2puIx2RVhJ+G0deau+yQH7Dvey1EaV5hu1/wf/5d0VRVftXwKp 48n6nVjA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:48894 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qA7yV-0004y7-8W; Fri, 16 Jun 2023 12:50:43 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qA7yU-00Ea4u-Je; Fri, 16 Jun 2023 12:50:42 +0100 In-Reply-To: References: From: Russell King (Oracle) To: Amit Kucheria , Andrew Lunn , Daniel Lezcano , Gregory Clement , Krzysztof Kozlowski , Miquel Raynal , "Rafael J. Wysocki" , Rob Herring , Sebastian Hesselbarth , Zhang Rui Cc: Josua Mayer , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 2/3] thermal: armada: add support for AP807 thermal data MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 16 Jun 2023 12:50:42 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_045045_183243_94A5861E X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Leibovich Add support for the AP807 die thermal data. This is the same as AP806, except for the coefficients. ap807 values taken from TSENSE_ADC_16FFC spec, which says: T(in Celsius) = T(code)*TSENE_GAIN+TSENE_OFFSET where in default: TSENE_OFFSET = 128.9 TSENE_GAIN = 0.394 Signed-off-by: Alex Leibovich Tested-by: sa_ip-sw-jenkins Reviewed-by: Stefan Chulski Signed-off-by: Russell King (Oracle) Reviewed-by: Miquel Raynal --- drivers/thermal/armada_thermal.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 2efc222a379b..f64c2b508542 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -231,7 +231,7 @@ static void armada380_init(struct platform_device *pdev, regmap_write(priv->syscon, data->syscon_control0_off, reg); } -static void armada_ap806_init(struct platform_device *pdev, +static void armada_ap80x_init(struct platform_device *pdev, struct armada_thermal_priv *priv) { struct armada_thermal_data *data = priv->data; @@ -620,7 +620,7 @@ static const struct armada_thermal_data armada380_data = { }; static const struct armada_thermal_data armada_ap806_data = { - .init = armada_ap806_init, + .init = armada_ap80x_init, .is_valid_bit = BIT(16), .temp_shift = 0, .temp_mask = 0x3ff, @@ -643,6 +643,30 @@ static const struct armada_thermal_data armada_ap806_data = { .cpu_nr = 4, }; +static const struct armada_thermal_data armada_ap807_data = { + .init = armada_ap80x_init, + .is_valid_bit = BIT(16), + .temp_shift = 0, + .temp_mask = 0x3ff, + .thresh_shift = 3, + .hyst_shift = 19, + .hyst_mask = 0x3, + .coef_b = -128900LL, + .coef_m = 394ULL, + .coef_div = 1, + .inverted = true, + .signed_sample = true, + .syscon_control0_off = 0x84, + .syscon_control1_off = 0x88, + .syscon_status_off = 0x8C, + .dfx_irq_cause_off = 0x108, + .dfx_irq_mask_off = 0x10C, + .dfx_overheat_irq = BIT(22), + .dfx_server_irq_mask_off = 0x104, + .dfx_server_irq_en = BIT(1), + .cpu_nr = 4, +}; + static const struct armada_thermal_data armada_cp110_data = { .init = armada_cp110_init, .is_valid_bit = BIT(10), @@ -686,6 +710,10 @@ static const struct of_device_id armada_thermal_id_table[] = { .compatible = "marvell,armada-ap806-thermal", .data = &armada_ap806_data, }, + { + .compatible = "marvell,armada-ap807-thermal", + .data = &armada_ap807_data, + }, { .compatible = "marvell,armada-cp110-thermal", .data = &armada_cp110_data, From patchwork Fri Jun 16 11:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13282694 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BE0AEB64D8 for ; Fri, 16 Jun 2023 11:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cqza410pL9kSYuP6sB5kCaAKMlFe/mQpG8DscM6Tzs4=; b=mYPYrYR8qfAz6x mIMWXrkzHSUHPNbYiFcGUOc2Lv/yLyJILkD3tQpkAlfpdHE2soPxUw5Ko2wAv4GTLXgMd05KI7W/M xGQX2i8rVtE+k4xWXhl7lt9qwJVYHLTS8ntH+/OnWB3hNXNXvH5HzyxvtHmnT6KPF8/8dY/hV3GHN ZsWsnzIL/KJUGvzByA7slOUt/hUWqdvBZQ/7nJrLmP6XLSuiXCkdopxbLCeawXf0l8s+bPkI3emM1 ouic6tW0Kfci1/4cxJnqLmXtYIuW3/yV3I1Jwi7wal0Ab8b9bDzkLS8oiXGUg9rdmhWi1WayOQUa4 e8KVDakowRd8Sk7l4opA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA7yi-000SeR-1W; Fri, 16 Jun 2023 11:50:56 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA7yd-000SdA-37 for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 11:50:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oLOIF1H6yTDEB/JvSnvMfuJtDFZIQU8yHCwm9funvhI=; b=HJD/bGqXFaP5CTwe5mHusExVjX pM5Q+Mg0WqSWMQj13b6woRcnlXI0kk6aEBlDwr2S4LBD42uIEe3gDzaWdvOpc3UeQ8jL5Vseed7i/ yBg0aedSI8lyKljFvHxOyT0Tm6nznadwV4KPbsNCxQW1In51QX4HbtgjlfdSeTjOBJOr+lvGyUtm1 OBKI7R6xj7B4nM9GK+jQTebPGIBwYEp0Uh0tBrbesYuT/hi67hsgY7zf57d/FoMmQtw9DreCQoM0u PCUH4Lu9u1uGFXgtU4QYLhqcseyIHaBiTvFdNxxsqsBhjUIclDFC5KC16Lnc9iiDpNB3DFuzBbdFM usowFtnw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59344 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qA7ya-0004ya-F0; Fri, 16 Jun 2023 12:50:48 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qA7yZ-00Ea50-OC; Fri, 16 Jun 2023 12:50:47 +0100 In-Reply-To: References: From: Russell King (Oracle) To: Amit Kucheria , Andrew Lunn , Daniel Lezcano , Gregory Clement , Krzysztof Kozlowski , Miquel Raynal , "Rafael J. Wysocki" , Rob Herring , Sebastian Hesselbarth , Zhang Rui Cc: Josua Mayer , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 3/3] arm64: dts: armada-ap807: update thermal compatible MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 16 Jun 2023 12:50:47 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_045051_999174_0CD23FC1 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alex Leibovich Use the correct thermal coefficients for the Armada AP807 dies. Signed-off-by: Alex Leibovich Reviewed-by: Stefan Chulski Tested-by: Stefan Chulski Signed-off-by: Russell King (Oracle) --- arch/arm64/boot/dts/marvell/armada-ap807.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/marvell/armada-ap807.dtsi b/arch/arm64/boot/dts/marvell/armada-ap807.dtsi index 4a23f65d475f..a3328d05fc94 100644 --- a/arch/arm64/boot/dts/marvell/armada-ap807.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-ap807.dtsi @@ -33,3 +33,6 @@ &ap_sdhci0 { "marvell,armada-ap806-sdhci"; /* Backward compatibility */ }; +&ap_thermal { + compatible = "marvell,armada-ap807-thermal"; +};