From patchwork Tue Nov 27 16:29:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 152144 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1486382ljp; Tue, 27 Nov 2018 08:30:09 -0800 (PST) X-Google-Smtp-Source: AJdET5fIp3bLvL8vSxwk+a6DkvH4HobuP43/lhtM602/LKEBiS7wliMm0QbFkNt50cYckT+RFDG6 X-Received: by 2002:a62:d885:: with SMTP id e127mr33370318pfg.197.1543336209216; Tue, 27 Nov 2018 08:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543336209; cv=none; d=google.com; s=arc-20160816; b=iAGXDrCxXLMiCHV1A6nscnS+sBtmuGcM9Bgs82mwjYd8f6Ev8HuDSaU8F0um8zvYLg 4EYJqS6evcx38MJGEbZQ55pMNbAzTdLrflk4cp/FwB57oMPu262BfvbqO/HD5SQEKJgC 8Swh2J55aPrwLa032/f72ySv0/3j2lawW+1usI5KrLuT1QuSjbcY8wAP/6/loXg2udIx Ti7XQgtuJTf5brIXB1QZOZ62eX7rpGOsUK0SWLWTMNazPqugsPvs8b1BShGS8H7TCujG Uhj6xHkYpHIl87FTPgkWqRhwGkDY+jZBXS8h+mKDyrdMz9y9TcrQFUiPkCmJLaTX0CtI kbOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ySS9ak8736GKuz1GUi70Wz4dUI9Ax/bqLZ13e7Wb3I8=; b=K6mP+YISvivY7NMYc0EzPTqXj1ioW/daFICO0FXkz19dm6DL7Vd977MT/8FKhOfu20 ce3e5GPhYox8mJHNXJ9K4qDlKtnWtd/3/VbtJcJdP0lJV4KwbrtUXtUv0gWqgCaVmrjV 2kErjnsZKo8uwsK+BP09YdVdp2WwvuLhrGT2uI/7mq/WTC6qslqjP+j9RT+PhEkoZ4sz 0W8+/2pUkKop1JhdEPzG8whr1zD2QbnrgSwuNoVrjNEuq8aPlwxJkpWrZWXFJhVIwZ38 Ul+Uav3JuT5fJORwfdSDFla9f5OY9x7D3nxyKGak5yvUOL5iBR5bSrzx8jEuZ15i1mqx TbkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GN32gwz6; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si4396224plq.41.2018.11.27.08.30.08; Tue, 27 Nov 2018 08:30:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GN32gwz6; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731107AbeK1D2P (ORCPT + 15 others); Tue, 27 Nov 2018 22:28:15 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36979 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730613AbeK1D2P (ORCPT ); Tue, 27 Nov 2018 22:28:15 -0500 Received: by mail-wr1-f65.google.com with SMTP id j10so23355920wru.4 for ; Tue, 27 Nov 2018 08:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ySS9ak8736GKuz1GUi70Wz4dUI9Ax/bqLZ13e7Wb3I8=; b=GN32gwz6a40w4VNUMQAm1giD/L8kZ0ljSCYaGM8U0EDH+IVi+geVy5+tuQgmwZJOB8 CWvstXEIiz5PbxNq3qrCiy/0lcx5jhfrC8mZRSdnPgEYSzydQUIdH9Jap12PpR/vFLw2 GITimkipCpZmMumNmuqSgpMV6aIp77E4GALTM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ySS9ak8736GKuz1GUi70Wz4dUI9Ax/bqLZ13e7Wb3I8=; b=OoGhrtADJT0QLR3whrbJJcrODDWRSsx8Xet0NgsZ244BerMNzuTWlPQ/fIkqxmdGaX 8NjBCbt3OELVdxTYnqA0H6dlzRefBaWPzMqyKYs+v0bDBrL4UufNIvdoB1qa2QqFG0NB qrQtWoO9KZt9YifZibT6Ac1/Tgaft9D/EHofT+J34yXhkYjhLDBubsZoQrIJlD5iM/Ms bw5003Uai0K/juYcQb+aGjidyLk1N6PfKtazsDQaWjOplpW5SduG4e3Ro/qznrkEeBlz 23aOGDYWXIKqJq5Np79p4D1C2Or+7Nht62ZXhUVPzveO/zGUzWTWkV+QK+2vtrpBqweC 56Rw== X-Gm-Message-State: AA+aEWbabhu1fuIo+eGrbRVPWKi9SNvIHq7nAkf9Api8LRH0L7JolPDh gvlQ9QI1UulE9Vcb/0bYhktcWw== X-Received: by 2002:adf:de91:: with SMTP id w17mr12831912wrl.320.1543336187565; Tue, 27 Nov 2018 08:29:47 -0800 (PST) Received: from localhost ([49.248.92.105]) by smtp.gmail.com with ESMTPSA id a1sm5158091wrw.76.2018.11.27.08.29.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 08:29:46 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, vkoul@kernel.org, khasim.mohammed@linaro.org, David Brown , Rob Herring , Mark Rutland Subject: [PATCH v3 3/4] arm64: dts: qcom: qcs404: Add tsens controller Date: Tue, 27 Nov 2018 21:59:06 +0530 Message-Id: <3491110ccf708efed795bfc756b2d108f8dbb710.1543335819.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org qcs404 has a single TSENS IP block with 10 sensors. The calibration data is stored in an eeprom (qfprom) that is accessed through the nvmem framework. We add the qfprom node to allow the tsens sensors to be calibrated correctly. Signed-off-by: Amit Kucheria Reviewed-by: Vinod Koul Tested-by: Vinod Koul --- arch/arm64/boot/dts/qcom/qcs404.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.17.1 diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi index 9b5c16562bbe..57d14d8f0c90 100644 --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi @@ -253,6 +253,16 @@ reg = <0x00060000 0x6000>; }; + qfprom: qfprom@a4000 { + compatible = "qcom,qfprom"; + reg = <0x000a4000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + tsens_caldata: caldata@d0 { + reg = <0x1f8 0x14>; + }; + }; + rng: rng@e3000 { compatible = "qcom,prng-ee"; reg = <0x000e3000 0x1000>; @@ -260,6 +270,16 @@ clock-names = "core"; }; + tsens: thermal-sensor@4a9000 { + compatible = "qcom,qcs404-tsens", "qcom,tsens-v1"; + reg = <0x004a9000 0x1000>, /* TM */ + <0x004a8000 0x1000>; /* SROT */ + nvmem-cells = <&tsens_caldata>; + nvmem-cell-names = "calib"; + #qcom,sensors = <10>; + #thermal-sensor-cells = <1>; + }; + tlmm: pinctrl@1000000 { compatible = "qcom,qcs404-pinctrl"; reg = <0x01000000 0x200000>, From patchwork Tue Nov 27 16:29:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 152145 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1486553ljp; Tue, 27 Nov 2018 08:30:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/VJ1eZk/QkR7HBdKsrMXpVRBzeenur77NR4r7WBBGnhP44GtfhZawUQDI+H2cqBS4/B5JC5 X-Received: by 2002:a17:902:280b:: with SMTP id e11mr33127969plb.269.1543336216224; Tue, 27 Nov 2018 08:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543336216; cv=none; d=google.com; s=arc-20160816; b=YfHLZWA7dDgGlKT3RLUDmdv3fZ5cUaAf523svVcn/pHsr/9tqdt+zUANh5Lyx92QPB 0vobJn1HCe7MHt2XkOgmz1qFid+U1l7qMo7HowHm6ffFIyhTADE2sBZM6/OcqiQKr74d s4uYFp3DJO6HOYcc62H1cei9cP4hoq01WE1LvUjnHBYMdC7kWyQJUQVVHBT7AawIRt8X /1LLRn07/j24hcH5MrfOuhVuSYf5RoEMBxPAtHdjKiJ82wVGPNx7opT88TZAi5/Rzfkx Ixp5ruWBe9GEXUX9V4I/dd4IqHZeKnNRPTXlCqUCA3iOhpWqTEqk74eGuL/nPINQM7JL U1vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=4rjnRaV+6g5gOHVzVhs9FARzKLyeED1GNhZcm14IHcQ=; b=UjLyl4WIZfAoeymgt3blavnaMqeuadrItR0pMyHfD1iZXdD/sK+ap5A31DmMAFUBwL n0QpDKDPv8w+3tEEneNcNTt8B4CxWMfdNKsgplx8RNj6B8CcyHIJu8ubn9Z8I/NS9VOq CArHGKcufvqqUQZtE/CTu8HCcuvGnKfaFU8D7ZDjLNlxS0tP8H+cy1WLST96ivMPZngg yjPo91jCKu1kdG1m8rL2m2Sh81NxtP0vMCTy+uh6QZBYE8O4/6SUmVAVt31SMwJfKkNx seWoTpI+meLg0TOkf1t+11xlTXffxzYvKvl285TDD4frgxZZZy0GK6bv5k+Y/5jW9OFW h9SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhHZYN0O; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si4396224plq.41.2018.11.27.08.30.15; Tue, 27 Nov 2018 08:30:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhHZYN0O; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730952AbeK1D2Z (ORCPT + 15 others); Tue, 27 Nov 2018 22:28:25 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43618 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730444AbeK1D2Z (ORCPT ); Tue, 27 Nov 2018 22:28:25 -0500 Received: by mail-wr1-f67.google.com with SMTP id r10so23332118wrs.10 for ; Tue, 27 Nov 2018 08:29:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=4rjnRaV+6g5gOHVzVhs9FARzKLyeED1GNhZcm14IHcQ=; b=jhHZYN0OjAgFm7nzGlRp1OrMujFZRMpZgk632/l4MgD4u9A3RiATpkOaj8AeDQIAaC cXYMvBBUpOPaFhpsPBJzy7GQNWS+ISQMmszHj7wxoYu0pfHbCWqYoiJmPQAcca6pWh4V kcve0NR1wPcbD+BWZUgsRg2QhU6H3sQXa3hs4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=4rjnRaV+6g5gOHVzVhs9FARzKLyeED1GNhZcm14IHcQ=; b=bMs+NW9o9UB9Dk5RLHb8BqrTb8AlTMEj91NJovQ9W3qAEsv72CtyHC6+Nb3vrm8Kj0 SRfooqOFADogHqMj5lh9Lfr4UKL2R/pAX043wTh20JBXt2g5j2OdanlukBcobrFKyclq dfSu2/Ix0t4Ol6zD+suPZY9sGXrY6my0tABWlAD7VqYwIzTilzedZVL9xW2EKtIp5us7 wQJo8MLx8hoL5/xzsgAWWaF+WdBGsLlHmV7wIOihuyQlNGLsxJjqHacJdedyNm9vUUdS S9fo72P9/3ZLdp41b9n6rjCyQuLOs09u42FqVjmnEiKhYtvqDpVxQTtq44j+2/opYOi+ 7LpA== X-Gm-Message-State: AA+aEWbsCt1AFHUph+C5urtXaM5j/bVFUDR0v+E5+ojry3PLSJg7Vzil qkYf9OMa478NR0//UjOU0Hj78Q== X-Received: by 2002:adf:a50c:: with SMTP id i12mr26876754wrb.220.1543336197845; Tue, 27 Nov 2018 08:29:57 -0800 (PST) Received: from localhost ([49.248.92.105]) by smtp.gmail.com with ESMTPSA id v5sm2416870wrr.11.2018.11.27.08.29.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 08:29:57 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, vkoul@kernel.org, khasim.mohammed@linaro.org, David Brown , Rob Herring , Mark Rutland Subject: [PATCH v3 4/4] arm64: dts: qcom: qcs404: Add thermal zones for each sensor Date: Tue, 27 Nov 2018 21:59:07 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org qcs404 has 10 sensors connected to the single TSENS IP. Define a thermal zone for each of those sensors to expose the temperature of each zone. Signed-off-by: Amit Kucheria Reviewed-by: Vinod Koul Tested-by: Vinod Koul --- arch/arm64/boot/dts/qcom/qcs404.dtsi | 206 +++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) -- 2.17.1 diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi index 57d14d8f0c90..cbc3fd378893 100644 --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi @@ -30,6 +30,7 @@ reg = <0x100>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; CPU1: cpu@101 { @@ -38,6 +39,7 @@ reg = <0x101>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; CPU2: cpu@102 { @@ -46,6 +48,7 @@ reg = <0x102>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; CPU3: cpu@103 { @@ -54,6 +57,7 @@ reg = <0x103>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; L2_0: l2-cache { @@ -507,4 +511,206 @@ #interrupt-cells = <2>; }; }; + + thermal-zones { + aoss-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 0>; + + trips { + aoss_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + aoss_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + dsp-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 1>; + + trips { + dsp_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + dsp_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + lpass-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 2>; + + trips { + lpass_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + lpass_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + wlan-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 3>; + + trips { + wlan_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + wlan_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cluster-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 4>; + + trips { + cluster_alert: cluster_alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster_crit: cluster_crit { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal0 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 5>; + + trips { + cpu_alert0: cpu_alert0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit0: cpu_crit0 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal1 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 6>; + + trips { + cpu_alert1: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit1: trip1 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal2 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 7>; + + trips { + cpu_alert2: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit2: trip1 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal3 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 8>; + + trips { + cpu_alert3: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit3: trip1 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + gpu-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 9>; + + trips { + gpu_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + gpu_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; };