Repository navigation
iommu/apple-dart: add T8152 ANE Cold Gen3 DART support - #3863
Conversation
Document the Apple T8152 ANE Gen3 DART compatible ("apple,t8152-ane-dart").
Like apple,t8152-avd-dart, each T8152 ANE DART instance starts unlocked
with inactive streams, uses the shared Gen3 TLB invalidation aperture
("tlbi"), and requires power-domains, apple,dma-range, and apple,tunable.
Signed-off-by: Kevin loo <kevin@loo.ski>
Add support for "apple,t8152-ane-dart" (the four-instance Gen3 DARTs serving ANE0 and ANE1 on Apple T8152 / M6): - Cold-initialize stream 0 only (cold_gen3_sids = BIT(0)), verifying version 0x300, 16 streams, four-level support, ADT tunables, an attached PM domain, and inactive stream 0 at probe. - Keep native four-level 42-bit page tables (cold_gen3_4level = true) rather than clamping to a 36-bit 3-level window, matching the ADT's 1..4 TiB ANE DMA aperture and allowing ANE firmware at 0x10000000000 and fixed HWX surfaces (e.g. 0x30000000) to translate concurrently. - Set restore_on_power_up so runtime PM resume re-applies tunables and restores only owned cold_gen3_sids TTBR/TCR state followed by a stream-scoped TLB invalidation. Signed-off-by: Kevin loo <kevin@loo.ski>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed ab61b83. Every new path is selected by the new apple,t8152-ane-dart compatible, so the existing T8152 AVD/ISOC/ACIO/PCIe-C DARTs and older DARTs are untouched, and no device tree uses the compatible yet. The binding follows the AVD entry.
One thing to settle in the follow-up that adds the ANE nodes: the new cold_gen3_4level branch in apple_dart_resume() returns before apple_dart_dapf_replay() and the resume tunables that the normal power-up path runs. If the ANE DARTs lose their address filter or tunables when the PSD domain goes off, the first DMA after a runtime power cycle will fault. Please include a runtime power-off/on cycle (ANE idle long enough for the domain to drop, then a run) in that PR's J873g row.
|
Local merge-tree check while hosted CI is queued (main a2cc412 + ab61b83, pc). This holds the merge:
Update 14:15 UTC, head
|
The ISP host test compiles apple_dart_save_state() against its own struct apple_dart. Add the four-level flag and SID mask that the function now reads. The zero-initialized ISP fixture keeps exercising the ISP save path. Signed-off-by: Kevin loo <kevin@loo.ski>
satchlj
left a comment
There was a problem hiding this comment.
Verdict: MERGE at ed3899c2b7319281c3ccb73bda8e2876cec8b333
Blockers: none
Checked: no Apple material, no inappropriate model gating, apple,dart.yaml schema, apple-dart.c cold_gen3_4level probe/finalize/save/resume paths, apple-dart-isp-host-tests.py mock fix, local build/DT/KUnit/host-test and J873g qualification receipts, PR text
Evidence
Documentation/devicetree/bindings/iommu/apple,dart.yaml: addsapple,t8152-ane-dartto the Gen3reg-names: [dart, tlbi]group and requirespower-domains, matchingapple,t8152-avd-dart.drivers/iommu/apple-dart.c: all new logic is selected strictly byapple,t8152-ane-dart(no DT node in the tree uses it yet; existing DART compatibles are unchanged). Probe validates!locked,version == 0x300,num_streams == 16,four_level,tunables,dev->pm_domain, and inactive SID0;__apple_dart_finalize_domain()skips the 36-bit clamp whencold_gen3_4levelis set;apple_dart_save_state()andapple_dart_resume()scope save/restore and TLB invalidation to ownedcold_gen3_sids(BIT(0)).tools/asahi/apple-dart-isp-host-tests.py(ed3899c2b7): addscold_gen3_4levelandcold_gen3_sidsto the mockstruct apple_dartwith zero kernel diff fromab61b834c52e, fixing the earlier host-test compile failure (24/24 DART host tests pass).- Checks & receipts:
pr-readinessgreen (MERGEABLE, zero conflicts; note hostedapple-build/dt-checks/host-tests/KUnitwereskippedon this fork PR while local merge-treedt-checks141/141,W=1apple-dart.o0 warnings, 15/15 QEMU KUnit, 24/24 DART host tests, and J873g 8-instance dual-engine qualification passed). As noted on the prior review, please include a runtime PSD power-off/on cycle when the follow-up T8152 ANE DT PR lands to confirm DAPF/tunables retention oncold_gen3_4levelresume.
|
Local merge-tree receipt for head
Merging under the hosted-CI override. |
What: Add the
apple,t8152-ane-dartcompatible and Cold Gen3 DART support for Apple T8152 (M6) ANE0 and ANE1, cold-initializing stream 0 with native four-level 42-bit page tables and stream-scoped power-up restore.Tested: At
ed3899c2b, all 24 DART host tests passed on arm64 Linux. The ISP test passed its runtime restore and managed-link checks and caught all three negative controls. Strict checkpatch reported 0 errors, warnings, or checks on the fixture change. Atab61b834c,drivers/iommu/apple-dart.obuilds clean withARCH=arm64 LLVM=-22 W=1,checkpatch.pl --strictpasses with 0 errors/warnings, and ARM64 QEMU KUnit (jpeg+apple-dart-firmware-leaf) passes 15/15. Equivalentapple,t8152-ane-dartCold Gen3 implementation hardware-qualified on J873g M6 Mac mini (apple,t8152,7.3.0): all 8 DART instances (4x ANE0 + 4x ANE1) probe and translate concurrently with 0 DART faults, bit-exact fp16 execution across both engines (4,429 calls/s), clean driver unload, and reboot persistence.Risk: one-way door (new DT compatible
apple,t8152-ane-dart) · M6 (T8152) only; zero behavioral change for any existing DART compatible or other Mac.Not yet: Live boot on J873g M6 at the current head
ed3899c2b, and follow-up T8152 ANE / multi-slot PSD device-tree nodes.Details
Each T8152 ANE engine (
ane0andane1) sits behind four Gen3 DART instances (dart-aneat0x419800000..0x419860000, TLBI0x200000000, IRQ 789;dart-ane1at0x481800000..0x481860000, TLBI0x200000080, IRQ 837), each with 16 streams, version0x300, 42-bit VA/PA width (four_level = true), ADTapple,tunablerecords, and ADTvm-base = 0x10000000000/vm-size = 0x30000000000.Unlike
apple,t8152-avd-dart(which clamps to a 36-bit 3-level 64 GiB window), T8152 ANE needs native four-level 42-bit translation (cold_gen3_4level = true) so ANE firmware mapped at0x10000000000(1 TiB) and fixed HWX program surfaces (e.g.0x30000000) translate simultaneously without 36-bit aliasing or-ERANGE.Documentation/devicetree/bindings/iommu/apple,dart.yaml): addsapple,t8152-ane-dartto the Gen3reg-names: [dart, tlbi]group and requirespower-domains,apple,dma-range, andapple,tunable(same schema contract asapple,t8152-avd-dart).drivers/iommu/apple-dart.c):cold_gen3 = true,cold_gen3_sids = BIT(0),cold_gen3_4level = true, andrestore_on_power_up = trueforapple,t8152-ane-dart.!locked,version == 0x300,num_streams == 16,four_level == true,tunables != NULL,dev->pm_domain != NULL, and inactive SID0 at probe.__apple_dart_finalize_domain()whencold_gen3_4levelis set.cold_gen3_sids(SID0) across power cycles with stream-scoped TLB invalidation, leaving all existingapple,t8152-{avd,disp-isoc,acio,pciec}-dartand non-Gen3 paths untouched.Evidence
Local verification on
ab61b834c(rebased onorigin/mainf53f2fe9d):Hardware qualification on J873g M6 Mac mini (
apple,t8152,7.3.0) with the equivalent Cold Gen3 ANE DART implementation and dual-engineane_h18(owned_fw=1):419800000..419860000+481800000..481860000) probed and bound toane0andane1(SID0 only).ane0+ane1):4,429 calls/ssteady-state, bit-exact fp16 (mismatches=0,max_abs_err=0), 0 DART faults.0x30000000+0x31000000alongside0x10000000000firmware IOVA): 200 interleaved calls on both engines, 0 errors.