Skip to content

PCI: apple: adopt T6050 root ports the boot loader trained - #890

Closed
funkzy wants to merge 3 commits into
aurora-silicon:t6050/pciefrom
funkzy:pr/t6050-pcie-adopt
Closed

funkzy wants to merge 3 commits into
aurora-silicon:t6050/pciefrom
funkzy:pr/t6050-pcie-adopt

Conversation

@funkzy

@funkzy funkzy commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

On the M5 Ultra running Linux on the hardware, the boot loader powers the internal PCIe host's shared PHY, trains
each port's link and leaves it up. Port 2 carries the onboard RTL8127 Ethernet controller, and port 3 the ASM3142
xHCI behind the rear USB-A ports. Repeating the reset and training sequence from Linux is not needed and not known
to be safe on this SoC. apple,t6050-pcie adopts such ports as they are.

What it changes

  • A port marked apple,link-trained-by-bootloader gets no reset, tunable replay, clock or power change, or
    retraining. Its registers, interrupt and RID mapping come from the DT by port index.
  • Before the first PCIe write, each port is checked: the link is up and not retraining at Gen3 x1, the boot loader
    numbered the buses, the endpoint is device 0 function 0 with DMA and MSI off and a well-formed capability list,
    and the RID table has no valid entry. A port that fails is left alone, and the others are still adopted.
  • Then the endpoint's RID is routed to its SID and the host's MSI map is set from apple,msi-vector-base. Only
    the adopted ports and their endpoints are enumerated.
  • Bindings: apple,t6050-dart (t8110 fallback); apple,t6050-pcie with the per-port ranges and no
    reset/power properties; nonposted-mmio.

The APIF host (apple,t6050-pcie-apif, #474) is a separate driver and is unchanged. No other SoC sets
adopt_link.

Testing (J775D)

  • The same code adopts port 2 and port 3 on every boot: DHCP and SSH over
    the RTL8127, and a USB keyboard and mouse driving the desktop through the ASM3142 (lspci: two root ports,
    RTL8127 at 01:00.0, ASM3142 at 02:00.0; "adopted port 2, RID 0100 -> SID 1").
  • This branch on PCI: apple: Add T6050 APIF hosts and native AIC MSI #474: builds with no warnings.
  • Booted on these bases (2026-11-02): one tree of t6050/base with nvme: apple: Add resident T6050 ANS over APIF #473 and PCI: apple: Add T6050 APIF hosts and native AIC MSI #474 plus the DockChannel, PCIe and
    NVMe PRs, and the J775D board DT with apple,tx-never-wait. Cold boot and warm reboot in both directions: from
    another kernel into this one, ALARM came up on its NVMe root; out of it, a systemctl reboot took 38 s with a 2 s
    stop phase and no stop timeouts. With nothing reading the console, 20 lines to /dev/console took 3 ms. Both root ports adopted (RTL8127 at 01:00.0, ASM3142 at
    02:00.0).
  • checkpatch: clean apart from the Signed-off-by.

Shared commit

The apple,t6050-dart binding commit is also the first commit of a separate DART PR on aurora-wip. Whichever lands
first, the other drops it.

Not tested

  • A link the boot loader did not train, and hot reset or removal. Neither is supported: the boot loader owns the
    links.
  • Other T605x boards.

Dependencies

#474 (t6050/pcie).

Assisted-by: LLM

funkzy and others added 3 commits November 2, 2026 02:24
Add apple,t6050-dart, the DART of the T6050 (M5 Ultra) PCIe ports and
display co-processors, with the t8110 fallback like the other recent
SoCs.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oader

Add apple,t6050-pcie, a T6050 (M5 Ultra) PCIe host whose root ports the
boot loader powered, trained and left running. Each such port is marked
apple,link-trained-by-bootloader and named by its port<n>, phy<n> and
intr2axi<n> register ranges and its port<n> interrupt; the host's local
MSI map starts at apple,msi-vector-base. The OS adopts the trained state
and never resets, retrains or changes the port's power: reset-gpios,
pwren-gpios and power-domains are not allowed on it.

Also name nonposted-mmio, which these hosts take.

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the M5 Ultra (T6050, J775D) running Linux on the hardware, the boot
loader brings up the internal PCIe host's ports itself: it powers the
shared PHY, trains each port's link and leaves it up, with the endpoint
idle. Port 2 carries the onboard RTL8127 Ethernet controller and port 3
the ASM3142 xHCI behind the rear USB-A ports. Repeating the reset and
training sequence from Linux is not needed and not known to be safe on
this SoC.

Add apple,t6050-pcie, a host whose root ports marked
apple,link-trained-by-bootloader are adopted as they are: no reset, no
tunable replay, no clock or power change and no retraining. Every
resource comes from the DT by the port's index (port<n>, phy<n>,
intr2axi<n>, interrupt port<n>, the iommu-map entry for the endpoint's
RID). Before the first PCIe register write the driver checks that the
link is up and not retraining at Gen3 x1, that the boot loader numbered
the root port's buses (primary 0, one secondary), that the endpoint on
it is device 0 function 0 with DMA and MSI off and a well-formed
capability list, and that the port's RID table holds no valid entry. A
port that fails a check is left alone and the others are still adopted.
Then the endpoint's RID is routed to its SID, the host's MSI map is set
up from apple,msi-vector-base, and only the adopted root ports and the
endpoint behind each are enumerated. The links cannot be recovered by a
user reset or removal, since the boot loader owns them.

The APIF host (apple,t6050-pcie-apif) is a separate driver and is not
affected; no other SoC sets adopt_link.

Testing: on J775D, every boot adopts port 2 (RTL8127, DHCP and SSH over
it on every boot) and port 3 (ASM3142, a USB keyboard and mouse driving
the desktop session).

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@funkzy

funkzy commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing: this change now lives in the funkzy/j775d branch of aurora-silicon/linux-aurora (the J775D series as built and booted, 681521644671), which dj merges directly; no PR flow for it any more.

@funkzy funkzy closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant