Repository navigation
Conversation
…3-ias T8152 Gen3 DARTs are invalidated through a command slot in the SoC's shared TLBI aperture rather than the T8110 TLB command register, and the loader may leave a stream with a narrower table walk than the VA width the DART reports. Describe both, for apple,t8152-dart only: - apple,tlbi-aperture: physical address of the DART's command slot - apple,gen3-ias: the walk width in bits, which requires the aperture Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Gen3 DARTs of T8152 do not act on the T8110 TLB_CMD register: a stream flush written there completes, but the DART keeps translating with the old entries. A Gen3 stream is invalidated through the SoC's shared TLBI aperture instead. A 16-byte command (bit 60, the DART's TLBI route from register 0x4604, the stream) is stored to the aperture, followed by a broadcast TLBI that the DART observes; the final DSB completes only once the broadcast has. This is the sequence the aura loader uses for its own Gen3 mappings (dart_gen3_tlb_invalidate()). A DART opts in with "apple,t8152-dart" and the physical address of its command slot in "apple,tlbi-aperture". "apple,t8152-dart" gets its own hardware ops, the T8110 ones with an invalidate_tlb that takes the aperture when there is one; without the property nothing changes, so the existing T8152 nodes, which have no aperture, keep the T8110 path. The ranged invalidations of firmware-held and locked DARTs still use TLB_CMD, as no Gen3 DART takes them yet. Like the T8110 command path, an invalidation is refused with -EHOSTDOWN while the DART's commands are gated. The aperture is shared by all Gen3 DARTs, so commands are serialised by one lock. Tested with an earlier version of this change on an earlier base (integration/aurora f5fa539), on a MacBook Pro (M6, J804) with the USB device controller's two DART instances under SMP: without the aperture invalidate, 8 of 20 256 KiB bulk transfers carried stale data from earlier mappings; with it, 220 transfers of 256-512 KiB (100 MiB) were byte-exact and the DARTs raised no exceptions. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T8152 Gen3 DARTs report a 42-bit VA in PARAMS3, so the driver builds four-level tables for them. The loader (and the firmware it hands over to) runs these streams with a three-level walk indexed by the low 36 bits of the DVA, while the device itself issues DVAs in a high window such as 0x100_0000_4000. The tables Linux builds must match the walk the DART is configured for. Add an optional "apple,gen3-ias" property to Gen3 DART nodes (those with an apple,tlbi-aperture) that sets the walk width. The domain already masks every DVA with the walk width before it touches the tables, so the device keeps its high window while the tables use the low bits. The property is ignored outside 32 bits to PARAMS3's width, and without it nothing changes. Tested on an earlier base (integration/aurora f5fa539), on a MacBook Pro (M6, J804), on the SEP's Gen3 DART, whose stream 0 the loader leaves with a three-level walk: with apple,gen3-ias = <36> the SEP runs on Linux's tables (Touch ID enrolment and verification); without it the four-level tables do not match the stream's walk. Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sithglan
left a comment
There was a problem hiding this comment.
Test report, 2026-11-17: Apple Mac mini M6 (J873g/T8152, board 0x24). PR revision tested: 0ffca47a6103dbe9f8f87282ddcb9a2c165229e4.
Host validation used the combined #2105–2108/#2110–2112 series (54742c617db4 on 677be395b9d2) with Clang 22. All changed driver objects built with W=1 and no new warnings; two pre-existing DART unused-helper warnings were unchanged.
apple-dart.o built with Clang 22 and W=1 with no new warnings. The 15 DART host regression cases passed, including negative controls; the related MTP/DART check passed 1/1. All 137 Apple DTBs built at base and combined head with no new warning lines, and all ten changed bindings passed.
Hardware coverage is limited: the current mini DT contains neither apple,tlbi-aperture nor apple,gen3-ias. Its custom display DART uses apple,t8152-dart-gen3. The new opt-in invalidation/walk-width path was therefore not exercised on hardware. The patch also did not apply cleanly to the older private M6 DART branch, and no forced backport was used. These results do not qualify the new Gen3 path for deployment.
Summary
The Gen3 DARTs of T8152 (M6) ignore the T8110
TLB_CMDregister, so Linux-owned mappings that change after boot are not seen by the device. This adds the Gen3 invalidation path through the SoC's shared TLBI aperture, and an optional walk width for streams the loader left with a three-level walk. Both are opt-in per DART node and change nothing for existing device trees, including J873's T8152 nodes, which have neither property.Changes
dt-bindings: iommu: apple,dart:apple,tlbi-aperture(u64, the DART's 16-byte command slot) andapple,gen3-ias(u32, 32-42, requires the aperture). Both are allowed only forapple,t8152-dart.iommu/apple-dart:apple,t8152-dartgets its own hardware ops: the T8110 ones, with aninvalidate_tlbthat goes through the aperture when the node hasapple,tlbi-apertureand is the T8110 path otherwise. A Gen3 invalidation is a 16-byte command (bit 60, the route from register 0x4604, the stream) stored with onestp, thendsb(ish),__tlbi(vale1os, 0)anddsb(osh). Commands are serialised by one raw spinlock, because all Gen3 DARTs share the aperture. Like the T8110 command path, an invalidation returns -EHOSTDOWN while the DART's commands are gated for sleep. This is the same sequence the aura loader uses (dart_gen3_tlb_invalidate()).apple_dart_t8110_hw_tlb_command_range(), because the host tests (tools/asahi/apple-dart-*-tests.py) compile that function and its callers verbatim against their own model ofstruct apple_dart.apple_dart_fw_invalidate(), the locked range path) still useTLB_CMD. No Gen3 DART takes those paths in this PR.iommu/apple-dart:apple,gen3-iassets the walk width of a Gen3 DART. DVAs are already masked to the walk width before the tables are touched, so a device can keep its high DVA window.Testing
On hardware: MacBook Pro 14-inch (M6, J804), 2026-11-16, tested by LiamRay11.
bf423bf0ewith all nine J804 linux PRs merged (t8152-mailboxes, dart-gen3, dt-board, centauri, g18-fast-retire, cfg80211-stale-scan, smc, cs42l84-jack, and an NVMe PR that is not sent yet), plus retest-only device-tree changes that are not part of these PRs: SSD nodes (ANS mailbox, SART, NVMe), PCIe port 0 with the N1 Wi-Fi, the USB0 gadget console, and aread-onlyNVRAM partition. Those nodes were needed to reach the root filesystem and SSH.systemctl rebootfrom this kernel (watchdog restart) returned to the installed system.Results for this PR (the retest-only nodes give the PCIe port 0 and USB0 DARTs
apple,tlbi-aperture):Earlier, with the same changes on an older base (integration/aurora f5fa539):
apple,gen3-ias = <36>: Touch ID enrolment and verification work.apple,gen3-iaswas not exercised in this retest (no SEP node in that tree).Checks on this base:
drivers/iommu/apple-dart.owithW=1builds without warnings (clang, LLVM=1, arm64).host-tests.ymlruns them): everytools/asahitest that readsdrivers/iommu/apple-dart*.cpasses, at both base and head: apple-dart-range, apple-dart-fw, apple-dart-fw-harness, apple-dart-tlb-stall (with--dtc; theevery-handoffmutation is still killed), apple-dart-dapf, dart-sleep-power, dart-sleep-writer, dart-sleep-snapshot, dart-cio-owner, dart-cio-power and j613-mtp-s2idle. The--refnegative controls, which need git history, were not run.scripts/dtc/apple-dt-check.sh(basebf423bf0e, head = this series together with j804/dt-board, j804/t8152-mailboxes and the J804 NVMe change): 137 Apple DTBs built at both, 0 new CHECK_DTBS warnings (8 removed: the J873gapple,t8152-pmgr/-pmgr-pwrstateones), anddt_binding_checkpasses for every changed binding.integration/aurora has since moved to
677be395b; this branch still merges into it without conflicts.Known limitations
apple,tlbi-apertureis a physical address in a vendor property. A namedregentry would be more usual, but the aperture is one SoC block shared by every Gen3 DART, and the existing T8152 DART nodes already use their secondregfor a second DART instance. A phandle to a shared aperture node plus an offset is the other option, if reviewers prefer it.Gen3 exception reporting is not handled. The T8110 IRQ path reads registers that are zero on Gen3. That is left for a separate change, once the Gen3 exception registers are documented.
Keeping the firmware roots of locked T8152 display DARTs (
fw_mirror) is not part of this PR. On the locked real-time display streams a whole-stream TLBI under a running scanout faults the DCP, so that change belongs with the display support.No DT user is added here. The J804 nodes that use these properties come with their consumers.
Dependencies
None.
🤖 Generated with Claude Code