Repository navigation
Conversation
The generation 4 controllers (T8142, T8152) refused an interrupt line
("Generation 4 interrupt layout is not supported"), so their followers'
interrupts could not be used and the USB-C PD controllers behind them
were polled.
Generation 4 keeps one bit per interrupt source as generation 1 does,
only at other offsets: the enables at 0x400 and the pending sources,
write 1 to clear, at 0x600 (where the fault interrupt is acknowledged
already). Take both offsets from the match data and accept the
interrupt line on generation 4. Its command replies stay polled: source
256 is not enabled for them.
On the J873g (T8152), with the PD controllers' event, sleep and wake
sources described (11/17/19, 37/43/45 and 63/69/71, as in the ADT) and
the controller's line (AIC 682), the sources arrive and are acknowledged:
the controller whose DisplayPort partner raised IRQ_HPD delivered its
event interrupts, and all three displays stayed up. Generation 1
controllers keep their offsets, and generation 4 controllers without an
interrupt in the device tree are unchanged.
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
|
Thanks, Thomas, and thanks for the J873g run: seeing the PD controllers' event sources arrive (63 firing on IRQ_HPD) is the evidence this layout needed. This is the same change as #1743 (Joshua): match-data mask/ack offsets at 0x400/0x600, num_irqs for gen 4, the -EOPNOTSUPP removed, source 256 left masked. Two PRs for one mechanism will conflict, so we'd like to land it once, in #1743. It already has three things this one doesn't:
What #1743 is missing is your hardware run. Could you repeat it on #1743's head: tipd binding the three controllers with IRQs, 63 firing on a DP hotplug, then |
The generation 4 Apple SPMI controllers (T8142, T8152) refused an interrupt line:
Generation 4 interrupt layout is not supported. So the followers' interrupts couldn't be used, and the USB-C PD controllers behind them (ACE3,tipd'sapple,sn201202x) are polled on the J813 today.Generation 4 keeps one bit per interrupt source as generation 1 does, at other offsets: the enables at 0x400 and the pending sources (write 1 to clear) at 0x600. 0x600 is where the driver already acknowledges the generation 4 fault interrupt. This takes both offsets from the match data and accepts the interrupt line on generation 4. Command replies stay polled on generation 4: source 256 isn't enabled for them.
How the layout was found, from outside: with nothing enabling interrupts, the J873g's 0x600 bitmap holds the PD controllers' sources latched (11/13/19, 37/39/45, 63/71, and 256), and 0x400–0x5ff read 0. With enables written at 0x400, the sources are delivered.
Test (J873g, test kernel = #2178's stack + this + a DT describing the PD controllers' event, sleep and wake sources and the controller's AIC line 682):
tipdbound the three controllers with their interrupts, and they fired: the event source of the port whose DisplayPort partner raised IRQ_HPD (63) delivered 20 interrupts, and the wake sources fired too.Not changed: generation 1 offsets. A generation 4 controller without an interrupt in its DT behaves exactly as before.
Not tested: the J813. Its DT doesn't describe its PD controllers' interrupts yet; that follows with the board DT.
This is the step that makes the single PD owner on #2178 interrupt-driven.