Repository navigation
arm64: dts: apple: give the remaining DARTs their engines' power domains - #1676
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
I went through 49931e7 one commit at a time. For each DART I checked the domain of every engine that uses it in the DT, and checked the ADT evidence quoted in each commit message against the macOS device trees for J413, J414s, J475c, J180d, J873s and J813.
| Commit | DART(s) → domain | Consumer engine domain | ADT evidence in the commit | Result |
|---|---|---|---|---|
| t8112 | m2_dart_apr_0/1, m2_dart_scdc → ps_scodec |
m2_apr, m2_scdc on ps_scodec |
agrees | OK |
| t602x | m2_dart_scaler0 → ps_msr0 |
scaler0 on ps_msr0 |
agrees (the ADT DART vote names the AVD DART) | OK |
| t602x | m2_dart_scaler2 (T6022 die 1) → ps_msr0_die1 |
scaler2 on ps_msr0_die1 |
agrees (the ADT vote is missing the die-1 bit) | OK |
| t602x | J475c/T6022 dispext{2,3,6,7}/dcpext{2,3,6,7} DARTs → ps_dispextN_cpu0[_die1] |
DCPs on the same domains | agrees | OK |
| t602x | ane_dart0 ps_pmp → ps_ane_sys |
ANE under ps_ane_sys |
agrees | OK, needs a boot (see below) |
| t6050 | rsm_dart → ps_debug_gated, auss0_dart → ps_auss |
rsm, usb_auss0 on the same |
agrees | OK |
| t8142 | scaler0_dart → ps_msr |
scaler0 on ps_msr |
agrees | OK |
DTBs: I built all 137 Apple DTBs with dtc, before (f173f7c) and after. 26 change: 8 T602x, 11 T6050, 4 T8112 and 3 T8142. The preprocessed sources differ only in power-domains lines. t6000-j316s, t6040-j616s and t8140-j700 come out byte-identical. In t8112-j413 only the three apr/scdc DARTs change, and all three stay disabled.
Hardware (J413, M2). One boot of the live Stage 2 with only the j413 DTB changed, run as an aura-try trial on the production kernel 7.3.0-aurora-fleet67:
- The trial DTB is the live j413 DTB plus
power-domains = <&ps_scodec>oniommu@27d024000,iommu@27d028000andiommu@27d02c000. For this boot only, I also set the three DARTs tookayso the new domain gets exercised. The PR itself leaves them disabled. - All three bound to apple-dart, each with a device link to the scodec power controller. They runtime-suspend, and
pm_genpd_summaryshows scodecoff. Writingonto theirpower/controlpowered scodec up, andautopowered it down again. No SError. - 0 DART faults, SELinux enforcing, 0 failed units, 0 AVCs. s2idle 3/3 (rtcwake on rtc1), Wi-Fi back after each resume.
- Kernel errors: one new entry, a UBSAN shift-out-of-bounds in
apple_dart_probeatdart->dma_max = DMA_BIT_MASK(dart->ias).DMA_BIT_MASK(n)isGENMASK_ULL((n) - 1, 0), soiaswas 0: at least one of these DARTs read a zero VA width fromPARAMS3with only scodec on. This comes from my extraokayoverride, not from this PR. Before ProRes or SCDC gets enabled on T8112, someone should check whether these DARTs need another domain or clock to report valid params. The probe could also rejectias == 0with an error rather than computing a mask from it. - The production boot afterwards was clean (0 kernel errors), and the Stage 2 hash was unchanged.
- No trial was needed on J316s, J616s or J700, since their DTBs do not change.
Approving the series. ane_dart0 (856b8d4) is the only change to a node that is enabled, and it still needs the T602x boot listed in the description before merge.
…domains The M2 ProRes engine (m2_apr) and its SCDC coprocessor (m2_scdc) name ps_scodec, but their three DARTs (m2_dart_apr_0, m2_dart_apr_1 and m2_dart_scdc) name no power domain. A DART probes as a device of its own, so once these nodes are enabled the probe's first register read lands on an unpowered block, takes an SError and panics the boot in apple_dart_readl, as the T8132 scaler and JPEG DARTs did. The J413 device tree (macOS 27.2.1) gives dart-apr (both of its windows, 0x27d028000 and 0x27d024000) and dart-scdc no clock-gates of their own; their engines, apr and scdc, gate SCODEC. macOS powers these DARTs with their engines, so give each one the engines' domain, as the T602x ProRes and SCDC DARTs have. The nodes stay disabled, so no current boot changes. Fixes: 168d614 ("arm64: dts: apple: describe disabled T8112 peripheral resources") Signed-off-by: Diljit Singh <hey@djdev.me>
…r power domains Two groups of disabled T602x DARTs name the wrong power domain, or none, for their block. A DART probes as a device of its own, so once one is enabled its first register read needs its block powered, or it takes an SError and panics the boot in apple_dart_readl, as the T8132 scaler and JPEG DARTs did. Scaler DARTs. m2_dart_scaler0 names ps_avd_sys, and the M2 Ultra's die 1 copy, m2_dart_scaler2, names ps_spi3, a die 0 SPI controller. Both copy the M2 device trees (macOS 27.2.1) literally, and those entries are wrong there: dart-scaler0 votes AVD-SYS-DART, the vote of the AVD's DART, and dart-scaler2 votes 0xb6 without the die 1 bit, which is die 0's SPI3. The PMGR table has an MSR0-DART vote, parent MSR0, that no node uses, and the second scaler's DARTs (dart-scaler1, dart-scaler3) vote MSR1-DART. The scaler engines vote MSR0 on their own die, and the M1 Pro/Max/Ultra scaler DARTs at the same address already name ps_msr0 and ps_msr0_die1. Name the engine's domain: ps_msr0 on die 0, ps_msr0_die1 on die 1. External DCP DARTs. The J475c's dispext2/dispext3 and the M2 Ultra's dispext2/3/6/7 piodma and DCP DARTs name no domain, while their DCPs name ps_dispextN_cpu0. These DARTs have no clock-gates in the Apple device tree; their DCPs gate DISPEXTn_CPU0. Give each DART its DCP's domain, as the J414c and J416c copies in t6021-display2.dtsi have. All of these nodes stay disabled, so no current boot changes. Fixes: c91d838 ("arm64: dts: apple: describe disabled T602x peripheral resources") Signed-off-by: Diljit Singh <hey@djdev.me>
…ains The T6050 AUSS USB block (usb_auss0) names ps_auss and the RSM block names ps_debug_gated, but their DARTs (auss0_dart, rsm_dart) name no power domain. A DART probes as a device of its own, so once one is enabled its first register read lands on an unpowered block, takes an SError and panics the boot in apple_dart_readl, as the T8132 scaler and JPEG DARTs did. The J714s device tree (macOS 27.2.1) gives dart-auss0 and dart-rsm no clock-gates of their own; their engines vote AUSS_V (parent AUSS) and DEBUG_GATED. macOS powers these DARTs with their engines, so give each one its engine's domain. Both domains are disabled until a board enables the block, and the DART then waits for its domain instead of probing on an unpowered block. The nodes stay disabled on every T6050 board, so no current boot changes. Fixes: 7e0f7c7 ("arm64: dts: apple: stage disabled T6050 peripheral inventories") Signed-off-by: Diljit Singh <hey@djdev.me>
The T8142 scaler (scaler0) names ps_msr and ps_msr_ase_core, but its DART, scaler0_dart, names no power domain. A DART probes as a device of its own, so once the scaler is enabled the DART's first register read lands on an unpowered block, takes an SError and panics the boot in apple_dart_readl, as the T8132 scaler and JPEG DARTs did. The J813 and J704 device trees (macOS 27.2.1) give dart-scaler no clock-gates, which is what the node's comment said. That does not leave the DART without a domain: its engine, scaler0, votes MSR-V, parent MSR, and macOS powers the DART with it. Give the DART the engine's domain, ps_msr, as the T8112, T8132 and T8140 scaler DARTs have. The node stays disabled, so no current boot changes. Fixes: 234da6d ("arm64: dts: apple: share T8142 die resources with canonical labels") Signed-off-by: Diljit Singh <hey@djdev.me>
49931e7 to
9af4539
Compare
|
The t602x |
Carry the RSM and AUSS0 DART power domains from aurora-silicon#1676 into the loader-compatible layout. Also sync the ProRes register names/reset and DART aperture, JPEG register sizes and DART aperture, CLPC SMC supplier, and CPU PMU description added upstream since the previous merge. Keep the identity-mapped board includes: including the shared modern peripheral layout would change installed-loader paths. Disabled inventory stays disabled; GPU handoff resources are unchanged. Signed-off-by: Satya Benson <satya@benson.earth>
Follow-up to #1668 for the SoCs not covered there or in the parallel T8103/T600x/T603x/T8122/T8132 PR. #1668 fixed the J713 boot panic: a DART probes as its own device, and when it names no power domain (or the wrong one), its first register read can land on an unpowered block. That read takes an SError and panics in
apple_dart_readl.I checked every
apple,*-dartnode in the T8112, T602x, T6034, T604x, T6050, T8140, T8142 and T8152 device trees against its consumers (iommusandiommu-map) on all 137 Apple boards. I then compared each candidate with the macOS 27.2.1 device trees, using the DeviceTree images in the public IPSW. Evidence rule: if the ADT gives the DART a PMGR vote of its own (clock-gatesnaming anX-DARTdevice), use that vote's parent. Otherwise use the domain of the engine that names the DART iniommu-parent, as #1668 did.One commit per SoC family:
m2_dart_apr_0,m2_dart_apr_1,m2_dart_scdcps_scodecaprandscdcengines gate SCODEC; the T602x copies already useps_scodecm2_dart_scaler0(T6020/1/2)ps_avd_sysps_msr0dart-scaler0votes AVD-SYS-DART (the AVD DART's vote), while MSR0-DART (parent MSR0) is used by no node;dart-scaler1/3vote MSR1-DART; the engine votes MSR0; the M1 Pro/Max/Ultra DARTs at the same address useps_msr0m2_dart_scaler2(T6022 die 1)ps_spi3ps_msr0_die1dart-scaler2votes0xb6without the die-1 bit, which is die 0's SPI3m2_dart_dispext{2,3,6,7}_0,m2_dart_dcpext{2,3,6,7}ps_dispextN_cpu0[_die1]t6021-display2.dtsialready use these domainsane_dart0ps_pmpps_ane_sysdart-ane0votes ANE-SYS-DART (parent ANE_SYS); the T8103, T8112 and T600x ANE DARTs useps_ane_sysauss0_dart,rsm_dartps_auss,ps_debug_gatedscaler0_dartps_msrscaler0engine votes MSR-V (parent MSR)Every node except
ane_dart0is disabled on every board, so only the ANE commit changes a current boot.ane_dart0is enabled on J414s, J416s, J474s, J414c, J416c and J475c. Today it probes before anything has powered ANE_SYS, so it relies on the loader having left ANE_SYS on.ane_dart1andane_dart2(onps_ane_cpu, a child ofps_ane_sys) hold ANE_SYS on after they probe, so after probe nothing changes. It is a separate commit in case reviewers want to drop it.Checked, no change:
status = "disabled"), except on J616s where they are always-on. Pointing a DART at a disabled domain would make it defer forever.ps_disp_cpuis always-on and firmware-owned.ps_dispext0_cpustays disabled until the loader's J700 dcpext group turns it on, so a domain on the DART could make it defer.Validation, build-checked only:
make dtbs W=1for all 26 T8112, T602x, T6050 and T8142 boards: no new dtc warnings against the base.apple-adt-coverage.py --reporton J413, J716s and J873s: no broken paths.dt-check-styleon the changed files: clean.power-domainschanges.No hardware boot yet.
Before merge: the
ane_dart0commit (856b8d4) needs one boot on a T602x machine (any of J414s, J416s, J474s, J414c, J416c or J475c). Check that285800000.iommuprobes cleanly, that the ANE still binds, and that there is no SError. If no T602x tester is available, drop that commit from this merge and resubmit it as its own PR. The other commits only touch DARTs that are disabled on every board (the J475c/Ultra dispext/dcpext DARTs included), so build-checked is enough for them.🤖 Generated with Claude Code