Repository navigation
arm64: dts: apple: t6050: share the Neural Engine with every board - #2293
Draft
RyanTheTide wants to merge 3 commits into
Draft
RyanTheTide wants to merge 3 commits into
RyanTheTide wants to merge 3 commits into
Conversation
t6050-j714s-ane.dtsi has nothing J714s-specific in it: the ane0 node, its three DARTs and ANE_SYS are in t6050-peripherals.dtsi, and the two preload reservations are placeholders that the boot loader fills from the ADT of the machine it boots (aura matches the node by its "apple,t6050-ane" compatible, on any board). The accel/ane driver also matches only the compatible and refuses a hand-off whose preloaded firmware it does not know. Move the content to t6050-ane.dtsi. The new file also holds a vote on ANE_SYS's parents in the ADT power tree, FAB8_SOC and FAB9_SOC, and on FAB8_SOC's parent FAB0_PIOGW, as firmware-owned domains. Without them ANE_SYS cannot register on a board that does not describe its Secure Enclave or camera, which today are the only users that enable those fabrics. J714s already enables all three with the same properties. t6050-j714s-ane.dtsi stays as a one-line include for board files that still name it; t6050-ane.dtsi has an include guard, so a board that gets both is fine. The ANE description is DjDeveloperr's, from commit 6483844 ("arm64: dts: apple: t6050: Describe the ANE on the T8140 model, enable it on J714s"); this only changes where it lives. J714s now includes t6050-ane.dtsi directly. Its DTB is byte-identical before and after, and no other board changes in this commit. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…873s, K114s, K116c and K116s The ADT of every one of these boards has the same ane0 as J714s: device type ane, compatible "ane,t8132exclave", ane-type 0x220, die 0, interrupts 954 and 967, clock ids 335, 334 and 381, and the dart-ane0 DARTs on interrupt 955. That is the engine t6050-peripherals.dtsi describes, so enable it on them. A board opts in by defining T6050_ANE before it includes t6050-peripherals.dtsi, which then includes t6050-ane.dtsi at its end. This keeps the change to one line at the top of each board file, away from the lines other changes edit next to the peripherals include. The DTBs are the same as with a direct include after t6050-peripherals.dtsi. Nothing starts on its own. The boot loader enables ane0 and its reservations only when the ADT says the firmware is preloaded and its segments check out; otherwise it disables ane0. The driver then starts the engine only when the preloaded TEXT matches a firmware build it knows, and logs the digest and leaves the engine alone when it does not. Left out here: - J716c, K114c and J775c, which have their own open changes for this. - J775d (M5 Ultra): the second die has its own ane1, DARTs and power state, none of which are described, and the boot loader fills only /arm-io/ane0. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The apple,t6050-dart binding requires reg-names when a DART has its DAPF range as a second reg entry. The ANE DART never had them, which did not show while only the J714s enabled it. Now that the Neural Engine is shared with six more boards, dt-checks reports the missing property on each. Name the ranges dart and dapf, as the other two-range T6050 DARTs do; linux#1956 and linux#1607 carry the same line. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Only J714s enables the Neural Engine, through
t6050-j714s-ane.dtsi. Nothing in that file is specific to J714s. The engine, its DARTs and ANE_SYS are int6050-peripherals.dtsi. The two firmware reservations are placeholders that the boot loader fills from the ADT of the machine it boots. aura finds the node by itsapple,t6050-anecompatible on any board (src/kboot.c,ane_compatibles[]). The accel/ane driver also matches on the compatible only (ane_t6021_rtclient_main.c,ane_rtclient_of_match).Change
t6050-ane.dtsi. J714s includes it directly, and its DTB is byte-identical. The new file also enables ANE_SYS's parents from the ADT power tree (FAB8_SOC, FAB9_SOC, and FAB8's parent FAB0_PIOGW) asapple,firmware-owned, so Linux holds a vote and never switches them. Without these, ANE_SYS cannot register on a board that does not describe its Secure Enclave or camera. J714s, J716c and K116s already enable all three with the same properties.t6050-j714s-ane.dtsistays as a one-line include so arm64: dts: apple: t6050-j716c: enable the Neural Engine #1956 and arm64: dts: apple: t6050-k114c: enable the Neural Engine #1607 still build. The new file has an include guard.T6050_ANEat the top, andt6050-peripherals.dtsithen includest6050-ane.dtsiat its end. The one-line opt-in keeps clear of the lines arm64: dts: apple: t6050: describe the GPU on J714c, J873s, K114s, K116c #2276 edits next to the peripherals include, so the two PRs merge in either order. The DTBs are byte-identical to the ones a direct include aftert6050-peripherals.dtsiproduces. On each of these boards the ADTane0matches J714s:ane,t8132exclave, ane-type 0x220, die 0, IRQs 954/967, clock ids 335/334/381, and DART IRQ 955.Nothing starts by itself. aura disables
ane0when the ADT does not report a valid preload. The driver starts the engine only when the preloaded TEXT matches a firmware build it knows. Otherwise it logs the digest and leaves the engine alone. On integration today only the 27.0 TEXT is known; #1957 adds 27.2.Not in this PR:
ane1, DARTs and power state are not described, and aura fills only/arm-io/ane0.Testing
iommu@509800000: 'reg-names' is a required property. J714s already has it. arm64: dts: apple: t6050-j716c: enable the Neural Engine #1956 and arm64: dts: apple: t6050-k114c: enable the Neural Engine #1607 addreg-namestoane0_dartint6050-peripherals.dtsi, which clears it on every board, so this PR leaves that line to them and keeps J714s byte-identical. No other new messages.t6050-j714s-ane.dtsi, which is now a one-line include. Resolve it by keeping the include; the J716c include in arm64: dts: apple: t6050-j716c: enable the Neural Engine #1956 then works unchanged. arm64: dts: apple: t6050-k114c: enable the Neural Engine #1607 (K114c) also works unchanged through that include, and with this PR it gets the fabric parents too.Still to run (board owners, please)
Nobody in the lab has a T6050. If you have one of these boards, a boot row would help: boot through aura with the macOS 27.0 stub and run
Expected:
/dev/accel/accel0is present and there is no SError or deferred-probe line for ANE_SYS. On a stub other than 27.0, expectH17 ANE: no loader hand-off (firmware TEXT pin)and no accel node.Details
Per-board DT change (semantic diff of
dtc -I dts -O dts -s, phandles ignored):ane0okay withmemory-region= the two placeholders;ane0_dart{,1,2}okay;ps_ane_sysokay;ps_fab0_piogw,ps_fab8_soc,ps_fab9_socokay +apple,firmware-owned; two disabled/reserved-memory/ane-firmware-{text,data}@0On those five boards nothing else references the three fabric domains while enabled. Their other children (fab3/5/6/7, SIO, SEP, ISP) all stay disabled, so enabling them does not make any other device probe.
Firmware-owned domains are never read, reset or switched by the pmgr driver (
pmgr-pwrstate.c: it only setsGENPD_FLAG_ALWAYS_ON). The new hardware access is the same as on J714s: the DART probe powering ANE_SYS, and the driver's checks of the hand-off. This assumes FAB9_SOC is up at hand-off on boards without the camera, as it is on J714s, J716c and K116s. The boot row above checks that.The ANE description is DjDeveloperr's (6483844). This PR only moves it and widens where it is included.
Assisted-by: LLM (Claude:Opus 5.5)