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: 693553 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 5A72FEB64DA for ; Fri, 16 Jun 2023 11:50:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344439AbjFPLum (ORCPT ); Fri, 16 Jun 2023 07:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344620AbjFPLul (ORCPT ); Fri, 16 Jun 2023 07:50:41 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFBAB2D5D; Fri, 16 Jun 2023 04:50:40 -0700 (PDT) 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: Sender: Russell King Date: Fri, 16 Jun 2023 12:50:37 +0100 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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) --- 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: 693796 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 775B2EB64DA for ; Fri, 16 Jun 2023 11:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344132AbjFPLuq (ORCPT ); Fri, 16 Jun 2023 07:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344604AbjFPLuq (ORCPT ); Fri, 16 Jun 2023 07:50:46 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 074F8191; Fri, 16 Jun 2023 04:50:45 -0700 (PDT) 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: Sender: Russell King Date: Fri, 16 Jun 2023 12:50:42 +0100 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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) --- 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: 693552 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 ADE00EB64D8 for ; Fri, 16 Jun 2023 11:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344604AbjFPLux (ORCPT ); Fri, 16 Jun 2023 07:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344520AbjFPLuw (ORCPT ); Fri, 16 Jun 2023 07:50:52 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18B222D59; Fri, 16 Jun 2023 04:50:51 -0700 (PDT) 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: Sender: Russell King Date: Fri, 16 Jun 2023 12:50:47 +0100 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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"; +};