#asahi-dev · 2023-01-19 13:13
svenohhhh.... and the typec subsystem stuff ofc :/#asahi-dev · 2023-01-19 13:13
svenand removing all the duct tape and replacing it with something more sane ofc ;)#asahi-dev · 2023-01-19 13:12
svenonce the iommu works that's the only thing left to do#asahi-dev · 2023-01-19 12:49
svenand I guess once I figure out what this thing apple calls something like "unfreezing the thunderbolt clock" actually is I'm also confident enough to send out atcphy#asahi-dev · 2023-01-19 12:48
svennot a lot of changes are required there#asahi-dev · 2023-01-19 12:47
sventhe pcie part will probably be ready pretty soon#asahi-dev · 2023-01-19 12:25
svenand thanks to the way pcie works on these machines you can actually isolate every single device into its own iommu domain#asahi-dev · 2023-01-19 12:23
svenyou want an iommu inbetween if you pass through devices to a guest#asahi-dev · 2023-01-19 12:23
svenso that the guest can trivially own the host? nah :D#asahi-dev · 2023-01-19 12:22
sventhe weird part is that the internal pcie dart cannot be put into bypass mode#asahi-dev · 2023-01-19 12:17
sven(at least on t8103)#asahi-dev · 2023-01-19 12:17
svenwe’ll probably need a different compatible for those anyway and I’ll just force disable bypass then #asahi-dev · 2023-01-19 11:49
svenhuh... so the thunderbolt pcie darts support bypass if DART_PARAMS didn't change there#asahi-dev · 2023-01-19 11:49
sven[ 2.218521] apple-dart 521008000.dart: DART [pagesize 4000, bypass support: 1, bypass forced: 0] initialized #asahi-dev · 2023-01-19 08:49
svenyeah, i trust the people working on the official support for fedora that they wouldn't ship that. I don't think they ship anything publicly so far anyway #asahi-dev · 2023-01-18 19:10
svenhah, so that’s how they route it#asahi-dev · 2023-01-18 16:29
svennow let me apply those tunables and see if that fixes the capabilities. Then only that small dart issue is left to make dma work #asahi-dev · 2023-01-18 14:45
svenso thunderbolt is officially less broken than dwc3 because hotplug actually works :D#asahi-dev · 2023-01-18 14:45
sven\o/#asahi-dev · 2023-01-18 14:45
sven[ 154.854091] pcie-apple 530000000.pcie: Link up on /soc/pcie@530000000/pci@0,0#asahi-dev · 2023-01-18 14:45
sven[ 146.312742] pcie-apple 530000000.pcie: Link down on /soc/pcie@530000000/pci@0,0#asahi-dev · 2023-01-18 14:45
sven[ 146.098811] pcie-apple 530000000.pcie: Tunnel error on /soc/pcie@530000000/pci@0,0#asahi-dev · 2023-01-18 14:45
sven[ 77.420060] pcie-apple 530000000.pcie: Link up on /soc/pcie@530000000/pci@0,0#asahi-dev · 2023-01-18 14:38
svenkettenis_: oh, good point. let me check that later#asahi-dev · 2023-01-18 12:33
sventhat may even be what macos does, that's a bit hard to confirm with just MMIO traces though#asahi-dev · 2023-01-18 12:32
svenand then whenever I get a "tunnel error" just enable the tunnel reset, rescan the bus to remove all devices, disable tunnel reset and trigger link training again #asahi-dev · 2023-01-18 12:31
svenlooks like I could just disable the tunnel reset, trigger pcie link training and then just wait for the port up interrupt and then rescan the bus#asahi-dev · 2023-01-18 12:30
svenand I think I can make this work without an out-of-band tunnel state notification with this "tunnel error" interrupt#asahi-dev · 2023-01-18 12:02
svenwhich explains why there just wasn't enough bus space available once new devices appeared out of nowhere#asahi-dev · 2023-01-18 12:01
svenso apparently Apple considers setting PCI_EXP_SLTCAP_HPC for the thunderbolt pcie ports optional *sigh*#asahi-dev · 2023-01-17 17:19
sven*bit#asahi-dev · 2023-01-17 17:18
svenokay, removing and plugging in again works when I manually set that tunnel reset but again inbetween as well#asahi-dev · 2023-01-17 16:11
svenif you mess that one up though you either get SErrors on pcie/acio MMIO access or some internal watchdog just resets everything#asahi-dev · 2023-01-17 16:10
svenI think I know it but since this is all duct taped together I can't easily test it#asahi-dev · 2023-01-17 16:10
svenbut it should be possible, just need to figure out the right atcphy/acio sequence there#asahi-dev · 2023-01-17 16:09
svenI actually haven't figured out how to bring it down without resetting the entire soc yet :D#asahi-dev · 2023-01-17 16:08
sventurns out I can just leave the thunderbolt stuff up the entire time because it's much less broken than dwc3#asahi-dev · 2023-01-17 16:08
svenyup#asahi-dev · 2023-01-17 16:07
svenit might just work because it technically doesn't need the DART before the first device comes up#asahi-dev · 2023-01-17 16:07
sveni'll see what happens if I just fake a clock controller for now just to see if that breaks already#asahi-dev · 2023-01-17 16:06
svenyeah, i have some ideas.#asahi-dev · 2023-01-17 16:06
sventhis currently runs on essentially duct tape so i'll have to clean that up and then figure out how to get that DART up sanely#asahi-dev · 2023-01-17 16:05
sventhe config space was just completely messed up because I unplugged the adapter and that's why I assumed it was broken#asahi-dev · 2023-01-17 16:05
svenyeah, nvm, i'm just an idiot#asahi-dev · 2023-01-17 16:00
svenfor the pro/max chips, not for the base m1/m2 variant#asahi-dev · 2023-01-17 15:48
svenhuh, that would be useful#asahi-dev · 2023-01-17 14:58
svenon intel/amd controller this all happens without additional software notifications :(#asahi-dev · 2023-01-17 14:57
svenso I guess we'll have to come up with some kind of NHI -> {pcie, dpin0-phy, dpin1-phy} notification system anyway#asahi-dev · 2023-01-17 14:56
svenwhich also seems to come up at least on the NHI side when I connected my old thunderbolt display via apple's 3->2 adapter#asahi-dev · 2023-01-17 14:56
svenaaaand there's the thunderbolt DP tunnel