Repository navigation
Conversation
Allow the five ACIO register windows, LSTX GPIO and router firmware tunables used by T8142. Describe its native PCIe-C compatible and require the shared MSI vector base. Include the T8142 pinctrl fallback chain used by the AOP LSTX pin. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
9736db6 to
963d155
Compare
|
Rebased onto integration/aurora 0abc2f3. It is now 963d155 (was 9736db6); the old branch no longer merged.
|
|
Thanks for the J813 rear-port USB4 work. The sleep handling, and the hardware-reason comments on it, are good to have. One small thing: Happy to run a no-regression row on our other Macs once it's updated. |
963d155 to
4ed06b3
Compare
|
Done. It is now 4ed06b3 (was 963d155). Only "PCI: apple: support T8142 PCIe-C MSI slices" changed (now adee45b); the other three commits are identical (
Checked: #2238 is restacked on this head (6113f94, content unchanged). #2178 (T8152, 1879) has the same pattern and gets the same treatment in its rework. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks for the quick rework. At 4ed06b3 the machine check is gone (pcie-apple.c:3446-3447). I'd still like the AIC base out of the driver, because the DT already says it. msi-ranges names the AIC input of global vector apple,msi-vector-base, and the window is linear, so args[1] - apple,msi-vector-base is the base. On J813 every node gives 1741 (internal 1741 at 0, front 1837 at 96, rear 1869 at 128). msi_aic_base and the ECAM-keyed expected_base switch only re-derive that from a table, and #2178 is about to add a third constant.
Concretely, for the T8132/T8142 branch:
- Read
apple,msi-vector-basefirst. - Check the slice structurally: 32 vectors, 32-aligned, above the internal port's vectors, within
FIELD_MAX(PORT_MSIMAP_TARGET) + 1, edge-rising SPI,args[1] >= base. - Drop
msi_aic_baseand the ECAM table.
No binding change is needed: both properties are already required for t8142 PCIe-C. If you want the cross-node check, "all PCIe nodes agree on msi-ranges[1] - apple,msi-vector-base and the slices are disjoint" fits apple-dt-check better than the driver. T6030/T6040/T6050 can follow in a separate PR.
Two merge gates besides that:
- Rerun CI: both runs on 4ed06b3 were cancelled by the runner, not failed.
- The
usb4-1-pciealias needs aura#302, which is still open, and the qualified boot used the underscored alias with an older aura. Please post one boot of this exact DTB with an aura that has #302: link up, and the PCIe-C tunables present under the apciec1 node.
Minor, non-blocking: thunderbolt/apple.c keys three behaviours on acio->hw == &apple_cio_t8142_hw (4011, 4257, 4742). Named flags in apple_cio_t8142_hw would carry to the next SoC more easily.
|
Thanks for adee45b. Taking the AIC base from the match data and selecting the branch by |
T8142 uses the Intr2AXI controller layout but its three-cell AIC interrupt specifier and MSI window differ from T6050. Match it natively. This allows a tunnelled NVMe controller to allocate working MSI-X interrupts. For T8132 and T8142 the slice is checked against the device tree alone. msi-ranges names the AIC input of global vector apple,msi-vector-base in a linear window, so the window's AIC base is msi-ranges minus apple,msi-vector-base, and the slice is checked by its shape: an edge-rising SPI, 32 vectors, 32-aligned, above the internal port's vectors and inside the 8-bit map target. This replaces T8132's table of ECAM apertures and its AIC base 1506 behind a machine check. The T8132 trees give 1602 - 0x60 = 1634 - 0x80 = 1506, and every J813 PCIe node gives 1741. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Use the qualified MxWrap startup sequence: CIO reset leaves the CPU running, then RTKit readiness precedes the LSTX handoff. Admit native T8142 PCIe-C hosts without a T6050 fallback. Keep DP IN disabled. Deep sleep removes CIO power. Remove idle NVMe hierarchies before stopping the router and request fresh cable state on resume. Refuse sleep when a disk is open or another endpoint driver cannot be removed safely. Extend the production-C admission tests with native T8142 and a negative control. The T8142 behaviours are named flags of its match data (sleep_removes_domains, restart_on_wake, phy_shared_with_dwc3), so a later SoC that behaves the same sets them instead of extending a comparison. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe ACIO1, its mailbox and LSTX pin, and the PCIe-C tunnel. Populate both DARTs under their powered parents. Use connector port 4 so the existing DisplayPort alternate-mode route can retain port 3. Name the PCIe-C tunable alias usb4-1-pcie, as t6040-usb4.dtsi does; aura looks it up under that spelling since aurora-silicon/aura#302. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
4ed06b3 to
13483df
Compare
|
Thanks. All three points are done. The head is now AIC base from the DT (
Named flags ( CI and the aura#302 boot.
|
The J813 rear USB-C port can enumerate a USB4 storage enclosure, but the existing T8142 match data follows the wrong router startup sequence and has no native PCIe-C MSI setup. This enables the rear port with the MxWrap/RTKit/LSTX sequence verified on hardware, native PCIe-C match data and validated 32-vector MSI slices, and the corresponding device tree and bindings.
Deep sleep releases idle NVMe tunnels before the shared USB PHY shuts down, then requests fresh cable state after wake. An open disk or an unsupported endpoint driver refuses sleep. The notifier runs before DWC3: the initial default-priority version exposed a link-loss race during refusal, reproduced and covered by a production-registration test and negative control.
Hardware: J813 / T8142, rear port, UGREEN enclosure (vendor 0x00b8, device 0x2463), Samsung 980 PRO 2 TB, firmware 5B2QGXA7. The clean series is based on integration/aurora at dcce0e7. Runtime qualification used the same changes on the full J813 stack from #2135, retaining its display, GPU, radio, audio, media and sleep work.
Validation:
usb4-1-pcie(as in t6040-usb4.dtsi), which aura looks up since kboot: accept the hyphenated usb4-N-pcie alias for PCIe-C tunables aura#302.pcie-tunnel-N/pcie@...nodes, the rear link comes up at 20 Gb/s x 2, NVMe gets its MSI-X queues, and a 4 GiB direct read runs at 2.9 GB/s. With the enrolled aura (no drm/apple: dcp: let a Type-C port with HPD take over a pipeline held without it #302) the same DTB gives "PCIe-C tunnel disabled: not initialized by m1n1 or the kernel" and the enclosure falls back to USB.Scope: rear port only. USB4 DisplayPort tunnels stay disabled; the existing DP alternate-mode graph remains separate on connector port 3. Other enclosures, front-port USB4, write workloads, mounted-storage suspend, external-display combinations and long-duration sleep remain unqualified. The final clean build's physical replug matrix is still pending; the preceding bring-up build was tested through physical unplug/replug. Existing firmware/property and IRQ-affinity messages remain, so this is a functional qualification rather than a clean-dmesg claim. Raw logs, per-unit identities and firmware remain private.