#
…

2021-11-13

00:37yuyichao_ has quit [Ping timeout: 480 seconds]
01:23yuyichao_ has joined #asahi-dev
01:35X-Scale` has joined #asahi-dev
01:39X-Scale has quit [Ping timeout: 480 seconds]
02:20Emantor has quit [Quit: ZNC - http://znc.in]
02:20Emantor has joined #asahi-dev
03:14robinp[m] has joined #asahi-dev
03:30kov has quit [Quit: Coyote finally caught me]
03:30kov has joined #asahi-dev
03:52phiologe has quit [Ping timeout: 480 seconds]
04:24chadmed has quit [Remote host closed the connection]
04:24chadmed has joined #asahi-dev
06:22DarkShadow44 has quit [Quit: ZNC - https://znc.in]
06:23DarkShadow44 has joined #asahi-dev
06:51curlyqueue has joined #asahi-dev
06:53the_lanetly_052 has joined #asahi-dev
08:36chadmed has quit [Quit: Konversation terminated!]
09:31rkt is now known as Guest5763
09:31rkt_ has joined #asahi-dev
09:31rkt_ is now known as rkt
09:35Guest5763 has quit [Ping timeout: 480 seconds]
09:38DarkShadow44 has quit [Quit: ZNC - https://znc.in]
09:38DarkShadow44 has joined #asahi-dev
09:38chadmed has joined #asahi-dev
09:41rkt has left #asahi-dev [#asahi-dev]
09:41rkt has joined #asahi-dev
11:11Dcow has joined #asahi-dev
11:19the_lanetly_052__ has joined #asahi-dev
11:21the_lanetly_052___ has joined #asahi-dev
11:23the_lanetly_052 has quit [Ping timeout: 480 seconds]
11:27the_lanetly_052__ has quit [Ping timeout: 480 seconds]
12:17Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
12:24kettenismaz's commit messages are always a joy to read ;)
12:28mazkettenis: I need to entertain myself... it's otherwise very boring!
12:35svenjannau: looks like the last messages in macOS log on the M1 are "IOPlatformHaltRestartAction -> AppleT8103PMGR" and then "wdog restart"
12:37jannau"AppleARMCHRPNVRAM: writing to bank 1" is printed after "IOPlatformHaltRestartAction -> AppleT6001PMGR"
12:37jannaunothing else
12:37sveniirc nvram is also somehow involved in shutdown on the M1
12:39aleasto has joined #asahi-dev
12:42kettenisthe corellium code does indeed touch nvram
12:43kettenisit would surprise me that writing to nvram is really necessary
12:43kettenisbut it may be needed to prevent the machine booting into recovery mode or something when powered up again
12:43svenyeah, i wonder what that's actually about
12:44svenjannau: you can try to boot with smcdebug=0xff and maybe you'll see a SMC write at the very end
12:47Dcow has joined #asahi-dev
12:48Dcow has quit []
12:48svenMBSE is also used for poweroff on the M1
12:48svenso i guess they added reset to that one on the Pro/Max
12:53svenhuh, or maybe it's already there on the M1. i think if you write 'rest' to 'MBSE' it'll reset.
12:56svenhrm, nope.
12:56jannau[cpu4] [SMCTracer@/arm-io/smc] [smceptracer] [a] >W: <MBSE> = 61726870
13:29robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:29robinp[m] has joined #asahi-dev
13:32jannauthat seems to work on the mac mini as well but the message for poweroff 'off1' just resets
13:33kettenisas in, it doesn't actually power the machine off?
13:34jannauyes, it reboots
13:35kettenisso maybre the magic nvram writes are necessary after all
13:36the_lanetly_052___ has quit [Ping timeout: 480 seconds]
13:37robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:39robinp[m] has joined #asahi-dev
13:41slicey has joined #asahi-dev
13:57slicey has quit [Quit: cya]
13:57slicey has joined #asahi-dev
13:58slicey has quit []
14:06robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:07robinp[m] has joined #asahi-dev
14:09rkt has quit [Quit: rkt]
14:20robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:35Nspace has joined #asahi-dev
15:29Dcow has joined #asahi-dev
16:01Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
16:24marcanugh, dammit
16:24marcanapparently AVD *does* have firmware
16:24marcansome 35kb blob... that's embedded in the kext
16:24marcanso I guess we need a stupid firmware cutter to deal with that :/
16:25marcan(it's a little cortex-m3 thing)
16:25marcanannoyingly, there are 6 blobs all named with the same symbol name, apparently
16:25marcan(for different hardware versions)
16:28arwhat's avd? video decoder thing?
16:30jannauyes, ave (video encoder) works probably in the same way
16:35marcanno, AVE has a Chinook loaded by iBoot
16:35marcanthat one's easy
16:35marcanAVD did not which is why I assumed it was firmwareless
16:35marcanapparently not :/
16:36jannauwhat about jpeg and apr (prores)?
16:37marcanjpeg wouldn't have firmware, that'd be silly for a jpeg decoder
16:37marcanprores, no idea yet, though I'd hope that a codec as relatively simple as that doesn't need firmware either...
16:44jannaum1 has avd-version=3, m1 max avd-version=4 with "compatible = [avd,t8103, avd,t6000]"
16:45marcanthe firmwares do change from version to version, at least some of them
16:46marcansince we're going to support a subset of versions anyway, I guess we can just have a semiautomated script that finds the firmwares in the kernelcache given the kext and maybe some manual ghidra (the annoying part is matching up firmware blobs to hardware versions, since that's just a code reference)
16:46marcanand then the installer just has a table of kext offsets/lengths to cut out (and maybe a sha1 for sanity check)
16:46marcaner, kernelcache offsets/lengths
16:48marcanprores doesn't look like it has firmware
16:52marcanre avd, at least given it's a 35kb blob of unsigned cortex-m3 junk, it would seem entirely feasible to reverse engineer whatever it's doing and write an open source replacement
16:52marcanbut it's probably not worth doing that initially
16:53marcan(the format is obviously a raw cortex-m3 memory image, it starts with initial SP and the vector table)
17:13Dcow has joined #asahi-dev
17:14jeffmiwdoes anyone know why we have a register length of 0x8000 for the aic in the t8103.dtsi while adt has it at 0xC000 for the M1 and another value for aic2 (likely 0x1000 if the m1n1 define is correct) ?
17:16j_eyjeffmiw: similar for the darts and pinctrl, they seem to have larger registers in the ADT than needed
17:26jeffmiwhumm ok. thx.
17:28Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
17:31marcanaic2 has a bunch of pages for event registers for presumably ASCs, but the CPU only cares about the first
17:31marcanwhich is 0x10000 bytes total (event page at 0xc000)
17:31marcanaic1, IIRC there's a timer and other stuff we don't care about / map
17:31dsrt^ has joined #asahi-dev
17:31marcanjeffmiw: in general, the ADT is terrible and full of lies; do not trust it to be correct for anything :p
17:36jeffmiwok, it is just that with aic2 changes, m1n1 hv.py is using the adt values for base and size, but the aic.c is using base from adt and size is hard coded to a smaller value of 0x4000 resulting in an HV IPA not mapped if you trace irqs when running macos under the hv
17:37jeffmiwI will submit a pr to fix it, just trying to make it more "aligned" in aic.c using also values from adt
17:38marcanhmm? is macOS hitting registers > 0xc000?
17:38jeffmiwthen I realized we are currently using 3 different values :) 0x4000 in aic.h, 0x8000 in .dtsi, and adt has 0xC000 :)
17:39marcan#define AIC2_REG_SIZE 0x10000
17:39marcanwhere are you seeing 0x4000?
17:39jeffmiwmacos is hitting 0x5024 which is above 0x4000
17:39marcanoh, you mean for AIC1
17:39jeffmiwyes aic1
17:40marcanyeah, just make it 8000 I guess
17:40marcanmight as well consider the timer part of it
17:41marcanactually isn't the timer at 8k? I forget what's at 4000... :p
17:41marcanoh wait, that's still AIC
17:41marcanok, that's just a bug then
17:41marcanthat should've been 0x8000 all along
17:41jeffmiwso you prefer to use hard coded value than the adt one ?
17:42jeffmiwok, that is even easier
17:42jeffmiwif we do not "trust" or do not want to use the adt value
17:42marcanyes, just use 8000; if macos still crashes then it means it uses the timer (which is interesting information) and then I guess use c000
17:42jeffmiwmacos works with 8000
17:43marcanI don't particularly mind having fail situations like these when they might yield interesting information in the future
17:43jeffmiwok I'll submit the pr with just that then
17:43jeffmiwI was trying to avoid hard coded value, like you did for the aic_base for aic2
17:43marcanit's useful to have the thing blow up when something unexpected happens (like a future version of macos hitting a higher event reg)
17:44marcanbase is different because that is expected to change from SoC to SoC
17:45marcanbut if something is hitting registers we don't expect it to, I might as well have it crash and investigate
18:12Dcow has joined #asahi-dev
18:47the_lanetly_052___ has joined #asahi-dev
18:52jacoxon has joined #asahi-dev
19:30Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
19:48the_lanetly_052___ has quit [Ping timeout: 480 seconds]
19:58kettenisthere are some benefits in specifying the smallest possible size and in making it a power of 2
20:55X-Scale has joined #asahi-dev
21:00X-Scale` has quit [Ping timeout: 480 seconds]
21:00jacoxon has quit []
21:18maor26 has joined #asahi-dev
21:22maor26 has quit []
21:27maor26 has joined #asahi-dev
21:33X-Scale` has joined #asahi-dev
21:34Dcow has joined #asahi-dev
21:36X-Scale has quit [Ping timeout: 480 seconds]
22:05Jawse has joined #asahi-dev
22:07Jawse has quit []
22:21KDDLB has joined #asahi-dev
22:23jeffmiw has quit [Ping timeout: 480 seconds]
22:26robinp[m] has joined #asahi-dev
22:33Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
22:40slicey has joined #asahi-dev
23:02aleasto has quit [Quit: Konversation terminated!]
…