#asahi · 2021-08-16 10:07
svenso all you should need is another linux machine#asahi · 2021-08-16 10:06
svenlibidevicerestore also support DFU-restore now afaik#asahi · 2021-08-16 10:06
sventhere's also a chance that erasing the NOR flash bricks it even beyond DFU-repair, but that's still unknown#asahi · 2021-08-16 10:06
svenDFU is only required if you mess up very badly, like using a nvme-enabled kernel and then overwriting the entire namespace or something#asahi · 2021-08-16 06:50
svenno worries, it's not required for pcie. you also only hit that issue if you disable an interrupt inside its own interrupt handler, so it's probably rare#asahi · 2021-08-16 06:07
sven*ordered#asahi · 2021-08-16 06:07
svenand regarding conflicts... that's probably because i didn't order the nodes correctly. if they're all order by address git should be able to just resolve them#asahi · 2021-08-16 06:05
svenalyssa: the apple-aic is on the ML and needs marcan's review/ack. and i'd rather wait before submitting the usb nodes until at least the replugging issue is fixed#asahi · 2021-08-16 06:04
svenand we need the interrupt for thunderbolt in the end anyway#asahi · 2021-08-16 06:04
svenalyssa: pretty sure we just win the race#asahi · 2021-08-14 18:57
sven*sound#asahi · 2021-08-14 18:57
svenyou don't sounds convinced ;)#asahi · 2021-08-14 18:52
svensome combination of (first write32(asc_base + 0x10004, 0x11) then write32(asc_base + 0x10004 + 0x20, 0x1)), (clear that bit in asc_base+0x44 that's used to start them) and (set bit 31 in the clock gate register, delay for a bit, clear that bit again)#asahi · 2021-08-14 18:49
svenlet me see if i can find it again#asahi · 2021-08-14 18:49
svenbut we can try#asahi · 2021-08-14 18:49
svenalyssa: so "shutdown" really means "put into hibernation/low-power mode". there's a possibility to restart them, but that hasn't worked for ANS or SMC and i doubt it works for DCP#asahi · 2021-08-14 18:48
svenkettenis_: yeah, i think whatever end up handling the rtkit endpoints should also handle SART#asahi · 2021-08-14 18:15
svenyou can also just crash either processor early on while mac os boots and it will happily print the mailbox log with the messages iboot sent to shut them down fwiw#asahi · 2021-08-14 18:13
svenuh, i've mentioned the sequence and i think there's even code in the nvme/dev branch for that#asahi · 2021-08-14 18:13
svensame as e.g. iboot does#asahi · 2021-08-14 18:13
sventhen the bootloader better should just shut them down again#asahi · 2021-08-14 18:11
svenwe need to handle the exact same thing for other processors anyway inside linux (dcp, smc and who knows what else)#asahi · 2021-08-14 18:08
svenwe can do all the rtkit stuff inside mailbox (see nvme/dev) but i kinda expect that will get shot down rather quickly on LKML#asahi · 2021-08-14 18:04
sventhis all kinda circles back to the question how to handle mailboxes/rtkit in general#asahi · 2021-08-14 18:02
sveni *think* it can somehow talk to SMC with that#asahi · 2021-08-14 18:01
svenyes, and that endpoint is called "smc" and the other one "ans"#asahi · 2021-08-14 17:59
svenstill not happy about the mbox with the fake endpoint either#asahi · 2021-08-14 17:59
svenkettenis_: it doesn't, that branch is still very much WIP#asahi · 2021-08-14 17:59
svenyou don't need IOP/SMC/clocks/etc.#asahi · 2021-08-14 17:58
svenwell#asahi · 2021-08-14 17:58
svenah :)#asahi · 2021-08-14 17:58
svenot?#asahi · 2021-08-14 17:57
svenyes, sorry#asahi · 2021-08-14 17:53
sven*changed#asahi · 2021-08-14 17:53
sven(asahi/nvme essentially is arnd's platform work with like 3 lines changes + patches to the nvme core to support apple's new queue format and their nvme-iommu)#asahi · 2021-08-14 17:51
svenand one of the nvme maintainers found my WIP branch and essentially said that we should copy pci.c, remove all stuff that isn't supported/used by apple's chip and just keep a duplicate copy of the shared code#asahi · 2021-08-14 17:42
svenasahi/nvme is actually close to how the final driver will look. just with cp pci.c apple-ans.c and lots of removed code#asahi · 2021-08-14 17:42
svenawesome!#asahi · 2021-08-14 15:14
svenwell, that and the patch series to support 16k iommus on 4k kernels#asahi · 2021-08-14 15:13
svenpipcet[m]: nvme i guess#asahi · 2021-08-14 12:21
svengetting gpio/pinctrl upstream would be very helpful :)#asahi · 2021-08-14 12:20
svenand ofc some asahi-next branch or something like that would be really nice ;)#asahi · 2021-08-14 12:16
sveni think the most important stuff right now are clocks, gpio, pinctrl and then spi and i2c. they're all relatively simple but are required for a lot of the fun stuff later on#asahi · 2021-08-14 12:15
svenand broadcom wifi needs some patches to the upstream driver. might be possible to take corellium's patches and just submit them as-is#asahi · 2021-08-14 12:14
svennvme requires me to take nvme/pci.c, strip off all the PCI-specific stuff and create apple-ans.c. it also needs a simple hv tracer to figure out some details (how does the nvmmu actually work + how to shutdown the controller) and then ofc asc/rtkit#asahi · 2021-08-14 12:13
svenusb-c requires the usb phy driver (ugh...) and some way to get an interrupt when a new device is connected (usb-pd is a good guess, but there might also be a SMC event). otherwise it already works with an upstream kernel in bypass mode, but now also with an iommu since DART is done for now#asahi · 2021-08-14 12:12
svensorear: pcie (and with that ethernet and usb a) requires gpio/pinctrl, ~100 lines of magic register pokes and some thinking about how to handle the rid2sid iommu mapping. that's maybe a day or so of work now that DART is done. #asahi · 2021-08-14 11:11
sventhat's perfect! it's what wikis are for :)#asahi · 2021-08-14 10:53
sventophevich[m]: if you don't know IOMMU will "I/O Memory Management Unit" be helpful? i'd probably just put a link to a wikipedia page or something there#asahi · 2021-08-14 10:51
svendart = device address resolution table fwiw, not sure if anyone actually cares about that though