Skip to content

arm64: dts: apple: t6050: share the Neural Engine with every board - #2293

Draft
RyanTheTide wants to merge 4 commits into
integration/aurorafrom
spec-m5neo/t6050-dt-share
Draft

RyanTheTide wants to merge 4 commits into
integration/aurorafrom
spec-m5neo/t6050-dt-share

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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 in t6050-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 its apple,t6050-ane compatible 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

  1. The content moves to 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) as apple,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.dtsi stays 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.
  2. J714c, J716s, J873s, K114s, K116c and K116s opt in: each defines T6050_ANE at the top, and t6050-peripherals.dtsi then includes t6050-ane.dtsi at 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 after t6050-peripherals.dtsi produces. On each of these boards the ADT ane0 matches 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 ane0 when 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:

Testing

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

ls -l /dev/accel/ ; dmesg | grep -iE 'ane|509800000|ps_ane|fab[089]'

Expected: /dev/accel/accel0 is present and there is no SError or deferred-probe line for ANE_SYS. On a stub other than 27.0, expect H17 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):

Board Change
J714s none (DTB byte-identical)
J714c, J716s, J873s, K114s, K116c ane0 okay with memory-region = the two placeholders; ane0_dart{,1,2} okay; ps_ane_sys okay; ps_fab0_piogw, ps_fab8_soc, ps_fab9_soc okay + apple,firmware-owned; two disabled /reserved-memory/ane-firmware-{text,data}@0
K116s the same, but without the fabric domains, which it already had
J716c, J775c, J775d, K114c none (DTB byte-identical)

On 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 sets GENPD_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)

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>
@axboe

axboe commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

K116s row (16-inch M5 Pro, firmware 27.2 stub, booted through aura). The three commits at f76b13a are cherry-picked on integration/aurora 0abc2f3 with my K116s stack; the one conflict was at the end of t6050-peripherals.dtsi, where #2355's fast-die block also appends, and both blocks are kept.

$ ls -l /dev/accel/
ls: cannot access '/dev/accel/': No such file or directory
$ dmesg | grep -iE 'ane|509800000|ps_ane|fab[089]'
OF: reserved mem: 0x0000010000de4000..0x0000010000e9ffff (752 KiB) nomap non-reusable ane-firmware-text@10000de4000
OF: reserved mem: 0x0000010002138000..0x00000100023e7fff (2752 KiB) nomap non-reusable ane-firmware-data@10002138000
apple-dart 509800000.iommu: params 1e313020 31121003 2a2a0204 00010010, version 0204, 16 streams, AS 42 -> 42, protect 00000002/00000002, diag lock 00000000; 6 tunables (no client partitions), 2 bypass
platform 508000000.neural-processor: H17 ANE: no loader hand-off (firmware TEXT pin); leaving the engine alone
platform 508000000.neural-processor: H17 ANE: preloaded TEXT sha256 635346550705c815eafa54d0fcaf7837800f5538e65ccade8028b0909a1d7792
platform 508000000.neural-processor: H17 ANE: preload TEXT 0x10000de4000+0xbc000 @0x10000000000, DATA 0x10002138000+0x2b0000 @0x100000bc000 (layout differs)
ane_t6021 508000000.neural-processor: H17 ANE: bound; no hand-off, engine left off

As expected on a stub other than 27.0: no accel node, the engine left alone. No SError, no deferred probe, and no error-level line in the boot log. (The grep's unrelated matches on "panel" lines are left out.)

The TEXT digest above is the K116s's 27.2 preload, if it is of use for #1957.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Thanks @axboe for the K116s row at this head. On the 27.2 stub it shows what it should: the reservations and the ANE DART come up, the driver binds and leaves the engine alone because there is no hand-off, and there is no SError, deferred probe or error line. So enabling ANE_SYS and the fabric domains on the K116s is safe on that stub.

The conflict you hit with #2355 at the end of t6050-peripherals.dtsi is only textual; keeping both blocks is right.

Still open: a row on a 27.0 stub showing /dev/accel/accel0 (K116s or any of the other boards), and rows from the J714c, J716s and K114s owners. The 27.2 preload digest will be picked up in #1957, which admits that build.

@axboe

axboe commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Ryan, the K116s again, now that #1957 is in: the 27.2 layout is taken, the code pin is not, and the engine stays off. Firmware 27.2, integration/aurora 8fd2d5e with my K116s stack and this PR's commits (the third is already in through #1956; the first two needed the comment in t6050-j714s-ane.dtsi and the end of t6050-peripherals.dtsi resolved).

platform 508000000.neural-processor: H17 ANE: TEXT before 0xb4f80 sha256 87d1ae72d24495acc19a8f8955bc91bded0767bb573ebfdf4808c26e57a4c642
platform 508000000.neural-processor: H17 ANE: firmware 27.2 26B123, TEXT code sha256 8d552dcd27c4f539e89a285c5af893849ab8ae2e3efffed0aba8944e44e431a8 (not the code pin)
platform 508000000.neural-processor: H17 ANE: no loader hand-off (firmware TEXT pin); leaving the engine alone
platform 508000000.neural-processor: H17 ANE: preloaded TEXT sha256 635346550705c815eafa54d0fcaf7837800f5538e65ccade8028b0909a1d7792
platform 508000000.neural-processor: H17 ANE: preload TEXT 0x10000de4000+0xbc000 @0x10000000000, DATA 0x10002138000+0x2b0000 @0x100000bc000 (layout as expected)
ane_t6021 508000000.neural-processor: H17 ANE: bound; no hand-off, engine left off

No /dev/accel, no error-level line. The pin for 27.2 is from the J71y image; the K114/K116 run their own 27.2 build (26B8125 for the GPU firmware), so I take this for another image with the same layout. I have not compared the images.

With that TEXT admitted as loaded (a local text_pin of the digest above on the 26B123 entry, nothing else changed) the engine comes up at boot:

platform 508000000.neural-processor: H17 ANE: loader hand-off verified; starting the engine
ane_t6021 508000000.neural-processor: H17 ANE: bound; ANE_SYS held until the bring-up owns it
ane_t6021 508000000.neural-processor: ANE probe: raw-boot evidence and cold child power verified; no writes
ane_t6021 508000000.neural-processor: ANE map: firmware heap tail at 0x1000036c000 bytes 0x14000
ane_t6021 508000000.neural-processor: ANE map: reserved preload, SID0 on three DARTs, DAPF verified
[drm] Initialized ane 3.1.0 for 508000000.neural-processor on minor 0
ane_t6021 508000000.neural-processor: [drm] H17 accel node ready (ABI 3, programs switch within one firmware boot)
ane_t6021 508000000.neural-processor: H17 ANE: up at boot, accel node ready

/dev/accel/accel0 is there, and no warning or error line comes with it. Not run: a program (I have no HWX here), and a sleep with the engine up. The K114/K116 image needs its own code pin for this; the code digest above is what the 26B123 entry's two sections give on it.

@axboe

axboe commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

A follow-up to the above, same kernel with the engine up: one deep sleep by the lid, woken by the lid 9.7 s in, no program loaded.

ane_t6021 508000000.neural-processor: H17 ANE: powered down for system sleep; ANE_SYS requested off, still on at the put (0x3ff)
ane_t6021 508000000.neural-processor: H17 ANE: resume ok: firmware ready 20 ms, first program ready -1 ms, node reopened 20 ms, 0 programs replayed

/dev/accel/accel0 is still there after it. I do not know whether "still on at the put" is expected on this board.

t6050-j714s-ane.dtsi: kept the one-line include of t6050-ane.dtsi (integration only reworded its comment); t6050-j714s.dts: kept the t6050-ane.dtsi include and integration's new hpm port-controller blocks.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged integration/aurora (f5f023b); conflicts in t6050-j714s-ane.dtsi and t6050-j714s.dts resolved (kept the one-line include and t6050-ane.dtsi include, kept integration's hpm blocks; the ane0_dart reg-names now come identically from both sides), all eleven T6050 board DTBs build with unchanged dtc warnings; J714s, J716c, J775c, J775d and K114c decompile identical to integration.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Rebased and dt-checks is green; the K116s rows are in. Still needed: boot rows from J714c, J716s and K114s owners on this head (reservations and the ANE DART up, the driver binds, no SError or deferred probe) before it leaves draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants