Repository navigation
arm64: dts: apple: fix t6032-j575d against the 27.0.1 ADT; add ADT-vs-DT CI check - #207
joshuaswarren wants to merge 8 commits into
Conversation
…-DT CI check Fix the T6032 (M3 Ultra, Mac Studio 2025, Mac15,14, j575dap) description against the j575dap ADT of the pinned macOS 27.0.1 (26A434) firmware: - Add USB-C controller 3. drd3 is not a die-stride mirror of a die-0 port: the ADT puts it at 0x1302280000, inside die 0's identity window, powered by the die-0 ATC3_USB state (dwc3 irq 1446, darts 1450). Delete the die-1 mirror of die-0 port 2 (dwc3_2_die1 at 0x2f02280000 with its darts and atcphy): no such port exists. Ports 4 and 5 stay as the dieX mirrors of die-0 ports 0 and 1 (ADT usb-drd4/5, dart-usb4/5). - Delete the phantom die-1 USB4 controller (usb4_2_acio_die1 + usb4_2_mbox_die1 at 0x2f01ac0000); the die-1 usb4_0/1 instances match ADT acio4/acio5 and stay. - Delete the laptop-only devices with no j575dap ADT counterpart: the MTP keyboard stack, the AOP audio ADMAC (with aop_audio, its only consumer), i2c3 and spi1; the board file drops spi1-nvram.dtsi with it. - Add the GPU (gpu,t6032 sgx + gfx-asc + ASC mailbox + OPP/UAT scaffolding), the eight external display pipes (dcpext0-7 with their mailboxes and DARTs) and both ANE engines (ane0/ane1 + three DARTs each) from the ADT. All stay disabled: drm/asahi g15 has no T6032 row, the DCP driver has no 27.x firmware family and m1n1 gates the display handoff on the OS firmware, and no M3 ANE driver exists. The power states these nodes reference already exist in the t6031 pmgr description. - Keep the die-1 cpufreq and pmgr nodes: hardware mirrors at the die stride (m1n1 PMGR_DIE_OFFSET) of register files the ADT describes inside the pmgr node's window list. Add an ADT-vs-DT CI checker (.github/scripts/adt-dt-check-t6032.py, workflow t6032-adt-dt-check) so these fixes cannot regress: it builds the DTB, fetches DeviceTree.j575dap.im4p from the pinned 27.0.1 IPSW by two HTTP range requests, verifies pinned SHA256 hashes of both the im4p and the LZFSE-decompressed ADT, and requires every ADT node the board needs to be covered by the DT, the phantom and laptop-only windows to be absent, every DT SoC node to map into the ADT, the referenced power states to sit at the ADT bank+offset in both dies, and the GPU/DCP/ANE nodes to stay disabled. The fixed tree passes 104 checks; the pre-fix tree fails 43. DTBs verified to still build: t6032-j575d, t6030-j516s, t6031-j514c, t6031-j516c, t6034-j514m. Local branch w7C/t6032-dt-27, based on omacom/linux-aurora integration/aurora 7b96998. Not pushed. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
…st the ADT The first interrupt column of the ADT encodes die 1 by adding 0x1000 to the AIC number; the DT interrupt spec carries the die in its own cell and uses the die-0 number. The die-1 ANE and display-pipe nodes added for t6032 carried the raw ADT numbers (5xxx) in a die-1 spec, which maps to AIC hardware interrupts that do not exist. Rewrite them as die-0 numbers with the die cell set (ane1 965/964/967/966/983 and dart 984, the pipe 4-7 mailboxes 1068-1179 and darts 1047/1083/1119/1155). Extend the ADT-vs-DT checker to compare interrupts, so this class cannot regress: every DT interrupt must appear in the interrupt set of an ADT node its windows overlap (compared as (die, irq) pairs, so order differences such as the gfx-asc mailbox reorder are handled), and every required ADT node with valid interrupts (per the ADT interrupts-valid bitmask; sgx entry 5, IRQ 1249, is invalid) must have them carried by a DT node. Allowlisted deliberate differences, each commented: the display pipes' interrupts are carried by their mailbox and DART nodes, and the inherited four-cluster mca node carries a fourth interrupt (1321) the 27.0.1 ADT does not list (it describes three MCA instances). Verified against the 27.0.1 j575dap ADT: the fixed tree passes 245 checks; the unfixed base tree (integration/aurora 7b96998) fails 84, the previous commit's tree fails 30, and a DTB with one dart interrupt changed fails and exits 1. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Enable the four PCIe ports and their DARTs and add the 10 Gbit Ethernet node, with the SMC power-enable lines for the WLAN, SD reader and USB xHCI ports. The port assignment and the power-enable keys come from the 27.0.1 ADT of a retail unit: WLAN and Bluetooth on port00, SD reader on port01, 10 Gbit Ethernet on port02, ASM3142 xHCI on port03. The ADT has no power function for port02 and no PCI IDs, so the WLAN, Bluetooth and SD reader child nodes are left out. Checked: the dtb builds, and the ADT-versus-DT check passes. Not checked: any PCIe link, DMA or boot on hardware. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Build in the pin controller, SMC GPIO, SART and NVMe drivers that the PCIe ports and the disk need, so a boot without an initramfs can reach the 10 Gbit port. Add the aQuantia AQtion driver for the 10 Gbit port (the ADT names it lan-10gb with an aqc-a i2c companion; it has no PCI ID) and the xHCI PCI driver for the USB-A ports. Checked: merged over defconfig and asahi.config, olddefconfig keeps every symbol. Not checked: a kernel build with this config, or any boot. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
84f063c to
df16bdb
Compare
|
GREEN at df16bdb Scope: the two new commits, 0bbf34a (PCIe ports, Ethernet, power-enable lines) and df16bdb (console and network config fragment), plus how they sit on the T6031 base the T6032 tree includes. I did not re-review 40ae094 and 05cc2d4 (the CI checker covers those), and I did not run the ADT check, a dtc build or any boot. No boot claim in the texts, which is right. PCIe commit, checked against the included T6031 nodes (t6031-die0.dtsi at this head):
Config fragment: every symbol exists in asahi.config as a module (PINCTRL_APPLE_GPIO, MFD_MACSMC, GPIO_MACSMC, APPLE_SART, NVME_APPLE) and the fragment turns them to y, which is what "boot without an initramfs" needs; PCIE_APPLE, APPLE_DART, APPLE_AIC, APPLE_RTKIT and SERIAL_SAMSUNG are already y there. AQTION, USB_XHCI_PCI(_ASMEDIA) and the CDC USB net options are plain additions. GPU, display and ANE stay off. The commit says olddefconfig keeps every symbol; I did not reproduce that. Not checked, and the reason this is a GREEN for the diff and not a boot claim: the port assignment, the three SMC key values and the PERST pins (pinctrl_ap 4 to 7 come from the T6031 base, not from this commit) against the real ADT of a T6032; the checker and ADT fetch were not run by me. |
|
Review at df16bdb: commits 1-2 ( What I did. Built the real
dtsi against the ADT, beyond what the checker does.
Findings in
Not run on hardware and not on CI. I did not read the commit 3-4 content again (already GREEN at this head). |
Section 6 of the ADT-versus-DT check compared the DT node name before the '@' with a list of DT labels, so it never matched a node. A DT node is now a gated node when its first register window starts where a window of a gated ADT node starts (a DART: any window); it must be disabled, and fewer matching DT nodes than gated ADT nodes is a failure. Switching on ane@3c9400000 and dcp@306c00000 in a copy of the DTB is now a CI step and must be flagged. Also: install device-tree-compiler in the workflow, fix the die-1 label test (the soc node ends in 2200000000), and say in the docstring what section 4 compares. Checked: 277 ok, 0 FAIL on the real DTB; the mutation is flagged for both nodes. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
GREEN at b732ee8 Read the diff over
Not run on CI (the workflow still needs approval to run) or hardware. |
|
Ready for review. The device tree and the checker fix (b732ee8) have one review, and the earlier PCIe and ethernet commits have two. Nothing here has booted a Mac. |
The 27.0.1 ADT of a retail unit names the SD reader on port01 as pci17a0,9755, so the child node can be written. The card-detect and write-protect polarity is taken from the M2 Ultra Studio board; it is not in the ADT. Checked: the dtb builds, the ADT-versus-DT check passes, and the mutation check still flags a gated node switched on. Not checked: any SD card on hardware. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
[Medium impact] No blocking findings remain, but the three earlier checker gaps are still open. FindingsSummaryUpdates the T6032 board description against the pinned macOS 27.0.1 ADT.
|
| (0x5B8, "td"), (0x5C0, "base")): | ||
| REQUIRED_PS.append((soc, "power-management@292280000", off, | ||
| f"ps_ane_{nm}{sfx}")) | ||
| REQUIRED_PS.append(("soc@2200000000", "power-management@2a0280000", 0x158, "ps_atc3_usb")) |
There was a problem hiding this comment.
REQUIRED_PS checks ps_atc3_usb on die 1, but the new USB controller and PHY use the die-0 state. The checker also never follows power-domains, so changing those devices to the wrong state still passes while the expected controller nodes remain. Check the die-0 entry and follow each device’s reference before checking its bank and offset.
| hit = any(overlap(w, dw) for _, _, dwins in dtnodes for dw in dwins | ||
| for w in wins) |
There was a problem hiding this comment.
Required-node coverage accepts any single overlapping window. Removing ane0_dart2 and its iommus entry still leaves the other two DARTs covering dart-ane0 and carrying IRQ 984. Their extra matches also keep the disabled-device count above its minimum. CI therefore misses the loss of one of the three DARTs added here. Check each required DART window separately and add a deletion mutation test.
| for path, node, wins in dtnodes: | ||
| if wins and wins[0][0] in starts: | ||
| hit += 1 | ||
| st = dt_strings(node.props.get("status", "")) | ||
| check(st == ["disabled"], f"{path}: disabled" | ||
| if st == ["disabled"] else f"{path}: status is {st or 'okay'}, must be disabled") | ||
| check(hit >= len(gw), f"{hit} DT nodes match the {len(gw)} gated ADT nodes" |
There was a problem hiding this comment.
Enabled engine escapes the check
The disabled check recognizes an engine only by its first reg window, then checks a shared total instead of each device. Reordering ane0’s first two windows and setting its status to okay skips its status check. The unchanged windows and interrupts still satisfy the other checks, and the extra ANE DART matches cover the lost count. Track each gated device separately and add a mutation that changes register order as well as status.
|
Review at 042b0f4: the SD reader node is fine; the commit message is wrong about the ADT. Diff over Finding: the commit says the card-detect and write-protect polarity "is not in the ADT". Both properties are there, and both values are 1 ( Not run: the checker again (this hunk adds no gated SoC node), and no SD card on hardware. |
Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The self-test job audits every workflow with zizmor in the pedantic persona, and the new t6032 workflow tripped six findings: an action pinned to a tag instead of a hash, a checkout that keeps the token, default permissions at both the workflow and the job level, a job with no name, and no concurrency setting. The unpinned action is an error, so the audit exited 14 and the self-test failed, which failed the result gate. Give the workflow the same shape as the kernel CI workflows it sits next to: an empty workflow permissions block, a job permissions block that only reads the tree, a named job, a concurrency group that replaces a superseded pull request run, the checkout pinned to the hash the other workflows use with persist-credentials off, and a timeout. The runner is pinned to ubuntu-24.04 so the toolchain does not move under the job. Checked: zizmor 1.31.1 in the pedantic persona reports no findings on .github/workflows, and actionlint 1.7.12 is clean. Not checked: the workflow has never run on CI, because a workflow from a pull request needs a maintainer to approve it first. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
[Joshua's agent] The current head needs the required review; the squash commit will correct the SD reader polarity evidence. |
Phase 2 of M3 Ultra (Mac Studio 2025, Mac15,14,
j575dap, T6032) support: the board description. Draft. Target firmware macOS 27.0.1 (26A434).What changes
0x1302280000(ADT: inside die 0's window, power state ATC3_USB). Deletes the die-1 copy of die-0 port 2 at0x2f02280000; the ADT has no such port. Ports 4 and 5 stay as die-1 mirrors of ports 0 and 1.0x2f01ac0000).dcpext0..7, mailboxes, DARTs) and both ANE engines (ane0,ane1, three DARTs each), alldisabled. The GPU, display and ANE drivers for this chip are separate work..github/scripts/adt-dt-check-t6032.py(workflowt6032-adt-dt-check): builds the DTB, reads the device tree of the pinned 27.0.1 image from Apple's public IPSW by two HTTP range requests, verifies pinned SHA-256 hashes, and fails when a needed ADT node is not covered, a deleted window returns, a DT node maps nowhere in the ADT, a power state sits at another bank or offset, or the GPU, display or ANE nodes become enabled.Checked: the fixed tree passes 104 checks; the tree before this change fails 43. The T6030, T6031 and T6034 DTBs still build.
Not shown: that this Mac boots Linux. No M3 Ultra is available to the developers; the ADT is the only reference. Open points are listed in the commit message.