#asahi-re · 2021-09-13 07:32
svendunno, just need to read more code and see what the right thing to use is#asahi-re · 2021-09-13 07:32
marcanheh#asahi-re · 2021-09-13 07:30
sventhere's also this whole extcon thing that seems to be somehow related to usb which also seems to have some kind of notification system#asahi-re · 2021-09-13 07:28
marcanI imagine some systems have a separate VBUS GPIO and the like#asahi-re · 2021-09-13 07:28
marcanI assume this hasn't been done before for other USB PHYs?#asahi-re · 2021-09-13 07:28
marcancould be a gpio thing too, perhaps#asahi-re · 2021-09-13 07:20
svenand then ofc see if there's a sane way to forward usb connected interrupts to the phy driver (possibly just a virtual irq chip) so that usb hotplug finally works#asahi-re · 2021-09-13 07:16
svenand change the irq numbers to what apple uses. they don't seem to line up with the TI ones :/#asahi-re · 2021-09-13 07:16
svenyeah. i'll have to fix the linux driver a bit anyway because right now it also treats IntMask1 and IntMask2 the same. #asahi-re · 2021-09-13 07:13
marcanand then we just need to make sure we don't mask the wrong IRQs#asahi-re · 2021-09-13 07:13
marcanthat would make a lot of sense, yeah#asahi-re · 2021-09-13 05:55
sveni'm fairly sure at this point the secondary bus of those usb pd chips is connected to the smc directly#asahi-re · 2021-09-13 05:54
svenand yeah, i guess it would make sense if they exposed the two busses that way#asahi-re · 2021-09-13 05:44
svensure#asahi-re · 2021-09-13 05:35
marcanre 2 i2c buses, I saw two exposed externally via those debug PD modes and now I wonder if they're those two#asahi-re · 2021-09-13 05:34
marcanI do expect us to expose i2c to userspace; people want that for monitor control#asahi-re · 2021-09-13 05:34
marcannothing terribly wrong with a monolithic driver like that, and considering how many hacks Apple has in their model, if we tried to modularize it we'd probably have a bunch of abstraction breaks anyway...#asahi-re · 2021-09-13 05:34
marcanit can still expose whatever zillion interfaces we feel like to userspace or other drivers#asahi-re · 2021-09-13 05:33
marcanI don't think we have a good reason to do that; all the endpoints can be bundled together in dcp.ko#asahi-re · 2021-09-13 05:33
marcanthe rtkit node is about us having multiple *drivers* (potentially different modules) bind to rtkit directly#asahi-re · 2021-09-13 05:33
marcansven: even if it were a separate i2c bus to expose to other drivers, that could just be provided by the dcp node#asahi-re · 2021-09-12 18:08
roxfanit would be too boring otherwise#asahi-re · 2021-09-12 17:07
svenurgh.. and it looks like the interrupt bits are different from those defined in the TI manual i think :/#asahi-re · 2021-09-12 15:38
roxfan72 bits ought to be enough for everyone#asahi-re · 2021-09-12 15:34
alyssauh#asahi-re · 2021-09-12 15:19
svenuhh... wtf.. the interrupt mask on the USB PD chips seems to be 8 bytes but the interrupt event register 11 bytes of which macos only reads 9?!#asahi-re · 2021-09-12 15:01
alyssajust a question of whether the AP can bypass the DCP (directly or indirectly), and whether that's ever useful#asahi-re · 2021-09-12 14:59
alyssawell, "fake" .... there still an i2c bus that the DCP is using internally to get at display properties#asahi-re · 2021-09-12 14:59
svenok#asahi-re · 2021-09-12 14:59
alyssausually there's an i2c bus for the display and that does get routed into userspace but AFAIK there's no good reason to fake it in our case#asahi-re · 2021-09-12 14:58
alyssai mean#asahi-re · 2021-09-12 14:58
alyssano, I don't think so#asahi-re · 2021-09-12 14:58
svenso this is not a separate i2c bus we need to expose to other drivers#asahi-re · 2021-09-12 14:58
alyssait's unclear to me if the other endpoints expose raw "send i2c, recv i2c" calls#asahi-re · 2021-09-12 14:58
svenoh#asahi-re · 2021-09-12 14:58
alyssaif everything we need is accessible over dcp, we don't /need/ i2c from the ap#asahi-re · 2021-09-12 14:57
alyssasven: what makes you say that?#asahi-re · 2021-09-12 14:45
svenhrm, so we may need that rtkit node after all?#asahi-re · 2021-09-12 11:49
alyssalooks like we can get to i2c via dcp over one of the other endpoints (dpdev, mdcp29xx, ..)#asahi-re · 2021-09-05 06:25
dougallyeah - that sounds right, I guess it's nice for experimentation for now at least :)#asahi-re · 2021-09-05 06:11
marcanI don't think they're particularly seriously trying to make them resilient to AP meddling, at least not yet#asahi-re · 2021-09-05 06:11
marcandougall: I think the idea of locking down coprocessor firmwares in iBoot is kind of an afterthought in this iteration#asahi-re · 2021-09-05 05:28
dougall(although i'm perhaps misunderstanding the dcp/carveout system threat model, so to be explicit, i believe xnu can read and write agx firmware memory by design)#asahi-re · 2021-09-05 05:12
dougall(fwiw agx firmware has similar 'this probably isn't, and definitely wasn't, a security boundary' features)#asahi-re · 2021-09-05 04:23
Graypup_inb4 another "<marcan> I don't know what <...> is; <marcan> aaand that's a macOS CVE. hoo boy." hahaha#asahi-re · 2021-09-05 03:15
marcanlol#asahi-re · 2021-09-04 15:55
svenand that section seems to contain functions pointers i think#asahi-re · 2021-09-04 15:55
sveni can write to it#asahi-re · 2021-09-04 15:46
marcanhopefully read-only? if you can map its own locked-down area with its own DART and have it write there, that's... kind of a big hole in the entire carveout system#asahi-re · 2021-09-04 15:45
marcansven: is it an interesting part of the data section? :)