From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796370213; b=xJMkb4oIWbYHJAbfaheZv8lInBltmylEH9oxVHsk4jfCVrd7RvBQY1IkIQ1UhHQqoV+X 28ucNzq96kNgVFgmvC7ChUyi6FI7/tyR4C86cwsqQzcsbTUpwYgQZ0Ci/kZhfwOZJz3wU ePkbOF5DnP8p3JdNu7GRXqjlDwY4sV8gRto+kjwVKMxd2FFx+p5CCdRpy9I7nxbL0RDSz pk97KkNqC+hvNrqHrwNQxvx/yvyatJC/wj273tpG+16FM3m69F83SMkWJVmp6+DTLbGFv OTBRBMo3xoRFL9OdrYz/B5/HspO7qUTfY/CzeJc3X5TIMV6DK6esYMT52lH6Ahyhttg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796370213; 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:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=2LyOnJtTRyZrW1XA+WsGzz98ClmnRlzQRPMbLLkNDmM=; b=4WW4HTxK70IqeGE8FgKdCFdhRLh1vEyD76sILA6/zlFabzCZ0PG2O2TB/Wr19SK78xpo UzWGqW52rSAbQO6IENXNvkpj7loJ3kij6QZsmgJqFsC5el0o8mzfGuKHMhMzqbt8M1kod k3MzWZM0GlJI86yEIwOgLCMZFZ0f+SOhdBheQyj9zbT58u6DERZDNvZcdK1hqFBStEJeN /NwchVtoFKvsx2OPU/BrwjrtkEfdZr8aDPm1QkHKjZQiHPBEZVF5xTRE2M5QfITKhI0/j Nbtglf8jEVOCIm0jISBqzq045UWIceS0l/zyoJ7+1r/SxjgyM6KA0QOITkkDr5RY/Ow== 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=ZWnj2UGb; arc=none smtp.remote-ip=209.85.128.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.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 C00BB606A683 for ; Fri, 4 Dec 2026 07:43:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C00BB606A683 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=ZWnj2UGb Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4bb69f5b161so3396695e9.0 for ; Thu, 03 Dec 2026 23:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796370211; x=1796975011; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2LyOnJtTRyZrW1XA+WsGzz98ClmnRlzQRPMbLLkNDmM=; b=ZWnj2UGbTNNv+ygvWSZiUX6LDWfUA/T5PTnIogL55Kt1e1+2yAJWC//nQAUiYKh/6W rbgtjgKotiBDlqd+ckW10ORLmT3UVc+tUxLEps2FpuSAoZFOAiNUXoCnlU0VQZRJMQbU IUiOrxQTte1xtH0vQLg16FNsa5jio1Ye9pK3GYBUWxmFgZmenQhPtYnrZj1kWpw+4S94 p3ZLKIkYkthfgzhvZkpoC57DK2/WGxhSDQ3NX6DLWaqF92DT0dG65xZSQVfmlzpiY2GN uTkuQXpepTSuuezTnU7Ag/eZEAz5r05TRPVaIzdGyWQGb5mEgpaISJtvJ00Mo+TI7eua vEJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796370211; x=1796975011; h=content-transfer-encoding:content-type:mime-version: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=2LyOnJtTRyZrW1XA+WsGzz98ClmnRlzQRPMbLLkNDmM=; b=ISMnVkShrf+Cog/XkhfbSThEPtmDQgi8lkS79z7crwtxkINYeeOsKSD0rWQZcGxZmX 8M2EBxu99x8ZRaaDA1h8lG0Q4+10JqaGcg++CzYJFPWx5dre+brTtkuykZi6Q0iCh3Tz H1fEXgG+E6jsg8P6e/To+SS2Xt89brRN4TcDbKnBp66bASWUknyYEJsUoxMxCsUAh+HZ MCXI0ycgKM4aJ1mjwkWFF0HLZW/e+jGo8xXt7gbzUP0A8nL2Q/NFn/ZY1S2Bs/0g2b5O /YmMK3SgBmDm/Z0uaa225Zn6ffK6jdCyoVYRVgeUR976o/jIp4G4ffN0inyGGwRNLfz9 AKFA== X-Forwarded-Encrypted: i=1; AL+hErFJ6tbG5ozlTcYJNpV87ts6W1Tg9cl1KN2X/RaZKqav/AaxGV5QuYzjPtaZAZTbcAsafjJZuWM2kB3F@vger.kernel.org X-Gm-Message-State: APuU4Z8vAr3eMwSMae5B1X2RezktB/3P7e1haqQqkfNObywKZXn1LA3n 1Xmodx46AszCPrqQ37PLKBSxjxaisAlgYe8hE/69Pr86XGKZsdHjNXWb X-Gm-Gg: AZFdTZeQBUrTtytVqece+m0LetkoeOwxf/nGHz8A+sFJUHoFh5phADtkQKkXxjrSfe+ IDtn/Bn+tsC+cz3xklvd7K+SLxEuLmFNu24/f4uA9jwoRQU97f4pc6U7pzYd610ul7RdLNbCNpN hKAiWOHftuFJccFqvX1tCAuwn0NgWcbOLxXVYVtdGDcULkcutAUG3GUfWg25BqwePVP9sptS+VA +rRdhmyiKZpfRVqpDef/pVvcxebmu092RXhpscAmWeXPar1h8VYDDChvsy6QKt/tWNF3q33fK4C 1X63liy6VEleMufKO5LYsNT0ftQB/+/TEE7kwMOwoIv9gWZqBeP7OCuPEdstVRIqi2vV6YTnYzH Y1Ej05lJLpYkI2cQcBXJIQPnf1nr9YOC2NmdWq7bndXDe1hPG2m25Mqa6SPDOJb2jlnBbAiGnUt QMxOE4E4sTaAahqfOSBvY4WLgwoAE/UmTWRCZeC9qmut53Fbo7L5qxblwQL9uhiWD1iMewS5Xqa fZv3p3sqZ/YEhZJRAAOACZKQm6d79VAc7nsP1De3hzjA+uHkmXxfvInEiO3H9mVKP33+R04xKOb oLtFhvn1jgJ7GjQpcd5T/FGWGcR+wm+ERFZnVEsKfaAsrJ0WP7fhhq3rnt6G1LG3c/0d6CiSvur kifrTbzMJicRnmvE92I4L4K4SUD3SdMFtKZaS7w8uiiGL X-Received: by 2002:a05:600c:8b33:b0:49f:e8bf:8f9b with SMTP id 5b1f17b1804b1-4bbeb6ec9c5mr17768435e9.4.1796370211022; Thu, 03 Dec 2026 23:43:31 -0800 (PST) Received: from thinkpad16.ts.appmire.be ([94.110.48.221]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe003108asm129692405e9.1.2026.12.03.23.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 23:43:30 -0800 (PST) From: Jeroen Trappers To: rafael@kernel.org, daniel.lezcano@kernel.org, sven@kernel.org, j@jannau.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: rui.zhang@intel.com, lukasz.luba@arm.com, neal@gompa.dev, towinchenmi@gmail.com, konradybcio@kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jeroen Trappers Subject: [PATCH v2 0/3] Apple T7000 (A8) die temperature sensors and thermal zones Date: Fri, 4 Dec 2026 08:43:25 +0100 Message-ID: <20261204074328.3741080-1-jeroen.trappers@gmail.com> X-Mailer: git-send-email 2.47.3 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Apple A8 has no thermal zones in Linux today. Unlike Apple Silicon Macs, it has no SMC doing thermal management in firmware; on iOS the kernel reads the die sensors itself. With nothing reading them, the only protection is the hardware failsafe (SoCHOT) at 120 C. This series adds a binding and a driver for the A8's five die temperature sensors, in two blocks: two sensors in the power manager (PMGR) and three in the CPU complex (TCC). It also adds thermal zones in t7000.dtsi on three of the sensors. The zones throttle the CPUs from 70 C, with 90 C hot and 100 C critical. The register interface is the one iOS drives (AppleT700XTempSensor): - only 32-bit accesses; - a freeze / read / restart of each sensor's accumulator; - no writes to calibration, alarm or SoCHOT registers; - the per-sensor offsets from the tempsensor0..4 nodes of the iPhone 6 device tree. The driver is adapted from Berkay Kösebay's out-of-tree A9 (S8003) driver for the same block. Changes in v2 (all from the Sashiko review of v1): - Binding: each block is its own node, with its own compatible (apple,t7000-pmgr-thermal and apple,t7000-tcc-thermal) and the sensor index within the block as the cell. This replaces one node with two reg pages, where the TCC page was optional. - Driver: an accumulation interval is never cut shorter than 100 ms, so fast polling cannot starve the accumulator. In v1, a read that found no sample still restarted the interval. - Driver: a sensor without a valid sample for 5 s reads -EIO, and one disabled since probe reads -ENODEV without being restarted. v1 kept returning the last sample forever. - Driver: a sensor is only started once a zone using it is registered. Sensors no zone uses are not written at all; v1 started and then stopped them. - DTS: both CPUs are in the cooling maps. - DTS: the commit message explains why TCC sensors 0 and 1 get no zone yet. Testing on v2, on an iPhone 6 (N61): the driver is byte-identical on a 7.3-rc1 based kernel, the iPhone 6 port this work comes from. That kernel's n61 device tree has the same two sensor nodes and zones, plus a GPU cooling map for a GPU driver that is not upstream. The v7.4-rc5 tree itself was not booted. - Both nodes bind after a cold boot. The zones read 31.5 / 29.0 / 29.8 C idle (CPU complex / SOC0 / SOC1). - 2000 back-to-back reads of the CPU zone return no errors. - The unused TCC sensors 0 and 1 keep the CTL0 value the boot chain left. The three used sensors accumulate while bound, stop on unbind, and start again on rebind. - Two busy cores take the CPU complex sensor from 33 to 62 C in 5 s. It is back at 34 C seconds after the load stops. The 70 C throttling step was tested on v1, with the same zones and trips: the CPUs stepped to 1128 MHz and held 67-74 C. It was not repeated on v2. On v7.4-rc5, all of these are clean: - a W=1 arm64 build; - checkpatch --strict; - dt_binding_check; - CHECK_DTBS for every t7000 board. v1: https://lore.kernel.org/r/20261203155600.3911447-1-jeroen.trappers@gmail.com Tool use (Documentation/process/generated-content.rst): the series was written with an LLM coding assistant over a longer working session. The assistant drafted: - the driver, adapting the A9 driver to the A8 offsets and the iOS register sequence; - the binding; - the device tree nodes; - the changelogs. Under my direction, it also ran the on-device tests and the build and schema checks, and made the v2 changes. A separate LLM review pass, with the review prompts Sashiko uses, found an issue that was fixed before posting. I have reviewed the series and can answer for it. Jeroen Trappers (3): dt-bindings: thermal: Add Apple T7000 die temperature sensors thermal/drivers/apple: Add T7000 (A8) on-die temperature sensor driver arm64: dts: apple: t7000: Add die temperature sensors and thermal zones .../bindings/thermal/apple,t7000-thermal.yaml | 57 ++++ MAINTAINERS | 8 + arch/arm64/boot/dts/apple/t7000.dtsi | 130 ++++++++ drivers/thermal/Kconfig | 13 + drivers/thermal/Makefile | 1 + drivers/thermal/apple_t7000_thermal.c | 295 ++++++++++++++++++ 6 files changed, 504 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/apple,t7000-thermal.yaml create mode 100644 drivers/thermal/apple_t7000_thermal.c base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.47.3