From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381066; b=AgF11m+AifjuOw87VLYv4NW/jdkg5/TUkT06sIJfbZPAmxOILmVPIkuYLL7OhP+dZJpP Eaxl7TV6jMtoMEPZ6iKkne+dOS0XgXLe6R6+ly+C5aPtJyAhN+OX5ehu8qzWkL0JEl1qP CivHnuyUO5y6euTUqEv4+sPDt+m11N0K8UWEVqr8DmkE76bOZOflh+JX8vG5Ew/GFmsXV 8TN9FpShsIxH32ZVqN0L3i9WVy3GE3IAKNwCgEXWxc/QuMXzm8s3mZLfR9cZwPxUmLdX7 kNPUv0+bVZRSq1jSiZn40teE/YUgWFqTiO2ECDUeFUGq3jq63Yp14BlDiwUtoSRDi5A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381066; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=XgAgz3UklWHel5GimHg1bmIogP4HBgNeFoL++xPT4rg=; b=sj4db8upzZ91NNtATw5GcAllYzexBJ4Bw/mczHE5seQ7qXRiH7BmYeE+/TZOULZ3dWZo Z/Sb3fiFe/7XrasexlQ5clY+FKTQfNSvHog2A9JNjKzhwdAERm9H1MA1jRptLJuhnXewK OkfXrQ4L2ymtJk6jbJ03wjv4cN7ft/hN0j4h7MrViXda2+uMFsSvVutHrQacJWYIrSO2w fdGaCOyHo6rblMDKJgvyw4MO+Wv5YhNFvo+AXanh83xQcN3bEDtcyKGgX2dziPFePEfcq l1PJtC5Xbxdaws2p2a2tQeMnKgWXHGIE4OU1h3u5/N/uORBQ4wtlMFjKBXUo3AGDPmQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=WmAVLqPR; arc=none smtp.remote-ip=209.85.216.44 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB239606A32D for ; Fri, 4 Dec 2026 10:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AB239606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=WmAVLqPR Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-3b564fe29cfso473832a91.3 for ; Fri, 04 Dec 2026 02:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796381065; x=1796985865; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=XgAgz3UklWHel5GimHg1bmIogP4HBgNeFoL++xPT4rg=; b=WmAVLqPRcuzecC6li8VElT8ZKO5nKH/n3V8S5XoUMZL2b1KZ/ajDn2BNOMvLqcjSsC jamhoA9THmnm2jf60dVvm6wzu1bta57rHGXGYkpMYDp6OpMOD3tRf8I9jw9eFX74Sjww XCDUiyQkkOB2PY48buA6xXftsQFMJGcmeLP/VZP7QM9tdikwSf4XeCz5fZAw0VFLEYVh oMhzV1HK0rkGJVBwY7Td6XKmkx9uyW32AA4+kaKGdANHJZhvf5MY/INpm2XziDHrtanx r6OSKaCipOnk87uuT2yQxH2+315qe7ho8C/4jZk7Jl3AimeHuuBtoukaMxLZAj1Zx3UQ KObQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796381065; x=1796985865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=XgAgz3UklWHel5GimHg1bmIogP4HBgNeFoL++xPT4rg=; b=08gJjbTJVNKXIXQniGJ2yonQQFK/UPCatQGSj0VfdokbwLpTJo5GsoH+8trmjNHQCY yzkzUmMB7QpZWLORI9qjsBvNyPirJBgMIxQuLnPoOx0HoZY0qMbEEKeeYpZcAUpUrnxV xGSwgo2GQ7YYM6HIvcTIXFxp8D6hD8Odazr/KeCc7Oh2vHakGx7XWFo72etIQr+0Nb9i X/Lalnto0nB6OCax8aE1n4ntEln5RpsXC6F1mdDNoNFwul5PXF8uWAY2YIcaZMXqamRR 6TX4XhyqNUiewRjGCVKrkTn+Bc+jNHLpy1CxEzu2WtzN2SouFl2+iP3W1JbwqDNKuX4a TGFQ== X-Forwarded-Encrypted: i=1; AL+hErELjcFZmIXbiEAorpq38Bv+ihLaSqlnYPRrzTgN4rzgvqfZ8rb+OA1bmgwnaf+WOjSdQjjwI1/TNV5ybjU=@vger.kernel.org X-Gm-Message-State: APuU4Z9MBl6MnrkTfzYaJsqFYN6/d+IMBQA3PJf8Sg9dpZxbrSA/QfM4 7hgj02KTVnQvIZILUgPieZjSYEePBXP3sW1EOxpy46nkDfR2xTPiS/Be X-Gm-Gg: AZFdTZfanarisqHczhn6tw/4m3c+RtYB9y7Vb7ct2HRaCHEj6Vnfd3OLLQgkm2U2dkz lF3syN9+nNN3J021pAXibDSTeqpe0YWqV30f1HYtFzqtFKG8egNWAtMIh/iZVQcJn0AxCthgsJc FbSTX9lBx/DUZHPluEi4BYd5dp9TySuhyyMQIIzB/7ATceWF2QqBUrXPDoTrgjYvs9REkssaRiL ISqs++r6/j7UxmJ3etYRYt+Xlw3q3qSz75H0b90ZW0759B0x7KwrCxbLzIHzOipPZjubX8lcESU plIYWKHP6W7oPueV1DjEUB7Msja0czIuirCA1XdJObV+Sim5bo93WfWTaSV3PPWVLa3/ynUpLCT 0yCABMZsB+15VtlTaSjoHAseNjZ4DE5WSDgdiGdMhg4arHjBSVwcmpfBspLYunG5Y3mrWwr5f1Z NmmGRpjQf3gbNSOSJw3Mbkge35sBZ+EGgv1SDGKnugScZ+i2p03WbpKGjozff3TXuQU3mK9Hel+ ZZ8F63/hsOSwJBlKhnAI0Okwybd1TJEa6kch1p5baC0qcFPmrds5IDHn2Q9lyxKLUtaIQJX X-Received: by 2002:a17:90b:1641:b0:3ab:36c4:b4ff with SMTP id 98e67ed59e1d1-3b5e0603d30mr1463056a91.24.1796381064926; Fri, 04 Dec 2026 02:44:24 -0800 (PST) Received: from archlinux ([2605:e440:15::152]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-ce12a8d1edfsm399280a12.29.2026.12.04.02.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 02:44:24 -0800 (PST) From: Mikhail Kalashnikov To: Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Philipp Zabel , =?UTF-8?q?Juan=20Manuel=20L=C3=B3pez=20Carrillo?= , Andre Przywara Subject: [PATCH v7 5/5] arm64: dts: allwinner: sun55i: add thermal sensors Date: Fri, 4 Dec 2026 18:43:06 +0800 Message-ID: <662a31b046d756f60cd58253bc06cc519b35a6af.1796378254.git.iuncuim@gmail.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The A523 processor has two temperature controllers, THS0 and THS1. THS0 has only one temperature sensor, which is located in the DRAM controller. THS1 does have 4 sensors: ths1_0 - "big" cores ths1_1 - "little" cores ths1_2 - gpu ths1_3 - npu Add the thermal sensor configuration and the thermal zones. Trips temperature, polling-delay and sustainable-power parameters are derived from the manufacturer's BSP. Signed-off-by: Mikhail Kalashnikov --- .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi index 85ef492ff..ced544154 100644 --- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi @@ -11,6 +11,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; @@ -26,6 +27,7 @@ cpu0: cpu@0 { device_type = "cpu"; reg = <0x000>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu1: cpu@100 { @@ -33,6 +35,7 @@ cpu1: cpu@100 { device_type = "cpu"; reg = <0x100>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu2: cpu@200 { @@ -40,6 +43,7 @@ cpu2: cpu@200 { device_type = "cpu"; reg = <0x200>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu3: cpu@300 { @@ -47,6 +51,7 @@ cpu3: cpu@300 { device_type = "cpu"; reg = <0x300>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu4: cpu@400 { @@ -54,6 +59,7 @@ cpu4: cpu@400 { device_type = "cpu"; reg = <0x400>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu5: cpu@500 { @@ -61,6 +67,7 @@ cpu5: cpu@500 { device_type = "cpu"; reg = <0x500>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu6: cpu@600 { @@ -68,6 +75,7 @@ cpu6: cpu@600 { device_type = "cpu"; reg = <0x600>; enable-method = "psci"; + #cooling-cells = <2>; }; cpu7: cpu@700 { @@ -75,6 +83,7 @@ cpu7: cpu@700 { device_type = "cpu"; reg = <0x700>; enable-method = "psci"; + #cooling-cells = <2>; }; }; @@ -380,6 +389,30 @@ gpadc: adc@2009000 { status = "disabled"; }; + ths1: thermal-sensor@2009400 { + compatible = "allwinner,sun55i-a523-ths1"; + reg = <0x02009400 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_GPADC1>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_THS>; + nvmem-cells = <&ths_calibration0>, <&ths_calibration1>; + nvmem-cell-names = "calibration", "calibration-second-part"; + #thermal-sensor-cells = <1>; + }; + + ths0: thermal-sensor@200a000 { + compatible = "allwinner,sun55i-a523-ths0"; + reg = <0x0200a000 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_GPADC0>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_THS>; + nvmem-cells = <&ths_calibration0>, <&ths_calibration1>; + nvmem-cell-names = "calibration", "calibration-second-part"; + #thermal-sensor-cells = <0>; + }; + wdt: watchdog@2050000 { compatible = "allwinner,sun55i-a523-wdt"; reg = <0x2050000 0x20>; @@ -611,6 +644,14 @@ sid: efuse@3006000 { reg = <0x03006000 0x1000>; #address-cells = <1>; #size-cells = <1>; + + ths_calibration0: ths-calibration0@38 { + reg = <0x38 0x8>; + }; + + ths_calibration1: ths-calibration1@44 { + reg = <0x44 0x8>; + }; }; gic: interrupt-controller@3400000 { @@ -1145,4 +1186,135 @@ npu: npu@7122000 { power-domains = <&ppu PD_NPU>; }; }; + + thermal-zones { + cpu0-thermal { + polling-delay-passive = <100>; + polling-delay = <1000>; + thermal-sensors = <&ths1 1>; + sustainable-power = <1200>; + + trips { + cpu-trip-0 { + temperature = <70000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu0_target: cpu-trip-1 { + temperature = <90000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu-trip-2 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu0_target>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + cpu4-thermal { + polling-delay-passive = <100>; + polling-delay = <1000>; + thermal-sensors = <&ths1 0>; + sustainable-power = <1600>; + + trips { + cpu-trip-0 { + temperature = <70000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu4_target: cpu-trip-1 { + temperature = <90000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu-trip-2 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu4_target>; + cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + gpu-thermal { + polling-delay-passive = <100>; + polling-delay = <1000>; + thermal-sensors = <&ths1 2>; + sustainable-power = <2400>; + + trips { + gpu-trip-0 { + temperature = <60000>; + type = "passive"; + hysteresis = <0>; + }; + + gpu-trip-1 { + temperature = <90000>; + type = "passive"; + hysteresis = <0>; + }; + + gpu-trip-2 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + }; + + npu-thermal { + polling-delay-passive = <100>; + polling-delay = <1000>; + thermal-sensors = <&ths1 3>; + + trips { + npu-trip-0 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + }; + + ddr-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths0>; + + trips { + ddr-trip-0 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + }; + }; }; -- 2.56.1