Skip to content

J773s: USB3 on the front USB-C ports (T6040 PHY behind an on-board hub) - #2361

Draft
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
m4fam/j773s-front-usbc
Draft

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
m4fam/j773s-front-usbc

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

The Mac mini M4 Pro (J773s) front USB-C ports are disabled. They sit behind an on-board USB2/USB3 hub on ATC3, with no PD controller and no Type-C connector, and the T6040 PHY driver only brings USB3 up for a plug orientation reported by a Type-C orientation switch. Without that switch, t6040_usb3_probe() also returned before the USB3 setup, so the PHY would have been treated as a DP-only (HDMI converter) PHY.

Change

Two commits: the PHY change, then the J773s device tree.

  • phy: apple: t6040: a PHY whose USB3 graph port (port 1) links to a controller with a hub child is wired to a fixed hub. This is the same hardware description dwc3-apple already uses to start such a controller as a host. That PHY runs USB3 on the lanes of a normal-orientation plug and registers no orientation switch. The ADT gives every connector-less ATC PHY plug orientation 1, the laptops' HDMI converter PHYs included, and Linux already drives those unflipped. PHYs with orientation-switch (every Type-C port) are unchanged.
  • t6040-j773s-usb-front.dtsi: enable atcphy3, its mailbox, the dwc3_3 DARTs and dwc3_3. Add the hub child (usb5ac,800b: the J773g front hub, which has the same GL3590 firmware id in the ADT), the PHY to controller SuperSpeed link, the ATC3 power domains and the hub reset / flash-OE GPIO hogs (ADT usb3hub_rst = 127, usb3hub_flash_oe = 130; the loader leaves both high, as on the J773g).

The J614s, J616s and J616s-tether DTBs are byte-identical. Only the J773s changes.

Details
  • J773s DTB delta: phy@39aa90000 (+ports/port@1), mailbox@39b148000, iommu@39af00000/39af80000, usb@39a280000 (+hub@1, ports/port@2), pinctrl hogs usb3hub-flash-oe/usb3hub-reset, ATC3 common/common_dp/usb_aon/usb/phymxwrap power states.
  • If the lanes were reversed after all, the SuperSpeed side of the hub would not link and the ports would stay at USB2 high speed, as the J773g front ports run today. The USB2 side does not depend on the orientation.
  • The orientation is set once at probe. Nothing else writes it, because only the Type-C switch's set did.
  • Not touched: t6040-j773s.dts (arm64: dts: apple: t6040: Thunderbolt/USB4 on the Mac mini M4 Pro, router enables shared by every M4 Pro #2284 adds an include there), the J773s rear ports.

Testing

  • cpp + dtc for every T6040 board, comparing enabled nodes against integration/aurora. dtc prints the same warning counts.
  • drivers/phy/apple/t6040-usb2.c compiled for arm64 with clang 22 and the W=1 warning set against a prepared integration/aurora tree (CONFIG_PHY_APPLE_T6040_USB2=m): 0 warnings, the same as before the change.
  • Not booted: no J773s in the lab, and aura does not admit the J773s yet (mcc: admit the mcc,t6041 firmware-cache layout by its geometry, not by board aura#253).

Still to run

A J773s boot (community tester, #1479):

  • dmesg | grep 39aa90000 shows USB3 PIPE on the PHY and no USB3: no plug orientation.
  • lsusb -t shows the front hub on the usb@39a280000 bus at 480M and at 5000M or 10000M.
  • A USB3 stick in each front port enumerates at SuperSpeed.
  • Replug and suspend/resume keep the hub.

Assisted-by: LLM (Claude:Opus 5.5)

The Mac mini M4 Pro (J773s) has two front USB-C ports behind an
on-board USB2/USB3 hub on ATC3, with no PD controller. This PHY brought
USB3 up only for a plug orientation from a Type-C orientation switch.
Without that switch it skipped the USB3 setup entirely and was then
taken for a DP-only (HDMI converter) PHY.

Recognise such a port the way dwc3-apple already does: a "hub" child on
the controller that the PHY's USB3 graph port (port 1) links to. The
PHY then takes the connection as fixed and runs USB3 on the lanes of a
normal plug orientation, with no orientation switch. The ADT gives
every connector-less ATC PHY plug orientation 1, as it does the
laptops' HDMI converter PHYs, which already run unflipped. PHYs with an
orientation switch, and those without a hub, are unchanged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The two front ports sit behind an on-board USB2/USB3 hub on ATC3, whose
controller (ADT usb-drd3) is a fixed host. Enable atcphy3, its mailbox,
the dwc3_3 DARTs and dwc3_3, and add:
- the hub child on raw USB2 root port 1. It is the J773g's front hub:
  the ADT lists the same hub firmware (usb3hub-fw-gl3590, id 56) and
  the same hub port layout (usb-drd3-port-hs/-ss);
- the link from the PHY's USB3 port to the controller's SuperSpeed port
  (raw port 2), by which the PHY finds the fixed hub;
- the ATC3 power domains;
- the hub's reset and SPI-flash output-enable lines (ADT usb3hub_rst
  127, usb3hub_flash_oe 130), held high as the boot loader and macOS
  leave them, as on the J773g.

The J614s, J616s and J616s-tether DTBs are unchanged.

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