Repository navigation
usb: typec: tipd: take the replug's unlock key from the DT - #2639
Conversation
|
Looks right. With this, the J700's debug-port controller (0xc, Assisted-by: LLM (Claude:Opus 5.5) |
df67ad1 to
59e7bb5
Compare
…ntroller
The macOS sleep entry and wake of an SN201202x, its USB-wake arm after
the PHYs' stop and the SSPS/USBw at a cable change were taken only on
the J714s (of_machine_is_compatible("apple,j714s")). Select them by
what the controller and its DT present instead:
- the sleep entry and wake: a polled controller (no interrupt in the
DT) that follows the system's power state (apple,sleep-ssps) and arms
no USB wake of its own (no apple,usb-remote-wake), for a firmware
sleep, from a port last known dry or mitigated, as before;
- the USB-wake arm: every controller with apple,sleep-ssps registers
for apple-sleep's notifier; it arms only with that macOS entry and a
connector with a partner, as before, and only the T6050 sleep's
.prepare_late calls the notifier;
- the cable change: an SN201202x whose DT asks for it with the new
apple,cable-change-ssps (set on the J714s's USB-C port controllers,
where macOS's sequence was traced), with a connector, while running,
and not one in a debug route (from before Linux, or opened through
debugfs). It is not
tied to apple,sleep-ssps: the J700's controllers follow the system's
power state, but macOS sends them only SSPS around a sleep.
On the J714s nothing changes, given a DTB built from this tree, except
that a USB-C controller in a debug route no longer gets the cable
sequence. The macOS entry now also applies to the other boards whose
DT marks polled SN201202x controllers with apple,sleep-ssps, J716c and
J813, and the USB-wake arm on the T6050 one (J716c). Neither has been
traced or tested with it.
Signed-off-by: Diljit Singh <hey@djdev.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A partner replug ("DISC") was offered only on the J714s, with the
J714s's unlock key built into the driver: "417J", the board number
reversed. The key is a board fact, the same kind of key the
controller's LOCK takes for its debug mode, which the DT already gives
as apple,debug-lock-key (J700: "007J").
Read the key from apple,debug-lock-key. tipd_replug_supported() is
true for an SN201202x whose DT gives a four-character key, and the
replug unlocks with it. The binding's description says the key is the
board number reversed, four characters, and serves both commands. The
J714s's three USB-C port controllers get "417J".
On the J714s the replug behaves as before, given a DTB built from this
tree; with an older DTB it is refused (-EOPNOTSUPP). The J700's debug
port controller already has its key, but its connector has no USB role
switch, so neither debugfs nor dwc3-apple can ask it for a replug. The
debug link rearm needs the key and a sleep that cut that controller's
link (apple,debug-port, the J700's only), so it doesn't start on the
J714s.
Signed-off-by: Diljit Singh <hey@djdev.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59e7bb5 to
82123a0
Compare
|
J700 row on fleet77 (integration b4cd7b3 based), with this PR's tipd modules (with #2622 and #2638) swapped in at runtime. The modules load, both controllers probe, and the dock's devices re-enumerate. The Two ways out: let the replug go without a role switch (the Assisted-by: LLM (Claude:Opus 5.5) |
Stacked on #2638, whose commit this branch includes; #2640 stacks on it. Review only the last commit, take the replug's unlock key from the DT. Part of the no-board-gates rule: board facts go in the DT, not in driver lists.
What changes
DISC) was J714s-only, with the J714s key417Jbuilt into the driver. The key is the board's target identifier, reversed.apple,debug-lock-key. That's the same LOCK key the DT already gives for debug mode (J700:007J).tipd_replug_supported()is true for an SN201202x that has a four-character key.apple,debug-lock-key = "417J"in t6050-j714s.dts.Effect
apple,debug-port(only the J700 has it) and a sleep that cut that controller's link, so it doesn't start on the J714s.Review: done. Fixed from it: the J700 statement, "board number reversed", and two stale comments. Still open:
cd321x_inherited_boardshard-codes LOCK keys behind machine compatibles (J716c "617J", J575c "575J"), left for the later board-table pass.Merge prerequisite (rig): the M5 rig boots a lab-built DTB (fdc15472) that doesn't have the new property. Merging this without refreshing that DTB would turn off the replug on the rig: the Dell-port SuperSpeed recovery and the gates' replug trigger. So the merge waits for a rig DTB refresh: fdc15472 plus these properties, gated and switched.
🤖 Generated with Claude Code