Skip to content

Neo: tune the eUSB2 repeater and the VL122 hub like macOS - #1041

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
surp/neo-usb2-tuning
Nov 6, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
surp/neo-usb2-tuning

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What

USB 2.0 signal tuning on the MacBook Neo (J700), matching what macOS applies.

  • phy: ti-cd2e22: I2C driver for the TI CD2E22 eUSB2-to-USB2 repeater on i2c2. It applies the firmware tuning list in apple,tunable (four-byte register, mask, value, reserved entries; masked read-modify-write with readback verify) when it probes, opens its channel, and reapplies on resume. The ATC PHY takes it as an optional eusb2-repeater PHY.
  • usb: misc: vl122-hub: driver for the VIA Labs VL122 hub's I2C management interface. That interface only answers while the hub is held in reset, so the driver holds reset, reads the hub vendor/variant, applies the matching apple,tunable-{vl,vlf0,gl} list, verifies it and releases reset (probe and resume).
  • Bindings for both, J700 DT nodes, config entries.

No tuning values are in the kernel. The bootloader copies them from the ADT (aurora-silicon/aura#91). Without those properties both drivers bind quietly and leave the hardware exactly as today, and the ATC PHY treats the repeater as optional, so this is inert until the bootloader change and a Stage 2 DT refresh reach a machine.

Why

Under Linux the repeater ran with its power-on defaults: none of the five fields macOS programs matched, and the hub was never tuned.

Testing (J700, fleet16 kernel)

The Neo's DT lives in its Stage 2, so the drivers were tested as modules against the running fleet16 kernel, with a test-only harness creating the two I2C clients with the properties aura will provide (this machine's own ADT lists):

  • Repeater: all five fields at the macOS values after probe, verified by the driver's readback; re-applied and verified after a pm_test=devices suspend/resume cycle. USB stayed up throughout (manual and driver runs).
  • Hub: variant F0 detected, apple,tunable-vlf0 applied and verified in the reset window, hub re-enumerates at 480M with both ports, survives resume.
  • The hardware test found the hub reset is active high (the first version had it active low, which left the hub in reset); fixed in the last commit, plus a settle delay (20 ms; the interface needs ~7 ms after a resume-time reset) so no management read NACKs. Confirm run with the final modules: probe + three resume cycles, tuning verified each time, 0 I2C NACK in the log, clean unload.
  • Buildbox: W=1 clean (both drivers, atc.c); dt-doc-validate/yamllint clean for ti,cd2e22, via,vl122, apple,atcphy; CHECK_DTBS on t8140-j700: 0 new warnings.
  • After the test the Neo was rebooted to fleet16: os_uuid pin present, SELinux enforcing, 0 AVC, 0 failed units, Touch ID restored.

🤖 Generated with Claude Code

Describe the firmware-supplied byte tuple format, hub reset window, and the Apple ATCPHY repeater consumer link.

Signed-off-by: Ryan Murray <[email protected]>

Assisted-by: LLM
Apply only firmware-provided masked byte tuples, keep missing tuning data a silent no-op, and sequence the VL122 reset-only sideband window.

Hook the optional repeater supplier into Apple ATCPHY without blocking existing device trees.

Signed-off-by: Ryan Murray <[email protected]>

Assisted-by: LLM
Describe the CD2E22 repeater, VL122 configuration interface, reset line, hub association, and ATCPHY repeater route. Leave all tuning properties for Aura to copy from the ADT.

Enable both drivers in the Apple config fragment.

Signed-off-by: Ryan Murray <[email protected]>

Assisted-by: LLM
- The J700 hub reset line is active high. With it described active low
  the hub is never in reset during the configuration window, its
  management address NACKs throughout, and the release step holds the
  hub in reset so it drops off USB.
- Give the management interface 2 ms after asserting reset before the
  first read, so the poll does not start with a NACK (and an I2C
  controller error line) on every probe and resume.
- Tune the repeater as soon as it probes, as the firmware does; PHY
  init and resume reapply the same list.

Tested on J700 (fleet16 kernel, drivers as modules with the tuning lists
from the machine's ADT): repeater fields verified at probe and after a
pm_test=devices suspend/resume; hub variant F0 selected, its list
verified, the hub re-enumerates and survives resume.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
On resume the VL122 management interface needs about 7 ms after reset
is asserted before it answers, against under 2 ms at probe. Wait 20 ms
so neither path starts its poll with a NACK, which the I2C controller
logs as an error.

Tested on J700: probe plus three pm_test=devices resume cycles, tuning
list applied and verified each time, no I2C NACK in the log.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
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