#asahi-dev · 2022-03-15 18:13
sventhe lanes are configured inside atcphy#asahi-dev · 2022-03-15 18:12
svenxnu also doesn’t have an additional delay in between #asahi-dev · 2022-03-15 18:12
sventwo strs just after another work fwiw#asahi-dev · 2022-03-15 18:11
svenand it really hates you if you do both at the same time :D#asahi-dev · 2022-03-15 18:11
sventhe low 2 is some clock enable, the high 2 selects the mode (or the other way around)#asahi-dev · 2022-03-15 18:10
sven22?#asahi-dev · 2022-03-15 18:02
svenand https://github.com/AsahiLinux/m1n1/blob/main/src/usb.c#L131 really only wants to enable that "dummy PHY"#asahi-dev · 2022-03-15 18:00
svenand those two lines here https://github.com/AsahiLinux/m1n1/blob/main/src/usb.c#L128 actually set up what probably is that "usb2-only" mode :)#asahi-dev · 2022-03-15 17:57
svenso i guess there's "connect dwc3 to dummy super-speed PHY" aka usb2-only, "connect dwc3 to USB3 phy" and "tunnel it all over USB4"#asahi-dev · 2022-03-15 17:56
svenso just from skimming the code that three mode thing makes sense. the third one I didn't use yet seems to be related to some "cio tunnel"#asahi-dev · 2022-03-15 17:44
sven"The PHY Interface for the PCI Express*, SATA*, and USB* Architectures (PIPE) "#asahi-dev · 2022-03-15 17:41
svenhm... weird#asahi-dev · 2022-03-15 17:39
sveni guess that reset messes up something inside dwc3 which then messes up the pipe part or something#asahi-dev · 2022-03-15 17:39
sven(break as in requires a PMGR reset of atcphy and dwc3 to work again)#asahi-dev · 2022-03-15 17:39
sven-paer#asahi-dev · 2022-03-15 17:38
svenit's certainly all very interconnected. i can e.g. break the atcphy/pipehandler paer by issuing a port reset for the usb2 phy only#asahi-dev · 2022-03-15 17:37
sventhe exact sequence you have to do is "bring up usb2 phy (because dwc3 will never clear the softreset otherwise", "bring up dwc3", "bring up atcphy", "switch mux to usb3"#asahi-dev · 2022-03-15 17:35
svenyou can't e.g. switch that mux when dwc3 is in softreset#asahi-dev · 2022-03-15 17:35
svenalso makes sense that it's tightly coupled to dwc3 then#asahi-dev · 2022-03-15 17:31
svenone less "// TODO: WTF does this do" comment :D#asahi-dev · 2022-03-15 17:31
sventhere's also a string about a "dummy PHY" related to usb2, so that would also fit#asahi-dev · 2022-03-15 17:30
svenyeah, that makes sense then#asahi-dev · 2022-03-15 17:30
svencould be, there are strings about "cioTunnelMode" nearby#asahi-dev · 2022-03-15 17:28
svenIt’s probably just mislabeled #asahi-dev · 2022-03-15 17:28
svenI know#asahi-dev · 2022-03-15 17:28
svenand I think usb4 is another setting there#asahi-dev · 2022-03-15 17:28
svenI need to switch a register xnu calls something like “pipe handler mux mode” from what works for usb2 to what works for usb3 :/#asahi-dev · 2022-03-15 17:27
svenapparently…#asahi-dev · 2022-03-15 17:27
svenPIPE also contains the dwc3 reset bits and that final mux thing that decides usb2/3/4 #asahi-dev · 2022-03-15 17:26
sven(In the adt)#asahi-dev · 2022-03-15 17:26
svenpart of the atcphy regs are inside the dwc3 node e.g.#asahi-dev · 2022-03-15 17:26
sveneven for usb3, dwc3 and atcphy are interconnected #asahi-dev · 2022-03-15 17:24
svenand sync that all to the correct place inside dwc3 ofc#asahi-dev · 2022-03-15 17:24
svenatcphy itself is also fairly high level fwiw, most of what I needed to do was essentially enables some clocks, configure the lane modes, apply those tunables and switch what they call “PIPE handler” to the correct mode#asahi-dev · 2022-03-15 17:22
svenlet’s what macOS does, maybe it’s really just setting up this DisplayPort crossbar thing#asahi-dev · 2022-03-15 17:22
svengood point#asahi-dev · 2022-03-15 17:19
svenI guess I’ll trace everything and connect a display and then some thunderbolt thing to see what requires more magic pokes#asahi-dev · 2022-03-15 17:18
svenit’s “just” that their cio coprocessor and the pcie parts aren’t up#asahi-dev · 2022-03-15 17:17
svenI mean… I can already switch the lanes to thunderbolt mode at this point#asahi-dev · 2022-03-15 17:16
svennot sure tbh, there’s lots of references to a dpphy in the kexts that scare me#asahi-dev · 2022-03-15 17:15
sventhat’s the final stage I guess :D#asahi-dev · 2022-03-15 17:13
svenhmmm…. DisplayPort or thunderbolt now? :>#asahi-dev · 2022-03-15 16:33
svenbut maybe that just doesn't work?#asahi-dev · 2022-03-15 16:33
svenso far i've only seen macos configure the lanes to be USB/DP though but i assumed that was because I don't have any device that uses two lanes#asahi-dev · 2022-03-15 16:33
sven<3 usb#asahi-dev · 2022-03-15 16:33
svenah, ofc there is.#asahi-dev · 2022-03-15 16:26
svenand a separate path for usb4#asahi-dev · 2022-03-15 16:26
svenmilek7: hrm, interesting. i assumed it was up to 2x2 because there seems to be a code path in the typec phy that configures both lanes to be USB#asahi-dev · 2022-03-15 16:24
svenah, the 20 gbit which is 2x2 is actually 60 eur#asahi-dev · 2022-03-15 16:23
svenJamie[m]1: huh, and that thing is just 20 eur. i would've expected these things to be more expensive