From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDDFDCD3423 for ; Mon, 4 May 2026 05:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Zx5JZiDM7P1W4ijYGbXe8KVsddltmoo33akfRDuMeY=; b=N6tSe1bj2ruY38fGcmeLYJtBMg J6oquc/adxGYWljSbRbB7E/upRbE8R1Pq/v1eisoa0Ux27y0y6Sl2NjNqh2cfBJ79NfY4NYiTmDcL Z/XkIE44Q8iF3FBKdX1Y/ef3MlkVzMUJppAhqewW++VRe4enNEqUF6D31Z3HlH9bCLAPGGD52Rb1P czHvKm0teX/RVpR2741YHRwJeYNiRkXyipQXGnXFW6/PvJJhVJEGdSmzEbPwRslAaCvcLxGAvZKCa qmQsJslB5vNwt+CxcLceaDJ2NpULyWWMoZWaw7znsL0/VDMrdKzNz5xDT+mS/YbRY33I4BW54JKZl Kr4qcj0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wJlTm-0000000CNh0-484E; Mon, 04 May 2026 05:04:27 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wJlTk-0000000CNfZ-0DNr for linux-arm-kernel@lists.infradead.org; Mon, 04 May 2026 05:04:25 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-35fb166b0c6so2234980a91.0 for ; Sun, 03 May 2026 22:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777871063; x=1778475863; darn=lists.infradead.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; bh=2Zx5JZiDM7P1W4ijYGbXe8KVsddltmoo33akfRDuMeY=; b=Y6YqG9nNuPKUKDw+GlVHioh98d76A2MaMny/cuA9fowzHd2lT8/JRHBJitJv/lzssb yfbMFkexPgfUxPjsxbqw2hhMElxzxOzhX2XbsIHArrGYQa9zjxlKhUtyE9qtCXRo51Ud OXhECLYZ4w6xS9VtOeegA5xAj6Lxr3X73nww3Y/e0+722gK5oxlhGQZA2ANGwEkQwxO8 gotbxQCunUl0c5LJlIN0QLO+lYlMMQrLQfdMUjvaOnVwMQOljP8KuI+tLIpS/BmMqm5Y A71HWNYa4NJLY373kDIjHkqh7UCqZQFISTIFW5ab4gKwR8nrIi1pT+nn0So86pZHZRok y1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777871063; x=1778475863; 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=2Zx5JZiDM7P1W4ijYGbXe8KVsddltmoo33akfRDuMeY=; b=PCYSRC7Uxet5ymFXw7SekYBifPkboBZ9CzZrZo53nciyrbkK9OxWpw7sT98+Gai739 ouXRgT2fOUCAfGeOJbxaZLAYoFArD+Y0jZDgqr5RJZbsdlbgkz6w5j6Pax/A0hghZ6Sh akXMlBCWFo27UNIbTvbr5WnuyabUJJiWkOOMHnxvLBWC+Oa/jzqAgbj5CD4gIPvy084t TQbDTUn4w5ySmuwjSdSaTlvrfcK8mWh5Z2QmKSrrj2pPOsdcec5Z7jioOPmGe6/52e2t D0MEYQ04UJv2luXUxJLM7RQLk9SwfSvaITU08mjphtD+X+q8NAjk0/L9cwKzjXMAho7t EB0g== X-Forwarded-Encrypted: i=1; AFNElJ+Dkhg50SXNUXrRIzzUlGcBx8kU4s8pJ3RVZWd3yfWCVgaeGYIBDJ75kbRZP8+KbTQERD0xQrTkOdPY4hHkEPee@lists.infradead.org X-Gm-Message-State: AOJu0YwEwXd9jf0ckAub5pb38BC4itw3VZs1F6H1IjJYCHTwWsPLFJWY swdzfc1hNr6c4Zje4FKdBRggZAXejIUDcVZxw3MDOOuHOiNvWwKoGxky X-Gm-Gg: AeBDiesBVO93nq80nhRu9UBu8s9sumySHcHQ65gzzjx+wHsxdEhjXkwLaBJjTUcUOtC 2k7HR7TNTh5IfpAxKD70zZx0xLh+d0pM7R8Ohm45f0VgpKM4Io3R7suxRuIZf7U9xAIEMQCPr2A hViXXMjQBvh9mDXpU+TW+kQZZVmWrD7npn6ox0YJfUpQkME2U5pS5lUtApMwzoWsSJUX7Mg8ZS6 vsqZJ8JRnMaqfM/RQTikNBkzk+M6vdsTGO6nxdrAgq21OshtZ1qrufLBYr1JVwvXtrs2sYFyhAA Xng2pbDAkmL4LWTVh4Tbbj+90S4fVuhua0SROkowM7AegD0ZYazTXNTIV9SaFmDbY4M5a59MMGX FwPUWZG7T413HsDVbUPuKzUXefTTblAPPC1/j97p1PKASEA/INhZyDSef/ngP3rLrh1GAVlhrf9 MkEQ== X-Received: by 2002:a17:90b:2586:b0:35f:c258:a9a2 with SMTP id 98e67ed59e1d1-364c49fc890mr13397626a91.17.1777871062958; Sun, 03 May 2026 22:04:22 -0700 (PDT) Received: from archlinux ([2605:e440:15::152]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-365437b50b0sm2662908a91.0.2026.05.03.22.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 May 2026 22:04:22 -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 v4 5/5] Allwinner: A523: add support for A523 THS0/1 controllers Date: Mon, 4 May 2026 13:02:45 +0800 Message-ID: <20260504050245.646078-6-iuncuim@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504050245.646078-1-iuncuim@gmail.com> References: <20260504050245.646078-1-iuncuim@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260503_220424_229669_F95050E7 X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The A523 processor has two temperature controllers, THS0 and THS1. THS0 has only one temperature sensor, which is located in the DRAM. 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 | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi index 5afa8d92a..288a4710b 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>; }; }; @@ -565,12 +574,46 @@ dma: dma-controller@3002000 { #dma-cells = <1>; }; + 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>; + }; + sid: efuse@3006000 { compatible = "allwinner,sun55i-a523-sid", "allwinner,sun50i-a64-sid"; 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 { @@ -1087,4 +1130,115 @@ 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.54.0