#
✕ nick:sven
#asahi · 2021-08-09 18:06
svenand either way i'd move the cpu control register (which is like a page or so away from the mailbox regs) out of that mailbox driver
#asahi · 2021-08-09 18:06
svenregarding debug feature for the mailbox framework: i used tracepoints because i was sick of spamming dmesg with every single message and that worked out quite nicely
#asahi · 2021-08-09 18:05
svenit's just.. a little bit awkward
#asahi · 2021-08-09 18:05
svenfwiw, it's also not too bad to have the mailbox driver already correctly expose the channels and mux them into the single fifo
#asahi · 2021-08-09 17:05
svenbut then we always need to wait for an interrupt to deliver every single message, don't we?
#asahi · 2021-08-09 17:00
sventhat only leaves the fifo thing then. might be worth it, dunno
#asahi · 2021-08-09 16:59
svenok, sure
#asahi · 2021-08-09 16:59
sveni'm just not convinced it's a good fit
#asahi · 2021-08-09 16:59
svenand the mailbox driver also assumes that all endpoints are separate, but on the m1 they all go to the same FIFO anyway. now that can all be worked around and maybe that's worth it
#asahi · 2021-08-09 16:58
svenpipcet[m]: maybe, but i'm not 100% convinced about that. the mailbox driver implements a fifo and is usually used for even dumber mailboxes. apple's hw at least has a HW fifo that's 16 messages or so deep
#asahi · 2021-08-09 16:56
svenand those MMIO shmem buffer need special treatment as well
#asahi · 2021-08-09 16:54
svenDART is transparent through the dma_map_ops anyway
#asahi · 2021-08-09 16:53
svenANS could also just special-case that SART stuff then and SMC the MMIO shmem buffers
#asahi · 2021-08-09 16:52
svensure, that's also fine
#asahi · 2021-08-09 16:51
svenso it might make sense to reuse the mailbox interface but build some custom abstraction for the RTKit stuff, but dunno
#asahi · 2021-08-09 16:50
svenSEPOS uses the same dumb mailbox HW but not the RTKit stuff. and iirc acio or something uses a slightly different dumb mailbox interface but the same RTKit stuff again
#asahi · 2021-08-09 16:06
svenin my current hack those endpoints are just implemented in my mailbox driver and that 0x20 channel i request in the nvme code is a lie
#asahi · 2021-08-09 16:05
sventhe nvme mmio interface we see is emulated by the firmware running on that processor
#asahi · 2021-08-09 16:04
svenwhich requires syslog, etc. to be up.
#asahi · 2021-08-09 16:04
svenjust to boot the co-processor
#asahi · 2021-08-09 16:02
svenand because that's not fun enough these endpoints require shared memory buffers that sometimes go through a DART IOMMU, other times through a simple DMA address filter Apple calls SART (that's where these HMB buffers are configured) and other times the shared memory is just exposed on the MMIO bus
#asahi · 2021-08-09 15:58
svenand then most of these sub-processors have some shared endpoints (management to boot them, syslog, etc.). the code to handle that doesn't seem to really fit into drivers/mailbox
#asahi · 2021-08-09 15:58
svenessentially there's a low-level dumb mailbox interface backed by some hardware FIFO.
#asahi · 2021-08-09 15:58
svenyeah. the bigger issue is probably that i'm not really sure how to handle that mailbox part yet.
#asahi · 2021-08-09 12:31
sveniirc there are two kexts: samsung and apple. no idea if the apple is just a new variant of the samsung one or a completely new thing
#asahi · 2021-08-09 12:29
svenhttps://github.com/AsahiLinux/linux/tree/i2c/dev that's what i had for i2c. iirc i wasn't happy with that yet
#asahi · 2021-08-09 12:28
svensounds good!
#asahi · 2021-08-09 12:27
svenand it gets more fun: some clocks have two parents
#asahi · 2021-08-09 12:27
svennope :(
#asahi · 2021-08-09 12:27
sventhere's also gpio/pinctrl iirc
#asahi · 2021-08-09 12:26
svenyeah, i think i2c, spi and at least the clocks-gates would be very useful
#asahi · 2021-08-09 12:26
svensure
#asahi · 2021-08-09 12:25
svenuh.. i have some WIP i2c somewhere, but i never event sent that for review anywhere
#asahi · 2021-08-09 12:21
svenUSB would work, but just once per port because dwc3 only sees a single "device connected" event. to use a port twice we need to hook up something from SMC or the USB-PD chip to the not-yet-existing usb phy driver to issue a reset there :/
#asahi · 2021-08-09 11:07
svenanyway, back to $work for me
#asahi · 2021-08-09 11:07
svenno idea if it still works. i last touched this in march or so
#asahi · 2021-08-09 11:06
svenmarcan: https://f.svpe.de/70fb5357bea78c2e50f0017f563907ebe775cd731861d37751346a1eb8ad61c9_aes.py that's my very old aes code
#asahi · 2021-08-09 10:44
sven*enabling
#asahi · 2021-08-09 10:44
sveni never could get it to work without enable DART and DAPF bypass back then. but i didn't try much
#asahi · 2021-08-09 10:43
svenyeah, and as i said: the AES engine is behind SIO. let's see if i can dig up my old code to drive that one
#asahi · 2021-08-09 10:40
svenah, no. acio is actually not the thunderbolt dart. my mistake.
#asahi · 2021-08-09 10:39
svenyeah
#asahi · 2021-08-09 10:39
svenwaaaaiit... the thunderbolt DARTs also have #15 set to bypass. so.. uh... maybe to give the thunderbolt ports to a guest?
#asahi · 2021-08-09 10:39
sveni thought it meant TTBR is unconfigured at first
#asahi · 2021-08-09 10:38
sventhat would be cute actually
#asahi · 2021-08-09 10:38
svenhah, could be
#asahi · 2021-08-09 10:37
svenand the DAPF is completely missing the in the ADT
#asahi · 2021-08-09 10:37
svenit's just strange that the ADT also wants to set stream #15 to bypass for that DART
#asahi · 2021-08-09 10:37
sveni don't know. maybe. maybe not.
#asahi · 2021-08-09 10:37
sveni haven't tried what happens with #15 set to bypass yet fwiw

plus ›