Repository navigation
arm64: dts: apple: t8142: Neural Engine, video encoder and JPEG on every M5 - #2325
RyanTheTide wants to merge 1 commit into
Conversation
…ery M5 The Neural Engine (with its three DARTs and ANE_SYS power state), the video encoder (two DARTs, VENC power tree) and both JPEG engines (DART, JPG power state) are SoC blocks: the J704, J813 and J815 ADTs give the same addresses, interrupts and power gates for ane, dart-ane, ave, dart-ave, jpeg0, jpeg1 and dart-jpeg. Only the J815 enabled all three and the J813 only the encoder (twice); the J704 had none of them. Turn them on in t8142-peripherals.dtsi and drop the per-board enables. The ANE and the encoder run firmware that iBoot preloads: the boot loader hands the preload over by compatible and disables the node when the ADT has none, so a board without a preload keeps them off. Every DART keeps its engine's power domain. The JPEG engines need no firmware. J815: no change in the built tree beyond status "okay" becoming implicit. J813: gains the Neural Engine and both JPEG engines. J704: gains all three. The ANE and JPEG enables on J815 come from m0d16l14n1's 33d8f13 and c3c1417. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
J813 (MacBook Air 13" M5), macOS 27.2 stub (26B123). All three engines work. On 27.2 they also need two open kernel PRs and one aura change that's already on aura main. They're listed per engine below. Tree: #2135's merged head 408e272 plus #2328 (so #2325), #2218 (which includes #1900) and #1899, with our usual J813 PRs on top. aura is sithglan's J813 branch 8b9c92ea plus aura#251 and aura#358. DT: the J813 DTB differs from the one before only in the ANE, its three DARTs, ANE_SYS, jpeg0/jpeg1, the JPEG DART and JPG going to okay, as you list. Neural Engine: binds and
JPEG: both engines bind ( Encoder: on 27.2 it needs #1900. Without it, the probe stops with
No DART faults in dmesg. 🤖 Generated with Claude Code |
|
J813 row (MacBook Air 13" M5, macOS 27.2 stub, enrolled aura The kernel is this head (
|
|
J704 (MacBook Pro 14" M5), macOS 27.0 stub (26A428). All three engines bind and run; no DART faults. Setup: our J704 Fedora kernel (7.3.0, integration/aurora be8d4cd base + J704 GPU/DCP commits), booted through the installed aura (which has aura#251). The DTB is our J704 tree with this PR's J704 changes applied: the 18 nodes it enables, and our older tree's missing jpeg0/jpeg1 and ps_jpg added from this branch, checked property by property against this branch's J704 tree. apple-jpeg needed 74213b0 (the T8142 match), which our kernel predated. Neural Engine: binds, /dev/accel/accel0 appears: Encoder: /dev/video12. On 26A428 the driver only qualifies 30 fps with 3 B-frames, so ffmpeg's h264_v4l2m2m (which forces 0 B-frames) is refused with -EOPNOTSUPP ("26A428 layout: only 30 fps with 3 B-frames is qualified"). With gstreamer v4l2h264enc (driver default 3 B-frames), 1080p30, 10 s, 8 Mb/s: 300 frames, Main profile; decoded on the J704's own AVD (v4l2slh264dec), 45.4 dB average PSNR against the source (worst frame 42.5 dB). JPEG: both engines bind (Apple JPEG encoder, HWREV 0x110010, video10/video11). Encode only, as on J813: 30 frames of 1080p NV12 through each engine, valid 1920x1080 baseline JPEG, identical output from both, interrupts rising on both. |
Problem
The Neural Engine, the video encoder and the two JPEG engines are T8142 SoC blocks, but only some boards enabled them. The J815 had all three, the J813 only the encoder (described twice), and the J704 (MacBook Pro 14-inch, M5) none. The J704, J813 and J815 ADTs give the same registers, interrupts and power gates for
ane,dart-ane,ave,dart-ave,jpeg0,jpeg1anddart-jpeg.Change
t8142-peripherals.dtsi.t8142-j813.dtsandt8142-j815.dts.The ANE and AVE run firmware that iBoot preloads. The loader hands the preload over by compatible and disables the node when the ADT has none. Every DART keeps its engine's power domain. JPEG needs no firmware.
Testing
Built J704, J813 and J815 with cpp + dtc before and after and compared the decompiled trees node by node:
status = "okay"becoming implicit.dt-validate -magainst the processed bindings reports nothing new on any of the three boards.Still to run
Hardware rows. I have no M5 machine.
ls /dev/accel*and one ANE inference, a 10 s H.264 encode through the AVE video node, and one JPEG encode/decode. Checkdmesgfor DART faults.Details
adtdiffof J704 against J815 forane,dart-ane,ave,dart-ave,jpeg0,jpeg1,dart-jpeg,pmgrand/cpusgave no differences in reg, interrupts, compatible or clock/power gates. J704aneisane,t8132exclave, IRQs 751/764;jpeg0/jpeg1/dart-jpegIRQs 1156/1159/1157, matching the nodes int8142-peripherals.dtsi.traces/kernel/20261119-dtfill-m5m6/.Assisted-by: LLM (Claude:Opus 5.5)