#asahi-dev · 2022-08-09 09:22
svenpovik: loading firmware and handing it off to a device is a bit different from parsing some complex data structure or even interpreting some byte code#asahi-dev · 2022-08-09 09:22
svendon't worry, i'm joking. though it's probably possible#asahi-dev · 2022-08-09 09:21
svenmaybe we can implement the FFT as a BPF program!#asahi-dev · 2022-08-09 09:19
svenit must be faster if it's running in kernel mode ofc!#asahi-dev · 2022-08-09 08:35
svenhttps://twitter.com/svenpeter42/status/1496175390469115904#asahi-dev · 2022-08-09 08:35
sveni think i dumped all bootargs at some point, let's see if i can find that again#asahi-dev · 2022-08-09 07:35
svenmaybe those ideas also don’t work because of some subtleties in overlooked #asahi-dev · 2022-08-09 07:32
svenbut it's been a while, let me take a brief look after $work#asahi-dev · 2022-08-09 07:31
sveni vaguely remember two possibilities. one of them was to create a shadow pagetable and just memcpy to the locked first level table in the flush callback or something. i think the other one was more annoying to implement but didn't require the shadow copy#asahi-dev · 2022-08-09 07:20
svenyeah, this can (and should) all be done atomically #asahi-dev · 2022-08-08 11:43
sven(like e.g. what magic poke i'm missing to bring cio up and make the usb4 pcie bus accessible)#asahi-dev · 2022-08-08 11:43
svenall this really just requires me to sit down for a few hours to write atcphy.py. after that it should be relatively easy to figure some of this out from m1n1#asahi-dev · 2022-08-08 11:41
sveni assume DP will be similar#asahi-dev · 2022-08-08 11:41
svenusb3 tunneled via usb4 is just "switch pipehandler mux from setting 2 to 3" or something like that#asahi-dev · 2022-08-08 11:40
svenit seems to be mostly setup DP as usual and then do some more magic stuff i haven't looked into yet#asahi-dev · 2022-08-08 11:38
svenso far i just have a very rough idea about usb3 and thunderbolt but haven't even thought how to fit that into typec yet#asahi-dev · 2022-08-08 11:37
svenand ofc nothing does it the way apple split this up so this is gonna be a lot of fun#asahi-dev · 2022-08-08 11:37
svenoh, thunderbolt probably as well :/#asahi-dev · 2022-08-08 11:36
sveni think this bikeshedding is gonna be worse than usual because it'll involve typec, phy, usb, drm and who knows what else :D#asahi-dev · 2022-08-08 10:36
sveni think the trickiest part is going to be how this all fits into the various subsystems#asahi-dev · 2022-08-08 10:35
svenyeah, i've also traced the "dpphy" part and that seems to be mostly a set of static MMIO pokes#asahi-dev · 2022-08-08 10:02
svenand I guess I should finally just write atcphy.py and figure out external display support #asahi-dev · 2022-08-06 10:58
svenand they already have the pcie block and their “chipcommon” core from WiFi which they just reuse for BT#asahi-dev · 2022-08-06 10:57
svenabrasive: true, they already need pcie for WiFi anyway #asahi-dev · 2022-08-06 10:55
svenbecause they obviously wanted R and me to learn about Bluetooth :P#asahi-dev · 2022-08-06 10:51
svenI’m only sure that apple wrote the XNU driver themselves #asahi-dev · 2022-08-06 10:51
sventhe transport seems to be called “Apple Converged IPC” and it’s a bit unclear if it’s just Broadcom or some apple/Broadcom collaboration #asahi-dev · 2022-08-06 10:50
svenyeah, all other Broadcom chips just expose bt as uart but these require a custom driver#asahi-dev · 2022-08-06 10:42
svenit’s a pity these Bluetooth chips haven’t shown up anywhere else together with a downstream Android driver #asahi-dev · 2022-08-06 10:39
sveninteresting! I guess at least bcm4377 has some kind of auto-sleep feature like those LTE chips then#asahi-dev · 2022-08-05 11:14
sveni should probably load the symbols and look at the backtrace whenever a write to that register happens just to rule out that this is a coincidence#asahi-dev · 2022-08-05 11:12
svenand the write 2 always happens just before they submit a command. it's very strange#asahi-dev · 2022-08-05 11:12
svenbut the 0/1 flip is one of the first things the interrupt handlers seems to do#asahi-dev · 2022-08-05 11:12
svenyeah#asahi-dev · 2022-08-05 11:04
svenbut then again, this is Broadcom and they have a “virtual transmission queue” that’s used to received data in the “completion queue”….#asahi-dev · 2022-08-05 11:03
svenit’s very odd that it needs another kind of state change ack#asahi-dev · 2022-08-05 11:03
svenyeah… and the commands are just queues and sending is update the head and ring a doorbell #asahi-dev · 2022-08-05 11:01
svenI’m just guessing as well, speculation is very welcome :)#asahi-dev · 2022-08-05 11:00
svenit actually flips it, as in write 0 if it was 1 and write 1 if it was 0#asahi-dev · 2022-08-05 10:58
svenhm, not sure what it would protect. the register is called sleep control inside debug strings fwiw#asahi-dev · 2022-08-05 10:57
svenon t2 you need to write 2 before each command because it’ll otherwise just not reply if it’s been idle for a second or so #asahi-dev · 2022-08-05 10:57
svenon m1/2 you can just not do that and everything works#asahi-dev · 2022-08-05 10:56
svenmacOS seems to flip it between 0 and 1 on every interrupt and set it to 2 before it enqueues a command #asahi-dev · 2022-08-05 10:53
svenyes#asahi-dev · 2022-08-05 10:53
svenand macOS writing to it also doesn’t make much sense#asahi-dev · 2022-08-05 10:53
sventhat register still bugs me. 0/1/2 doesn’t seem to make any difference except when resuming#asahi-dev · 2022-08-05 10:38
svenalright, looks like Bluetooth suspend/resume works fine on m1 if I write 0 to the sleep control register instead of 2