Skip to content

arm64: dts: apple: t6050: share the SD card reader, add it to J714c, J716c, J716s and J775d - #2291

Draft
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
dtfill-t6050/sd
Draft

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
dtfill-t6050/sd

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The SD card reader (Genesys GL9755, pci17a0,9755, on PCIe port 1) is described only on the J714s and the K116s, each with its own copy of the port node. The J714c, J716c, J716s and J775d have the same slot (Apple lists SDXC on every 14- and 16-inch MacBook Pro and on the Mac Studio) and the same reader in their ADT, but no node. The K114c is in #1719 and the J775c in #2102; this PR leaves both alone.

Change

  • New t6050-sdreader.dtsi: the port 1 root port node (PERST# GPIO 81, interrupt map), the GL9755 child with card detect and write protect active high, and dart_apcie1 with apple,manual-availability. Its bus comes from T6050_SDREADER_BUS (default 2).
  • Per board, from each board's ADT: pcie0's port1/phy1/intr2axi1 windows (apcie0 reg[22], reg[24], reg[25]), phy-shared (reg[3]) where the kernel trains the port, interrupt 1531, the iommu-map entry on dart_apcie1 stream 1, and pin 81 opened in gpio-reserved-ranges. How the port comes up:
    • J714c: the kernel trains it. pwren-gpios is SMC pcIO output 0, a new list holding sd_pwr_en (0x0, 0x190000).
    • J716c: the kernel trains it. sd_pwr_en is added as pcIO output 3, after the board's three existing outputs. The include sits after t6050-peripherals.dtsi, which describes the same DART node.
    • J716s: port 1 and its DART are described disabled until the loader trains the port. The board's SMC gpio node is the gP bank, which carries the N1's power, so the pcIO node cannot be described next to it (same node name). The kernel therefore has no way to power the reader.
    • J775d: port 1 and its DART are described disabled on tree bus 4 (bus-range 0-4), as arm64: dts: apple: support M5 Max Mac Studio (J775c) #2102 does for the J775c.
  • J714s and K116s now use the shared file and keep their own pci-bridge1 link tunables. No other board has a booted ADT with those lists, so none is copied. The driver skips a list that is not in the tree.
  • K116s now uses the die's dart_apcie1 node, as J714s does, not the copy at the same address in t6050-peripherals.dtsi.

CLKREQ# (GPIO 77) and the ADT's GL9755 settings are not described: no driver takes them.

Loader and driver notes

  • J714c, J716c: aura trains only port 0 and leaves port 1 down. pcie-apple trains port 1 itself when the port has pwren-gpios (apple_pcie_t6050_cold_train), as on the J714s and K114c. No loader change is needed.
  • J775d: the kernel would number port 1's bus start + 1 + idx = 2, which is port 3's (USB-A) bus after aura's bring-up. So the port has to wait for the loader.
  • J716s and J775d both depend on aura#163.
    • aura#163 adds port 1 to aura's T6050 port list. That list is driven by the ADT, so the change is not specific to the J775c.
    • It checks sd_pwr_en against (0x0, 0x190000), which is the value on every board here.
    • With it, aura powers and trains the port, renumbers it, and enables pci@1,0 and its DART in the handed-over tree.
    • Without it, both ports stay disabled and nothing changes.
  • pcie-apple.c board gates (not changed here):
    • apple_pcie_check_adopted_s2idle() (drivers/pci/controller/pcie-apple.c:6777-6780) qualifies s2idle only on j716c, k114c, k116s and j714s. On the J714c, J716s and J775d it returns -EBUSY for the whole adopted host, with or without the reader.
    • apple_pcie_t6050_sleep_probe() (pcie-apple.c:5429-5430) sets up the firmware-sleep park/unpark of the kernel-trained port only on j714s and j716c.
  • Related, not changed here: the T6050 SMC profile in drivers/mfd/macsmc.c (68-82) registers apple,smc-pcio-gpio and apple,smc-low-gpio but not apple,smc-gpio. The J716s gP-bank node therefore gets no device.

Testing

  • Full kernel tree make dtbs CHECK_DTBS=y (dtschema) for every T6050 DTB on this branch: builds clean, no dtc warnings, and no schema message that integration/aurora does not already have.
  • DTB build of all 11 T6050 boards with kbuild's cpp and dtc flags: 0 warnings before and after.
  • Byte-identical: J775c, J873s, K114c, K114s, K116c.
  • J714s: the same nodes and values, with phandles resolved to paths. Only the phandle numbers move.
  • K116s: only the DART change above.
  • J714c, J716c, J716s, J775d: the additions listed in the details.
  • dt-validate on the six changed boards: no new messages. pci17a0,9755 has no binding of its own, the same as before.

Still to run (owner hardware rows)

  • J714c (XY55bqg6iAw8ttP) and J716c (erikwb):
    • Boot. dmesg shows port 1: trained by Linux, the boot loader left it down and sdhci-pci 0000:02:00.0: SDHCI controller found [17a0:9755].
    • Insert a card: mmcblk0 appears.
    • dd if=/dev/mmcblk0 of=/dev/null bs=4M count=64 iflag=direct (256 MB) reads at a sane speed: tens of MB/s or more for a UHS-I card. The K114c read 237 MB/s with a UHS-II card.
    • Boot with no card: no errors.
    • Suspend with the reader present depends on [Joshua's agent] PCI: apple: accept an endpoint in D3hot for the adopted-link s2idle check (draft) #2010 (D3hot) and, on the J714c, on the s2idle gate above.
  • J716s (rolotrealanis98) and J775d (funkzy): with aura#163, aura logs port 1 up and renumbered and Linux binds sdhci-pci. Then run the same card insert and dd row. Without aura#163, check that the boot is unchanged: port 1 stays disabled, and the N1 still works (J716s) and Ethernet and USB-A are still up (J775d).
  • J714s, K116s: optional regression row (card insert, mmcblk0, the same dd).
Per-board values and DTB diffs

All values below come from each board's ADT (26C5035r templates). The reader node is the same on every board.

Board bridge PERST# CLKREQ# sd_pwr_en pcIO index port 1 IRQ tree bus trained by
J714s apcie0/pci-bridge1 81 77 (0x0, 0x190000) 0 1531 2 kernel
K116s apcie0/pci-bridge1 81 77 (0x0, 0x190000) 0 1531 2 kernel
J714c apcie0/pci-bridge1 81 77 (0x0, 0x190000) 0 (new list) 1531 2 kernel
J716c apcie0/pci-bridge1 81 77 (0x0, 0x190000) 3 1531 2 kernel
J716s apcie0/pci-bridge1 81 77 (0x0, 0x190000) - (no pcIO node) 1531 2 loader (aura#163)
J775d apcie0/pci-bridge1 81 77 (0x0, 0x190000) - 1531 4 (renumbered by loader) loader (aura#163)

port1 0x211028000 +0x8000, phy1 0x217014000 +0x4000, intr2axi1 0x211024000 +0x4000, phy-shared 0x217020000 +0x4000; dart-apcie1 0x211000000, IRQ 1532, manual-availability. These are the same on every board.

DTB diffs (phandles resolved to node paths):

  • J714c, J716c:
    • pcie0 gains the port 1 windows and phy-shared, interrupt 1531, an iommu-map entry 0x200 -> dart_apcie1 1 1, and post-init-providers on dart_apcie1.
    • New pci@1,0 node: bus 2, pwren-gpios, reset-gpios 81, with mmc@0,0 (pci17a0,9755, reg 0x20000, cd/wp-inverted).
    • dart_apcie1 becomes okay with manual-availability.
    • Pin 81 is no longer reserved.
    • The pcIO output-commands gains 0x0019000000000000.
  • J716s: the same pcie0 additions, with post-init-providers now on dart_apcie0 and dart_apcie1. pci@1,0 (bus 2) and dart_apcie1 are disabled. Pin 81 is no longer reserved.
  • J775d: pcie0 gains the port 1 windows, interrupt 1531, 0x400 -> dart_apcie1 1 1, and bus-range 0-4. pci@1,0 is added disabled (bus 4, mmc reg 0x40000). dart_apcie1 stays disabled and gains manual-availability. Pin 81 is no longer reserved.
  • J714s: no change beyond phandle numbering.
  • K116s: /soc@200000000/iommu@411000000 is okay with manual-availability, and /soc/iommu@411000000 is back to disabled.

dt-validate, line counts before -> after and new messages: J714c 2 -> 2, J714s 12 -> 12, J716c 14 -> 14, J716s 0 -> 0, J775d 0 -> 0, K116s 0 -> 0; 0 new on each. The existing messages are on the PCIe-C tunnel hosts, not on apcie0 or the reader.

Merge note: #2162 also changes the J716c gpio-reserved-ranges line (pin 138), so whichever lands second needs a one-line rebase.

Assisted-by: LLM (Claude:Opus 5.5)

…J716c, J716s and J775d

The SD card reader, a Genesys GL9755 on PCIe port 1 of apcie0 (ADT
pci-bridge1/pcie-sdreader), was described only on the J714s and the K116s,
each with its own copy of the port node. The 14- and 16-inch MacBook Pros
and the Mac Studio all have an SDXC slot, and every T6050 board's ADT has
the same reader: port 1, PERST# on GPIO 81, CLKREQ# on GPIO 77, card detect
and write protect active high, power from the SMC pcIO template of
function-sd_pwr_en (0x0, 0x190000), behind dart-apcie1. Only the GL9755's
own settings differ between the laptops and the Studios, and no driver
takes them.

The port node and dart-apcie1's manual availability move to a new
t6050-sdreader.dtsi. Each board gives what differs:

- pcie0's port1, phy1 and intr2axi1 windows (apcie0 reg[22], reg[24],
  reg[25]), phy-shared (reg[3]) where the kernel trains the port, interrupt
  1531 (apcie0 interrupts[1]) and the iommu-map entry for the port's bus
  on dart-apcie1, stream 1;
- pin 81 opened in pinctrl_ap's gpio-reserved-ranges;
- the reader's power, pwren-gpios on the board's SMC pcIO output for
  sd_pwr_en: output 0 on J714c (new list) and the J714s/K116s as before;
  output 3 on J716c, after its three outputs;
- the J714s and K116s keep their pci-bridge1 link tunables. No other board
  has a booted ADT with those lists, so none is copied; the driver skips
  a list the tree does not have.

On the J714c and J716c the boot loader leaves port 1 down and pcie-apple
trains it, as on the J714s. The J716s cannot power the reader from the
kernel: its SMC gpio node is the gP bank that carries the N1's power, so
the pcIO node stays deleted, and port 1 and its DART are described
disabled until a boot loader that powers and trains the port enables
them. On the J775d the bus the kernel would number port 1 (2) is
already port 3's, so the port and its DART are described disabled with
the tree's bus 4 (bus-range now 0-4), as the J775c tree does: a boot
loader that powers and trains port 1 enables both and renumbers the
buses.

J714s: the DTB is unchanged apart from phandle numbers. K116s: it now
uses the die's dart-apcie1 node, as the J714s does, instead of the copy
at the same address in t6050-peripherals.dtsi. J775c, J873s, K114c, K114s
and K116c are unchanged. J775c and K114c have their own open changes for
the reader.

The port node is the one Diljit Singh wrote for the J714s and Jens Axboe
carried to the K116s.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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