Repository navigation
Neo: tune the eUSB2 repeater and the VL122 hub like macOS - #1041
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inapple,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 optionaleusb2-repeaterPHY.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 matchingapple,tunable-{vl,vlf0,gl}list, verifies it and releases reset (probe and resume).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):
pm_test=devicessuspend/resume cycle. USB stayed up throughout (manual and driver runs).apple,tunable-vlf0applied and verified in the reset window, hub re-enumerates at 480M with both ports, survives resume.dt-doc-validate/yamllint clean for ti,cd2e22, via,vl122, apple,atcphy;CHECK_DTBSon t8140-j700: 0 new warnings.🤖 Generated with Claude Code