#
✕ nick:sven
#asahi-dev · 2023-01-22 21:58
svenhrm, looks like apple's pciec driver has some quirks for certain devices that don't play nice with the rid2sid map
#asahi-dev · 2023-01-22 19:30
svencan’t really do anything about that though :(
#asahi-dev · 2023-01-22 19:29
sventhanks for checking, sounds like some kind of signal integrity issue then
#asahi-dev · 2023-01-22 19:03
svendoes it work on the same machine when running macos?
#asahi-dev · 2023-01-22 14:14
svenand DCP at least uses that piodma thing somehow internally. it's just weird that the thunderbolt pcie controller has that thing as wel
#asahi-dev · 2023-01-22 14:12
sveni'm just a bit confused because it uses stream 15 of that pcie dart
#asahi-dev · 2023-01-22 14:11
svenyeah, somehow associated with the thunderbolt pcie controller
#asahi-dev · 2023-01-22 14:07
svenapciec[%s]::%s no PIODMA engine associated with this port <-- oh dear god, I'm not sure I want to know what that's about
#asahi-dev · 2023-01-22 13:56
svenlike, all of them. I guess they only exist in that kernelcache now?
#asahi-dev · 2023-01-22 13:56
svenand apparently at some point the .kexts disappeared from /System/Library/Extensions :/
#asahi-dev · 2023-01-22 13:55
svenits MMIO starts where usually the second root port would be
#asahi-dev · 2023-01-22 13:54
svenhrm, there's a strange apciec1-piodma node in the ADT which seems to use the pciec dart for some reason
#asahi-dev · 2023-01-22 11:47
svenwhich is probably a sign that we're doing something wrong ;)
#asahi-dev · 2023-01-22 11:47
svenhacking around dwc3 is getting more and more painful these days
#asahi-dev · 2023-01-22 11:46
svenyeah, there's some annoying details to figure out but at least I want to give this a try
#asahi-dev · 2023-01-22 11:45
svenjannau: it looks like we e.g. don't need a dwc3 reset if we just switch from usb3-only to usb3/dp
#asahi-dev · 2023-01-22 11:44
svenjannau: especially with thunderbolt this seems to be very annoying to get right and end in even more ugly hacks
#asahi-dev · 2023-01-22 11:44
svenjannau: fwiw, I think at this point we might as well try to just writer our own small dwc3 driver that calls into the dwc3 core but is more aware of the annoying atcphy dance by hooking into the typec_mux stuff as well
#asahi-dev · 2023-01-22 08:57
svenoh well, here comes the usb curse: if I first use my apple tbt 3->2 adapter and then switch to this startech adapter acio hangs 🙃
#asahi-dev · 2023-01-21 14:37
svenbut I'm happy if that works
#asahi-dev · 2023-01-21 14:37
svenI still have no clue about PCIe topologies ;)
#asahi-dev · 2023-01-21 14:14
svenright now the pcie driver parses iommu-map and makes sure that rid2sid map is configured correctly
#asahi-dev · 2023-01-21 14:14
sven(for which there are also 64 slots here)
#asahi-dev · 2023-01-21 14:13
svenit also needs to be configured inside the pcie port with that rid2sid map
#asahi-dev · 2023-01-21 14:12
sven64
#asahi-dev · 2023-01-21 14:08
svenwe might have to think about an alternate mechanism to synchronize which iommu SID will be used for which pcie device
#asahi-dev · 2023-01-21 14:08
svenoh, there's also iommu-map/iommu-map-mask which is rather awkward for the usb4 pcie controller
#asahi-dev · 2023-01-21 13:42
svenadd a “connected” flag to forward the actual HPD value and then just trigger it once after setup
#asahi-dev · 2023-01-21 13:41
svenI’d rework the oob event a bit anyway
#asahi-dev · 2023-01-21 13:37
svenmaybe we’ll have to rethink how that is handled :/
#asahi-dev · 2023-01-21 13:37
sventhe role switching issue is annoying
#asahi-dev · 2023-01-21 13:36
svenmissed hpd events?
#asahi-dev · 2023-01-21 13:33
svenI think whatever I have in my latest branch worked for me though
#asahi-dev · 2023-01-21 13:31
svenmaybe I don’t remember correctly and the issue was just that the bit changed without a data status changes irq
#asahi-dev · 2023-01-21 13:28
svenor, well, the bit works iirc but I didn’t get an irq
#asahi-dev · 2023-01-21 13:27
sveniirc I found an interrupt though
#asahi-dev · 2023-01-21 13:27
svenim pretty sure that doesn’t work with my usb3/DP hub and yet it works on macOS
#asahi-dev · 2023-01-21 13:21
svenguess that just leaves figuring out how to correctly trigger the bus rescan and cleaning up a bunch of hacks until I can look into DP-over-usb4 then
#asahi-dev · 2023-01-21 12:48
svenoh that's just great. any update to PCI_PREF_MEMORY_BASE or PCI_PREF_MEMORY_LIMIT clears that bit again 🙃
#asahi-dev · 2023-01-21 12:38
svenurgh... but I can't set it in apple_pcie_setup_port because something seems to disable it again :/
#asahi-dev · 2023-01-21 12:33
svenwell... looks like that #define even already exists: #define PORT_PREFMEM_ENABLE 0x00994
#asahi-dev · 2023-01-21 12:31
svenwell... there we go
#asahi-dev · 2023-01-21 12:31
sven64 bytes from fra24s08-in-f3.1e100.net (142.250.186.163): icmp_seq=1 ttl=115 time=19.8 ms
#asahi-dev · 2023-01-21 12:30
svenbit 1 in port_base + 0x994 must be set to allow reads to that prefetchable region
#asahi-dev · 2023-01-21 12:30
svenoh for fuck's sake...
#asahi-dev · 2023-01-21 12:15
svennot sure yet what the error is but it seems that the entire prefetchable memory region reads as -1 on the usb4 pcie controller
#asahi-dev · 2023-01-21 09:30
sveni'll take a closer look
#asahi-dev · 2023-01-21 09:30
svenhrm, I never checked but assumed that the linux pci code would do that correctly
#asahi-dev · 2023-01-21 08:46
svenalso, hotplugging too fast breaks acio and resets the soc it seems :D
#asahi-dev · 2023-01-21 08:43
sven(i.e. non-prefetchable ones work in linux while the only prefetchable bar that’s on the bus doesn’t)

plus ›