Skip to content

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

Open
RyanTheTide wants to merge 4 commits into
mainfrom
m4fam/j773s-front-usbc
Open

RyanTheTide wants to merge 4 commits into
mainfrom
m4fam/j773s-front-usbc

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

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.

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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. dt-checks fails on this head with two new schema warnings, both on the J773s DTB only:

    • phy@39aa90000 (apple,t6040-atcphy): ports: 'port@0' is a required property. Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml:128-129 requires the connector port, and the new ports node has only port@1.
    • usb@39a280000 (apple,t6040-dwc3): 'usb-role-switch' is a required property. Documentation/devicetree/bindings/usb/apple,dwc3.yaml:26-37 requires it on every enabled node.

    The PR text says dtc warning counts are unchanged, but make dtbs_check adds these two. Both bindings need a fixed-hub case: the atcphy schema should accept ports with only port@1 when there is no orientation-switch, and the dwc3 schema should not require usb-role-switch when dr_mode = "host" and a hub child is present. Put that in a dt-bindings commit ahead of the DT commit.

Checked and fine:

  • t6040_usb3_fixed_hub() (drivers/phy/apple/t6040-usb2.c:2225-2235) keys on the same hub child dwc3-apple reads (drivers/usb/dwc3/dwc3-apple.c:1816), and its __free cleanups hold for every NULL step.
  • PHYs with orientation-switch take the old path unchanged. PHYs with neither still return at :2275, so the laptops' HDMI converter PHYs stay DP-only (t6040_dp_only(), :1376).
  • With the orientation preset, t6040_usb3_up_locked() (:1083-1092) brings USB3 up on dwc3's power_on, with no Type-C event.
  • Both commits carry only a human Signed-off-by.
  1. Nit, t6040-usb2.c:2271-2274: the lane orientation of a fixed-hub PHY is assumed to be normal. The comment says the ADT gives it per PHY, so carry it in the DT (the ADT's plug-orientation value on the PHY node, normal when absent) rather than in the driver. Then a future board with its hub on the flipped lanes needs only a DT change.

HW row: nothing has booted this. J773s (community tester, #1479) on this head:

  • USB3 PIPE on the PHY for 39aa90000, and no no plug orientation line;
  • lsusb -t shows the front hub at 480M and at 5000M/10000M;
  • a USB3 stick enumerates at SuperSpeed in each front port;
  • 3 replugs and 2 s2idle cycles keep the hub;
  • 0 AVC, 0 failed units, no new kernel errors.

Plus one J616s boot as a no-regression row: all Type-C ports reach USB3 SuperSpeed and HDMI is up.

Assisted-by: LLM (Claude:Opus 5.5)

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…ixed hub

The J773s front USB-C ports sit behind an on-board hub on ATC3: the
controller is a host with a hub child and no Type-C connector, and its
T6040 PHY has only the SuperSpeed link to the controller (port@1), no
connector port. Neither has a role or connector to describe.

apple,dwc3: require usb-role-switch only on controllers that are not
fixed to dr_mode = "host" (resets stay required). apple,t6040-atcphy:
a ports node needs the connector port or the controller link, not
always the connector port.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged main f02bd68 (38bcb9c, clean) and fixed the 11-21 dt-checks blocker in cbabdb3 by describing the fixed-hub case in the bindings rather than adding fake nodes:

  • apple,dwc3.yaml: usb-role-switch stays required on every enabled controller except one fixed to dr_mode = "host" (a hub child, no connector); resets stays required on all.
  • apple,t6040-atcphy.yaml: ports needs the connector port or the controller link (port@0 or port@1), not always port@0.

Local: dt_binding_check on both schemas clean; CHECK_DTBS on all 116 Apple DTBs against main, 0 new warnings (the two J773s warnings are gone, nothing new elsewhere); t6040-usb2.o W=1 clean. Ready for review. Rows wanted: a J616s regression boot (USB-C ports unchanged, the PHY change only takes a PHY without orientation-switch) and a J773s owner row (front ports enumerate at SuperSpeed behind the hub).

@RyanTheTide
RyanTheTide marked this pull request as ready for review December 5, 2026 01:39
@RyanTheTide
RyanTheTide requested review from a team as code owners December 5, 2026 01:39
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Merge readiness at cbabdb3a: not ready yet

Check Detail
CI at head no failing: host-tests
Review no approved by aurora-silicon-review, but GitHub does not count it yet (code owner from Core, Omarchy Mac or Aurora Maintainers needed, or approval went stale)
Requested changes ok none
Hardware row at head no no line with the head SHA cbabdb3a, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:bringup, area:usb

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 5, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at cbabdb3

Checked: The fixed-hub PHY follows port 1 to an available hub child using the same criterion as DWC3. The Type-C switch takes precedence, and a PHY with neither path stays on its prior route. The revised bindings admit the fixed graph and host topology, and exact hosted DT and DWC3/ATC checks passed. The exact Host Tests log has failures in sleep fixtures outside this diff. Host CI and the native J773s row remain open.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant