From: Alexander Sverdlin <alex@sverdlin.org>
To: rajanyadav0307@gmail.com
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,
Cody Eksal <masterr3c0rd@epochal.quest>
Subject: Re: [PATCH 3/6] cpufreq: sun50i: Add A133 speed grade detection
Date: Tue, 17 Nov 2026 23:38:00 +0100 [thread overview]
Message-ID: <8b999262c330cbe43ffa477f76ef55ed886ebce8.camel@sverdlin.org> (raw)
In-Reply-To: <20261104-a133-series-v1-3-58217cb33a87@gmail.com>
Hi Rajan!
On Wed, 2026-11-04 at 22:40 -0600, Rajan Yadav via B4 Relay wrote:
> From: Rajan Yadav <rajanyadav0307@gmail.com>
>
> 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 <andre.przywara@arm.com>
> Signed-off-by: Rajan Yadav <rajanyadav0307@gmail.com>
Reviewed-by: Alexander Sverdlin <alex@sverdlin.org>
Tested-by: Alexander Sverdlin <alex@sverdlin.org>
next prev parent reply other threads:[~2026-11-17 22:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 4:40 [PATCH 0/6] sunxi: A133: Add CPU speed grade detection and OPP table Rajan Yadav via B4 Relay
2026-11-05 4:40 ` [PATCH 1/6] dt-bindings: opp: h6: Add A133 operating points Rajan Yadav via B4 Relay
2026-11-05 4:40 ` [PATCH 2/6] cpufreq: sun50i: Move nvmem cell reading into a helper Rajan Yadav via B4 Relay
2026-11-17 22:34 ` Alexander Sverdlin
2026-11-05 4:40 ` [PATCH 3/6] cpufreq: sun50i: Add A133 speed grade detection Rajan Yadav via B4 Relay
2026-11-17 22:38 ` Alexander Sverdlin [this message]
2026-11-05 4:40 ` [PATCH 4/6] arm64: dts: allwinner: a100: Add A133 speed grade efuse cells Rajan Yadav via B4 Relay
2026-11-17 22:38 ` Alexander Sverdlin
2026-11-05 4:41 ` [PATCH 5/6] arm64: dts: allwinner: a133: Add CPU OPP table Rajan Yadav via B4 Relay
2026-11-05 4:41 ` [PATCH 6/6] arm64: dts: allwinner: a133: Use the A133 " Rajan Yadav via B4 Relay
2026-11-05 11:30 ` [PATCH 0/6] sunxi: A133: Add CPU speed grade detection and " Andre Przywara
2026-11-05 14:49 ` Rajan Yadav
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b999262c330cbe43ffa477f76ef55ed886ebce8.camel@sverdlin.org \
--to=alex@sverdlin.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=masterr3c0rd@epochal.quest \
--cc=rajanyadav0307@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox