Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381066; b=WNf4WPvut2IhNJ0KNQ5mmgeb3x1ECT2mG2GaF76mLGDm/NZNaRRtUF1IQH7VkGGOLj7m nNvKSJO3ggc07Iwqm7y5+FXDGrqI7aLT+8HGkUauS3pcFOuMCmn8F+lh4v4ALDhcuCjWV VyZYgk73iOXZTd8rrVQAmWz7SJYo5etagHkqfU/CeIVSLf8nK4kjVziqHE1mO48cudlJP ouCsoFpQQ8YP+XJxlZKxh6L3cOYpOUdxdxY3aTaBiIAL/YzzvNQ+q0ndq4TotYvy4aGtA X2AD0oQc0Qskr3/EvRffQ8zhj4lSG4xisPlpgZuEaJeAXgJsq0zOIjFYaLHrfPDBOhQ== 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=Skcqix6UYyVA0I73OUdu6Sw+JUW9igPSap2HBuL+ozC/K4zET4uFXgsThHngCsjs99Vb xVg/jXLEiPbeC1Tns+uwF88i7ZVu9liyK0x1a58Q0ljTpmUilhWz/SBr6Dvm3Uun/jP2+ vL2/l6Wvg81wwttZizU1iMKh6aSasBRWKOsZcO+9P/D5tYa4SiJuJT+MpaYMBV/sY/zb9 G9+UFJHQVg3uOfgJa7/3Wc3tqgdGq2utgImElDryUFUbLPx9i1DZUGjet0cQqApq8Ewif 4w+B4F3LOdN+nDYGKLBjLiSPRsPb0hA4HbT8OjoUL2Uk3dl/idhvMMJyMDdZJ9RaUfg== 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.48 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 AE101606A32F for ; Fri, 4 Dec 2026 10:44:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AE101606A32F 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-f48.google.com with SMTP id 98e67ed59e1d1-3b53db3d0a5so406581a91.0 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=XM359RRC1x4xuBHl21DXRbJGH8mum793IWpPBNdcUMIVFU6LN+AqSXCGqzPpMwEO+L ngiwfrkxvXjisF3lHOrSj3gs8kG8uOtBxPCea0yq/AkakpaThdnNeDA9kQIcYxhr8sTv 9B9DP5nKnlT8WRiciRonQ2QAgaKicF2Bow0ThcNdRMnqd40uNvpWxUVxFOII1ZzKMViJ c51zjcTbWTnVy9Nc35V3XxV3T3PMiebbmIK5iIyRSIjHd9yzh4FQOU/rbB/zEh3zflm3 t1g0IlrTJP/WBzwpB8djoSzhVNX2nWmqqLgcWoicVOvHxLYybRZndmuZEuIz72J//+Uu 34Og== X-Forwarded-Encrypted: i=1; AL+hErFExLYmgqT2wGI8YdSqq4MT+tamo+jU1BkM8eL1hx6v7KIuHnomlv2HhAM1ISG2BpeYnJqblVQ7VSF5@vger.kernel.org X-Gm-Message-State: APuU4Z/+pstuGGkwb31UtnxgnsNVNVMaJkO5g0boL7CIQgs2mQ7nnrRL tIA9KfME+MAZl0NaH8Fg0QNXKG9MEwMC85mm4mzmkhs3gsvAybRUbmd4 X-Gm-Gg: AZFdTZdsnjN7lUgjwsT9kmQvLbuv3axkAIcQe3DlphzvVNlEvj3+BZVMqc1l5mYqGdw MbQF+4gv0klxQneztrrQquzGNESA4B4DVLVfLSwreKSz6/woKhgHHX6Vo5wElwfYql05mpqIdZ4 BtENk6fxawHq2OlgNVZc4luBwdRTyVER9tvNw9WX2SY5A91be7kK+/OSuQp6JUMyMJsj3BmADcg 8CpE5ruM0a1H/QcSAQKgQHMiLxabErZloIBSAXJGRAwXBbb/e0RgvRbLNuerPKRRjgPoN8+8iAt Ml2GEdZ+6TRXE+IW07l8OBvuAa5ygcvXi8U+muZB5oHLgDrw0zs2UMFHpaUjknOQE9Y1wQhN5iy Uog3FN/XqvapCTdUJE4npcLS3jW6NvLBXk16oKPz2GfmPCFpvUAbC3nCFs5BeTCtpvjNbQtqqbl xaJe2WFCTkqU/WtpuMHI1FzORRVjt31uuXh0ddHuZ7gULaIHBd7qKWbD9qHbkiI6PSGp3nX0hmv cDZkM+hBzLwaXyvS6Z41G6eFLxuExAZQebYmJDCwZpsn0NwROF1t8kOXTp3epxpiUiENe2P 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: devicetree@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