robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robinp[m] has joined #asahi-dev
<jannau>
that seems to work on the mac mini as well but the message for poweroff 'off1' just resets
<kettenis>
as in, it doesn't actually power the machine off?
<jannau>
yes, it reboots
<kettenis>
so maybre the magic nvram writes are necessary after all
the_lanetly_052___ has quit [Ping timeout: 480 seconds]
robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robinp[m] has joined #asahi-dev
slicey has joined #asahi-dev
slicey has quit [Quit: cya]
slicey has joined #asahi-dev
slicey has quit []
robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robinp[m] has joined #asahi-dev
rkt has quit [Quit: rkt]
robinp[m] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Nspace has joined #asahi-dev
Dcow has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<marcan>
ugh, dammit
<marcan>
apparently AVD *does* have firmware
<marcan>
some 35kb blob... that's embedded in the kext
<marcan>
so I guess we need a stupid firmware cutter to deal with that :/
<marcan>
(it's a little cortex-m3 thing)
<marcan>
annoyingly, there are 6 blobs all named with the same symbol name, apparently
<marcan>
(for different hardware versions)
<ar>
what's avd? video decoder thing?
<jannau>
yes, ave (video encoder) works probably in the same way
<marcan>
no, AVE has a Chinook loaded by iBoot
<marcan>
that one's easy
<marcan>
AVD did not which is why I assumed it was firmwareless
<marcan>
apparently not :/
<jannau>
what about jpeg and apr (prores)?
<marcan>
jpeg wouldn't have firmware, that'd be silly for a jpeg decoder
<marcan>
prores, no idea yet, though I'd hope that a codec as relatively simple as that doesn't need firmware either...
<jannau>
m1 has avd-version=3, m1 max avd-version=4 with "compatible = [avd,t8103, avd,t6000]"
<marcan>
the firmwares do change from version to version, at least some of them
<marcan>
since 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)
<marcan>
and then the installer just has a table of kext offsets/lengths to cut out (and maybe a sha1 for sanity check)
<marcan>
er, kernelcache offsets/lengths
<marcan>
prores doesn't look like it has firmware
<marcan>
re 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
<marcan>
but it's probably not worth doing that initially
<marcan>
(the format is obviously a raw cortex-m3 memory image, it starts with initial SP and the vector table)
Dcow has joined #asahi-dev
<jeffmiw>
does 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) ?
<j_ey>
jeffmiw: similar for the darts and pinctrl, they seem to have larger registers in the ADT than needed
<jeffmiw>
humm ok. thx.
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<marcan>
aic2 has a bunch of pages for event registers for presumably ASCs, but the CPU only cares about the first
<marcan>
which is 0x10000 bytes total (event page at 0xc000)
<marcan>
aic1, IIRC there's a timer and other stuff we don't care about / map
dsrt^ has joined #asahi-dev
<marcan>
jeffmiw: in general, the ADT is terrible and full of lies; do not trust it to be correct for anything :p
<jeffmiw>
ok, 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
<jeffmiw>
I will submit a pr to fix it, just trying to make it more "aligned" in aic.c using also values from adt
<marcan>
hmm? is macOS hitting registers > 0xc000?
<jeffmiw>
then I realized we are currently using 3 different values :) 0x4000 in aic.h, 0x8000 in .dtsi, and adt has 0xC000 :)
<marcan>
#define AIC2_REG_SIZE 0x10000
<marcan>
where are you seeing 0x4000?
<jeffmiw>
macos is hitting 0x5024 which is above 0x4000
<marcan>
oh, you mean for AIC1
<jeffmiw>
yes aic1
<marcan>
yeah, just make it 8000 I guess
<marcan>
might as well consider the timer part of it
<marcan>
actually isn't the timer at 8k? I forget what's at 4000... :p
<marcan>
oh wait, that's still AIC
<marcan>
ok, that's just a bug then
<marcan>
that should've been 0x8000 all along
<jeffmiw>
so you prefer to use hard coded value than the adt one ?
<jeffmiw>
ok, that is even easier
<jeffmiw>
if we do not "trust" or do not want to use the adt value
<marcan>
yes, just use 8000; if macos still crashes then it means it uses the timer (which is interesting information) and then I guess use c000
<jeffmiw>
macos works with 8000
<marcan>
I don't particularly mind having fail situations like these when they might yield interesting information in the future
<jeffmiw>
ok I'll submit the pr with just that then
<jeffmiw>
I was trying to avoid hard coded value, like you did for the aic_base for aic2
<marcan>
it's useful to have the thing blow up when something unexpected happens (like a future version of macos hitting a higher event reg)
<marcan>
base is different because that is expected to change from SoC to SoC
<marcan>
but if something is hitting registers we don't expect it to, I might as well have it crash and investigate
Dcow has joined #asahi-dev
the_lanetly_052___ has joined #asahi-dev
jacoxon has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
the_lanetly_052___ has quit [Ping timeout: 480 seconds]
<kettenis>
there are some benefits in specifying the smallest possible size and in making it a power of 2
X-Scale has joined #asahi-dev
X-Scale` has quit [Ping timeout: 480 seconds]
jacoxon has quit []
maor26 has joined #asahi-dev
maor26 has quit []
maor26 has joined #asahi-dev
X-Scale` has joined #asahi-dev
Dcow has joined #asahi-dev
X-Scale has quit [Ping timeout: 480 seconds]
Jawse has joined #asahi-dev
Jawse has quit []
KDDLB has joined #asahi-dev
jeffmiw has quit [Ping timeout: 480 seconds]
robinp[m] has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]