Skip to content

arm64: dts: apple: t6050: apr1 on every T6050, both ave1 DART streams - #2422

Draft
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
community/t6050-apr1-ave1-dt
Draft

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
community/t6050-apr1-ave1-dt

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

The M5 Max has two video encoders and two ProRes engines (Apple's tech specs). In our T6050 tree the second ProRes engine, apr1, was described only under #if defined(T6050_J873S). The J873s is the M5 Pro Mac mini, so that was the wrong gate: no Max or Ultra board had the node, and the one board that had it is a Pro. The second encoder, ave1, listed only SID 0 of its two DARTs. ave0 lists SIDs 0 and 12.

Change

  • Move apr1 out of the board block. It now sits next to apr1_dart, which is already described for every T6050. Give it reg-names = "core", "wrapper" and keep it disabled. The ADT has apr1 only under the M5 Max and Ultra die variants (:sotra_h17c, h17cr1, h17cr2, h17d) and not under the M5 Pro (h17s). Every single-die T6050 board, Pro or Max, includes the same SoC description (t6050-max.dtsi is the one-die base despite its name). So there is no Max-only file to move the node into, and a disabled node in the shared description is the honest option.
  • ave1: iommus now lists SIDs 0 and 12 on both DARTs, the same as ave0. The ADT's dart-ave1 has the same sid property as dart-ave0 (0 and 12).
  • Nothing gets enabled. apr1 has no SCODEC windows (aux, ctrl), which the driver's T6050 variant requires. ave1 needs a firmware handoff for a second encoder (see below).

Testing

  • Built every T6050 DTB (J714c, J714s, J716c, J716s, J775c, J775d, J873s, K114c, K114s, K116c, K116s) with kbuild's cpp flags and dtc, before and after, with the W=1 checks this dtc supports turned on (unit_address_vs_reg, avoid_unnecessary_addr_size, alias_paths, simple_bus_reg). Same warning count on every board, and none come from these nodes.
  • Decompiled the DTBs and diffed them: J873s gains only reg-names on apr1. Every other board gains the disabled apr1 node, a phandle on apr1_dart, and the two extra ave1 streams. Everything else is phandle renumbering.
  • dt-validate against this tree's bindings: 6074 messages before and after, none for apr1 or ave1. The ProRes binding already allows two windows for a T6050 instance.
  • Merges cleanly with arm64: dts: apple: t6050: enable the media engines on every board #2278 (t6050 media enables).

Still to run (M5 Max owner: J714c, J716c, J775c, K114c, K116c; Ultra J775d)

  1. Does iBoot preload ave1? From the aura log, or from the ADT in macOS: ioreg -l -p IODeviceTree -n ave1 | grep -E 'segment-ranges|reg'. With aura#334 plus aura#341, the line to look for is FDT: AVE ... from ADT /arm-io/ave1, with two memory-region entries on /proc/device-tree/soc*/video-encoder@23a3100000.
  2. On an M5 Pro (J714s, J716s, J873s, K114s, K116s): is apr1 absent from the live ADT (ioreg -l -p IODeviceTree -n apr1)? Is ave1 present, and is it preloaded?
  3. After the encoder is enabled (follow-up): two concurrent encodes on the two video nodes, both at full rate (gst-launch-1.0 videotestsrc num-buffers=600 ! video/x-raw,format=NV12,width=3840,height=2160,framerate=60/1 ! v4l2h265enc ! fakesink on each node at once, fps for each).
  4. ProRes on apr1: needs a driver variant for the two-window "apr,n1" engine first. That variant needs a Max owner's ADT apr1 node and a register dump. Not in this PR.
Why there is no driver or boot loader change here
  • The single-encoder assumptions (ave-drv.c fixed apple-ave debugfs directory, ave-fw.c one set of CRCs in /chosen) are already fixed generically by media: apple: ave: add the T6021 (M2 Max) encoder #2374 (ludagoo, commits "give each encoder its own debugfs directory" and "read the firmware CRC and IOVA per encoder": aurora,crc32 per reservation, several iommu-addresses tuples). T6050 can reuse those as they are.
  • Boot loader: aura#334 (draft) hands over every encoder node, matched to its ADT node by address. Its own notes say T6050 ave1 is matched and reserved if the ADT preloads it, and stays disabled in the DT. aura#341 adds the per-reservation CRC that two encoders with different DATA images need. With both merged and rebased, enabling ave1 (and its DARTs and VENC1 power states) for T6050 is a DT-only follow-up, gated by the preload the boot loader finds and not by a board list. It waits for row 1.
  • The ProRes driver already takes its windows from DT by name and creates no fixed debugfs names, so two instances do not collide. apr1 is a different engine ("apr,n1": two windows, two interrupts, its own reset). Its init rows are not known, so a variant for it would be guesswork.
  • J775d die 1 (ave2, ave3, apr2, apr3, jpeg2, jpeg3, scaler2, scaler3) has no nodes, and die 1's VENC/PRORES/SCODEC power states are not described either. That is DT fill work for the DTFILL-T6050 lane and is left out here.
ADT facts used (public J873s dump, GravityLinux adt-collection, macOS 27.0)
  • apr1 (compatible apr,n1, interrupts 1763 and 1762, clock gate 639): only under /arm-io/:sotra_h17cr1_42, :sotra_h17cr2_42, :sotra_h17c_48 and :sotra_h17d_97. Its reg is two windows, 0x210b000000 (0x4000) and 0x210a000000 (0x1000000), which are 0x230b000000 and 0x230a000000 after arm-io's ranges. apr0 (apr,n0) has five.
  • dart-apr1 is a plain /arm-io child, as in the DT.
  • dart-ave0 and dart-ave1: both have sid = 0xc00000000, which is SIDs 0 and 12. Their registers match ave0_dart/ave0_dart1 and ave1_dart/ave1_dart1.

Assisted-by: LLM (Claude:Opus 5.5)

The second ProRes engine (apr1) was described only when T6050_J873S was
defined. The J873s is an M5 Pro Mac mini, and its ADT (the public
GravityLinux adt-collection dump, macOS 27.0) has apr1 only in the
children for the M5 Max and Ultra die variants (:sotra_h17c, h17cr1,
h17cr2, h17d), not for the M5 Pro (h17s). Its DART, apr1_dart, is
already described for every T6050.
Move the node out of the board block next to its DART, name its two
windows (core, wrapper, in apr0's order) and leave it disabled: unlike
apr0 it has no SCODEC aux/ctrl windows, which the T6050 ProRes variant
needs.

ave1's iommus listed only SID 0 of its two DARTs. That ADT's dart-ave1
has the same SIDs as dart-ave0, 0 and 12 (the temporal filter), and
ave0 already lists both: do the same for ave1. ave1 stays disabled.

The J873s DTB gains only reg-names on apr1. Every other T6050 DTB gains
the disabled apr1 node and the two ave1 streams.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.

1 participant