#
✕ nick:sven
#asahi-dev · 2021-08-25 19:07
sveni can clean the mess that i have right now up tomorrow or so
#asahi-dev · 2021-08-25 19:06
sven11.5 20G5033c i think
#asahi-dev · 2021-08-25 19:06
svenuhh... let's see
#asahi-dev · 2021-08-25 19:06
svenbut this is also on a man mini
#asahi-dev · 2021-08-25 19:06
svenmy firmware is rather old fwiw
#asahi-dev · 2021-08-25 19:04
svenweird
#asahi-dev · 2021-08-25 19:03
svenbut i can check again
#asahi-dev · 2021-08-25 19:03
sveni think i've seen 0x70, 0x71 and 0x72
#asahi-dev · 2021-08-25 19:03
sveni get notifications from the SMC inside m1n1 using shell.py
#asahi-dev · 2021-08-25 19:02
svenbut that's only called once m1n1 exits
#asahi-dev · 2021-08-25 19:01
svenor is it just specific notifications that are missing?
#asahi-dev · 2021-08-25 19:00
svenand i definitely get notifications after that
#asahi-dev · 2021-08-25 19:00
svenhttps://github.com/AsahiLinux/m1n1/blob/main/src/usb.c#L281 so i think m1n1 should disable all interrupts by default
#asahi-dev · 2021-08-25 18:58
svendoesn't m1n1 set the intmask by default these days?
#asahi-dev · 2021-08-25 18:57
sventhat sounds insane. but at this point it would also only surprise me a little bit
#asahi-dev · 2021-08-25 18:57
svenuh... no
#asahi-dev · 2021-08-25 18:56
sveni'm still annoyed that they didn't consider hooking up the usb connected/disconnected line to dwc3
#asahi-dev · 2021-08-25 18:55
svenuh, why mailbox? if this chained/whatever irq controller makes sense this would be aic -> mailbox -> rtkit -> smc -> usb phy. the length of that chain makes me uncomfortable though.
#asahi-dev · 2021-08-25 18:52
svenpci as well i guess. but this is slightly different
#asahi-dev · 2021-08-25 18:52
svengpio usually does chained interrupts fwiw
#asahi-dev · 2021-08-25 18:52
svenyeah, i dunno
#asahi-dev · 2021-08-25 18:51
svenwe just need to identify individual interrupts, don't we? so something like interrupts = <&smc 0x70 0x20....>; for the usb phy might work
#asahi-dev · 2021-08-25 18:50
svenwhat payload data do we need?
#asahi-dev · 2021-08-25 18:49
svenj_ey: :D
#asahi-dev · 2021-08-25 18:48
svenbut yeah, smc is gonna be annoying
#asahi-dev · 2021-08-25 18:48
svensoc = sven's ugly hacks
#asahi-dev · 2021-08-25 18:48
svenalyssa: drivers/soc/apple :>
#asahi-dev · 2021-08-25 18:47
svenno idea yet
#asahi-dev · 2021-08-25 18:47
svenj_ey: it needs to somehow be hooked up to the SMC driver. maybe SMC will be an interrupt-controller as well or something
#asahi-dev · 2021-08-25 18:43
svenugh. should've taken a look at the wiki then instead of finding that from tracing macOS :D
#asahi-dev · 2021-08-25 18:43
svenand then send er... let me find it again
#asahi-dev · 2021-08-25 18:42
svenyou write 0x1 to that shared memory location
#asahi-dev · 2021-08-25 18:42
svenj_ey: oh, it's a key inside the SMC
#asahi-dev · 2021-08-25 18:42
sventhat would certainly fit
#asahi-dev · 2021-08-25 18:42
svenhaven't tested anything else yet
#asahi-dev · 2021-08-25 18:42
svenj_ey: your guess is a good as mine. if i write 0x0 it disables notifications, and if i write 0x1 it enables then.
#asahi-dev · 2021-08-25 18:41
sventhat 0x20... is event_name-bit41: USB2_plug according to the ADT
#asahi-dev · 2021-08-25 18:41
sven0x7020000000000018: 0x18 = notification, 0x70 = "system state" and 0x20... is a bitmask for individual events
#asahi-dev · 2021-08-25 18:41
svenwriting 0x1 to NTAP enables notifications, and then you get a message from it
#asahi-dev · 2021-08-25 18:40
svenalright, finally confirmed how mac os knows about new usb devices connected to usb-c ports: it's the SMC
#asahi-dev · 2021-08-25 15:04
svenoh, and probably to get_default_domain to force DMA domains for locked DARTs
#asahi-dev · 2021-08-25 15:03
svenand you'll also need some changes to ensure to that get_group function to ensure that you can't mix a locked DART with any other DART
#asahi-dev · 2021-08-25 15:02
svenalyssa: dunno, both of you i guess? :)
#asahi-dev · 2021-08-25 15:02
sventhen write a custom free function for io-pgtbl that only frees the top-level if that flag isn't set
#asahi-dev · 2021-08-25 15:01
svenif you want to keep them: in attach_dev first create the io-pgtbl as usual. then walk the Apple pagetable and just ->map everything they mapped. then do a u64-by-u64 copy from the first level io-pgtbl to the first level Apple pagetable. then finally swap the ttbrs in io-pgtbl and set a flag that there are not managed by linux
#asahi-dev · 2021-08-25 14:59
svendo you want to keep the mappings or start over with a clean pagetable for a locked dart?
#asahi-dev · 2021-08-08 18:36
sventhis isn't my fork
#asahi-dev · 2021-08-08 18:27
svenalright, got rid of that commit
#asahi-dev · 2021-08-08 18:23
svenyeah, i blame github's UX for that
#asahi-dev · 2021-07-19 05:46
svenchadmed: that's surprisingly accurate. except that for me usually the code is also the problem :D

plus ›