Received: by 10.223.176.5 with SMTP id f5csp465637wra; Tue, 6 Feb 2018 01:57:10 -0800 (PST) X-Google-Smtp-Source: AH8x226WOP8DCnO4Frz8FbL2yd8vsPz6zTsIZa7WyCRAdjq387cuGmFtUNvW4D9pO4RipAIQHsw5 X-Received: by 10.98.196.204 with SMTP id h73mr1887641pfk.143.1517911030478; Tue, 06 Feb 2018 01:57:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517911030; cv=none; d=google.com; s=arc-20160816; b=SZx5YyxrfmsdDxuhVgkIS2aR2Q5KGmlz83tzPVcQ+Tf//QHlH9fT8Tgx89wPJM5FyM ZRHPAYnEG0oR5l9BIuZ1wr+w5ZLxmbddCFluoIfPN0ALEMQUSqA1V67lAP+PWFPXkjnO NXRDqVOVMm/GIrPbjqLcIvhMJQ4pZjHSojeEZ7AxHZwC7blGQsqp1p2jLSeUbuMIM04x CLgPlnoc/29jIToAejX6Pjw87uqwT2F6VT2nfg/C1rVbz2jSvtFYRXh/Tcy9iZziZQud cmy9G6i3S+mHB5dDaMYTQVnSK5qqclGb7zqGGqlzV5MQVvwWgnvXVqZw79266AkG/P9j /x1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=lspLk0+ZLwArv9bVsrskdjLGafjPpFwlBoCFT42lpVg=; b=hB+8DPfE1uNS/vnyN/xLkZIjUe89j+LY7GbYSvNZY9KSDGHX1dv3XTtUzZ4b79UrCl V02qhHR7eogvG145xwFY6HRLj3oRbRBHbHx91T2k9gh4qGAnK8v6VMvkov+BKqKQX/q7 RJmwGhnQ0kzNLb06z97HmC2slk1C778gir0+sMFkLNmhzE9x6MHiIEiRYk0FNePmYqsU q5boSvyca5GlE1d57NDIMkiYcBpDGbcaZLPYzKT+uWNWFeXvvs3khBsuHJakBjc28Id6 drswouxvNU5PjGFK+ZZrm7oR3c6QZUu+sDpHX0DiuCn+UXowEKmkEQxgVj/l5nzrU4yi xS2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si1515444pgs.682.2018.02.06.01.56.56; Tue, 06 Feb 2018 01:57:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbeBFJy0 (ORCPT + 99 others); Tue, 6 Feb 2018 04:54:26 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:36731 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752717AbeBFJxc (ORCPT ); Tue, 6 Feb 2018 04:53:32 -0500 X-UUID: ac58a2bab9f74fe9b881805027adb120-20180206 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 298069073; Tue, 06 Feb 2018 17:53:28 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 6 Feb 2018 17:53:26 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Tue, 6 Feb 2018 17:53:26 +0800 From: To: , , , , CC: , , Sean Wang Subject: [PATCH v2 14/16] arm64: dts: mt7622: add thermal and related nodes Date: Tue, 6 Feb 2018 17:53:03 +0800 Message-ID: <687a7c43e3e3260ebdf004a96d2cde143f563250.1517910489.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang add nodes for the thermal controller and associated thermal zone using CPU as the cooling device for each trip point. In addition, add a fixup for thermal_calibration on nvmem should be 12 bytes as the minimal requirement. Signed-off-by: Sean Wang --- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 72 +++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi index e6dd4f6..6cf67dd 100644 --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi @@ -12,6 +12,7 @@ #include #include #include +#include / { compatible = "mediatek,mt7622"; @@ -75,6 +76,7 @@ <&apmixedsys CLK_APMIXED_MAIN_CORE_EN>; clock-names = "cpu", "intermediate"; operating-points-v2 = <&cpu_opp_table>; + #cooling-cells = <2>; enable-method = "psci"; clock-frequency = <1300000000>; }; @@ -119,6 +121,58 @@ }; }; + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + + thermal-sensors = <&thermal 0>; + + trips { + cpu_passive: cpu-passive { + temperature = <47000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_active: cpu-active { + temperature = <67000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_hot: cpu-hot { + temperature = <87000>; + hysteresis = <2000>; + type = "hot"; + }; + + cpu-crit { + temperature = <107000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_passive>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map1 { + trip = <&cpu_active>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map2 { + trip = <&cpu_hot>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; + timer { compatible = "arm,armv8-timer"; interrupt-parent = <&gic>; @@ -201,7 +255,7 @@ #size-cells = <1>; thermal_calibration: calib@198 { - reg = <0x198 0x8>; + reg = <0x198 0xc>; }; }; @@ -384,6 +438,22 @@ status = "disabled"; }; + thermal: thermal@1100b000 { + #thermal-sensor-cells = <1>; + compatible = "mediatek,mt7622-thermal"; + reg = <0 0x1100b000 0 0x1000>; + interrupts = <0 78 IRQ_TYPE_LEVEL_LOW>; + clocks = <&pericfg CLK_PERI_THERM_PD>, + <&pericfg CLK_PERI_AUXADC_PD>; + clock-names = "therm", "auxadc"; + resets = <&pericfg MT7622_PERI_THERM_SW_RST>; + reset-names = "therm"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration>; + nvmem-cell-names = "calibration-data"; + }; + btif: serial@1100c000 { compatible = "mediatek,mt7622-btif", "mediatek,mtk-btif"; -- 2.7.4