From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F28183750AD for ; Sat, 4 Jul 2026 17:16:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783185377; cv=none; b=lTN0/AH04c8FWcaX3w37l1AXVUeM/QGaxNGUUUAOS/eIjvO6ZHOdD2TL+2GmP6eBmfXs5krKP2MWZ/dIygo6qY1VGYRyUkjMrOL79yKaZhSyWFSUgVkb78sJuVvCpj18RqHxAphNqU69jMfiS0pKCHrp5A64f0X4ZRfU4y+SPTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783185377; c=relaxed/simple; bh=UwcwC3xtFbMfaEu/qElwOXnRVv0bbJHNhKNq97pt4IE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kVsG2xCz7jucw4UhcHsJGGqIkUE6C5l17WOa8QpM06qRZ7fHhks/PZdzL2ZtfwNEaczHrNRqth3M1lw81UNCoctdmpi0TBnAxMtml8t6xlYDnpB5Zzly2mlW1aosebXVE9NFLnbCbzRNw6LfM9Bahsds/SH14UwSJyUyPaMDJ6E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q+gdP/sg; arc=none smtp.client-ip=209.85.215.180 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.b="Q+gdP/sg" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c88973b6965so1848334a12.1 for ; Sat, 04 Jul 2026 10:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783185374; x=1783790174; darn=lists.linux.dev; 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; bh=d95C5AOhdaLbCgZk6LC0vYbHPRqhfdHed++OCDXOWh4=; b=Q+gdP/sggO66Bb+kO6AEK3r1kWIHOzmcaxEBsR4JmyvSiLa2nmgU7REOeEngkarXlX i0mUSgvTuJJArMZFjCplB1OmO9IHHSJfgUoz+bxAgJP+EtC11trDf/oOTLPmhpSy7wyE rptJ6RpwEsDu/QcF6E1VnYkPxOjGmQMCUtEy1lxegREAIL4pDl0qfvUMG40cIxNyZ4Dp ZEwb5+kpBB4YSWrJ5s23MfYsr0QKL2wkKhfFbxFQL+ro2NOy9NXgbd0kjuTXoGR7Edlj V7OPF628IcQ2Y0HbhsM4qit2gXrcWQr4bpk1jvilpTcjEyOB+VX4wihuOTr60GZ44C7w h8Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783185374; x=1783790174; 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; bh=d95C5AOhdaLbCgZk6LC0vYbHPRqhfdHed++OCDXOWh4=; b=sS/mbz3yE1PV9UxBiYle9dKDy4oL29nMkPwHEnaugxabPQsJFaqxY1/4QorgtWsaSe gxNhcPUwqFSrnAQPFZV9Gg/8Dd8Ea5gYCIk2PaUDdHQFY8OLJtIe8crueBm/1szXttXP +OWKRUNfT1OVmVJ8U1BhVVtaIZRzAApu/0NGs1UOm3VxTtbyz6OxQonyNEUNHHxa8U1I uNiLohJHp9VlItQEtErjL9JRNsdn3uHOM3xDRvWYYGjQuhGf0x+XTrvo0G+duRu6EFSt rWKdzoZGYW4Ay5QwLhb9rVtyxKkXg8MmMeqPkpMV2i9FpS6fEiOBq4QV3qg8gzq2Hss7 wV5Q== X-Forwarded-Encrypted: i=1; AFNElJ+y832X9jpBP6SZ41Gq6W7///Kbckkk31bv4rg7PnNlZR6u72daTc1AFH2/Ho92tSqtQFUT5FDfDzCJMg==@lists.linux.dev X-Gm-Message-State: AOJu0YwAd/kf0JfWwb8bSTdcWOyA2ixeSrqU6AfDb9AkvYhjSKFziRwj wD/J5VEnJXNFU/Wzyq1aQn7LeUgsosg3wRvOkrSDoVBqIGB7RomKgxkeZuzpmw== X-Gm-Gg: AfdE7cm5IV8jerkT8GCwnAPSDv0VloBXniwheRG5j3N/AiSkOraIi+eMD6rklLpeVo3 sGb/G26dQuUrCVJVuLY3owcnO/lqf/5bNtBzoFyanCjgx4bPSoBlTg8vFmUia2EQ4sJRiDCDCID zO1IzyGKiRIJ2yqt4VjHBXpD1yuh3EYLJIFZEZ2w99qxKho7LdYAopG/5WE/Pz0VPAbwq7TFnCB 13PC+/QQl7C64SdGRCQRNhzA+5f1S/Rcdbt3WWPqo2K9lnwKecn/dd0cyRyXWAkBxBcITE2ewZH DejNVDfSHtkWzPlXBXsU6Fvx0VItcx/rFdCj8+Ko0AUHnRcgW6MYU1x8S7aEu+5miQL2l580vFs h4OZis2fhL72xAbc1W8j5YuXn98ShZl78OQfNuGc7HsP4B1ilvy00qdnaUNoJYNeJBEWG/HWHsk wlGtHj X-Received: by 2002:a05:6a21:3394:b0:3bf:aa29:1612 with SMTP id adf61e73a8af0-3c03fa43612mr3885982637.28.1783185373846; Sat, 04 Jul 2026 10:16:13 -0700 (PDT) Received: from archlinux ([212.192.12.80]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6d498adsm1379101b3a.32.2026.07.04.10.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2026 10:16:13 -0700 (PDT) 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 , Philipp Zabel 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 Subject: [PATCH v5 5/5] arm64: dts: allwinner: sun55i: add thermal sensors Date: Sun, 5 Jul 2026 01:14:11 +0800 Message-ID: <20260704171411.1413349-6-iuncuim@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260704171411.1413349-1-iuncuim@gmail.com> References: <20260704171411.1413349-1-iuncuim@gmail.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 3 sensors: ths1_0 - "big" cores ths1_1 - "little" cores ths1_2 - gpu 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 | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi index ca6a16807..2ed00e7a7 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>; }; }; @@ -355,6 +364,32 @@ 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>; @@ -586,6 +621,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 { @@ -1102,4 +1145,121 @@ npu: npu@7122000 { power-domains = <&ppu PD_NPU>; }; }; + + thermal-zones { + cpu0_thermal: cpu0-thermal { + polling-delay-passive = <100>; + polling-delay = <1000>; + thermal-sensors = <&ths1 1>; + sustainable-power = <1200>; + + trips { + cpu0_threshold: cpu-trip-0 { + temperature = <70000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu0_target: cpu-trip-1 { + temperature = <90000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu0_critical: 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: cpu4-thermal { + polling-delay-passive = <100>; + polling-delay = <1000>; + thermal-sensors = <&ths1 0>; + sustainable-power = <1600>; + + trips { + cpu4_threshold: cpu-trip-0 { + temperature = <70000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu4_target: cpu-trip-1 { + temperature = <90000>; + type = "passive"; + hysteresis = <0>; + }; + + cpu4_critical: 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>; + + gpu-trips { + gpu_temp_threshold: gpu-trip-0 { + temperature = <60000>; + type = "passive"; + hysteresis = <0>; + }; + + gpu_temp_target: gpu-trip-1 { + temperature = <90000>; + type = "passive"; + hysteresis = <0>; + }; + + gpu_temp_critical: gpu-trip-2 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + }; + + ddr-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths0>; + + trips { + ddr_temp_critical: ddr-trip-0 { + temperature = <110000>; + type = "critical"; + hysteresis = <0>; + }; + }; + }; + }; }; -- 2.55.0