#
✕ nick:sven
#asahi-dev · 2022-09-30 15:11
svennice, thanks.
#asahi-dev · 2022-09-30 15:07
svenlooks like the dpin connected signal comes as a packet on the thunderbolt NHI, so we’ll eventually have to hook that up as well…
#asahi-dev · 2022-09-30 15:07
svenjannau: what is your current DCP branch? that September one? And I guess I’ll also need some m1n1 patch for the reserved regions?
#asahi-dev · 2022-09-30 11:02
svenat least the setup seems to happen via that epic Interface, dunno how they actually push the data then
#asahi-dev · 2022-09-30 06:47
svenbut then you can just stare at trace_dcp.py and probably figure out audio in a day or so. I took a very brief look and it seemed rather simple
#asahi-dev · 2022-09-30 06:46
sveni'll prepare a PR to handle that as well this weekend
#asahi-dev · 2022-09-30 06:46
sventhe dcp->ap side is still missing though
#asahi-dev · 2022-09-30 06:45
svenhttps://github.com/AsahiLinux/m1n1/blob/main/proxyclient/hv/trace_dcp.py#L900 that's what I already have
#asahi-dev · 2022-09-30 06:44
svenpovik: I'll need to prepare one more PR for the DCP EPIC pretty printer. then the extraction literally is "add bt() to the unknown command handler after loading kext symbols"
#asahi-dev · 2022-09-30 06:43
svenlooks like atc-dpin0/1 both have an interrupt. maybe that's how they know when a stream needs to be tunneled
#asahi-dev · 2022-09-30 06:40
svenor adjust dart.c to allow more than 2 darts/domain and just attach them all to the same one
#asahi-dev · 2022-09-30 06:39
svenmaybe just add all of them to the main node then :D
#asahi-dev · 2022-09-30 06:37
svenit actually doesn't look too complicated fwiw
#asahi-dev · 2022-09-30 06:37
svenpovik: you know you want to :D
#asahi-dev · 2022-09-30 06:36
sven*iomfb.c actually
#asahi-dev · 2022-09-30 06:36
svenI'll add dptx.c and dcpav.c and povik can then later add audio.c :-P
#asahi-dev · 2022-09-30 06:36
sven2) split dcp.c into dcp.c and iofm.c (i think that's how apple calls the main dcp endpoint) so that struct apple_dcp can be used for other endpoint
#asahi-dev · 2022-09-30 06:35
sven1) the top level node shouldn't be called disp0 and also shouldn't attach to the disp0 iommu. instead it probably needs to take pairs of dcp(extN), dispN
#asahi-dev · 2022-09-30 06:35
svenjannau: I need to figure out how usb4 tunneling works first to figure out more details, but I think it already makes sense to change two things inside dcp:
#asahi-dev · 2022-09-29 21:03
svenheh, fair enough. then maybe it was the Linux driver who already used interrupts there
#asahi-dev · 2022-09-29 20:59
svencould also be sone memory ordering bug. These chips are so highly out of order that they’re very good at uncovering those
#asahi-dev · 2022-09-29 20:58
svenI think your interrupts work though because iirc they are already required when setting up the rings early on
#asahi-dev · 2022-09-29 20:57
svenalso keep in mind that you won’t get any interrupt when you disconnect a device. Effectively these ports only work once for now
#asahi-dev · 2022-09-29 20:56
svenyeah, usb c ports are driven by dwc3 on the mini
#asahi-dev · 2022-09-29 20:36
svenyeah, dwc3 bringup should be pretty simple
#asahi-dev · 2022-09-29 20:33
svenI couldn’t see any reasonable pattern in the split
#asahi-dev · 2022-09-29 20:33
svenyeah.. it’s pretty weird. half of the xhci dma xfers go through the first one and the other half through the second
#asahi-dev · 2022-09-29 20:27
svenoh, and dwc3 has two darts that must be configured to the same pagetables essentially
#asahi-dev · 2022-09-29 20:27
svenfor the PCIe darts that bit is just ignored though so you have to setup translation tables there
#asahi-dev · 2022-09-29 20:26
svenAnd I think m1n1 or uboot puts the dwc3 darts into bypass mode
#asahi-dev · 2022-09-29 20:26
svenI don’t think I ever checked the xhci regs but I would be surprised if they don’t advertise 64bit as well
#asahi-dev · 2022-09-29 20:25
sventhere’s some hwparams in the dwc3 core that has dma width as 64 fwiw
#asahi-dev · 2022-09-29 17:09
sven*on
#asahi-dev · 2022-09-29 17:08
svenespecially when it’s in hacker news!
#asahi-dev · 2022-09-29 15:46
sven:D
#asahi-dev · 2022-09-29 15:19
svenhttps://f.svpe.de/0b967b971dcedee4353a594e266f957dd6151115dec250dc06bd2cf6f329cc9a_dpext.png and here's a picture with a real screen :D
#asahi-dev · 2022-09-29 15:17
sventps6598x will just trigger ATCPHY to switch the lanes to usb4 mode
#asahi-dev · 2022-09-29 15:17
svenit gets a bit more tricky with the display signal though once we have usb4 tunneling
#asahi-dev · 2022-09-29 15:17
svenyeah, the electrical side is easy: tps6598x tells ATCPHY to switch the lanes to USB/DP-Altmode
#asahi-dev · 2022-09-29 15:16
svenmaybe that can just be part of the drm driver though since I think it already has a top level thing like that that takes multiple dcps
#asahi-dev · 2022-09-29 15:16
sven*of
#asahi-dev · 2022-09-29 15:16
svenwe'll also need some kind if top-level thing that decides which port goes to which dispext
#asahi-dev · 2022-09-29 15:11
svennot yet, DCP certainly needs to implement two more endpoints
#asahi-dev · 2022-09-29 15:04
svenit wants to know the link rate, lane count, etc. to start the link training
#asahi-dev · 2022-09-29 15:04
svenI just had to implement the DCP->AP IPC calls
#asahi-dev · 2022-09-29 15:02
svensame procedure as usual: first reverse engineering it and implement a PoC inside python using m1n1. then once I understand it well enough write that linux driver
#asahi-dev · 2022-09-29 15:02
svenpython
#asahi-dev · 2022-09-29 15:01
svennext up: thunderbolt :>
#asahi-dev · 2022-09-29 15:01
svenalso not looking forward to implementing this inside a linux driver :D
#asahi-dev · 2022-09-29 15:01
svenyup :-)

plus ›