ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
egavinc__ has quit [Quit: Leaving]
yuyichao has quit [Ping timeout: 480 seconds]
yuyichao has joined #asahi-dev
cz3 has quit []
kov has joined #asahi-dev
gladiac is now known as Guest5659
gladiac has joined #asahi-dev
Guest5659 has quit [Ping timeout: 480 seconds]
riker77_ has joined #asahi-dev
riker77 has quit [Ping timeout: 480 seconds]
riker77_ is now known as riker77
Dcow has joined #asahi-dev
Dcow has quit []
kov has quit [Quit: Coyote finally caught me]
phiologe has joined #asahi-dev
Dcow has joined #asahi-dev
Dcow has quit []
Dcow has joined #asahi-dev
DarkShadow44 has quit [Quit: ZNC - https://znc.in]
DarkShadow44 has joined #asahi-dev
DarkShadow44 has quit [Remote host closed the connection]
DarkShadow44 has joined #asahi-dev
DarkShadow44 has quit [Read error: Connection reset by peer]
DarkShadow44 has joined #asahi-dev
DarkShadow44 has quit []
DarkShadow44 has joined #asahi-dev
DarkShadow44 has quit [Read error: Connection reset by peer]
DarkShadow44 has joined #asahi-dev
DarkShadow44 has quit [Remote host closed the connection]
DarkShadow44 has joined #asahi-dev
rkt has joined #asahi-dev
jeffmiw has quit [Ping timeout: 480 seconds]
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
richbridger has quit [Ping timeout: 480 seconds]
aquijoule_ has joined #asahi-dev
chadmed has quit [Remote host closed the connection]
chadmed has joined #asahi-dev
Dcow has joined #asahi-dev
kov has joined #asahi-dev
jeffmiw has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Dcow has joined #asahi-dev
aquijoule_ is now known as richbridger
richbridger has quit []
richbridger has joined #asahi-dev
cepheus has quit [Remote host closed the connection]
aleasto has joined #asahi-dev
suricato has quit [Ping timeout: 480 seconds]
chadmed has quit [Remote host closed the connection]
chadmed has joined #asahi-dev
fried_dede[m] has joined #asahi-dev
Dcow has quit [Quit: Textual IRC Client: www.textualapp.com]
yuyichao has quit [Ping timeout: 480 seconds]
Dcow has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
yuyichao has joined #asahi-dev
yuyichao_ has joined #asahi-dev
yuyichao has quit [Ping timeout: 480 seconds]
Dcow has joined #asahi-dev
leah2 has quit [Remote host closed the connection]
leah2 has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<sven> looks like this thing has three watchdog timers. first one can also fire an interrupt N ticks before reset but then always resets to recovery mode. The other two just seem to do a “normal” reset
<sven> and more importantly: unlike the usb pd reset these don’t seem to turn that annoying startup chime back one :D
<maz> sven: it's the bestest!!!!
<sven> according to the ADT there’s also some GPIO involved but I haven’t been able to figure out what it does yet
<sven> maz: still needs macOS at least once for now to turn it off for the first time though :-(
<maz> sven: yeah, still can't be bothered. I found that I end-up hacking on the M1 when I'm not next to it. another good reason to go back into the office!
<sven> hah :D
<sven> mine is next to me and I’ve actually been very close to just forcibly disconnecting that speaker
<maz> yup. given that PD reset is what I use all the time, that's the only solution (at least as I understand it)
<kettenis> heh, I actually find the chime useful as feedback when I'm sitting in my lazy chair and I'm resetting the mini on my desk
Dcow has joined #asahi-dev
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<kettenis> anyway, I'm somewhat surprised nobody implemented a linux driver for the watchdog yet
* sven just did
<sven> let me push my current version
<jannau> also corellium's apple-reboot is just a very limited watchdog driver
<kettenis> it is
<sven> not sure if it makes sense to expose the two watchdogs that don't trigger recovery mode. i mostly care about the system reset anyway
<kettenis> start simple
<kettenis> regarding the binding, I don't think it makes a lot of sense to call this "wdt2"
<sven> yeah, not sure about that either. ADT claims it's version 2 and i have no idea how version 1 looks like
<kettenis> from what I've seen, older phone SoCs have the same interface
<sven> (and probably don't care about version 1 since it's probably only present on iphones)
<sven> oh, interesting. i wonder why it's called version 2 then
<sven> but if they have the same interface anyway wdt is fine with me
<kettenis> maybe the more advanced options aren't present on the older SoCs
<jannau> base compatible in the ADT is "wdt,s5l8960x" so the version might be not that important
roxfan has quit [Remote host closed the connection]
<sven> oh.. looks like there's also another register range in the ADT
<sven> the one starting at 0x23d280000
roxfan has joined #asahi-dev
<jannau> it has also two interrupts, the second one is empty though
<sven> i think we somehow don't understand the interrupt property completely fwiw
<sven> i've seen second interrupts which just contains zero or one a few times already
<kettenis> sometimes it looks as if the 2nd cell is some sort of flag instead of an interrupt number
<jannau> I think the interrupts property depends on the interrupt parent
<kettenis> that is the case in proper device trees as well
<sven> yeah. and i've seen nodes with AIC as a parent in the ADT that had that additional "flag" and others that don't
<jannau> for aic it seems to be just a list of interrupts. for gpio it is the pin number and config flags
<sven> but the wdt parent _is_ aic and it contains that weird flag
<sven> but anyway, if the interface for the previous phone SoCs is similar i'll just call the base compatible "apple,wdt"
<kettenis> the reboot driver in the linux-sandcastle tree does effectively the same thing as the sven's new driver
<sven> apple,wdt it is then
<kettenis> is the clock enable/disable code really necessary?
<sven> I think I’m only allowed to call get_rate after I enabled the clock :/
<j_ey> I thought the same thing for SPI
<sven> it’ll work without that enable but that’s just because our ref clock is a constant clock anyway
<kettenis> fair enough
Dcow has joined #asahi-dev
<jannau> macos uses the watchdog to generate interrupts every 5 seconds
<sven> the first one?
<sven> or is there a way to convince the one at 0x10 to also generate interrupts?
<jannau> the t6000 adt doesn't have a second reg range
<jannau> just the first one but it resets cur time for the first and the second one
<sven> what's their reboot timer for the first one?
<sven> maybe these function-* entries in the ADT can somehow be used to switch the first one to just do a normal reboot as well
<jannau> 0xffffffff
<sven> or maybe not :D
aleasto has quit [Remote host closed the connection]
<jannau> bite times for the 2nd and 3rd are 0xaba95000 and 0x2922b0024 but both are not enabled
<sven> i know that if you reset macos it'll use the 2nd watchdog
<sven> 0xaba95000 should be two minutes
<sven> and 0x2922b0024 looks wrong. that more than what can fit inside a 32bit register
<jannau> I don't see monterey using the watchdog for reset
<kettenis> looks like the physical address of a register to me ;)
<jannau> copy and paste error. value is 0x80befc00
<sven> which trace mode do you use? if it's async the usb interface might just disappear before you see the writes
<sven> 0x80befc00 is 90 seconds
<jannau> I use SYNC
<sven> weird
<jannau> 0x2922b0024 is APPLE_WDT2_WD2_BITE_TIME on the t6000
<sven> [cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b0010 (wdt[0], offset 0x10) = 0x0
<sven> [cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b001c (wdt[0], offset 0x1c) = 0x4
<sven> [cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b0014 (wdt[0], offset 0x14) = 0x0
<sven> [cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b0010 (wdt[0], offset 0x10) = 0x0
<sven> that's what i see
<sven> (and just after that the usb device disappears)
<sven> you could try to disallow any write to 0x1c and just print it instead
<jannau> no writes to 0x1c before reset. macos' serial log ends with "IOPlatformHaltRestartAction -> AppleT6001PMGR"
X-Scale has joined #asahi-dev
<kettenis> it isn't inconceivable that they implemented a "proper" reset path for the new machines instead of abusing the watchdog timer
X-Scale` has quit [Ping timeout: 480 seconds]
<sven> oh, this is on the pro/max?
<jannau> yes
<jannau> no need for a "proper" reset path on iphones and ipads which don't have UI reset
<jannau> M1 seems to be really a ipad chip which somehow ended up in mac devices
<jannau> a watchdog reset with empty battery (~5% here) is poweroff. poweroff in linux worked unexpectedly
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Dcow has joined #asahi-dev
<sven> hah. so now we just need to find a way to quickly the drain the battery and then we also have power off without requiring SMC :P
<kettenis> maybe you should implement a battery status reader to see how fast you can drain your battery
<kettenis> oh wait...
<kettenis> meanwhile I can confirm that the touchpad does indeed produce the same kind of packets as those handled by the bcm5974.c linux driver when in raw mode
Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]