From patchwork Wed Nov 18 10:52:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Yadav via B4 Relay X-Patchwork-Id: 4155 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 5D9351C7D3C for ; Wed, 18 Nov 2026 11:52:29 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27814-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27814-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 8EECB32011 for ; Wed, 18 Nov 2026 10:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999147; b=J0+H3/2I5Y6dyHYcXrWNuDwJ7fwoR/2F5C+/dWtZSUJiV640rpRI29h+3Ob6U8rF1Dbr l43EkebHr6SSzgHHqISDUc/0OQdkLwcVHgCi2OXkv6+LFlxrJgl16h5tP2FJqLsPK3QIt e7uvwdGZSRCfTQxe2v2uN/O1CL0oy3/Fj6gtkkO3fSM2vrmyrSXymAm68cvCoO1UzpXJy o32LdeBdsLV/Gln2zkA4Hl4AvXxRqZW9mKTnFDQv2k5R7AEISXpTl2JY4jLc6nqI49Mau KW181XHYYilhOth+WXfVe66fbiq7TxuD+vsmfB3w4oes0/ITtIBJZ9hQoHf3hGfhsLw== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999147; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=7gsWmvqHjORY7K1m06+fKawyHuEa0Hrt5rL694njs3E=; b=PWo9aFWl9XNPStRw2AUeDxHT7bHJYi99FjqFuCU2ffRy+M3VVIOU1HBPbTy8uz2Q2j07 1yP1TvJ7wWlSIadYoYCxyQp6rTAAd7F/VENLK4AC7U2k7zvLk+qCsTOq9nX5rSgqbvGi7 EffttwirnGjve37TAc8L6gkAoRpACvpcji6Vw+6JwnDfrFR7LeAiL3ULC8YebWgiReuaF n4fs1WUW6M/skSRtQ6tomme7v2DXM/3oHeW2QRyKcAvbb0mY65Q6OA96oFyDVnZGzSlso WxKIIWKrO078s1Bq+2QQ9thLzpJIW5qgFytLiEM6nTDHPjKhVDpwLdIgL8yp9oZlPCA== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EJlr6Yjt; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDE16606A320; Wed, 18 Nov 2026 10:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EJlr6Yjt X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999146; b=nNiR1AQBt5Ha2vc5L5P2R7PSKK0YTczyhgNWaykJOH4icRqp7A0BqYobKnEogw0XfhWF oW2lOGamrlvlx2CxdlWdD8Aha8YwGY/h/rHpvySxXqyAti85Bj9s/BA0mlcAm+zps9ayl eUMnN7HhxKUF7Rky22PkfUkCMqDP80KLzLwITheZsgpTL9AEh/nPjXRsAvflDBjaVKKtm CMpeSVEfiC3TekzXOA83RXGpdG+CA6paJBNyvLekI5ROz7NYAzNaI2/L9NFG7St6VJ9/Y PXiHmlyeogfBh0SYqPryImYXfal7/S5TqkBx3bIBlHu5cWgLgYjGyce9syWa/uUcHtw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999146; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=7gsWmvqHjORY7K1m06+fKawyHuEa0Hrt5rL694njs3E=; b=ZNaizuzCjGqAZQPLbhNFUE3AsevMhVr9rNqHsqlgY3gIM1aPrDzi6ObuGbyeUQ5DD+SF CxCfzH6pLiEAMn1fvFUuy3wYBgAymXQ/a0U9hL1PuJ+u3W8Lz3M7Oi/2fLTzt1LU7QqRW M9hjix0brIOfDx3bYEhbBwoRnmzJJ3jhEmuG3Prh/YoRoSJW+hekVdoOf8US90EgYsEZV XC2mDarQ6MflTano5ibBAt/83ZJowEvlkF54ER7b4qcWqFs4JGR5G4Dx+G9JhBfF7dvlB /7HTpbnTMfhLKfIh18RhAWXbvWHhxJ1uhfEESiPGp+1E0FKpY50SfvBoaD8Ybx5dVjQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EJlr6Yjt; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAC31606A31C; Wed, 18 Nov 2026 10:52:26 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794999146; b=OInwZ1SS1WMPlSC/VhRWGKIGRSxDHkfx/7cnGbPP8b/Nx1VQ5lP+Gu1KY2JoInLQETVh hbnvzH01M0TmymWzEGr+JKiTMgDb59MI+9U/Lf6RS37cra25Mu2l9i/1sna/n4jnCBupg TeO+WKqvkxWMgDRvuXVfiJht4WZ/z4M4IVgtqWR2DSVfc4jf40LbwraLLGF3mmBNz06Sg MVifEzCuU2/REqqcc2PhxzjxpoUG28ZOzSuvD2mQBaTGCw1OkLolEbAvGnhaQbvhz7H0S /VrpgTmKnweawoYMNdF8MiPhcVe5ElS8TnLgtGCjdYG/IvO+sqUsPj79SK6XwZRgLNA== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794999146; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=7gsWmvqHjORY7K1m06+fKawyHuEa0Hrt5rL694njs3E=; b=UaEfz8RCmR/YO56PJcgeFX+JauR+Ie3t4217F5XNPPStGX3JNTUQJ4Y65iNrRnGMEMIW c/M7kpglmP97K1oCkYJ+g4Ek77bBEx6jPUyl41ZhzEkFEvs1+vPPUw+pNGHps1b58PcnO YwA2FRmGT9hrdFUQxQAdmfxN0n6X7NUdxGPI2WBQhXXRu+ZY+ZRvBHx28DtuHDAUWP0Wx Jea3IVgBW8CgOhZTVhiW9UAbVN/CidMPfL4AlFer7LVY9cRMI62qbA04hpVJd/XqFo9UD W4qOFVHI3nS5UsLvhLruV/+r5o4lspV5VQLy3TEOUNWCq1zGcTd5AgAlKQb4uPp7nSg== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id E33121F000C5; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794999146; bh=7gsWmvqHjORY7K1m06+fKawyHuEa0Hrt5rL694njs3E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=EJlr6Yjty1SPLK9BRj7k1c6KYMpBSMsHX7PFgWZPs4Gi3QF1NkvHFRjAtK1iFYHYd rvicB05dCV34uSyXIJ9/O6bjueE+4PDIJ7Gp2jxQ1CGD59uTJAJnMrwR/C9Jt2arOI KGMgzeP3QGv0GWFDw827/bftGeWwErtMoZQm/hxqBAraFhXPffnTKWIMGtK5jwWFyT KFFZ14MqPqZqZZNRVZAkcZocQQwb2pfI9sYvpH0jDsVOpRcMsSZ0vVjYQYp+mErGaw NW9SI1MGIg8AErKWdn+uokrrb3kwpSrxDNPGWTSHhHtbfbx5EpvyDw/JG0tpuXTrWP FPWNHbdkvQk4Q== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 614834AD0C; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) From: Rajan Yadav via B4 Relay Date: Wed, 18 Nov 2026 04:52:24 -0600 Subject: [PATCH v2 1/6] dt-bindings: opp: h6: Add A133 operating points X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261118-a133-series-v2-1-8bcec9c9aadf@gmail.com> References: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> In-Reply-To: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> To: Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , "Rafael J. Wysocki" , Viresh Kumar , Andre Przywara 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, Alexander Sverdlin , Cody Eksal , Paul Kocialkowski , Rajan Yadav X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794999144; l=6454; i=rajanyadav0307@gmail.com; s=20261103; h=from:subject:message-id; bh=t1FpjYwSX+5T/HhM/HdhDFg5tta8TvLt0nYNWKvJh/Y=; b=s/+eOpb58cAPqfEPoRIndBMnjW5N+hQVNtb5yB7TgCrvO8dxB3q8zH55rGPr+O+5mLo8WdCJb n6oj4pWjl3MDvSbHtUcjNY2mL5SZTWLcmNVOG5j6EiPwwquLn5YXLyu X-Developer-Key: i=rajanyadav0307@gmail.com; a=ed25519; pk=4ZPeiP5qrv2b44q/Obxi2koUS70Q6npbttJnpUoTlgg= X-Endpoint-Received: by B4 Relay for rajanyadav0307@gmail.com/20261103 with auth_id=1391 X-Original-From: Rajan Yadav Reply-To: rajanyadav0307@gmail.com X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Rajan Yadav The vendor BSP for the A100/A133 family (sun50iw10) selects the CPU speed grade from four efuse fields and the die revision: the speed bin (SID offset 0x1c, which also holds the ICPU current), the chip marking ID (0x00), a value programmed at production that the BSP calls PCPU (0x20) and a bin extension bit (0x28). It knows 11 grades, a0-a6 and b0-b3. The A100 operating points describe only three speed bins, taken from 0x1c. Add allwinner,sun50i-a133-operating-points for this. In its tables the N of opp-microvolt-speedN is the vendor grade: 0-5 are a0-a5 (a6 has the same OPPs and voltages as a5) and 6-9 are b0-b3. The four cells are named, with the speed bin first. The meaning of the PCPU field is not documented; the name follows the vendor BSP. Indices 0-2 are the vendor grades a0-a2, which have the voltages of the three A100 speed bins. So allwinner,sun50i-a100-operating-points is a valid fallback: software that knows only the A100 compatible reads the first cell, selects one of speed0-2 with the A100 rule and gets the OPPs and voltages of the A100 table today, with 1008 instead of 1080 MHz. That is the A100 selection, not the vendor's; the new compatible adds the vendor's. The binding requires indices 0-2 to stay usable this way. The new compatible is SoC specific, like the root compatible allwinner,sun50i-a133; the A100 compatible stays as it is for existing DTBs. The schema now also limits the other compatibles to the single unnamed cell that all in-tree users have. Claude Code (Anthropic) drafted this change and its message from the vendor BSP sources (field layout and numbers only, no code copied); I reviewed it and checked it with dt_binding_check and dtbs_check. Tested-by: Alexander Sverdlin Signed-off-by: Rajan Yadav --- .../opp/allwinner,sun50i-h6-operating-points.yaml | 94 ++++++++++++++++++++-- 1 file changed, 86 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/opp/allwinner,sun50i-h6-operating-points.yaml b/Documentation/devicetree/bindings/opp/allwinner,sun50i-h6-operating-points.yaml index 75ab552f6ec..5fa6a1074da 100644 --- a/Documentation/devicetree/bindings/opp/allwinner,sun50i-h6-operating-points.yaml +++ b/Documentation/devicetree/bindings/opp/allwinner,sun50i-h6-operating-points.yaml @@ -16,24 +16,70 @@ description: | Voltage Scaling Tables define the voltage and frequency values based on the speedbin blown in the efuse combination. + With allwinner,sun50i-a133-operating-points, the speed bin index N of + opp-microvolt-speedN and opp-supported-hw is the speed grade of the + Allwinner BSP: 0-5 are a0-a5 (a6 uses the a5 values) and 6-9 are b0-b3. + Indices 0-2 must be usable as the A100 speed bins 0-2, because software + using the A100 fallback compatible selects only these. + allOf: - $ref: opp-v2-base.yaml# + - if: + properties: + compatible: + contains: + const: allwinner,sun50i-a133-operating-points + then: + properties: + nvmem-cells: + minItems: 4 + required: + - nvmem-cell-names + else: + properties: + nvmem-cells: + maxItems: 1 + nvmem-cell-names: false properties: compatible: - enum: - - allwinner,sun50i-a100-operating-points - - allwinner,sun50i-h6-operating-points - - allwinner,sun50i-h616-operating-points + oneOf: + - enum: + - allwinner,sun50i-a100-operating-points + - allwinner,sun50i-h6-operating-points + - allwinner,sun50i-h616-operating-points + - items: + - const: allwinner,sun50i-a133-operating-points + - const: allwinner,sun50i-a100-operating-points nvmem-cells: description: | - A phandle pointing to a nvmem-cells node representing the efuse - register that has information about the speedbin that is used - to select the right frequency/voltage value pair. Please refer - to the nvmem-cells bindings in + Phandles pointing to nvmem-cells nodes representing the efuse + registers that have information about the speedbin that is used + to select the right frequency/voltage value pair. Please refer to + the nvmem-cells bindings in Documentation/devicetree/bindings/nvmem/nvmem.yaml and also the examples below. + minItems: 1 + items: + - description: + Speed bin, or the chip marking ID on the H616. With the A133 + compatible, bits 15:12 are the CPU bin and bits 11:0 the ICPU + current in units of 0.1 mA. + - description: Chip marking ID. + - description: + Value programmed at production, called PCPU by Allwinner. Bits + 11:0 are used together with the ICPU current to select the speed + grade; their unit is not documented. + - description: + Bin extension. Bit 31 is used to select the speed grade. + + nvmem-cell-names: + items: + - const: bin + - const: marking + - const: pcpu + - const: bin-ext opp-shared: true @@ -132,4 +178,36 @@ examples: }; }; + - | + opp-table { + compatible = "allwinner,sun50i-a133-operating-points", + "allwinner,sun50i-a100-operating-points"; + nvmem-cells = <&cpu_speed_grade>, <&chip_marking>, + <&cpu_pcpu>, <&cpu_bin_ext>; + nvmem-cell-names = "bin", "marking", "pcpu", "bin-ext"; + opp-shared; + + opp-408000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <408000000>; + + opp-microvolt-speed0 = <900000>; + opp-microvolt-speed1 = <900000>; + opp-microvolt-speed2 = <900000>; + opp-microvolt-speed8 = <940000>; + opp-supported-hw = <0x107>; + }; + + opp-1512000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1512000000>; + + opp-microvolt-speed6 = <1180000>; + opp-microvolt-speed7 = <1130000 1130000 1140000>; + opp-microvolt-speed8 = <1100000>; + opp-microvolt-speed9 = <1080000>; + opp-supported-hw = <0x3c0>; + }; + }; + ... From patchwork Wed Nov 18 10:52:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Yadav via B4 Relay X-Patchwork-Id: 4156 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id B0BF71C7D48 for ; Wed, 18 Nov 2026 11:52:30 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27816-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27816-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id CCEDF48931 for ; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999147; b=nfKqNUozQ8pOFrQYAghr+d/ZfQnmwLxZ81AwAF91jsoZqHOxAA4+a8kregeVDyt+6PHv xUeeQXRBykhYeZeLexrNrwPPufca76utZasFbq85VhekjtWGkeWopZ1tG0734u8YWQs7b MtkzNqcogn341lOdCbFyqky1xWqxOY/HvYahPQno9mz8tTA2gQ3uH1pJiZZ5wrn9Ua3iU AyoINMGzhnxWRI6HN22DG5L8go8R4yh0yL9X+9cdmcJ7hqwbjUdqhoiueJAZCqX5IXbBG 8CyRtRZ9NM8Ei9TSXRDwHwXT0r7lL1V6+Oa/WfiWyahwKz0toVfZj45+ujPXnh/g4OA== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999147; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=E3osvfmeF/jQrh3Wedc0Un28ejx+8cAJcxtwjUsQUnc=; b=HSOKGNfQv4FJFnRaJ+JXZOwqrsx5do+APPzPpnCYwkbD1D7eLZ4aGl2+X9nQhyJvhsrr pLl1v+eeV2t8GdCCbrkJGRRnokSOKU1/qWKddhP+TP1bIO3uJhFCwXs12pm9Qc5wC2t1M wyHnxbnW9Pa3Z/JdL0BMsJoK7iYhzbxRMU6bIHSdeS9pjTleS+kIkI6WMeWwAIQ/KzFmJ nhpRr8N/Mm1T27bGjWC0MPSArs2WGa62OOcUygIJhjSol8SBBw+yNRUCyTm4OM6A4bZdF jF8/Yemv7Ym3gbfeZkuLaOt8BCm0HZHV+EQzeIVkw+SJQyTgGdNx7bz5IVOY9/xAjlg== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="KGNY2nH/"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A419560A2601; Wed, 18 Nov 2026 10:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KGNY2nH/ X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999147; b=zGiUmCfLalJBBJD86gDBo3SlRJAbhO2HBJnN5eIUxNUeFc78V6CQTjUiVsPeOZ3O5pAi HW5bFVEQ84qiKlwchxF8PaDkuTYm+l7XQhbohTSryPXoTdh80abBt/pxU7iwLabzNCicl OlPnMO9V1lTa1NPcF5uIzYgzCRSJGxk5S/7JKz9Mt4ojzAB4RcayicdR6Knz8dret0w27 1SX592JKt5wxMymo4NT+/qNHYYDmLCQCHiF3GZRqxn09DpnVygU9j+b2SUXjgcUDS6Tm2 De3fhOWy2pHEVCTpVy/yTlq8iqs37gSKVUcloz1AvckLVtxDGALX0ncn7PMY+JdpSmw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999147; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=E3osvfmeF/jQrh3Wedc0Un28ejx+8cAJcxtwjUsQUnc=; b=bZS9RZ4b6iUcMO6nlDQ7frDrX9L8vdR2mHJOpg622CPECOSZWgDtkWsOOd74aMRSwIPb RG+H/C0SN5VP4INz5iPBtc2+Qic2w48N6NsCI+wEDtQGdg0t+Z+7S1akb9SEQZERQKRgt gB16bV6c1X5X9Iz0QdHtKlviLGKad1RiOxf+UIbaucC5wCdZ8qQsMXydqTcugDD1cvcdj gUX9TEpzs9tLD4jduAleE1BhsHpsqkm/o8T43xT5Ph35J5MWyYhQXMj2ELvvNcV09gJRz q4gQ9uk4mIO3BD69nn0K3NHlRDKqaVTNZdwEOYOgHpDf5t8TGPoGsICLZ2v+198uhPw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="KGNY2nH/"; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 803E6606A33A; Wed, 18 Nov 2026 10:52:27 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794999147; b=KyeEJLZug1bVLrzp9ukOsnDz4NJ3WBQmD9LaDUdlvfUcxErdnInchGVpeDSKK+sm5TtN iq1gUzXazwGLBazJxDGZhjcolnYlqHjAfc3GEqIk3beFCSJr/xMPFEBYulxNXcuEGWG+E 5IPiTCUeY16sCII/K/12BKmSkYTVS9Xn+3GoNcmcWkOMrB+7C9JR9X8V4uRhbwwcX+U0v lyzfkfd0lzqvLeSAwPPwmRK5NefQbfr48xipra/g3MRl9Wj9EYW4z/cOrCPYjyY6N2tcT f0P5W5mdB/iD0dbiPluUERtjWlBL/pJf7tdXqy1r/uyx06jDre5KWvM8oJ5xEpXPgjQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794999147; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=E3osvfmeF/jQrh3Wedc0Un28ejx+8cAJcxtwjUsQUnc=; b=Sipv9VaGTkINXx0fAzF/iyO9Dh2wtOybLo7pJ7PLqmoCEBBGwjM9krvaUMChoBIngtqw 6tdelS/C0l2+fycgMHvCdGKxcB8/HiMz7hvWgrgqAreM9U8r3svqiCWlnA0fxHEY61eL3 5DY/RUhlLyG7+IOnhzDsYEyY0pAh5xhgFPTQ6rvrTA2LRQI0BGy2561dKeB2uSZS0T8YF iXZfZC9+zvjpyK1TszaR7UphvKVpwmG0xDkSndb5ANcJ8xKCGv+3qv2jSGc6I6qo6QS6B J0E6yarlUd/J3TMP7g6OWl+Ca4ppoJfWvcwyLv25OKJtKa8B7+c4tBDsgBHlW+VE+Tw== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id EBFF61F000C6; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794999147; bh=E3osvfmeF/jQrh3Wedc0Un28ejx+8cAJcxtwjUsQUnc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=KGNY2nH/wdEXd9FAhwn/Cf88a0tEcwXRE9VSnO2cqeHhgAUZ6Zy1k2JFi+ZR66mbk wK85vOHBY2K8czhTBOq9qNgiVXyOk51B28jX2dbka4YTo9ZvqhUFRNZJp3/ih4geoH VIA1wnzmrX2JyZfccwJ6wLgaDWOpF7rFARri3IpyBvFSruqAD20MjxkCmwzRLv1Pti 4J5iJNEMl5YYajHx3oHrIrMaZ4xjiENV8wmuFHQsIEifKOMq+RdrGrCdZ0a1JWtCGR xf3CzRIauydj6wJuENzos1GKB8r3j+gYFodoxPZqaguN4R6jE+QUQAbLMGOKgeq0+q UZ3fkCCqYaecQ== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 78CCE4AD14; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) From: Rajan Yadav via B4 Relay Date: Wed, 18 Nov 2026 04:52:25 -0600 Subject: [PATCH v2 2/6] cpufreq: sun50i: Move nvmem cell reading into a helper X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261118-a133-series-v2-2-8bcec9c9aadf@gmail.com> References: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> In-Reply-To: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> To: Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , "Rafael J. Wysocki" , Viresh Kumar , Andre Przywara 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, Alexander Sverdlin , Cody Eksal , Paul Kocialkowski , kernel test robot , Rajan Yadav X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794999144; l=3315; i=rajanyadav0307@gmail.com; s=20261103; h=from:subject:message-id; bh=vQMAtGZJDRtx69UU5Evyhp22Ohka9g8vqRSa6Av0uww=; b=/iR630XagWCGKfxs4w50SDK7/FVOhyuA5FzDZPxddcU6aWe/8piODyfVMs7rA3b/D4urOCi82 64oUMcsnWoBAn6Jv6brrnV5NomY/KceOQyiYDxirESf4l6e+iIJd57/ X-Developer-Key: i=rajanyadav0307@gmail.com; a=ed25519; pk=4ZPeiP5qrv2b44q/Obxi2koUS70Q6npbttJnpUoTlgg= X-Endpoint-Received: by B4 Relay for rajanyadav0307@gmail.com/20261103 with auth_id=1391 X-Original-From: Rajan Yadav Reply-To: rajanyadav0307@gmail.com X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.21 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; HFILTER_HELO_IP_A(1.00)[sea.lore.kernel.org]; R_DKIM_TEMPFAIL(1.00)[kernel.org:s=k20260515]; MID_RHS_MATCH_TO(1.00)[]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; RSPAMD_EMAILBL_FAIL(0.00)[alex.sverdlin.org:query timed out,lkp.intel.com:query timed out,rajanyadav0307.gmail.com:query timed out]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[24]; FREEMAIL_REPLYTO(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,sverdlin.org,epochal.quest,sys-base.io,intel.com,gmail.com]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[devnull@kernel.org,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27816-noreply=patchwork.local,rajanyadav0307.gmail.com]; TO_DN_SOME(0.00)[]; MAILSPIKE_FAIL(0.00)[172.234.253.10:query timed out]; R_SPF_DNSFAIL(0.00)[temporary DNS error]; FORGED_SENDER_MAILLIST(0.00)[]; MSBL_EBL_FAIL(0.00)[alex@sverdlin.org:query timed out,lkp@intel.com:query timed out,rajanyadav0307@gmail.com:query timed out]; DKIM_TRACE(0.00)[kernel.org:?]; MIME_TRACE(0.00)[0:+]; FREEMAIL_TO(0.00)[gmail.com,kernel.org,ti.com,sholland.org,linaro.org,arm.com]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; RCVD_TLS_LAST(0.00)[]; HAS_REPLYTO(0.00)[rajanyadav0307@gmail.com] X-Rspamd-Queue-Id: B0BF71C7D48 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Rajan Yadav The A133 speed grade needs several efuse cells, but the cell reading is open coded in sun50i_cpufreq_get_efuse() for a single cell. Move it into sun50i_cpufreq_read_cell(), which takes the cell name, so the next patch can read the A133 cells by name. No functional change: the existing users read the first cell, as before, with the same length check, byte order and error message. The raw bytes are now held in a __le32, the type le32_to_cpu() expects, which also removes the sparse warning "cast to restricted __le32" that the kernel test robot reported. Claude Code (Anthropic) drafted this refactor and its message; I reviewed and tested it. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202603021703.aBD0w99y-lkp@intel.com/ Reviewed-by: Alexander Sverdlin Tested-by: Alexander Sverdlin Signed-off-by: Rajan Yadav --- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 55 ++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index 9261d148a16..34c0897c22c 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -31,6 +31,34 @@ struct sunxi_cpufreq_data { u32 (*efuse_xlate)(u32 speedbin); }; +static int sun50i_cpufreq_read_cell(struct device *cpu_dev, + struct device_node *np, const char *id, + u32 *value) +{ + struct nvmem_cell *cell; + void *buf; + size_t len; + __le32 tmp = 0; + + cell = of_nvmem_cell_get(np, id); + if (IS_ERR(cell)) + return dev_err_probe(cpu_dev, PTR_ERR(cell), + "Could not get nvmem cell\n"); + + buf = nvmem_cell_read(cell, &len); + nvmem_cell_put(cell); + if (IS_ERR(buf)) + return PTR_ERR(buf); + + if (len <= 4) + memcpy(&tmp, buf, len); + *value = le32_to_cpu(tmp); + + kfree(buf); + + return 0; +} + static u32 sun50i_h6_efuse_xlate(u32 speedbin) { u32 efuse_value; @@ -191,12 +219,9 @@ static bool dt_has_supported_hw(void) static int sun50i_cpufreq_get_efuse(void) { const struct sunxi_cpufreq_data *opp_data; - struct nvmem_cell *speedbin_nvmem; const struct of_device_id *match; struct device *cpu_dev; - void *speedbin_ptr; - u32 speedbin = 0; - size_t len; + u32 speedbin; int ret; cpu_dev = get_cpu_device(0); @@ -214,25 +239,11 @@ static int sun50i_cpufreq_get_efuse(void) opp_data = match->data; - speedbin_nvmem = of_nvmem_cell_get(np, NULL); - if (IS_ERR(speedbin_nvmem)) - return dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem), - "Could not get nvmem cell\n"); - - speedbin_ptr = nvmem_cell_read(speedbin_nvmem, &len); - nvmem_cell_put(speedbin_nvmem); - if (IS_ERR(speedbin_ptr)) - return PTR_ERR(speedbin_ptr); - - if (len <= 4) - memcpy(&speedbin, speedbin_ptr, len); - speedbin = le32_to_cpu(speedbin); - - ret = opp_data->efuse_xlate(speedbin); - - kfree(speedbin_ptr); + ret = sun50i_cpufreq_read_cell(cpu_dev, np, NULL, &speedbin); + if (ret) + return ret; - return ret; + return opp_data->efuse_xlate(speedbin); }; static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) From patchwork Wed Nov 18 10:52:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Yadav via B4 Relay X-Patchwork-Id: 4159 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 17D1A1C7D4D for ; Wed, 18 Nov 2026 11:52:33 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27817-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27817-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id DB3B648B29 for ; Wed, 18 Nov 2026 10:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=K5nbJ3Tyi4V3wQ97lQF5s8dX3sflIuwQtpNIldP92yi3uU9KDwY32Db2lWLlsMy8+vXI iU1M1NwOv7Uctiqsl4idCGsul+kP5urSfpoXG4Ff3ON2fonuzHo19f5kVLqKinvpBjOKA McAAQvo16Ca9tdaoOOGLVmkWvh9M3Qm0LFhNwidRCjOIi2bvA/NfjVwTioHuy1ezRi5er PoWd+tNG7L0mBiP3hCenFs2tshBtUYc3c58ZVgFqXY1jkDH5mhaLUIVKJT1vmr8t40yGr sHoO05AIFSCVeqXuxaC40mKKh/VunOwvvImTJW/WHZwG+FS6YvYfmFhv/C2xAXOlcdA== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=QlGcfLij8av6qp98RVpWyQQewfFODrr+GkYipOKWbyE=; b=qMF/lD22UzarPOTIA6vTDeStmWz9qH1YOrj6whD9fslBRD/eKYvWmDHDxPMPL/R2jcT5 4IWLteU+FOA9EnRu+qniusGcUWT9+wmr4vnYZpvi37Mg78DlT50kSf2V2As1WxEevnR5u EbJ7t6hrBAPMXT3UldNn/h+NK5Pu58sCjndqH2xLJDyPKl9csEZ7n7AmAXpL66244KB6s g9/DuF8pgjgowBUNpJl0WD82+FbVZ9mw6LazoOCInqBYcJrPUI8s0DKlixXDnV4AhMd0/ nfo8pyywWsnVvQdgO+PRLVVyaJBPFaOfJUjPPRr90XROacOv4OARvxTKs4lAt1c5Wzw== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Vxe1pz0A; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2685960A2610; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Vxe1pz0A X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=tJsaRVpjAaO+OaQ1gsc9RxMflOHizoeh2RyB7UPxMSsFNk9/rvAf5ES8kPVsJevMq0Fs fsQKz5g7t1yItsJyXWlGWx+F/N/ODNwPg0lZgIDp9c8kLfBKFl3XCUkGM5tDVZCioy1h9 666AFyUHqQbZ4tify2BvxZ6gFJjfX1bgtR2ADwEu9hbwexJO/uksF75QbYSdBG2eYKbzz 0NT8NyQlYAheNOnzy0mCNua3hQOQd00cmyoljmUuTP9bWl+cocJNPh2HWnrdM5bmFyTz6 xlorEzcStNoSJnOFFpr16azMg7fG1zVsSpDUwa4131wlPRMuGSxrsHO5tI5ZkSBDPgw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=QlGcfLij8av6qp98RVpWyQQewfFODrr+GkYipOKWbyE=; b=ZEm7Od+/WBsQLmazAKf1Kzsvv4TOw3FU9+U0HaAXDBByLjHOarmHAkW5moZ/tMXeETWg RQ1cv4Y/1tXHCaCDBrBExPGWc/Bnyid7s4V+nIKwfQZ+BPdH1Xwl0Rxk4t8vD8V/xFhwc WrkY2EY+mEHwHW9HMvcB2IJgVPw2FM/Vkf6eq/pcKNPrJ1XyuZOyXbxMI0NI6stXKL9Se o/Nf/OMfMEdXg+6RD0roR1AChZbES5UlBC8bpvSDINlMmELSSb5mJoMX8L5qSfsnPPi+4 bHgf9SqbUIDb/1hNvjLyLGSk8Hm8lGSMWZvne/BUnV+Oyl/ZVma65iZwqEnhQif4Cyw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Vxe1pz0A; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04BCE60A260B; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794999147; b=necjqn/kcZnnEpnF/o0RUHwablR0PIw9rVE49jCaOxichLNAKcyhGrslGb4VI+fpTXgG HQQclSYGyiLey1kqHm1Wb+Am5fybxa3pOT38DMm58MAw1IUhHYAzeNQodOtYsnvZdSIJi BYtmOZXSaisIy4EgS8LHzxNUxDJLAOWQQ+w96ZuBwUTc/lozT6bwE47XLQ7KLi82Pffs/ CUa9pSe9NUPbD8jUKYF08UIrBdrfoMHbys9wB5qoooBRLHFEq1Na6llBxVUpv+GW0FX1z 1BYuVMh3juy3MFj2RBxnZ1u2NRv6TTYjidHVUEGG+AVuYsMQmNS2dgkNLm2dI+N/bZQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794999147; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=QlGcfLij8av6qp98RVpWyQQewfFODrr+GkYipOKWbyE=; b=xe/vK6JoDuj533MGkdt9DLJu8aYUjCMwzY3WwPStgaixz8iLLPyWK5lucNcwzlRfymVl kn0H7FCqK9NSpo0RqkKC5CuyjclNTrBxF7hjrK4HIHJMuZjKqRRHInr0Dx8vjdhy6czl5 9wIWfoE/JZeuD6dnwcv3uiquclsj0jA0K5cql+eWTg+JfT4C0Tdl/FdzC599MS0wAFcOH u5HvQimAwFKqRag1jOzguvPcFJhPij4cHkfPZdBYhedtybhFfovMipNXYOBC6r1md9fAJ BrcMAwQx16SUc3AsWsKRncfWmH2Gz6dDjnXTSuNpuo6uqfOyWOXP/hsGFIpvJKhPBMw== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id 0E77A1F000C7; Wed, 18 Nov 2026 10:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794999147; bh=QlGcfLij8av6qp98RVpWyQQewfFODrr+GkYipOKWbyE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=Vxe1pz0A5n7uiLflHzSUepJFn7J1YYiXCOgRZAQt0TzEQQ1scrHSdz91vPJhZSopm BPBhsK8kD+fpt5EWXtpE44d9nG9TzhmVb6hfaH7SfYrOh6eTBBIAUz9K+ueH0U+l3e /WeG6qdy2Ch2pt14V2xOHWDtDqv5s0wrFBCR9A/l5Bnn8zPVRcxwdD+eDhYC+Lk7Jr lhQMocB/kN2zOey0oCBDLLOi3VVRYo5OHdTuK3ZghdwGAUlAv80cBkjo+uyBU1hB9b mRkc1rBalWBF9cjVA9h1o2EVgQ1AZvQrccfSLRL7HwfR9i1yhNkxls57JIe8aGVoDY QYVwoqA1ZY0UQ== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 901834AD18; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) From: Rajan Yadav via B4 Relay Date: Wed, 18 Nov 2026 04:52:26 -0600 Subject: [PATCH v2 3/6] cpufreq: sun50i: Add A133 speed grade detection X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261118-a133-series-v2-3-8bcec9c9aadf@gmail.com> References: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> In-Reply-To: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> To: Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , "Rafael J. Wysocki" , Viresh Kumar , Andre Przywara 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, Alexander Sverdlin , Cody Eksal , Paul Kocialkowski , Rajan Yadav X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794999144; l=10249; i=rajanyadav0307@gmail.com; s=20261103; h=from:subject:message-id; bh=6Dawq9ZI2QbNXLM3j+DGg6oB3gIXo6g8Z6P1BQubvD0=; b=mgQyEEDCU7go+fJVJSj/x5WI5X9C9iIUqV0SqsXRIcIZbbO9zqQ4v8mBs8P+W8whAI7ukoffL kPGYD4rOlCxCFv6OmLLWlAmSpTF+MKdoEioPyq1zPq6sLDuOnr6zaRO X-Developer-Key: i=rajanyadav0307@gmail.com; a=ed25519; pk=4ZPeiP5qrv2b44q/Obxi2koUS70Q6npbttJnpUoTlgg= X-Endpoint-Received: by B4 Relay for rajanyadav0307@gmail.com/20261103 with auth_id=1391 X-Original-From: Rajan Yadav Reply-To: rajanyadav0307@gmail.com X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Rajan Yadav The A133 is handled as an A100 today: only the CPU bin field at SID offset 0x1c is read, which gives one of three A100 voltage tables. The vendor BSP for this family (sun50iw10) selects one of 11 grades from the chip marking ID, the CPU bin, the ICPU current, the PCPU field, a bin extension bit and the die revision: - "high speed" marking IDs use the b0-b3 grades, which have 1416 and 1512 MHz instead of 1464 MHz - the other parts use a0-a6 - die revisions 0, 3 and 4 ("A-E") use different grades from all other revisions ("F and later") - revision A-E normal parts with ICPU and PCPU within fixed ranges use a0 On a KickPi K5C (A133, marking 0x1400, bin 0b010, revision 6), the BSP selects b2: 408-1512 MHz with 1.10 V at 1512 MHz. Mainline selects the A100 speed1 table instead. So the chip runs 40 mV below the vendor voltage at 408-816 MHz and 40 mV above it at 1200 and 1320 MHz, and its top OPP is 1464 MHz at 1.18 V instead of 1512 MHz at 1.10 V. Grades with 1416 and 1512 MHz cannot be described at all. Add the vendor selection for the new A133 OPP compatible. a5 and a6 share their voltages, so the 11 grades map to speed0-9: index: 0 1 2 3 4 5 6 7 8 9 vendor: a0 a1 a2 a3 a4 a5/a6 b0 b1 b2 b3 The die revision comes from SMCCC SOC_ID, as for the H616. On the A133 this needs TF-A with the sun50i_a133 platform, added in commit a584e8632a7a ("feat(allwinner): add support for allwinner A133 SoC") and not yet in a release; it reads the same SYSCON register as the BSP. Neither the A-E nor the F grades always have the lower voltage (for the same bin, A-E is mostly lower or equal up to 816 MHz and higher or equal from 1008 MHz). So without SOC_ID the driver keeps the A100 selection, as before, adds the BSP's a0 rule for normal parts, which never lowers a voltage, and warns. Revision F parts then still run 20-40 mV below the vendor voltage at 408 and 600 MHz, some of them also at 816 MHz. The error message for a missing named cell now names the cell. Testing: - the function, built on the host from the driver source with stubbed cells and revision, matches a transcription of the BSP rules for 120,960 combinations of boundary and typical field values, and gives the A100 selection with the BSP's a0 rule when the revision is unknown - on the K5C it selects b2; the vdd-cpu regulator reads 0.94 V at 408 MHz, 0.96 V at 1008 MHz, 1.06 V at 1416 MHz and 1.10 V at 1512 MHz, as in the BSP table - one hour of full load held 1512 MHz without throttling (max 79 C, with the 90 C trip from the A100 thermal trips patch) - with the revision forced to unknown it warns and selects speed1 - the same kernel with the A100 OPP table gives the same OPPs as before - a missing cell fails the probe with an error naming the cell, and the system keeps running without cpufreq Claude Code (Anthropic) drafted this patch and its message from the selection rules in the vendor BSP cpufreq driver (no code copied) and from my test results; I reviewed and tested it. Suggested-by: Andre Przywara Reviewed-by: Alexander Sverdlin Tested-by: Alexander Sverdlin Signed-off-by: Rajan Yadav --- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 162 ++++++++++++++++++++++++++++++++- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index 34c0897c22c..6bccea2887b 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -27,8 +27,10 @@ static struct platform_device *cpufreq_dt_pdev, *sun50i_cpufreq_pdev; +/* Exactly one of the two callbacks is set */ struct sunxi_cpufreq_data { u32 (*efuse_xlate)(u32 speedbin); + int (*get_speed)(struct device *cpu_dev, struct device_node *np); }; static int sun50i_cpufreq_read_cell(struct device *cpu_dev, @@ -41,9 +43,14 @@ static int sun50i_cpufreq_read_cell(struct device *cpu_dev, __le32 tmp = 0; cell = of_nvmem_cell_get(np, id); - if (IS_ERR(cell)) + if (IS_ERR(cell)) { + if (id) + return dev_err_probe(cpu_dev, PTR_ERR(cell), + "Could not get nvmem cell %s\n", + id); return dev_err_probe(cpu_dev, PTR_ERR(cell), "Could not get nvmem cell\n"); + } buf = nvmem_cell_read(cell, &len); nvmem_cell_put(cell); @@ -152,6 +159,149 @@ static u32 sun50i_h616_efuse_xlate(u32 speedbin) return value; } +/* + * A133 speed grades, as selected by the vendor BSP (sun50iw10): a0-a6 for + * normal parts and b0-b3 for "high speed" parts. a5 and a6 have the same + * OPPs and voltages and share an index. The index is the N of + * opp-microvolt-speedN and the bit in opp-supported-hw. a0-a2 have the + * same voltages as the A100 speed0-speed2. + */ +enum sun50i_a133_grade { + SUN50I_A133_GRADE_A0, + SUN50I_A133_GRADE_A1, + SUN50I_A133_GRADE_A2, + SUN50I_A133_GRADE_A3, + SUN50I_A133_GRADE_A4, + SUN50I_A133_GRADE_A5, /* also a6 */ + SUN50I_A133_GRADE_B0, + SUN50I_A133_GRADE_B1, + SUN50I_A133_GRADE_B2, + SUN50I_A133_GRADE_B3, +}; + +#define SUN50I_A133_MARKING_MASK 0xffff +#define SUN50I_A133_BIN_SHIFT 12 +#define SUN50I_A133_BIN_MASK 0xf +#define SUN50I_A133_ICPU_MASK 0xfff +#define SUN50I_A133_PCPU_MASK 0xfff +#define SUN50I_A133_BIN_EXT BIT(31) +#define SUN50I_A133_REV_MASK 0x7 + +/* + * The BSP runs revision A-E normal parts at a0 when both the ICPU current + * (in 0.1 mA) and the PCPU field are in these ranges (upper bounds + * exclusive). + */ +#define SUN50I_A133_ICPU_A0_MIN 84 +#define SUN50I_A133_ICPU_A0_MAX 160 +#define SUN50I_A133_PCPU_A0_MIN 2900 +#define SUN50I_A133_PCPU_A0_MAX 3100 + +static bool sun50i_a133_force_a0(u32 icpu, u32 pcpu) +{ + return icpu >= SUN50I_A133_ICPU_A0_MIN && + icpu < SUN50I_A133_ICPU_A0_MAX && + pcpu >= SUN50I_A133_PCPU_A0_MIN && + pcpu < SUN50I_A133_PCPU_A0_MAX; +} + +/* Marking IDs that the BSP treats as "high speed" parts */ +static bool sun50i_a133_is_high_speed(u32 marking) +{ + switch (marking) { + case 0x0200: + case 0x0600: + case 0x0620: + case 0x0640: + case 0x0800: + case 0x1000: + case 0x1400: + case 0x2000: + case 0x4000: + return true; + default: + return false; + } +} + +static int sun50i_a133_get_speed(struct device *cpu_dev, + struct device_node *np) +{ + u32 marking, bin_cell, pcpu, bin_ext, bin, icpu; + enum sun50i_a133_grade grade; + int ver_bits, ver; + bool before_f; + int ret; + + ret = sun50i_cpufreq_read_cell(cpu_dev, np, "marking", &marking); + if (ret) + return ret; + ret = sun50i_cpufreq_read_cell(cpu_dev, np, "bin", &bin_cell); + if (ret) + return ret; + ret = sun50i_cpufreq_read_cell(cpu_dev, np, "pcpu", &pcpu); + if (ret) + return ret; + ret = sun50i_cpufreq_read_cell(cpu_dev, np, "bin-ext", &bin_ext); + if (ret) + return ret; + + marking &= SUN50I_A133_MARKING_MASK; + bin = (bin_cell >> SUN50I_A133_BIN_SHIFT) & SUN50I_A133_BIN_MASK; + icpu = bin_cell & SUN50I_A133_ICPU_MASK; + pcpu &= SUN50I_A133_PCPU_MASK; + + /* + * Neither the revision A-E nor the revision F grades always have the + * lower voltage, so there is no safe guess without the revision. + * Keep the A100 selection then (a0-a2), which these SoCs used so far, + * plus the BSP's a0 rule for normal parts, which never lowers a + * voltage. Revision F parts then still run 20-40 mV below the vendor + * voltage at 408 and 600 MHz, some of them also at 816 MHz, and "high + * speed" parts get 1464 MHz instead of 1416 and 1512 MHz. + */ + ver_bits = get_soc_id_revision(); + if (ver_bits < 0) { + dev_warn(cpu_dev, + "SMCCC SOC_ID not available, using speed grades a0-a2\n"); + if (!sun50i_a133_is_high_speed(marking) && + sun50i_a133_force_a0(icpu, pcpu)) + return SUN50I_A133_GRADE_A0; + return sun50i_a100_efuse_xlate(bin_cell); + } + + /* + * The BSP treats revisions 0, 3 and 4 as "A-E" and all others as + * "F and later". + */ + ver = ver_bits & SUN50I_A133_REV_MASK; + before_f = ver == 0 || ver == 3 || ver == 4; + + if (sun50i_a133_is_high_speed(marking)) { + if (bin == 0b100) + grade = before_f ? SUN50I_A133_GRADE_B1 : + SUN50I_A133_GRADE_B3; + else + grade = before_f ? SUN50I_A133_GRADE_B0 : + SUN50I_A133_GRADE_B2; + } else if (!before_f && (bin_ext & SUN50I_A133_BIN_EXT)) { + grade = SUN50I_A133_GRADE_A5; /* a6 */ + } else if (before_f && sun50i_a133_force_a0(icpu, pcpu)) { + grade = SUN50I_A133_GRADE_A0; + } else if (bin == 0b100) { + grade = before_f ? SUN50I_A133_GRADE_A2 : SUN50I_A133_GRADE_A5; + } else if (bin == 0b010) { + grade = before_f ? SUN50I_A133_GRADE_A1 : SUN50I_A133_GRADE_A4; + } else { + grade = before_f ? SUN50I_A133_GRADE_A0 : SUN50I_A133_GRADE_A3; + } + + dev_dbg(cpu_dev, "marking 0x%04x, bin %u, revision %d: speed grade %d\n", + marking, bin, ver, grade); + + return grade; +} + static struct sunxi_cpufreq_data sun50i_h6_cpufreq_data = { .efuse_xlate = sun50i_h6_efuse_xlate, }; @@ -160,6 +310,10 @@ static struct sunxi_cpufreq_data sun50i_a100_cpufreq_data = { .efuse_xlate = sun50i_a100_efuse_xlate, }; +static struct sunxi_cpufreq_data sun50i_a133_cpufreq_data = { + .get_speed = sun50i_a133_get_speed, +}; + static struct sunxi_cpufreq_data sun50i_h616_cpufreq_data = { .efuse_xlate = sun50i_h616_efuse_xlate, }; @@ -171,6 +325,9 @@ static const struct of_device_id cpu_opp_match_list[] = { { .compatible = "allwinner,sun50i-a100-operating-points", .data = &sun50i_a100_cpufreq_data, }, + { .compatible = "allwinner,sun50i-a133-operating-points", + .data = &sun50i_a133_cpufreq_data, + }, { .compatible = "allwinner,sun50i-h616-operating-points", .data = &sun50i_h616_cpufreq_data, }, @@ -239,6 +396,9 @@ static int sun50i_cpufreq_get_efuse(void) opp_data = match->data; + if (opp_data->get_speed) + return opp_data->get_speed(cpu_dev, np); + ret = sun50i_cpufreq_read_cell(cpu_dev, np, NULL, &speedbin); if (ret) return ret; From patchwork Wed Nov 18 10:52:27 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Yadav via B4 Relay X-Patchwork-Id: 4157 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id B95F51C5989 for ; Wed, 18 Nov 2026 11:52:31 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27818-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27818-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id B906F47D77 for ; Wed, 18 Nov 2026 10:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=gb+BK8BTWppjl2/N+GyeO90z9CBctAbVK5U5aBIkwXlZI5k1TGwXTpaY7An1rALGGOBZ JRy5gioIc9h+Jk8NJiMB/DZQSyHS6sNPvkcFgJWwtj+WBftj14nfuwsC4OdS0b/CxNLqb rQ0YgBo40/NQMOZtCARAZHnEloBMHHbUwwPv1Qy294io+TZv7vRGp//XreSKkc+dzVENL vvgob4Jc5zLf0rPA5kcnTqkYs1oRV/sRPjl7Zlis87zbBW9LlooDx17T+nHoQdMXGxi69 O6ol+EvXEnfDtjIVm/NkRQUCz9rweqs97ycGsQoLK0pIpzitipoestSWshySWM2lW3w== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=xrAEk6/4WGNXDqt6SdPWcxivaPvWRQHVDKqiBuuVVeE=; b=EU1wVe2UnFGzTAq6lBSJKT1+rZnTnn0iS+pShQ3jv3rNVbNbIVK9J75F9K0JTQzsw6bX niAVTjb210L/qM6TNAx357LNF6++w2pmQoPw2XNPtPNFokJvZocpRrosSd/cNS7OsIOCG 6oxKpylCQpM3DvvvZOV4xl8mLvfOOIGI0O/QZHR5h0z1VIBulW2LbBoWNK/InT9sP2I54 va6sdbftox4cC6ysMtcxDFmrv0hj7CRiZIDFKgC2qz6CoHr2NB54dnfcy4l4W3xnd859m jXOjo/ebb4l0nZzsSo/Yx0w0TU9wfzJY/ZqTFsW5PN2E6SBE1bp4+o5F/plY2G2ygoQ== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FLmSuKsn; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44D1860A2618; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FLmSuKsn X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=337KuU6qDM3HLvXDHqdpcLlR8HbPEk2P6/L1gcm3rtaIMw8JygKky6mvLswx0nBAJg0W n64cnwqIcveQ9EIztH89i1xTNZwlki/4tzEgRMHwj9aDmGCe9lw9kd8wMIFzM6kTuQyEH RxE2cPOPfaYnHX/4VFaXTWZbcnX71wkswvS4zJ4wf1RNQ/nMA6RInreg/uMAyB4WVoKuh CkrQjXSqobBEw3M8n/3gMCTmN9rIl/wr1efntQKobdBTTpm9E1i/IJi1PRQuB973Sxpxq fwuFAujGNoY4TxUxA0nBH2wZW8wmmKlD3dwNQkjc5QfZ0t5j2YCCepBfSmV6JlPeLpA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=xrAEk6/4WGNXDqt6SdPWcxivaPvWRQHVDKqiBuuVVeE=; b=dm1xJIBSwIO9J72g7PVB2SEx5eKYen5+IMa1i0Iy4Q4boavD7habYv+KxyZVVF+flKvA aENpeMqs0X6jBsw33w/sHd6FfgttdEq0GOvXYml5oT+pMK5iPQxztxfEY2dK4HhHc59Q1 2vL1jkHKQtA8C7E+SfA1kQqCbn9uGwr4a7VURIBsDjXZjAN6Ov689wF/11RZJ7lcQZBy9 g4dOYTT/rCf89vHoxcFIyGkcC+eyEuzfrpIqFVko2xctI3EOz/4mHhqJmzjCu6GVl3ENn mp04xlILt0DYAYT3QcYZlXNNZ+ymI6YqVmPyyh53vPUweFX/R1G40Hia3vrw9lCJ0jg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FLmSuKsn; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20E3660A260D; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794999148; b=mg8UbZCYxgwekOA0F1e5ThM4Etrp+N/FjM4oMu5xIbuQkTUSgu50fpZH0iPIXvEpph+X hDRXDn9ybpwKAziPKoHxstjQyhkYBfNpSDdU8+SDY/HcYViw4oIkEGG8iStDFNpGoi1tj 3uQLHCxJRCfdDGZicCU4Wisn1xV6monq5jBZFzf6nL1TbvZpZbOwn+QO8NrOoRmD/pMD9 uOxdLmsFxXzyH+pUVQ+9A0k9Ze0fUsI0RxvlduvcgGFW+aQ72HYWAJ/L5hNu3aGySyWER Eq8YPbBv6QEqQm0BRGvROISrMccMc9+EAE+8rNG9YfkQKnojpI3hc2rUXd/1QbS98zg== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=xrAEk6/4WGNXDqt6SdPWcxivaPvWRQHVDKqiBuuVVeE=; b=rW8aq4KbrhhZDyd3vQmXjVbsbZ+o7LDKu/3qcHNY342OuQSZa0HczBZPRSGSrFlsroTS aLTEOw85Xl/p6zL/b3jHYdg7RP8XdU1GR57WsSEKApHxSScpTypkMgTcrqW1VyNl/1JYd /ZFaSz5rlYnRtYNSujtcI0JC4QEGfUQWDtXDkAhiEsSQx4etxK6AnN3b9R5sWXjF5F1SC /KQcKzb3Xtaao55kDkmbFXb61ajamNteNFxCGqJvWepRITwYk9SsWzDXjpsaQi7iMRcGu GpVvI4+j0mAZZm0/cdqw3tpufRGgCztPmYK/kqeowCquEodHfi8g9MpfCSFNpisnhuQ== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id 2736E1F000C8; Wed, 18 Nov 2026 10:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794999147; bh=xrAEk6/4WGNXDqt6SdPWcxivaPvWRQHVDKqiBuuVVeE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=FLmSuKsn0a8nrabKv3rbcj8Q7aPeYDxgKLK4EBmfDubuBX3Ym6U5yevh55ttN4/49 WO4rLPEprjk7HPS1Dga5CaaIk8Ag7E0SQHyB4e2XSy/GBRtuyVI6jKHhORQbsMvhJ4 QSuXzEksAZ8rGlwlgZjCyoYZzuU9u3XEo9T5P+ArPukkedHfw1uEbW4pfpvq1J/Duj qsawcGSbje4wxV2a47M9u66T3fvs+kumYQ1u0JmGUdgClnD8qavsdJORXWHvn3Wdlj /6X3+Cmv5aJrFl0hCvRwhmkfJICZgBT3yUyAfZSckZ6KXhmemk5uy9ZZ5MF3Sil/Xa 4h96mY/HElIhw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id A75664AD1C; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) From: Rajan Yadav via B4 Relay Date: Wed, 18 Nov 2026 04:52:27 -0600 Subject: [PATCH v2 4/6] arm64: dts: allwinner: a100: Add A133 speed grade efuse cells X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261118-a133-series-v2-4-8bcec9c9aadf@gmail.com> References: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> In-Reply-To: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> To: Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , "Rafael J. Wysocki" , Viresh Kumar , Andre Przywara 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, Alexander Sverdlin , Cody Eksal , Paul Kocialkowski , Rajan Yadav X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794999144; l=1665; i=rajanyadav0307@gmail.com; s=20261103; h=from:subject:message-id; bh=QDA+B3vGjPJfqlQByEbIUmG8/8wRVGARGoza4DrglDc=; b=hKLNDqmnQeDuJKQ7lx/vsNw7nGNI8PDmyb6Eo9Oy/s3ocVt9hvtNz/XziotlRlyPxC7g9ztRC F8W7C4Be9nyCsMkCNgx/hxLqbVshw8HalMmPmMOMJ7gBbd1MQThH8UG X-Developer-Key: i=rajanyadav0307@gmail.com; a=ed25519; pk=4ZPeiP5qrv2b44q/Obxi2koUS70Q6npbttJnpUoTlgg= X-Endpoint-Received: by B4 Relay for rajanyadav0307@gmail.com/20261103 with auth_id=1391 X-Original-From: Rajan Yadav Reply-To: rajanyadav0307@gmail.com X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Rajan Yadav The A133 speed grade selection also needs the chip marking ID (SID offset 0x00), the word at 0x20, whose low 12 bits the vendor BSP calls PCPU, and the word at 0x28 with the bin extension bit. Add nvmem cells for them at the offsets the BSP uses. The H616 reads the same kind of marking ID at offset 0x00 as its speed grade. The cells are used by the A133 OPP table added later in this series; the A100 OPP table keeps using only the existing 0x1c cell. Claude Code (Anthropic) drafted this change and its message from the vendor BSP device tree; I reviewed it and checked it with dtbs_check. Reviewed-by: Alexander Sverdlin Tested-by: Alexander Sverdlin Signed-off-by: Rajan Yadav --- arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi index ba6020989ce..d1164f3b549 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi @@ -176,6 +176,10 @@ efuse@3006000 { #address-cells = <1>; #size-cells = <1>; + chip_marking: chip-marking@0 { + reg = <0x0 0x2>; + }; + ths_calibration: calib@14 { reg = <0x14 8>; }; @@ -183,6 +187,14 @@ ths_calibration: calib@14 { cpu_speed_grade: cpu-speed-grade@1c { reg = <0x1c 0x2>; }; + + cpu_pcpu: cpu-pcpu@20 { + reg = <0x20 0x2>; + }; + + cpu_bin_ext: cpu-bin-ext@28 { + reg = <0x28 0x4>; + }; }; watchdog@30090a0 { From patchwork Wed Nov 18 10:52:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Yadav via B4 Relay X-Patchwork-Id: 4158 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 6DD021C5930 for ; Wed, 18 Nov 2026 11:52:35 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27820-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27820-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 9DCA8482CF for ; Wed, 18 Nov 2026 10:52:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=ACZsX6KV4FgCR5kji6Bx8BBXl9gT4sk+Ylm7DUM7RI3a9NqlIiSpMvhXoFVPEIdgdjwS 13DfIVhk5KuDiMZ3ZKIdx36cU9lxNmhlfIJ1z9aEydMBZGSjfapWaCPtZyvPHJyxjIo9b i6q5Torki6ULCSGN7PtgWaEFvfuVlCbg3igpS+17AFmZp31HyUjzqfkcoAs38gkdFFi+T dIddnn0+pH7uxDz3vtgc9rfx/YPRGxS4VnnBCs9jW0UYBPAG8v1kQ6coL0cmoTKvTpNzO 1yMbMwDWn5gx+29Z5Nkli007YuzBRhixMo2Gs22tgxWKMs52KmqF1Za0hHHZG+7oO1A== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ekSWlwMFYCJb5CWNs9PahwiZ4lvhB0X9D5Up2UC4Rjo=; b=omrjQGbgeiLVIemTVOfGOEbD/Xy5Zc/Xer8CUpf9Zf864WlTlO1dh1wsWGmeA3Io5RLb Zna6f5ZFLgVuL8AQxuIieqsV/J5NCs6QlnhAL3NoA+GvhJCLaXphgiF9VIZFtq+/CajMC GqySco5mwuXQaGHiV4CdFF2xiO2m4lRA+7K5HterehVtklwT100UtYtaUkrCkC+/BQsdf q6DfAR2hQJfnTP28QC72oytCx13qBARM6qMzpR9skQITnnSlX2jW9SWb5b1dv9hJan/6z R2J2NA3fFN01IwO5LQNKPp+bZjlTByPZck3UsF46vaCXo/tg1QKGxUbh5Mm5bGEHFQw== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="T08J5mk/"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9672B60A2631; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T08J5mk/ X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=LV13a3kuDLeflhBE//Yf8gqsQ9XZoYxt+5F6cpwe0Xwm/XtILH/+K6y7JiuaIifKJgjl hCzLtiLLi2HTCSLbwMrgK6rXAvFk6DKfkDYlqsiuIetEqgmeueNTFoAup2nXmGtyzuUOx wlu4KJOakkuS/9xQepL46ekojMtq50lHojYBlSiFDQbMuhivJ/jeFkmEI7MKNMunYHzsy VAdKb021W89H+q2jwYQNWc+mBC+qVnwS9eaJqqRo85xN47UgCa6gF8xNSZAhUMqKNXe5W BKL1pGL7FbqwG4/6X7z3icaQ4ReWC30rhhsfUb9xTwI3pksFZuMwiPt4kzDcaVluEUw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ekSWlwMFYCJb5CWNs9PahwiZ4lvhB0X9D5Up2UC4Rjo=; b=MzZ5a28bn/59chOD3ycXuIPVqRjN4vrU+NfiKXwG2+z4eqEs+Ps2uXKeHpzLFSDy7sZB 2miu+VR4OBWzpWohkL9hR52pNDbk5JQ7lhi3ZOrvOvLjSsmceMZBjlbT00+7KQog2UDQs kTkQ3GlGdTKWIJiqdUEEeQD7a/hVDegq5o8P+BnP7O9WyanbjIzpb7zc4wng82z9FqJiw iSRETUZLSWjQmWf7KpeTdY0wiWJzLAPPzA3L/jG5qoJSML7y8ZK4V+x4gy8dacOpDHRSL HOsKdxMf+zqOmAzakUv84NYPVpUnvm5SKXFQjFw3qIco4mHpcdJi1GNxcH8Xis/W5Ig== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="T08J5mk/"; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 742AB60A2626; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794999148; b=VOTTUb8d3CKjguUjFo7lsae+fiQwaDYp726xJuW3/FpL4qWiIHXL1IxheP0oXMdvXs0i y0kel/6tlVWjFiZnbkIQaKlF5oD0wkow8V4CkHkDHA11rOKlZNYFW93136m4gy6ed5XVa Mp3XN0melYnqjY84WypwhV+1xtZPZzXu8cpbmT0gwF9E5voIFseezv0CxM+5y7lhArzxy WHKcplzy0E18r04zJdRx8igP3tr8+dZYqrb5g/aaFhTEJDX7o/cddAa59zeEGCSt09qk2 CwySHSswf43IQefSFPiAESXZwjoYVOKySILvcL+ixjGcWp4y1hvifAsKvDMwedMJcdw== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ekSWlwMFYCJb5CWNs9PahwiZ4lvhB0X9D5Up2UC4Rjo=; b=QfjAlkXvjIf10KpP7nK+ZlVaZ0pzmyUtziH5mo4z3VlfmtmPKIWq32uv73Pd2LhZN0bY hQ7xljUQ8fWBD4niogYKhFQbXfxnz7eIx06cUXhoDQpr/rnBYCVn0+kSM/911TIfmel/E 0ZRgUZUoPSsDnjnRbSJ723MIObN3RNzCn3qrheZjrvWVm30i3GEaP+4U1hI44GRYLYq+D +dxhEJVgbL/mlFe6fU5uKc42+ueB/vXUSsydhJ1YaW4qbPBtXVmqIAkMLGliArgZ0rdEl omb78gXpARoU6t0oUjGokKmUDzfQRVYtp77aMShBwSyzsvr6H5Db5MG5Yh+kRFdFdZw== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id 3F1D71F000CF; Wed, 18 Nov 2026 10:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794999148; bh=ekSWlwMFYCJb5CWNs9PahwiZ4lvhB0X9D5Up2UC4Rjo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=T08J5mk/RX+6cdghSOFju2FhuuUou8N/LBUCqTfCa0UBoNFADH1c0K+WWAd5VX7q+ qQ9i1fmK3w/dGi9R8ZelK4hnt+aRYzdu5NocH0lCTxB+XvifWeP5tG5Xbkf3172m0T QAGhnl4/MISUWXDLO6pnwWSbVPsXOsGAD+/OTaOSog++vtmQlW/7pHUEvChE84BUh5 YrdKeXodM9ip2r5An5YEzOmHJZDtx4kUaVbKd0Gb/INaNWQA+dvmuYnoNDgCForaxG jF0QMbqWXfGILVyi+ZWKgjbkRucvanuiwjQf8+uxJKJsHSt8NrZZlsi63KvjyUjq+t FGou5gFdsE31g== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id BE0884AD20; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) From: Rajan Yadav via B4 Relay Date: Wed, 18 Nov 2026 04:52:28 -0600 Subject: [PATCH v2 5/6] arm64: dts: allwinner: a133: Add CPU OPP table X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261118-a133-series-v2-5-8bcec9c9aadf@gmail.com> References: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> In-Reply-To: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> To: Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , "Rafael J. Wysocki" , Viresh Kumar , Andre Przywara 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, Alexander Sverdlin , Cody Eksal , Paul Kocialkowski , Rajan Yadav X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794999144; l=8781; i=rajanyadav0307@gmail.com; s=20261103; h=from:subject:message-id; bh=S+uzsmUxTcW+8l4ePq+AR9wIIhaHfO1sQ5kGjKEbYc8=; b=Z1W2EcEk0u4/zpyvz+58cjfxO4XScNr+ZSFY4Po66FZn9lAt7r2eIttql/Zm9+MB23ZWG8vF7 lm5AEAE8SPxCHurWhhPwzl+ash1AglMpeWGOG9tRC4ODdhyx7C6x09g X-Developer-Key: i=rajanyadav0307@gmail.com; a=ed25519; pk=4ZPeiP5qrv2b44q/Obxi2koUS70Q6npbttJnpUoTlgg= X-Endpoint-Received: by B4 Relay for rajanyadav0307@gmail.com/20261103 with auth_id=1391 X-Original-From: Rajan Yadav Reply-To: rajanyadav0307@gmail.com X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.21 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; HFILTER_HELO_IP_A(1.00)[tor.lore.kernel.org]; R_DKIM_TEMPFAIL(1.00)[kernel.org:s=k20260515]; MID_RHS_MATCH_TO(1.00)[]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; RSPAMD_EMAILBL_FAIL(0.00)[andre.przywara.arm.com:query timed out,rajanyadav0307.gmail.com:query timed out]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[23]; FREEMAIL_REPLYTO(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,sverdlin.org,epochal.quest,sys-base.io,gmail.com]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[devnull@kernel.org,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27820-noreply=patchwork.local,rajanyadav0307.gmail.com]; TO_DN_SOME(0.00)[]; MAILSPIKE_FAIL(0.00)[172.105.105.114:query timed out]; R_SPF_DNSFAIL(0.00)[temporary DNS error]; FORGED_SENDER_MAILLIST(0.00)[]; MSBL_EBL_FAIL(0.00)[rajanyadav0307@gmail.com:query timed out,andre.przywara@arm.com:query timed out]; DKIM_TRACE(0.00)[kernel.org:?]; MIME_TRACE(0.00)[0:+]; FREEMAIL_TO(0.00)[gmail.com,kernel.org,ti.com,sholland.org,linaro.org,arm.com]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_TLS_LAST(0.00)[]; HAS_REPLYTO(0.00)[rajanyadav0307@gmail.com] X-Rspamd-Queue-Id: 6DD021C5930 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Rajan Yadav Add the A133 CPU OPPs from the vendor BSP (sun50iw10p1.dtsi), plus 1608 MHz for b0 and b1 from the vendor table in the factory firmware of the KickPi K5C. There are ten voltage sets, speed0-5 for the a0-a5/a6 grades and speed6-9 for the "high speed" b0-b3 grades. opp-supported-hw selects the frequencies of each grade: - 1464 MHz only for the a grades - 1416 and 1512 MHz only for the b grades - 1608 MHz only for b0 and b1, the revision A-E "high speed" grades - 408-1320 MHz for all The highest voltage is 1.18 V, inside the 0.81-1.2 V recommended operating range of VDD_CPU in the A133 datasheet (V1.5, table 5-2). The BSP uses 1008 MHz where the A100 table uses 1080 MHz, at the same voltages for a0-a2. U-Boot starts the CPU at 1008 MHz, which mainline now reports as an unlisted initial frequency. This table follows the BSP. The BSP table stops at 1512 MHz, although some datasheet versions list 1.6 GHz for the A133. The factory firmware of the KickPi K5C (Linux 4.9.170, built January 2026) has the same table plus five OPPs: 1608 MHz for b0 (1.18 V) and b1 (1.13 V, at most 1.14 V), and 1416 MHz for a0-a2. This patch takes the 1608 MHz OPP from it. The K5C is a b2 part and never uses this OPP. With a test-only change that forces the grade, the CPU PLL locked at 1608 MHz and the PMIC was set to 1.18 V for b0 and 1.13 V for b1. Forced to b0, two 20-minute runs of full load on the K5C without a heatsink reached the 90 C passive trip after 10-13 minutes; from then on the temperature stayed between 83.5 and 90.4 C. The table has the A100 compatible as a fallback and the speed bin cell first, so a kernel without A133 support selects speed0-2 from the speed bin and gets the voltages of the A100 table, with 1008 instead of 1080 MHz. It needs the efuse cells added to sun50i-a100.dtsi in the previous patch. A script compared every voltage and the frequency set of every grade with both vendor tables. It found no difference to the BSP file other than the added 1608 MHz OPP, and no difference to the factory table other than its 1416 MHz OPP for a0-a2. Claude Code (Anthropic) drafted this table and its message from the two vendor device trees (numbers only) and wrote the comparison script; I reviewed it and tested it on a KickPi K5C. Suggested-by: Andre Przywara Signed-off-by: Rajan Yadav Reviewed-by: Alexander Sverdlin Tested-by: Alexander Sverdlin --- Changes in v2: - Add 1608 MHz for b0 and b1 from the factory firmware table, as Andre asked; the commit message describes the source and the K5C tests. - Alexander's Reviewed-by and Tested-by for v1 are not carried over because of this change. Alexander, could you check whether they still apply to this version? --- .../boot/dts/allwinner/sun50i-a133-cpu-opp.dtsi | 182 +++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a133-cpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a133-cpu-opp.dtsi new file mode 100644 index 00000000000..dd5fdeea7ea --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a133-cpu-opp.dtsi @@ -0,0 +1,182 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2026 Rajan Yadav +/* + * A133 CPU OPPs. The voltages and grade selection follow the Allwinner + * vendor BSP (sun50iw10p1.dtsi); 1608 MHz for b0 and b1 is from the vendor + * table in the factory firmware of the KickPi K5C. Index 0-5 are the + * vendor's a0-a5 grades (a6 uses the a5 values), index 6-9 are the "high + * speed" b0-b3 grades. This needs the efuse cells from sun50i-a100.dtsi. + */ + +/ { + cpu_opp_table: opp-table-cpu { + compatible = "allwinner,sun50i-a133-operating-points", + "allwinner,sun50i-a100-operating-points"; + nvmem-cells = <&cpu_speed_grade>, <&chip_marking>, + <&cpu_pcpu>, <&cpu_bin_ext>; + nvmem-cell-names = "bin", "marking", "pcpu", "bin-ext"; + opp-shared; + + opp-408000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <408000000>; + + opp-microvolt-speed0 = <900000>; + opp-microvolt-speed1 = <900000>; + opp-microvolt-speed2 = <900000>; + opp-microvolt-speed3 = <940000>; + opp-microvolt-speed4 = <940000>; + opp-microvolt-speed5 = <920000>; + opp-microvolt-speed6 = <900000>; + opp-microvolt-speed7 = <900000>; + opp-microvolt-speed8 = <940000>; + opp-microvolt-speed9 = <920000>; + opp-supported-hw = <0x3ff>; + }; + + opp-600000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <600000000>; + + opp-microvolt-speed0 = <900000>; + opp-microvolt-speed1 = <900000>; + opp-microvolt-speed2 = <900000>; + opp-microvolt-speed3 = <940000>; + opp-microvolt-speed4 = <940000>; + opp-microvolt-speed5 = <920000>; + opp-microvolt-speed6 = <900000>; + opp-microvolt-speed7 = <900000>; + opp-microvolt-speed8 = <940000>; + opp-microvolt-speed9 = <920000>; + opp-supported-hw = <0x3ff>; + }; + + opp-816000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <816000000>; + + opp-microvolt-speed0 = <940000>; + opp-microvolt-speed1 = <900000>; + opp-microvolt-speed2 = <900000>; + opp-microvolt-speed3 = <940000>; + opp-microvolt-speed4 = <940000>; + opp-microvolt-speed5 = <920000>; + opp-microvolt-speed6 = <900000>; + opp-microvolt-speed7 = <900000>; + opp-microvolt-speed8 = <940000>; + opp-microvolt-speed9 = <920000>; + opp-supported-hw = <0x3ff>; + }; + + opp-1008000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1008000000>; + + opp-microvolt-speed0 = <1020000>; + opp-microvolt-speed1 = <980000>; + opp-microvolt-speed2 = <950000>; + opp-microvolt-speed3 = <1020000>; + opp-microvolt-speed4 = <960000>; + opp-microvolt-speed5 = <940000>; + opp-microvolt-speed6 = <980000>; + opp-microvolt-speed7 = <950000>; + opp-microvolt-speed8 = <960000>; + opp-microvolt-speed9 = <940000>; + opp-supported-hw = <0x3ff>; + }; + + opp-1200000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1200000000>; + + opp-microvolt-speed0 = <1100000>; + opp-microvolt-speed1 = <1020000>; + opp-microvolt-speed2 = <1000000>; + opp-microvolt-speed3 = <1100000>; + opp-microvolt-speed4 = <980000>; + opp-microvolt-speed5 = <960000>; + opp-microvolt-speed6 = <1020000>; + opp-microvolt-speed7 = <1000000>; + opp-microvolt-speed8 = <980000>; + opp-microvolt-speed9 = <960000>; + opp-supported-hw = <0x3ff>; + }; + + opp-1320000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1320000000>; + + opp-microvolt-speed0 = <1160000>; + opp-microvolt-speed1 = <1060000>; + opp-microvolt-speed2 = <1030000>; + opp-microvolt-speed3 = <1160000>; + opp-microvolt-speed4 = <1020000>; + opp-microvolt-speed5 = <1000000>; + opp-microvolt-speed6 = <1060000>; + opp-microvolt-speed7 = <1030000>; + opp-microvolt-speed8 = <1020000>; + opp-microvolt-speed9 = <1000000>; + opp-supported-hw = <0x3ff>; + }; + + opp-1416000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1416000000>; + + opp-microvolt-speed6 = <1100000>; + opp-microvolt-speed7 = <1070000>; + opp-microvolt-speed8 = <1060000>; + opp-microvolt-speed9 = <1040000>; + opp-supported-hw = <0x3c0>; + }; + + opp-1464000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1464000000>; + + opp-microvolt-speed0 = <1180000>; + opp-microvolt-speed1 = <1180000>; + opp-microvolt-speed2 = <1130000>; + opp-microvolt-speed3 = <1180000>; + opp-microvolt-speed4 = <1100000>; + opp-microvolt-speed5 = <1080000>; + opp-supported-hw = <0x3f>; + }; + + opp-1512000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1512000000>; + + opp-microvolt-speed6 = <1180000>; + opp-microvolt-speed7 = <1130000 1130000 1140000>; + opp-microvolt-speed8 = <1100000>; + opp-microvolt-speed9 = <1080000>; + opp-supported-hw = <0x3c0>; + }; + + opp-1608000000 { + clock-latency-ns = <244144>; /* 8 32k periods */ + opp-hz = /bits/ 64 <1608000000>; + + opp-microvolt-speed6 = <1180000>; + opp-microvolt-speed7 = <1130000 1130000 1140000>; + opp-supported-hw = <0xc0>; + }; + }; +}; + +&cpu0 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu1 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu2 { + operating-points-v2 = <&cpu_opp_table>; +}; + +&cpu3 { + operating-points-v2 = <&cpu_opp_table>; +}; From patchwork Wed Nov 18 10:52:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajan Yadav via B4 Relay X-Patchwork-Id: 4160 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id BC2561C598E for ; Wed, 18 Nov 2026 11:52:32 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=kernel.org; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27819-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27819-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 8CA9C47F4C for ; Wed, 18 Nov 2026 10:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=DYkCjXXLdAz9gIQ2wdmiRG6zJQKmoZo10q3TcSbPrzV7h6wlsD/VUxzp5pS0MSeh03/s 0R4jxrqqIFs7Ql3B3g01oVkZxlgWTXbr82q/f1WeZbo3+XU7vbsMlEJq2KUzbdZ0KRCRR QAVyz0fwcwwKUxB6JsGRQLHJ4RCZBYflczO+am/OhzYe7Oz+ce50vQST9YPRcKL6h9pn2 LRAiadjWiraKwPmYP8Jr5NvXxZk6cPNdN7YO/EMDQvf53MPOsXtWERM92PoVboQh8x55X UNO4O6GNHRMwgVtgMpHiSrhZX5T0uQf8By+KPQFeGzgpcB6uDdKZLDyAwm2zb9j91eQ== ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=2By4B2DmE6jOQ+T2SsshaYG24+i1LcC/o8XIi2KFjfQ=; b=2gL8lWFUrXnAbg2qH3/jTcrFbh68a4bhKx5Dxk2d+FEPHp1PnGdHCMyvorgEWPvn+V2J jOJ/EokdfjN2HAYu7ZwGDZesO1vQkuzTr8MHagHWrP/d+AZFdpcZATXjnucajpohDEUoE uvPZKha455VEBWkBpIe99+4Kpfbh7PYux2kGsu/3UcW7HIAcxjrjql9pQ6wLx+4P+Sbs2 a/oXa7sByJHC1rypSyj6AgeNW7Mj7/tyZaE1hCqBH0YQ0Fg7g8f1R4BJnmgL12nm/G2uN oEoC81PzV7FOvfoYQ9FL8Yy8rH13OUnEj4Eu7ElUcmY4JU+nkCfyuoNwBkM0llX4K8Q== ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=a+qRzA9A; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59C5060A261F; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=a+qRzA9A X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794999148; b=aCcA49h93GaDBcH2o0aH23H98fetX2NWGktBDyhwKztxCKzaThiibAcoO5UhFMOOikI1 V4haPbMDYmhKh6WagSYpwIMaJ37cdF7D11S/aY16uozaruaU9hKf3GmP7Dstw5uO/n04q qVf1fwrV4xFojo7BTKvMq7tjiO0YXJF31wAEGE4DOXktYt7KjWB+Pwr7MjvAe7NhqcXmp eUZGwGxTPU3VU4w6qGlfrz8xgAqZj9oyx7wh2AHay7IZwE/sBDIhO8ZRwRoIqpVIi7npI L912QYP+fJewNe2yF7zGlp9erXwFjmYOX9uywMix01QsVfgpIbvChanQ1m/XJXPkzQQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=2By4B2DmE6jOQ+T2SsshaYG24+i1LcC/o8XIi2KFjfQ=; b=JLdMco084qp86Zg9ud7PSmZcA0e0uhgPQS4xir4OIMAN3b5FJyGfVWktD+Yoq1b5HnC2 pjs+X76rXf4S6QgAanOC2W05uMB1+I6u9YeBwB8d5Ed9+uuIP8srPnhdLuMNfAu4RYZN9 ytUQuLCTnvj3laZnj3TUdvaMa4PjuZhca7GCllLWt51W7ogLAVJJGEvqw5bsJrU9MLCNg YCSEnLCj7BKTBAlhBcNrc6gwg3i8XXYDQfTfzPKDbIXcSM6Q6xIEo1FVCCs5/yNHzPPVs v6mRuKAIx6F5dBdzUxLk17rXHxADiwwND9GLsYvUYwcnbnraaG8JbsotK9TaxmjMI/A== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=a+qRzA9A; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31B4A60A2613; Wed, 18 Nov 2026 10:52:28 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1794999148; b=UV4d4i3hc8uJKj89x1fS/OabbwHwW9pgpqtKosQgEHG0bwrNrvTciyddWCPPQHmVNf8k pJefJGpSnHUoddWcwvPkCPkiNjCEDc1g++HW4JdgMOxFPl16XzhdX3ohAC+xlfAAt9e8N D3BjGUA6JKgoOziEjTwDE83JIK97bPHDAr3kzQ4faLfrUbVP4XuyKT5+SrI7I6hjwix64 1EPH+itMxWgH50iBVueqx2fvJGaSAPm3EMuh2Xriis2roSfCG45PX2M6T0EqVNDRWWuKP IhGN6r4e+yUfQoKbTTa+bnjsB1DAX+0Zx/4qjzDoy8tr4gIP+hE2pbm4Qby2bd6aihg== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1794999148; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=2By4B2DmE6jOQ+T2SsshaYG24+i1LcC/o8XIi2KFjfQ=; b=JX+NIHr45DW3P8igOXGLVwG75m9zPmQcsSSo8t2JXO7EWhKux5XqqOSNOIT+GzO1YlLD rQmPyd821AJDVTqBMOZeiF6znkgnC54PBuoF2d8NV80F+5LvZZsqsi88SkR46JgtmroPm HHMUoiI5FCXeJz+YYO0CSYMcydgaL8qniAb1E/apzFoQUJd/brpgyKrLFY2UB+R8CsEVR 2Gkbsq/GLRkwf1JevasC5IplF1yIhzoTyIOOZ6aHdv4MAFIiYba18rfVfs839XFoW+x+x Vm3DjTxDS5weHxWgzO9WzLt9+XlCkZRtvMbG32jXxzM0VaefKt1n9vgBWtLkomVo8HA== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id 428DE1F000D0; Wed, 18 Nov 2026 10:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794999148; bh=2By4B2DmE6jOQ+T2SsshaYG24+i1LcC/o8XIi2KFjfQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=a+qRzA9A9YDM+wVMDvTkzUD2OyvwOr/Sj3B0nOfhHr7Ai/qyqNBTg8XmqLpB5gxnn Cl5gxxcRJ4YGi5+QW233inzZGvgY4fV/d33ehBhvYv3Xt4hSfPs3G1vTf9W1Vaopvr j50WErYjLJuJ+Qyign3v3twPmZnMem/lhQJZajrAuv8R0TwSglIk9t/tvUxC1gwpn1 2AWefvqYnDTVrol1vwy/zKzp9soTmLZE++2ixNhmuU5YV/6uqhhqi6ur9Pr04ImrHr c43dRJGnZUQ3zAme6OTheS0Sfaj6lQ7qMdUf89dCo0vdEDI+5SMNMj2f53hZnymFXG eZ1yI8BYSc7UA== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id D4B664AD24; Wed, 18 Nov 2026 10:52:25 +0000 (UTC) From: Rajan Yadav via B4 Relay Date: Wed, 18 Nov 2026 04:52:29 -0600 Subject: [PATCH v2 6/6] arm64: dts: allwinner: a133: Use the A133 CPU OPP table X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261118-a133-series-v2-6-8bcec9c9aadf@gmail.com> References: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> In-Reply-To: <20261118-a133-series-v2-0-8bcec9c9aadf@gmail.com> To: Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , "Rafael J. Wysocki" , Viresh Kumar , Andre Przywara 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, Alexander Sverdlin , Cody Eksal , Paul Kocialkowski , Rajan Yadav X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794999144; l=3568; i=rajanyadav0307@gmail.com; s=20261103; h=from:subject:message-id; bh=9RwtNBE54nzjhJKSSd9WvjqDW6S0SKtsSGS0h60Ibhk=; b=RYaCsVy1CxE3WsdfOmFeUTfltmC5+noQeaqGmatT6wD6gN9vhvPy7TVRCmJgDFipyIzA7JAyj JmqGaudtNgCCC9jenEkNs1zsg71Gdo3pElxwH8rN/tuM6AMILFtMQNl X-Developer-Key: i=rajanyadav0307@gmail.com; a=ed25519; pk=4ZPeiP5qrv2b44q/Obxi2koUS70Q6npbttJnpUoTlgg= X-Endpoint-Received: by B4 Relay for rajanyadav0307@gmail.com/20261103 with auth_id=1391 X-Original-From: Rajan Yadav Reply-To: rajanyadav0307@gmail.com X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.21 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; HFILTER_HELO_IP_A(1.00)[tor.lore.kernel.org]; R_DKIM_TEMPFAIL(1.00)[kernel.org:s=k20260515]; MID_RHS_MATCH_TO(1.00)[]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; RSPAMD_EMAILBL_FAIL(0.00)[alex.sverdlin.org:query timed out,rajanyadav0307.gmail.com:query timed out,andre.przywara.arm.com:query timed out]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[23]; FREEMAIL_REPLYTO(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,sverdlin.org,epochal.quest,sys-base.io,gmail.com]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[devnull@kernel.org,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27819-noreply=patchwork.local,rajanyadav0307.gmail.com]; TO_DN_SOME(0.00)[]; MAILSPIKE_FAIL(0.00)[172.105.105.114:query timed out]; R_SPF_DNSFAIL(0.00)[temporary DNS error]; FORGED_SENDER_MAILLIST(0.00)[]; MSBL_EBL_FAIL(0.00)[alex@sverdlin.org:query timed out,andre.przywara@arm.com:query timed out,rajanyadav0307@gmail.com:query timed out]; DKIM_TRACE(0.00)[kernel.org:?]; MIME_TRACE(0.00)[0:+]; FREEMAIL_TO(0.00)[gmail.com,kernel.org,ti.com,sholland.org,linaro.org,arm.com]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_TLS_LAST(0.00)[]; HAS_REPLYTO(0.00)[rajanyadav0307@gmail.com] X-Rspamd-Queue-Id: BC2561C598E X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX From: Rajan Yadav Switch the three A133 boards in mainline (Baijie Helperboard A133, Liontron H-A133L and Teclast P80) from the A100 OPP table to the A133 one, so the speed grade is selected as the vendor does it. What changes depends on the chip: - revision A-E parts with a normal marking ID get a0-a2 from the bin field, as they get speed0-2 today, with the same voltages; only 1080 MHz becomes 1008 MHz. The exception is a part whose ICPU and PCPU values are in the range for which the BSP forces a0. - revision F and later parts with a normal marking ID get the a3-a6 voltages: higher at 408 and 600 MHz, equal or lower from 1008 MHz, and 1008 instead of 1080 MHz. - "high speed" parts get the b grades, with 1416 and 1512 MHz instead of 1464 MHz; revision A-E ones (b0 and b1) also get 1608 MHz. - if the firmware does not provide SMCCC SOC_ID, the driver keeps the A100 selection, adds the BSP's a0 rule for normal parts and warns at boot. All three boards supply the CPUs from AXP803 DCDC2 with a 0.81-1.2 V range, which covers every new voltage. Without the A133 support in sun50i-cpufreq-nvmem the A100 fallback applies. The Teclast P80 also needs "cpufreq: sun50i: Handle boards with the allwinner,sun50i-a133 compatible" to get cpufreq at all. Claude Code (Anthropic) drafted this change and its message; I reviewed it. I tested the A133 table on a KickPi K5C; I cannot test these three boards. Suggested-by: Andre Przywara Reviewed-by: Alexander Sverdlin Tested-by: Alexander Sverdlin Signed-off-by: Rajan Yadav --- Changes in v2: - Commit message: revision A-E high speed parts also get 1608 MHz. --- arch/arm64/boot/dts/allwinner/sun50i-a133-helperboard-core.dtsi | 2 +- arch/arm64/boot/dts/allwinner/sun50i-a133-liontron-h-a133l.dts | 2 +- arch/arm64/boot/dts/allwinner/sun50i-a133-teclast-p80.dts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a133-helperboard-core.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a133-helperboard-core.dtsi index 545972d2324..3a89d3f74b3 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a133-helperboard-core.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a133-helperboard-core.dtsi @@ -7,7 +7,7 @@ /dts-v1/; #include "sun50i-a100.dtsi" -#include "sun50i-a100-cpu-opp.dtsi" +#include "sun50i-a133-cpu-opp.dtsi" /{ model = "Baijie A133 HelperBoard Core"; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a133-liontron-h-a133l.dts b/arch/arm64/boot/dts/allwinner/sun50i-a133-liontron-h-a133l.dts index 90a50910f07..1b9cbcbe5f3 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a133-liontron-h-a133l.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a133-liontron-h-a133l.dts @@ -6,7 +6,7 @@ /dts-v1/; #include "sun50i-a100.dtsi" -#include "sun50i-a100-cpu-opp.dtsi" +#include "sun50i-a133-cpu-opp.dtsi" #include #include diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a133-teclast-p80.dts b/arch/arm64/boot/dts/allwinner/sun50i-a133-teclast-p80.dts index 47b5f2ac824..7d4c346276e 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a133-teclast-p80.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a133-teclast-p80.dts @@ -6,7 +6,7 @@ /dts-v1/; #include "sun50i-a100.dtsi" -#include "sun50i-a100-cpu-opp.dtsi" +#include "sun50i-a133-cpu-opp.dtsi" #include