From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22853606A32C for ; Fri, 4 Dec 2026 07:44:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=feqTXLOw; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Di3laUWa 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: Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=2LyOnJtTRyZrW1XA+WsGzz98ClmnRlzQRPMbLLkNDmM=; b=feqTXLOwVS0gYO3ARErOusAdqp D3qyt5cQVWk5JcMRXoG5wNgKMNiiUHxj8WAf5hAp1Oun7HDD7DMfv4UgJKBQuHjPEejRq57iUOaBr 5hU6TG1Z8M1+Gb/hodhLO7XHvgTr0Izow2RJR2X2KGPZTvpfgY4aiZpKAqT66GJYoOK+qPCd0dqSH iEyRbQJi8JXB0W5alTLcrJxuozz6gDMLiB7sZoRXgd1XT/VTt2tMhp9Fd1GbcT9Hdx8e0taLmkGLV Sk9Ox8qfs62BCW5Ztkdhw09hS6ysX/IASCddvQcEQF/rcAghDq2trdwRqnPEsWIr3o5DVRfzVXD98 5uIuoc/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZNy4-0000000H0Mp-3zbO; Fri, 04 Dec 2026 07:44:32 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZNx7-0000000Gztk-1GsL for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 07:44:03 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4bb6886d30aso5700715e9.3 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=lists.infradead.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=Di3laUWaGiW+f5MFAJTAb07pTZ8CC+I3f2TYxJZggbRhqQOAH5DoCjNGzTYcifM5RH YMmqgmS4W5ZaWXQKUe7m2+K/blsKBIfyja3cQ9oqdUDq9zj/ypYiSTYE+DynvcqYL60s B+FfS01Gylvyf7pPCx5ELOJKB+lKOd9JrV2LW7gAFGXlu1MwH1Kjoq1jiTCPZZC9zFpJ EHJO7+sn65elNxWJbTgbQArhk2MZTK0QCkhUsQLRAzuUNO9l7XaQRgPiRwiJWVQF3Bet YyIQXQVLP8RZ0Z8SjuVBzvKfNGdhmGyTJy7Dqq2Lq6ArBtD0LkpUBeGqqUQm9AnoeLRN Zaiw== 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+WsGzz98Clmn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uaeO810ubjRgBtzkqXxGqsr1yzAlyHejLbMIvYb4Ea8ME2CPm5c/RHOJTHxmIgVXz tnugfk+0j5iuZEbNAvpARvl0spseB1Ku2LY8jfKakfSnyAFNatcPiL/rD5yuIfE0VQqodc2CFZy tlSipoTo/GsEr0zXu9BVHjsmWjG9zFIap1uY/n1DCPU4jBV+ZaaqlvGCi6rPiM3020hR9Nztwgb yVtw1ujcbvqe4m2oontyCst3DeGMiwrGiSDQNK9q05jxX 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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_234333_606293_015B7342 X-CRM114-Status: GOOD ( 23.78 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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