2021-08-25
00:33suricato has quit [Ping timeout: 480 seconds]
01:17uralj has joined #asahi-dev
01:17alyssa has joined #asahi-dev
01:43riker77_ has joined #asahi-dev
01:46riker77 has quit [Ping timeout: 481 seconds]
01:46riker77_ is now known as riker77
02:19msmith12[m]sounds like gstremer
02:38phiologe has joined #asahi-dev
02:41PhilippvK has quit [Ping timeout: 480 seconds]
03:42yuyichao has quit [Quit: Konversation terminated!]
07:20jeffmiw has joined #asahi-dev
07:25bps has quit [Ping timeout: 480 seconds]
07:48aleasto has joined #asahi-dev
07:57bps has joined #asahi-dev
08:17jeffmiw has quit [Ping timeout: 480 seconds]
08:18suricato has joined #asahi-dev
09:57pipcet[m]alyssa: do you have timing info on your printks? on my system, the time between enabling the disp dart and switching the FB was perilously close to 1/60 s
10:28phiologe has quit [Ping timeout: 480 seconds]
11:36sirn has quit [Quit: ZNC 1.8.2 - https://znc.in]
11:41sirn has joined #asahi-dev
11:55aleasto has quit [Quit: Konversation terminated!]
12:18al3xtjames0 has joined #asahi-dev
12:21al3xtjames has quit [Ping timeout: 480 seconds]
12:21al3xtjames0 is now known as al3xtjames
12:30chadmed has quit [Remote host closed the connection]
12:30chadmed has joined #asahi-dev
12:41uralj has left #asahi-dev [WeeChat 3.2]
12:52bisko has joined #asahi-dev
13:05yuyichao has joined #asahi-dev
13:06aleasto has joined #asahi-dev
14:47pipcet[m]I've beaten up my Digital Crash Processor a bit more and I really don't think we should mix the interfaces if we can avoid it. I also don't like the current page table stealing hacks and am hoping you guys come up with something way better...
14:49gladiac has quit [Read error: Connection reset by peer]
14:49gladiac has joined #asahi-dev
14:53gladiac is now known as Guest5380
14:53Guest5380 has quit [Read error: Connection reset by peer]
14:53gladiac has joined #asahi-dev
15:01svenif 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
15:02sventhen write a custom free function for io-pgtbl that only frees the top-level if that flag isn't set
15:03svenand 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
18:40svenalright, finally confirmed how mac os knows about new usb devices connected to usb-c ports: it's the SMC
18:41sven0x7020000000000018: 0x18 = notification, 0x70 = "system state" and 0x20... is a bitmask for individual events
18:42svenj_ey: your guess is a good as mine. if i write 0x0 it disables notifications, and if i write 0x1 it enables then.
18:45pipcet[m]sven: IIRC it's the first thing it does, and tracing macos is good for you! builds moral fibre!
18:46pipcet[m]oh. there's a file called smc.wiki in my home directory which I never uploaded because my net was down
18:47svenj_ey: it needs to somehow be hooked up to the SMC driver. maybe SMC will be an interrupt-controller as well or something
18:49pipcet[m]sven: I tried the interrupt controller thing and another mailbox controller, didn't like either very much :-/
18:50pipcet[m]power button goes through it, and the battery indicator payloads changed when I upgraded macOS yesterday...
18:51pipcet[m]power button, lid switch, charging notifications, usb notifications, who knows what else...
18:51svenwe just need to identify individual interrupts, don't we? so something like interrupts = <&smc 0x70 0x20....>; for the usb phy might work
18:51alyssabut now you have a virtual interrupt controller and this is getting into sandcastle level hacks
18:53pipcet[m]I tihnk I just heard someone volunteer to rewrite the mailbox driver code so it's actually usable and handles stuff like this!
18:55svenuh, 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.
18:56sveni'm still annoyed that they didn't consider hooking up the usb connected/disconnected line to dwc3
18:57pipcet[m]sven: you did hear my "the SMC snoops the PD chips' interrupt lines to know when to kick the battery charging circuitry" theory?
18:58pipcet[m]setting the intmask over i2c means no more notifications from the SMC, plus charging doesn't work. You're right it's insane.
19:00svenhttps://github.com/AsahiLinux/m1n1/blob/main/src/usb.c#L281 so i think m1n1 should disable all interrupts by default
19:02pipcet[m]the SMC does stay on normally, but the tps chip also has a dead-battery mode to recover from that scenario
19:04pipcet[m]it would be wonderful if the firmware upgrade fixed this and I'll formally call in doubt my theory, then, but until yesterday I needed to enable intmasks for charging to work.
19:08aleasto has quit [Remote host closed the connection]
19:09svenit's really just the common rtkit bootstrap code + asc.send(0x4e54415000013011, 0x20) and then asc.recv()
19:12pipcet[m]oh, the corellium driver, and my variation on it, always have the second-lowest byte set to 0, which means it always starts at the beginning of the SRAM. macOS advances (I have no idea why because you can't get concurrency anyway)
19:55Mary has quit [Quit: The Lounge - https://thelounge.chat]
19:55Mary has joined #asahi-dev
20:36Mary has quit [Quit: The Lounge - https://thelounge.chat]
22:48yuyichao has quit [Quit: Konversation terminated!]
23:12suricato has quit [Ping timeout: 480 seconds]