Repository navigation
Conversation
aedc7af to
bd141ac
Compare
|
Restacked on #1743 instead of #2466, because Ryan asked to land the generation-4 SPMI interrupts once, in #1743. The head is now |
bd141ac to
182211d
Compare
|
Updated to |
182211d to
28447d8
Compare
28447d8 to
4e0bf8f
Compare
|
hdmi_pcon_power() in drivers/gpu/drm/apple/t8152_hdmi.c ends with an unconditional msleep(25) after the PS190 power writes, with no reason given for 25 ms. If the converter needs a power-on settle time, cite where the value comes from; better, wait for the thing that actually matters (the PS190 asserting HPD or answering AUX) with a bounded poll. Separately, the iboot_buffered module parameter is harmless with its default but should not be runtime-writable. Until then this should stay a draft. |
4e0bf8f to
e65af2d
Compare
|
@RyanTheTide both points are in #1800 ( |
e65af2d to
2880a16
Compare
|
Rebased onto integration/aurora Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-checked at 2880a16. The four commits this PR adds range-diff as Assisted-by: LLM (Claude:Opus 5.5) |
4aebfd7 to
5fbdac0
Compare
Generation 4 (t8142, t6050) had its interrupt refused at probe. macOS's trace (reported by Dj on the Aurora M5 Pro thread) acks peripheral sources 0..255 per bit in words from +0x600, with the controller fault source 263 at +0x620 bit 7. On K114c the PMIC RTC alarm sets +0x600 bit 2 (read-only probe, alarm armed 20 s out). Take the mask and ack bank offsets from the hw table (gen1 unchanged, shared with a host check in spmi-apple-irq.h). Generation 4 has no mask bank we could find (no word in 0x20..0x7f or 0x500..0x6ff toggles), so sources are masked in the cache only. Commands stay polled: the RX notification is not wired for gen 4. Tested: host check of the register math; compile only, not booted. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Probe on K114c: +0x400..0x41c toggle and restore (8 words), +0x420 does not, matching the +0x600 ack bank 0x200 above (Dj, seq 713, from write offsets in a macOS trace). The alarm latches +0x600 bit 2 once the PMIC alarm mask byte 0x200e is 0 (as rtc-macsmc writes it) and a write of 4 to +0x600 clears it (measured). Whether the +0x400 bit gates the AIC line is not measured. Drop the cache-only masking for gen 4. On a firmware resume re-apply the runtime mask, since a firmware sleep entry writes the mask bank itself. Host check extended; compile only, not booted. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
…ask writes Both open code points from review: The controller's fault source (263, word 0x620 bit 7 on gen4) shares its ack word with the notification word the handler reads first, and the stray-source path acked it directly: queued fault records were lost. Drain the queue before the bit is acked, in both the notification-word path and the readq stray path. gen4 has no notification source, and the word at +0x420 does not behave as a mask bank, so the init and teardown loops now write only the num_irqs / 32 mask words on gen4 (the legacy controllers keep the extra notification word). The host-test file is dropped: kbuild never built it and it checked constants against themselves. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The stray-queue loop visits ack words 0 to 3 (bytes 0 to 24), while the gen4 fault source lives in word 8 (0x620), which the chained handler already reads and drains before acking. The hunk also compared a word index against byte offsets. It could never fire; remove it. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The USB-C PD controllers behind the J873g's (T8152) SPMI controller at 0x308908000 answer as the T8132 ones do: no register-selection interrupt, so a selection is polled, and the payload length of the selected register is read from register 0x1f. Their event, sleep and wake sources are interrupts 11/17/19, 37/43/45 and 63/69/71 of that controller. Add apple,t8152-sn201202x with apple,t8132-sn201202x as fallback, so that the T8132 interrupt layout (irq, sleep, wake) applies. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
… as Type-C mode switches A T8152 DCP drives the rear USB-C port whose PD controller reports a DisplayPort sink. So far the DCP read the controllers itself, through apple,usb-pd. The controllers belong to the USB Type-C port driver instead, which passes the DisplayPort alt mode state of a port to the Type-C mode switches its connector's graph leads to. Describe one display switch per port, shared by the DCPs: the port's usb-c node in the shared ports node (the one apple,usb-c-ports refers to) is the mode switch, with an endpoint at the display port (port@3) of the port's usb-c-connector. The DCPs already share these nodes for the port's PHY registers and tunables, and each port has one owner at a time. One switch per DCP instead would fill the three mode switches a connector's port driver looks at (fwnode_typec_mux_get() collects the matches into a three-entry array and stops at the third endpoint without an error), and leave out the port's ATC PHY, which needs one for USB4. Drop apple,usb-pd, which nothing reads any more. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
5fbdac0 to
f53d6de
Compare
f53d6de to
377db77
Compare
|
#1797 has merged with its trailer-free head a7907d9. This branch still carried #1797's earlier commits, including 17cb996 with the
Assisted-by: LLM (Claude:Opus 5.5) |
377db77 to
fcbdb7f
Compare
|
Message-only remap,
#1800 has merged, so of the two prerequisites only #1743 is left. Assisted-by: LLM (Claude:Opus 5.5) |
The T8152 DCPs found a USB-C display by reading the rear ports' PD
controllers over SPMI every 250 ms (t8152_pd.c): plug and orientation
from STATUS (0x1a), DisplayPort connection, pin assignment and HPD
from DATA_STATUS (0x5f), through the controllers' register window
(select at 0x00, length at 0x1f, data from 0x20). With tipd bound to
the same controllers, tipd failed to read its events while the
display path polled. The controllers belong to tipd now.
Take the state from the Type-C class instead: one Type-C mode switch
per rear port, the port's usb-c node in the shared ports node, with an
endpoint at the display port of the port's connector. tipd sets the
port's mode on it. The switch records whether the port is in
DisplayPort alt mode with HPD high, the lanes of the pin assignment
(two for B, D and F, which share the cable with USB 3) and the plug
orientation of the Type-C port, once, next to the port claims of
t8152_atc.c, and tells every DCP that drives USB-C to look at the
ports. The port claim and the PHY, crossbar and DPTX handling of
t8152_atc.c and iboot_drm.c stay as they were.
One switch per port, not one per DCP: a connector's port driver takes
three mode switches at most (TYPEC_MUX_MAX_DEVS;
fwnode_connection_find_matches() stops at the third endpoint and
returns success). A switch per DCP would fill all three on every J873g
rear connector, and the port's ATC PHY, which needs one for USB4,
would never be called.
A HPD pulse is not a new sink. Without a video stream, an EV2780 drops
HPD for about 160 ms every 4.7 s; the PD controller reports it after
the fact, and tipd passes it on as HPD low and then high. Connecting
the sink anew on each pulse kept its link from coming up (link faults,
one lane, then a standby link trained at RBR whose mode list lacked
the enabled mode, so the next DPMS on failed atomic check). The 250 ms
poll never saw these pulses. A switch event is looked at 100 ms later,
which takes such a low and high together, and only a changed plug
(orientation, lanes) or a sink that leaves DP alt mode with its
partner is a new connection.
dcp-fabric.c's route layer itself does not fit these DCPs: it switches
a DP PHY and the display crossbar through their drivers and connects
the sink through the DCP's IOMFB DPTX service, while the iBoot
interface DCPs program the ATC PHY and the crossbar themselves and
connect through their own DPTX port service. Their switches only
record the state, in t8152_typec.c.
The 250 ms work now only re-arms while a DCP can take the shared HDMI
port, whose HPD line has no interrupt.
The PD controller reset that made a sink which stopped answering AUX
enter DP alt mode again (a cold reset, "Gaid", then system power state
S0, "SSPS") is gone: the controller is tipd's, and tipd puts it into
S0 whenever it sets the controller up. What remains is the DisplayPort
side, at most once a minute: release the link and connect the port's
sink again. HPD changes now reach the display path as they happen.
The first DCP that probes registers the switches, ahead of everything
else in its probe, and they stay until the driver is unloaded: tipd
keeps the switch it found, and must not wait for a DCP that cannot
start. Their parent is a faux device of their own ("t8152-typec"), not
that DCP, so unbinding a DCP leaves no switch under an unbound device.
A switch that cannot be registered is disabled in the live tree, so
that tipd goes on without it; the driver keeps that changeset and
reverts it at unload.
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
… tipd The PD controllers of the three rear USB-C ports were described for the display path alone, which read them over SPMI itself. Describe them for tipd, which owns them from now on, and the display path takes their DisplayPort alt mode state from the Type-C class: - the controllers as apple,t8152-sn201202x, with the T8132 fallback: tipd's SPMI transport then polls the register selection and reads the payload length from register 0x1f, as these controllers need; - the SPMI controller (AIC 682) as the interrupt controller of their event, sleep and wake sources: 11/17/19 (back-middle), 37/43/45 (back-left) and 63/69/71 (back-right), rising edge, as in the ADT. In a test with the compatibles and interrupts alone, tipd bound all three, took its events by interrupt, and both display partners showed DisplayPort alt mode active; - a usb-c-connector per controller, whose display port (port@3) leads to the port's usb-c node in the main DCP's shared ports node, the port's one display switch for all three DCPs. The USB port (port@0) stays unlinked: the USB data path is not changed here. The DCP's usb-c nodes lose apple,usb-pd, which nothing reads any more. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
fcbdb7f to
f9ad98d
Compare
|
The other seven commits are unchanged ( Assisted-by: LLM (Claude:Opus 5.5) |
|
J873g boot row on the exact head
Not in this row: DisplayPort alt mode with a USB-C display, because none was plugged in on this boot. That row follows with a monitor on a rear port. Assisted-by: LLM (Claude:Opus 5.5) |
|
J873g DisplayPort alt-mode row on the exact head
Assisted-by: LLM (Claude:Opus 5.5) |
Conflict in drivers/spmi/spmi-apple-controller.c between aurora-silicon#1743's generation 4 interrupt commits (mask/ack banks from the match data, legacy-only unmask) and main's ec141ba (per-instance vector count, spmi->num_irqs): keep the match-data banks and the legacy-only paths, and count vectors with spmi->num_irqs everywhere, the gen4 resume path included (it equals the match value there). Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
main now carries aurora-silicon#1799 (06bbe5b, f349ba7, cc82020), whose patches this branch already has as b620188, 2273dcf and cc129b6 (same patch-ids). The seven files where this branch edits aurora-silicon#1799's lines afterwards are merged against cc129b6 (the old base plus aurora-silicon#1799; the integration merge below it touches none of them): six keep this branch's version, since aurora-silicon#1799 is main's only change to them, and drivers/phy/apple/atc.c also takes aurora-silicon#2868's two changes (a CIO link survives the USB host stopping on every generation, T8152 included; a drive-only DP request succeeds on PHYs without drive control). The SPMI conflict is resolved in the aurora-silicon#2486 merge. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
What: The J873g's (M6 Mac mini) rear USB-C PD controllers move to tipd, and drm/apple takes the T8152 USB-C display state from the Type-C ports, so DisplayPort alt mode runs through their mode switches. Carries #1743's gen4 SPMI interrupt commits.
Tested: J873g M6 Mac mini at
f9ad98d1d5d6, before main was merged in: tipd binds the three rear PD controllers; a USB-C monitor in DisplayPort alt mode on back-left and back-right, unplugged, replugged and flipped, at 2560x1440@60 each time; 0 failed units, 0 tipd errors, 0 DART faults (issuecomment-7138244428). The current head, main merged in, is built (Details), not booted yet.Risk: one-way door (new DT bindings) · J873g (T8152 drm/apple and device tree); the SPMI commits are #1743's and reach its gen4 Macs.
Not yet: a J873g boot of the merge, HDMI included (main now carries #2873, which the earlier head lacked); #1743 leaving draft.
Details
Merge of main (11-24).
4f09b09b0a06merges main 595384b. The only conflict is indrivers/spmi/spmi-apple-controller.c, between #1743's generation 4 commits (mask and ack banks from the match data, unmask on legacy controllers only) and main's ec141ba (a per-instance vector count,spmi->num_irqs, that T8103 nodes can override from the DT). The merge keeps the match-data banks and the legacy-only paths and counts vectors withspmi->num_irqseverywhere; on generation 4 that equals the match value, as before. The merge builds for the J873g (Image, modules, DTB), and the SPMI driver is clean with W=1.#1800 (J873g displays in drm/apple) has merged. Still stacked on #1743 (generation-4 SPMI interrupts; its four commits are included unchanged). Review the last four commits. It stays a draft until #1743 leaves draft.
The second PR of the J873g Type-C stack: #1743, this PR, then #2178. The J873g's (Mac mini M6, T8152) three rear USB-C PD controllers (ACE3,
sn201202x) now have a single owner,tipd, which runs on their interrupts. drm/apple's T8152 DCPs take DisplayPort alt mode from Type-C instead of polling the controllers over SPMI.apple,t8152-sn201202xwith theapple,t8132-sn201202xfallback. Like T8132, the J873g's controllers have no select notification and report the payload length in register 0x1f. tipd's T8132 path needs no change.usb-cnode in the shared ports node becomes the port's one display mode switch, with an endpoint at the connector'sport@3. It replacesapple,usb-pd.TYPEC_MUX_MAX_DEVS), and leave out the ATC PHY's switch that USB4 needs (J873g: USB4 on the rear USB-C ports through tipd and atc.c (T8152 routers, PCIe-C, M6 Mac mini) #2178).t8152_pd.cis deleted, along with the PD reset ("Gaid", "SSPS") that came with it. A sink that stops answering AUX gets its DisplayPort link released and reconnected instead, at most once a minute.usb-c-connectorchildren, with graph links to every DCP's route for that port.Things to know
Evidence
Testing (M6)
The first version, with a switch per DCP, was tested as below. This head was booted with #2178 on top: all three displays, 6/6 DPMS cycles.
dcp-usb-cN-muxswitches register.tools/asahi/run-host-tests.py: 427/427. Changed C files are clean with W=1, and checkpatch--strictis clean.scripts/dtc/apple-dt-check.shagainst J873g: HDMI and USB-C displays in drm/apple (iBoot interface, T8152 Gen3 display DARTs, M6 Mac mini) #1800: 0 new and 0 removed warnings. Both changed bindings pass.Not tested: a physical replug, a flipped plug and a pin D dock. Nobody is at the machine.
cc @Acelogic @RyanTheTide @DjDeveloperr @LiamRay10