Repository navigation
PCI: apple: honor T6050 cold-train bus-range and enable J775c SD reader - #3844
Merged
Merged
Conversation
On multi-port T6050 hosts where the bootloader brings up and renumbers sibling ports before Linux runs, a port left down for Linux to cold-train may be described on a secondary bus other than start + 1 + port->idx (for example, port 1 on bus 4 after ports 0, 2, and 3 take buses 1..3). Hardcoding start + 1 + port->idx in apple_pcie_t6050_cold_train() programs a colliding secondary bus and routes the port to the wrong iommu-map entry and DART. Read the port node's single-bus bus-range property when present, validate it against the host bridge bus range, reject collisions with already adopted ports, and keep the start + 1 + port->idx fallback when bus-range is absent. Signed-off-by: Satya Benson <satya@benson.earth>
Enable the onboard Genesys GL9755 SDXC card reader on PCIe port 1 (pci@1,0, bus 4) so pcie-apple powers and trains it natively in Linux without requiring bootloader bring-up: - Add sd_pwr_en (0x19000000000000) as output 2 on smc_pcio. - Unreserve AP GPIO 81 (0x51, pci-bridge1 PERST#) in pinctrl_ap. - Enable dart_apcie1 with apple,manual-availability. - Add the shared PHY window (phy-shared, 0x417020000) and post-init-providers = <&dart_apcie1> to pcie0. - Enable port01 with pwren-gpios, reset-gpios, and the J775c ADT apcie-config and pcie-rc tunables. Signed-off-by: Satya Benson <satya@benson.earth>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
approved these changes
Dec 1, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Checked the cold-train path and the J775c DT at 2f458cf. The port uses bus 4 for both secondary and subordinate numbering, matching its DART map. The driver validates the range and rejects a collision with an already adopted port before hardware writes. Existing T6050 cold-train DTs still select their original single bus. The J775c row covers two boots, card-reader enumeration and s2idle with the paired display fixes. Media I/O remains untested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Teach
apple_pcie_t6050_cold_train()to honor a port node's single-busbus-range(instead of assumingstart + 1 + port->idx) and enable the onboard Genesys GL9755 SDXC card reader on J775c (port01, bus 4) so Linux powers and trains it natively without bootloader changes.Tested: J775c M5 Max Mac Studio at
2f458cfb4310(built onmain539585d7a60e+ required J775c display PRs#3682and#3765, Stage 2aura@maind8eb8ad4, default kernel command line): 2/2 clean boots + 15 ss2idlesuspend/resume (rtcwake -m mem -s 15,rc=0),00:01.0->04:00.0GL9755 (17a0:9755rev 2) trained at 5 GT/s x1,dart_apcie1(411000000.iommu, IOMMU group 20) + MSI active,sdhci-pci->mmc0(ADMA 64-bit), sibling ports (01:00N1,02:00RTL8127,03:00ASM3142) and HDMI unaffected, 0 failed units, 0 new kernel errors.Risk: two-way door · T6050 Macs using Linux PCIe cold-training (
J775cenabled here; boards with contiguousbus-rangeor nobus-rangekeep existing behaviour).Not yet: SD card media insert/read/write I/O (no card was inserted in the slot during this run; link training, DART/IOMMU attachment, MSI,
sdhci-pci/mmc0registration, ands2idleretention were verified on hardware).Details
PCI: apple: honor T6050 cold-train port bus-range(8825fd726988):On multi-port T6050 hosts where the bootloader brings up and renumbers sibling ports before Linux runs (for example, ports 0, 2, and 3 on buses 1..3), a port left down for Linux to cold-train can sit on a non-contiguous secondary bus (
bus-range = <4 4>on J775c/J775d). Previouslyapple_pcie_t6050_cold_train()hardcodedbus = pcie->cfg->busr.start + 1 + port->idx, which programmed bus 2 forport01, colliding withport02and routing to the wrongiommu-map/ DART. Readingport->np's single-busbus-rangewhen present (validated againstpcie->cfg->busrand checked for collisions against already-adopted ports inpcie->ports, keeping thestart + 1 + port->idxfallback when absent) allows non-monotonic Linux cold-training cleanly on top of the existingno_reassign_busbridge handling, and also helps multi-port T6050 boards such as J775d in arm64: dts: apple: t6050: share the SD card reader, add it to J714c, J716c, J716s and J775d #2291.arm64: dts: apple: t6050-j775c: enable SD card reader(2f458cfb4310):sd_pwr_en(0x19000000000000) as output 2 onsmc_pcio.0x51,pci-bridge1PERST#) inpinctrl_ap.dart_apcie1withapple,manual-availability.phy-shared(0x417020000, size0x4000) andpost-init-providers = <&dart_apcie1>topcie0(matchingt6050-k114-k116.dtsiwhere the bootloader leaves the shared PHY up with the other ports).port01withpwren-gpios,reset-gpios, and the J775c ADTapcie-configandpcie-rctunables.Evidence
linux@main539585d7a60e+ J775c display PRs#3682(bb01f44ff47e) and#3765(510a838db7a7, required for J775c Stage 2d8eb8ad4FDT prep) + exact PR commits8825fd726988and2f458cfb4310.lspci -tvnn,lspci -vv):00:01.0(Bus: primary=00, secondary=04, subordinate=04):LnkSta: Speed 5GT/s, Width x104:00.0(17a0:9755rev 02):Region 0: Memory at b80000000 [size=4K],IOMMU group: 20,MSI: Enable+ Count=1/1,Kernel driver in use: sdhci-pcirtcwake -m mem -s 15):rc=0, 16 s elapsed; post-resume00:01.0and04:00.0remain at5GT/s x1, MSI enabled,mmc0present, 0 failed units, 0 newdmesg -l errlines.scripts/checkpatch.pl --strict(0 errors, 0 warnings, 0 checks on both commits);tools/asahi/pcie-adopted-clkpm-tests.pyandtools/asahi/pciec-policy-tests.pypass.