Skip to content

usb: bring up the J616s (T6040) tether port as a USB2 CDC device - #245

Closed
RyanTheTide wants to merge 10 commits into
feat/sptm-hvfrom
dwc3cdc/j616s-cdc-link
Closed

RyanTheTide wants to merge 10 commits into
feat/sptm-hvfrom
dwc3cdc/j616s-cdc-link

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The explicit CDC-ACM debug-link handoff (usb_cdc_link_start) handled only three cases: the
T8140 Gen1 SuperSpeed path, the T6050/T8152 USB2 path and the T8142 live-reuse case. The J616s
(chip_id T6040, board 6, J616sAP) matched none of them. So on a chainload or SPTM-virt
boot that has to keep its inherited carrier, aura never brought up a DWC3 device controller and
the host saw no CDC serial port. The generic auto-gadget path (usb_init) can't cover this,
because it is skipped while the debug carrier is live and would retire the inherited proxy.

Change

The J616s ATC0 tether port now goes through the same explicit USB2 device handoff as the M5
(T6050):

  • usb_cdc_deferred_usb2() also selects atc-phy,t6040, the ATC0 PHY compatible.
  • usb_cdc_link_start sends T6040 to a new usb_t6040_init. It resolves the DWC3 core,
    PIPEHANDLER, USB2 PHY and T8110 DART from the ADT by index and checks them by compatible and
    size. It then parks the dummy PIPE and brings the USB2 device PHY up from the ADT's own
    tunable_USB2PHY_DFLT/DEV.
  • Two T6040 differences found on hardware (ea1e97c):
    • MUX_CTRL has no bit 6, so the M5's 0x42 reads back as 0x02. The dummy USB2 route here is
      0x22, the value the generic port bring-up already writes.
    • The ADT tunables leave the PHY role bits (SIG[14:12]) set to host. Device mode clears them;
      without that there is no pull-up and the host never sees a connect.
  • Full-speed hosts (11fcc66): the high-speed engine always advertised 512-byte bulk endpoints,
    which is invalid at 12 Mb/s. At ConnectDone it now takes the speed from DSTS. At full speed it
    resizes the bulk endpoints to 64 bytes with a DEPCFG modify and serves a matching
    configuration descriptor, and the ZLP check follows. High-speed setup is unchanged. USB2 CDC
    targets accept one schedule flag, USB_CDC_USB2_FULL_SPEED (BIT(3)), which advertises full
    speed so this path can be tested on a high-speed host. The proxy's flag range grows to 0-0xf,
    and the T8140 state machine still rejects anything outside bits 0-2.

The T6040 path is now selected by the tether port's atc-phy,t6040 PHY compatible in the ADT instead of the chip id, board id and J616sAP target (1d34eae); the J616s takes the same path as before, but a J616s CDC re-run on this head is still owed.

Hardware results (J616s, macOS host on the debug port)

aura was chainloaded over the KIS proxy, then cdc_schedule(1000, flags) was sent over KIS. In
every row the device enumerated 2.1 s later as 1209:316d "Aurora Silicon / Generic CDC". The
first ACM port answered as the proxy primary (iodev_whoami = USB0, cdc_status 0x502).

flags host link NOP round trip read 1 MiB 4 MiB write / read (exact readback) 16 MiB sustained read
0 480 Mb/s (Device Speed 2) 106 us 17.7 MB/s 9.6 / 16.9 MB/s 16.2 MB/s
0x8 12 Mb/s (Device Speed 1) 221 us 1.10 MB/s 0.88 / 1.10 MB/s 1.10 MB/s

For comparison, the KIS carrier the handoff replaces reads at 0.65 MB/s on the same runs. Each
row was re-run from a fresh reboot.

SuperSpeed is not part of this change. On T6040 it needs the ACIO (CIO80) PHY processor
brought to firmware tunables-done. Until then the USB3 link never trains, and the host's
SuperSpeed port saw no connect during these runs.

Tests

  • tests/python/test_usb_hs_session.py now covers the speed handling. A high-speed connect
    leaves the bulk endpoints alone. Both full-speed DSTS encodings resize every bulk endpoint to
    64 and still re-arm SETUP. A later high-speed connect restores 512.
  • The CDC/USB host tests pass (test_cdc_state, test_cdc_bulk, test_cdc_ss_desc,
    test_debugusb_proxy, test_usb_shutdown_retirement, test_usb_dma_reserve,
    test_usb_hs_session). The full tests/python run gives the same totals before and after
    the change.
  • CHAINLOADING=1 BUILDSTD=1 USE_CLANG=1 builds clean, and clang-format is clean on the
    changed files.
  • 456b58f (stop the controller and report the link as failed when a full-speed bulk resize fails, instead of advertising a size the endpoints lack) came after the hardware rows above; test_usb_hs_session.py covers the failed-resize case.

Still to run

  • J616s HS 480 Mb/s and FS 12 Mb/s re-row at this head: enumerate as 1209:316d, round trip and throughput as in the table above.

RyanTheTide and others added 5 commits November 14, 2026 23:07
The explicit CDC-ACM debug-link handoff (usb_cdc_link_start) only covered the
T8140 Gen1 SuperSpeed path, the T6050/T8152 USB2 path and the T8142 live-reuse
case. The J616s (chip_id T6040, board 6, J616sAP) matched none, so a chainload
or SPTM-virt boot that must preserve its inherited carrier never brought up a
DWC3 device controller and the host saw no CDC port.

Route the J616s ATC0 tether port through the same explicit USB2 device handoff
the M5 (T6050) uses: usb_cdc_deferred_usb2() now also selects atc-phy,t6040 on
this board (scoped to J616sAP so other T6040 J614s and T6041 M4 Max machines
keep the generic gadget path), and usb_cdc_link_start dispatches T6040 to a new
usb_t6040_init.

usb_t6040_init mirrors usb_t6050_init but for the T6040 ADT: it resolves the
DWC3 core (usb-drd0 reg 0), PIPEHANDLER (usb-drd0 reg 3), USB2 PHY (atc-phy0
reg 0) and the T8110 DART (dart-usb0 reg 1, mapper SID) by index and validates
them by compatible and size, parks the dummy PIPE, and brings the USB2 device
PHY up from the ADT's own tunable_USB2PHY_DFLT/DEV. The qualified high-speed
path leaves the ATC PHY in its initial state and needs neither the
event-counter bank the M5 writes nor the ACIO SuperSpeed PHY processor; a
USB2-only or forced-full-speed link runs at full speed. SuperSpeed stays
unqualified (it needs the CIO80 ACIOPHY processor brought to tunables-done).
Two problems kept the J616s tether gadget from enumerating after the
USB2 CDC handoff:

- T6040's PIPEHANDLER MUX_CTRL has no bit 6. Writing the M5's 0x42
  reads back as 0x02, so the step-2 check failed every time. On this
  SoC the dummy USB2 route is 0x22, the value the generic port bring-up
  already writes. Program and check that instead, and say so on the
  console when the route doesn't latch.

- The ADT USB2 PHY tunables leave the PHY's role bits (SIG[14:12]) in
  host mode. The controller then ran with no device pull-up and the
  host never saw a connect. Clear the host bits before forcing VBUS,
  as device mode needs.

Tested on a J616s chainloaded over the KIS proxy with a macOS host on
the debug port. The device enumerates as 1209:316d at 480 Mb/s within
about 2 s of cdc_schedule(1000, 0), and proxy reads run at about
17 MB/s (KIS: 0.65 MB/s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The high-speed DWC3 engine always advertised 512-byte bulk endpoints.
That's invalid at full speed (USB 2.0 9.6.6 caps full-speed bulk
packets at 64 bytes), so a host or hub limited to 12 Mb/s could not use
the CDC device.

The engine now picks the bulk packet size from the speed in DSTS at
ConnectDone: 512 at high speed, 64 at full speed. It resizes the bulk
endpoints with a DEPCFG modify and serves a matching configuration
descriptor. The ZLP check follows the same size. At high speed the
descriptor and endpoint setup are unchanged.

USB2 CDC targets also accept one schedule flag,
USB_CDC_USB2_FULL_SPEED (BIT(3)), which makes the controller advertise
full speed. That lets the full-speed path be tested on a high-speed
host. The proxy's flag range grows from 0-7 to 0-0xf to carry it; the
T8140 state machine still rejects anything outside bits 0-2.

Tested on a J616s with a macOS host. With the flag, the device
enumerates at 12 Mb/s and proxy reads run at 1.10 MB/s with an exact
4 MiB write/readback. Without it, the same build enumerates at 480 Mb/s
and runs as before (17.7 MB/s reads).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness now models DEPCFG resizes and the DSTS speed. It checks
that a high-speed connect leaves the 512-byte bulk endpoints alone,
that both full-speed DSTS encodings resize every bulk endpoint to 64
bytes and still re-arm SETUP, and that a later high-speed connect
restores 512.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide RyanTheTide changed the title usb: bring up the J616s (T6040) tether port as a high-speed CDC device usb: bring up the J616s (T6040) tether port as a USB2 CDC device Nov 19, 2026
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 19, 2026 11:20
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware evidence for a09e30d (code identical to 11fcc66), J616s with a macOS host on the debug port.

Host ioreg for the enumerated device:

flags 0:   idVendor 4617 (0x1209)  idProduct 12653 (0x316d)  UsbLinkSpeed 480000000  Device Speed 2  bcdUSB 0x200
flags 0x8: idVendor 4617 (0x1209)  idProduct 12653 (0x316d)  UsbLinkSpeed 12000000   Device Speed 1  bcdUSB 0x200

aura console on each run:

CDC USB2: retired Stage 1 gadget held in reset
CDC USB2: T6040 controller initialized, PIPE=22; link unverified
CDC USB2 controller ready; awaiting host enumeration, status=0x502

Before the two T6040 fixes, the same flow stopped at step 2 (cdc_status 0x203, MUX_CTRL 0x02 after writing 0x42). With only the mux fix, the controller came up (0x502) with USB2PHY SIG = 0x01c0700f, i.e. host role, and the host saw no connect. ea1e97c fixes both.

🤖 Generated with Claude Code

RyanTheTide and others added 2 commits November 20, 2026 00:35
The explicit USB2 CDC handoff for T6040 was gated on the chip id, board
id and the J616sAP target. Select it by the tether port's hardware
instead: any machine whose /arm-io/atc-phy0 is atc-phy,t6040 takes the
deferred USB2 path, and usb_cdc_link_start() dispatches to
usb_t6040_init() on the same compatible rather than on chip_id.
usb_t6040_get_regs() still refuses a port whose DRD, DART, port numbers
or register sizes do not match.

On the J616s nothing changes: its atc-phy0 is atc-phy,t6040, so it
takes the same path as before. Also fix the comment that called the
J616s a Mac mini; it is the 16-inch MacBook Pro.

Signed-off-by: Ryan <ryan@aurorasilicon.org>
On a USB2 connect at full speed the bulk endpoints are resized to 64
bytes. If a resize failed, the code only logged it and still recorded
the new packet size, so the configuration descriptor could advertise a
size the endpoints do not have. Stop the controller and report the link
as failed instead, as the SuperSpeed path already does on a mode
mismatch, and cover the case in the HS session harness.

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

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, Ryan. The T6040 handoff itself reads well:

  • usb_t6040_get_regs() resolves everything from the ADT and checks it by compatible and size;
  • the MUX_CTRL 0x22 and USB2PHY SIG role fixes are backed by the J616s read-backs;
  • the full-speed DEPCFG resize drops the link if it fails;
  • the hardware rows at 480 and 12 Mb/s are clear.

Two things hold it.

1. Adding atc-phy,t6040 to usb_cdc_deferred_usb2() turns off the generic USB path on every M4 Pro and M4 Max. That predicate isn't only "use the explicit USB2 handoff". It also makes usb_init(), usb_iodev_init(), usb_phy_bringup() and usb_iodev_bringup() return early (src/usb.c:540, :587, :711, :786 at 456b58f). The comment above it says so: "Never run the older automatic gadget initialization on them, including when the explicit setup is refused." On T6050 that's deliberate. But src/kboot_atc.c:1205 notes that the J614c and J616c have the J614s's ATC, also atc-phy,t6040. On all of them, a boot without the debug carrier would lose the USB gadget and proxy that docs/j616s-bringup.md qualified at 480 Mb/s. If usb_t6040_get_regs() refuses a board's layout, that board has no USB device path at all.

Suggested shape: split the two meanings. Keep usb_cdc_deferred_usb2() as "never run the generic gadget" (T6050 only), and add a second predicate for "this port takes the explicit USB2 CDC handoff". usb_cdc_link_start() (:872) and usb2_target() in usb_cdc.c:22 would test the new predicate, which usb_atc0_phy_is_t6040() already gives you.

2. DCO. docs/licensing.md asks for a Signed-off-by on new contributions. 640d9ff, ea1e97c, 11fcc66 and a09e30d have none. 1d34eae and 456b58f have one.

Once both are in, the J616s CDC re-run on the new head can come after the merge, with a J614s or J616c boot showing the normal USB proxy still enumerates.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1 (beyond the open review).

  1. src/usb_cdc.c:75 stores the full-speed request in the global usb_dwc3_usb2_full_speed (src/usb_dwc3.c:6), and usb_dwc3_init() reads it on every high-speed engine init (src/usb_dwc3_impl.inc:2001-2003). That includes the generic gadget at src/usb.c:600, not only the CDC handoff it is meant for. After one cdc_schedule(..., 0x8), every later USB2 gadget init in that boot advertises 12 Mb/s, until another schedule happens to clear it. Pass the speed into the CDC init (usb_t6040_init/usb_t6050_init through to usb_dwc3_init_mode), or clear the global as soon as usb_cdc_link_start() has created its controller, so a test-only flag cannot leak into the normal proxy path.

Commits 640d9ff, ea1e97c, 11fcc66 and a09e30d carry Co-Authored-By: Claude ... trailers, besides the missing Signed-off-by already noted. Drop them when those commits are re-signed.

HW row: on the new head, a J616s CDC run at flags 0 and 0x8 as in the table, then a flags-0 run in the same boot showing 480 Mb/s again. Plus a J614s or J616c boot without the debug carrier showing the generic USB proxy still enumerates at 480 Mb/s.

Assisted-by: LLM (Claude:Opus 5.5)

Aurora agent policy: remove assistant instruction files that are
not copies of .github/aurora/AGENTS.md on main, and keep the copies on policy
branches identical to it.
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Still needed: split usb_cdc_deferred_usb2() so atc-phy,t6040 selects the explicit CDC handoff without turning off the generic gadget on M4 Pro/Max, and stop the full-speed request from leaking into later gadget inits; commits 640d9ff, ea1e97c, 11fcc66 and a09e30d need re-committing with a human Signed-off-by only (no Co-Authored-By). feat/sptm-hv is already on main, so retarget onto main and merge it (conflicts in docs/sptm-nv2-virt.md, proxyclient/tools/run_guest_sptm.py and tests/python/test_usb_hs_session.py). Then the J616s CDC runs at flags 0 and 0x8 on the new head, and a J614s or J616c boot without the debug carrier showing the generic proxy still at 480 Mb/s.

@DjDeveloperr DjDeveloperr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formal §1–§6 pre-PR checklist re-review at head d33f3196fea7c393a11a7b2805f6cc7a3a04d3d0.

This PR touches Stage 1 (src/usb.c, src/usb_cdc.c, src/usb_dwc3.c, src/usb_dwc3_impl.inc, src/proxy.c are compiled unconditionally into every Stage 1 flavour via Makefile), and none of the previously requested changes from 456b58fd have landed yet (the only commit since is the automated github-actions[bot] policy commit d33f3196). In addition, a deeper audit of usb_t6040_init() turned up two T6040 PIPEHANDLER hardware bugs.

Blocking issues

  1. §1 / §3 — usb_cdc_deferred_usb2() still disables the generic USB gadget on every atc-phy,t6040 Mac (src/usb.c:174-188).
    Adding atc-phy,t6040 to usb_cdc_deferred_usb2() causes usb_init(), usb_iodev_init(), usb_phy_bringup(), and usb_iodev_bringup() to return early on every M4 Pro / M4 Max with atc-phy,t6040 (J614s, J616s, J614c, J616c). On any normal boot without an inherited debug carrier (or any board where usb_t6040_get_regs() rejects the layout), those Macs lose their 480 Mb/s USB gadget/proxy. Split "never run the generic gadget" (usb_cdc_deferred_usb2(), T6050 only) from "supports the explicit USB2 CDC handoff" (checked by usb2_target() in src/usb_cdc.c and usb_cdc_link_start() in src/usb.c).

  2. §2 / §3 (new) — usb_t6040_init() uses T6050/T8142 PIPEHANDLER_MUX_CTRL bitmasks (0x73/0x70/0x03) on T6040's T8103-layout register (src/usb.c:254, 264, 280, 285-296).
    T6040 uses the T8103 MUX_CTRL layout (CLK in bits [5:3] = 0x38, DATA in bits [2:0] = 0x07, combined mask 0x3f, where PIPEHANDLER_MUX_CTRL_DUMMY is (4 << 3) | 2 = 0x22 and PIPEHANDLER_MUX_CTRL_USB3 is 1 << 3 = 0x08). Keeping T6050's [6:4]/[1:0] masks (0x73/0x70/0x03) causes two real bugs:

    • read32(pipe + PIPEHANDLER_MUX_CTRL) & 0x73 masks off bit 3 (0x08, USB3 clock) and bit 2 (0x04). A native USB3 PIPE producer (0x08) with DWC3_RESET_N == 0 reads back as 0, silently bypassing the safety guard against touching an active/unknown PIPE producer.
    • mask32(..., 0x70, 0), mask32(..., 3, 2), and mask32(..., 0x70, PIPEHANDLER_MUX_CTRL_DUMMY & 0x70) never clear bit 3 or bit 2. Any pre-existing bit 3 (0x08) survives into MUX_CTRL (yielding 0x2a, invalid CLK=5), and the readback check (read32(...) & 0x73) != PIPEHANDLER_MUX_CTRL_DUMMY masks off bits 3:2 so it silently passes.
      Use 0x38 / 0x07 / 0x3f (matching PIPEHANDLER_MUX_CTRL_CLK_T8103 / DATA_T8103 in open #479's src/usb_atc_regs.h), and drop the unreachable 0x42 checks on T6040.
  3. §3 (new) — usb_t6040_init() reads DWC3 registers while DWC3 is held in reset when mux == 0x22 (src/usb.c:262-279).
    if ((aon & PIPEHANDLER_AON_GEN_DWC3_RESET_N) || mux == 0x22) was copied from usb_t6050_init(), where 0x42 is the parked dummy state and 0x22 is an older loader's released state. On T6040, 0x22 is the parked dummy state. If a prior stage left DWC3_RESET_N == 0 with mux == 0x22, this branch enters the retired-gadget check and reads regs.dwc + DWC3_GCTL/DCTL/DSTS/DEVTEN/DALEPENA while DWC3 is in reset (risking a bus error or reading zeroes and failing retired on a cleanly parked port). Only inspect DWC3 registers when aon & PIPEHANDLER_AON_GEN_DWC3_RESET_N is set; when DWC3_RESET_N == 0, accept mux == 0 || mux == 2 || mux == PIPEHANDLER_MUX_CTRL_DUMMY.

  4. §2 / §3 — Global usb_dwc3_usb2_full_speed leaks across subsequent gadget inits (src/usb_cdc.c:75, src/usb_dwc3.c:6, src/usb_dwc3_impl.inc:2001-2003).
    Setting a sticky global in usb_cdc_schedule() without clearing it on consumption, usb_cdc_cancel(), or usb_cdc_cleanup() (note merged #478 now resets USB_CDC_SCHEDULED in usb_cdc_cleanup()) means any later HS usb_dwc3_init() — including generic gadget bring-up — inherits 12 Mb/s full speed. Pass the requested speed explicitly into the CDC init path (or consume/reset it strictly inside the explicit CDC start path) so it cannot leak.

  5. §4 — Attribution, DCO, and bot commit on PR branch.

    • Missing human Signed-off-by: on 640d9ffb, ea1e97cd, 11fcc66e, a09e30d3 (and merge commit 07dd30f9).
    • Forbidden AI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> trailers in ea1e97cd, 11fcc66e, a09e30d3.
    • Bot commit d33f3196 (gfya, authored by github-actions[bot]) deletes .github/copilot-instructions.md, AGENTS.md, CLAUDE.md, GEMINI.md and has no human Signed-off-by:.
      Rebase cleanly onto main as human-authored commits with human Signed-off-by: only and zero AI trailers in commits (keeping Assisted-by: at the end of the PR body, which is already fine).
  6. Base branch & Live CI (statusCheckRollup empty; zero passing checks on d33f3196).

    • This PR still targets feat/sptm-hv (392 commits behind main; conflicts with main in tests/python/test_usb_hs_session.py, and overlaps open #479 in src/usb.c / src/usb_cdc.c).
    • Because build, test, format-check, and stage1-size only trigger on pull_request targeting main, none of them have ever run on this PR, and the two workflows that did trigger (aurora-agent-policy and esp-stage2-size) ended in action_required on the bot push d33f3196.
    • Retarget to main, drop d33f3196, and get a full green CI run on the new head — especially stage1-size across all toolchains, since this PR adds ~300 lines to unconditional Stage 1 objects (usb.o, usb_dwc3_hs.o, usb_cdc.o, proxy.o). (Sharing the common ADT/PHY bring-up helper between usb_t6040_init() and usb_t6050_init() would also avoid duplicating ~140 lines into Stage 1.)
  7. §5 — Hardware & Stage 1 evidence owed on the final main-based head.

    • Current J616s hardware numbers are from stale SHA a09e30d3 (prior to 1d34eaef, 456b58fd, and the fixes above).
    • On the rebased final head, please record:
      • J616s: cold + warm boot, both Type-C cable orientations, flags=0 (480 Mb/s), flags=0x8 (12 Mb/s), and a follow-up flags=0 verifying full-speed does not leak.
      • Other atc-phy,t6040 Mac (J614s or J616c): normal boot without the debug carrier proving the generic 480 Mb/s USB gadget/proxy still enumerates.
      • Stage 1 safety: green stage1-size headroom across toolchains + Stage 1 owner sign-off before merge (§3).

Minor note (non-blocking)

  • In src/usb_dwc3_impl.inc:1666, if usb_dwc3_ep_reconfigure_mps() fails on a generic USB2 port (once usb_cdc_deferred_usb2() is split), calling usb_cdc_link_failed() mutates cdc.state and logs a VDM recovery message meant for the explicit CDC handoff, and leaves dev->failed == false. Setting dev->failed = true (in addition to clearing RUN_STOP) and only calling usb_cdc_link_failed() when appropriate would keep the failure local to that controller.

(Clean-room §4 and naming §6 checks pass.)

@github-actions github-actions Bot added changes-requested A reviewer requested changes (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 required sections (bot) labels Nov 24, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at d33f3196fea7

Blockers:

  1. src/usb.c:148: adding atc-phy,t6040 to usb_cdc_deferred_usb2() also makes usb_init() (:540), usb_iodev_init() (:587), usb_phy_bringup() (:711) and usb_iodev_bringup() (:786) return early. So every atc-phy,t6040 Mac (J614s, J616s, J614c, J616c) loses the generic USB gadget and proxy on a boot without the inherited debug carrier, which is the path qualified at 480 Mb/s on the J616s. Fix: keep usb_cdc_deferred_usb2() for T6050 only, and test usb_atc0_phy_is_t6040() (you already have it) in usb_cdc_link_start() and usb2_target() for the explicit handoff.
  2. Commits: ea1e97cd, 11fcc66e and a09e30d3 carry a Co-Authored-By: trailer naming an AI tool. 640d9ffb, ea1e97cd, 11fcc66e, a09e30d3 and the merge 07dd30f9 have no Signed-off-by. The bot commit d33f3196 ("gfya") deletes AGENTS.md, CLAUDE.md, GEMINI.md and .github/copilot-instructions.md. Fix: rebase onto main as signed commits without the trailers or the bot commit. That also retargets the PR to main, so build, test and stage1-size run for the first time.

Checked: no Apple material. The T6040 registers are resolved from the ADT and checked by compatible and size, the USB2 PHY tunables come from the ADT, and the J616s rows at 480 and 12 Mb/s are clear. This is Stage 1 code, so it needs a J616s row at the rebased head before it merges. This replaces my earlier reviews. Of the five points in the last one, only these two are shown. I've folded the other three below as questions.

Evidence

Read src/usb.c, src/usb_cdc.c and src/usb_dwc3_impl.inc at d33f3196. Questions, not blockers; please check them on the J616s when you re-run the row:

  • usb_t6040_init() masks MUX_CTRL with the T6050 fields (& 0x73, mask32(..., 0x70, ...), :378, :409, :415). If the T6040 register uses the T8103 layout (clock in bits 5:3, data in 2:0, so 0x22 = dummy), bit 3 is neither read nor cleared there.
  • With DWC3_RESET_N clear and mux == 0x22 (:386), the retired check reads DWC3 registers while the core is held in reset.
  • usb_dwc3_usb2_full_speed is only set in usb_cdc_schedule() and never cleared on cancel or cleanup.

@DjDeveloperr
DjDeveloperr dismissed stale reviews from themself November 24, 2026 19:05

Superseded by the review at d33f319

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

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at dff7d434: not ready yet

Check Detail
CI at head no failing: policy
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head no no line with the head SHA dff7d434, 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: none matched in CODEOWNERS

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

Revert the automated agent-policy bot commit d33f319 that deleted assistant instruction files on this PR branch. The policy workflow has since been updated (aura#475) to stop pushing to PR branches.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>

@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: FINISH, then merge at dff7d434

Blockers:

  1. src/usb.c:148: prior Stage 1 review blocker remains unaddressed at dff7d434 (Revert "gfya" only reverted the stray policy-bot commit). Adding atc-phy,t6040 to usb_cdc_deferred_usb2() still causes usb_init(), usb_iodev_init(), usb_phy_bringup(), and usb_iodev_bringup() to return early, turning off the generic gadget on all atc-phy,t6040 Macs, and the full-speed request leak into later gadget inits remains open.
  2. policy CI check is failing at dff7d434, earlier commits lack human Signed-off-by, and the PR targets non-main base feat/sptm-hv.
  3. Missing exact-head hardware row (including Stage 1 size verification) and PR Tested: / Risk: lines.

Checked:

  • Commit history (d33f3196, 29a68eb5, dff7d434), CI status (3/4, policy=FAILURE), and prior review blockers on src/usb.c / Stage 1 impact.
Evidence
  • Head: dff7d43427eb (base: feat/sptm-hv, mergeable: MERGEABLE, +420/-19).

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Stage 1 disposition: preserve the generic gadget when there is no inherited debug carrier. Select the explicit CDC handoff from the ADT PHY capability and scope the full-speed request to that session. The carry-forward branch needs the author-signed series on main, then J616s explicit 480/12 Mb/s coverage and a second-family generic-gadget regression, including a real Stage 1 install row.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Carried forward onto main as #573: the signed series plus fc4d6c60, which fixes both review points (T6050-only usb_cdc_deferred_usb2(), and the explicit T6040 handoff by the ATC0 PHY compatible in usb2_target()/usb_cdc_link_start(); the full-speed request is cleared on cancel and cleanup). Review and rows continue there. This PR stays open until #573 merges, and then I will close it.

RyanTheTide added a commit that referenced this pull request Nov 29, 2026
usb: bring up the J616s (T6040) tether port as a USB2 CDC device (carry-forward of #245)
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #573 (merged as 1e01a27). It carries these six USB commits onto main, signed, plus the fixes the J616s rows needed: the T6040 explicit CDC selection, the released-PIPE-in-reset retire, the debug-window carrier skip and the full-speed OUT transfers. Thanks for the original work.

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

Labels

changes-requested A reviewer requested changes (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 required sections (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants