#
…

2021-11-12

00:15egavinc__ has quit [Quit: Leaving]
00:37yuyichao has quit [Ping timeout: 480 seconds]
01:05yuyichao has joined #asahi-dev
01:27cz3 has quit []
01:37kov has joined #asahi-dev
01:42gladiac is now known as Guest5659
01:42gladiac has joined #asahi-dev
01:48Guest5659 has quit [Ping timeout: 480 seconds]
02:30riker77_ has joined #asahi-dev
02:35riker77 has quit [Ping timeout: 480 seconds]
02:35riker77_ is now known as riker77
03:04Dcow has joined #asahi-dev
03:04Dcow has quit []
03:22kov has quit [Quit: Coyote finally caught me]
03:46phiologe has joined #asahi-dev
05:38Dcow has joined #asahi-dev
05:39Dcow has quit []
05:40Dcow has joined #asahi-dev
06:40DarkShadow44 has quit [Quit: ZNC - https://znc.in]
06:43DarkShadow44 has joined #asahi-dev
06:43DarkShadow44 has quit [Remote host closed the connection]
07:03DarkShadow44 has joined #asahi-dev
07:04DarkShadow44 has quit [Read error: Connection reset by peer]
07:05DarkShadow44 has joined #asahi-dev
07:06DarkShadow44 has quit []
07:11DarkShadow44 has joined #asahi-dev
07:11DarkShadow44 has quit [Read error: Connection reset by peer]
07:12DarkShadow44 has joined #asahi-dev
07:14DarkShadow44 has quit [Remote host closed the connection]
07:14DarkShadow44 has joined #asahi-dev
07:33rkt has joined #asahi-dev
07:41jeffmiw has quit [Ping timeout: 480 seconds]
08:14Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
08:14richbridger has quit [Ping timeout: 480 seconds]
08:14aquijoule_ has joined #asahi-dev
08:34chadmed has quit [Remote host closed the connection]
08:34chadmed has joined #asahi-dev
08:37Dcow has joined #asahi-dev
09:47kov has joined #asahi-dev
09:58jeffmiw has joined #asahi-dev
10:20Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
10:27Dcow has joined #asahi-dev
10:46aquijoule_ is now known as richbridger
10:47richbridger has quit []
10:47richbridger has joined #asahi-dev
11:48cepheus has quit [Remote host closed the connection]
12:27aleasto has joined #asahi-dev
12:35suricato has quit [Ping timeout: 480 seconds]
13:15chadmed has quit [Remote host closed the connection]
13:16chadmed has joined #asahi-dev
13:37fried_dede[m] has joined #asahi-dev
14:20Dcow has quit [Quit: Textual IRC Client: www.textualapp.com]
14:40yuyichao has quit [Ping timeout: 480 seconds]
14:41Dcow has joined #asahi-dev
14:53Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
15:00yuyichao has joined #asahi-dev
15:10yuyichao_ has joined #asahi-dev
15:14yuyichao has quit [Ping timeout: 480 seconds]
15:28Dcow has joined #asahi-dev
17:07leah2 has quit [Remote host closed the connection]
17:09leah2 has joined #asahi-dev
17:20Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
18:04svenlooks 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
18:05svenand more importantly: unlike the usb pd reset these don’t seem to turn that annoying startup chime back one :D
18:06mazsven: it's the bestest!!!!
18:06svenaccording to the ADT there’s also some GPIO involved but I haven’t been able to figure out what it does yet
18:07svenmaz: still needs macOS at least once for now to turn it off for the first time though :-(
18:09mazsven: 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!
18:09svenhah :D
18:10svenmine is next to me and I’ve actually been very close to just forcibly disconnecting that speaker
18:11mazyup. given that PD reset is what I use all the time, that's the only solution (at least as I understand it)
18:25kettenisheh, 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
18:30Dcow has joined #asahi-dev
18:42Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
18:46kettenisanyway, I'm somewhat surprised nobody implemented a linux driver for the watchdog yet
18:47* svenjust did
18:48svenlet me push my current version
18:48jannaualso corellium's apple-reboot is just a very limited watchdog driver
18:50svennot sure if it makes sense to expose the two watchdogs that don't trigger recovery mode. i mostly care about the system reset anyway
18:52kettenisstart simple
18:54kettenisregarding the binding, I don't think it makes a lot of sense to call this "wdt2"
18:54svenyeah, not sure about that either. ADT claims it's version 2 and i have no idea how version 1 looks like
18:54kettenisfrom what I've seen, older phone SoCs have the same interface
18:54sven(and probably don't care about version 1 since it's probably only present on iphones)
18:55svenoh, interesting. i wonder why it's called version 2 then
18:55svenbut if they have the same interface anyway wdt is fine with me
18:55kettenismaybe the more advanced options aren't present on the older SoCs
18:59jannaubase compatible in the ADT is "wdt,s5l8960x" so the version might be not that important
19:00roxfan has quit [Remote host closed the connection]
19:00svenoh.. looks like there's also another register range in the ADT
19:01sventhe one starting at 0x23d280000
19:03roxfan has joined #asahi-dev
19:05jannauit has also two interrupts, the second one is empty though
19:05sveni think we somehow don't understand the interrupt property completely fwiw
19:06sveni've seen second interrupts which just contains zero or one a few times already
19:07kettenissometimes it looks as if the 2nd cell is some sort of flag instead of an interrupt number
19:07jannauI think the interrupts property depends on the interrupt parent
19:08kettenisthat is the case in proper device trees as well
19:08svenyeah. and i've seen nodes with AIC as a parent in the ADT that had that additional "flag" and others that don't
19:08jannaufor aic it seems to be just a list of interrupts. for gpio it is the pin number and config flags
19:09svenbut the wdt parent _is_ aic and it contains that weird flag
19:12svenbut anyway, if the interface for the previous phone SoCs is similar i'll just call the base compatible "apple,wdt"
19:24kettenisthe reboot driver in the linux-sandcastle tree does effectively the same thing as the sven's new driver
19:28svenapple,wdt it is then
19:33kettenisis the clock enable/disable code really necessary?
19:33svenI think I’m only allowed to call get_rate after I enabled the clock :/
19:34j_eyI thought the same thing for SPI
19:34svenit’ll work without that enable but that’s just because our ref clock is a constant clock anyway
19:35kettenisfair enough
19:49Dcow has joined #asahi-dev
20:07jannaumacos uses the watchdog to generate interrupts every 5 seconds
20:08sventhe first one?
20:08svenor is there a way to convince the one at 0x10 to also generate interrupts?
20:08jannauthe t6000 adt doesn't have a second reg range
20:09jannaujust the first one but it resets cur time for the first and the second one
20:09svenwhat's their reboot timer for the first one?
20:10svenmaybe these function-* entries in the ADT can somehow be used to switch the first one to just do a normal reboot as well
20:10jannau0xffffffff
20:10svenor maybe not :D
20:10aleasto has quit [Remote host closed the connection]
20:12jannaubite times for the 2nd and 3rd are 0xaba95000 and 0x2922b0024 but both are not enabled
20:12sveni know that if you reset macos it'll use the 2nd watchdog
20:13sven0xaba95000 should be two minutes
20:13svenand 0x2922b0024 looks wrong. that more than what can fit inside a 32bit register
20:17jannauI don't see monterey using the watchdog for reset
20:17kettenislooks like the physical address of a register to me ;)
20:17jannaucopy and paste error. value is 0x80befc00
20:17svenwhich trace mode do you use? if it's async the usb interface might just disappear before you see the writes
20:18sven0x80befc00 is 90 seconds
20:18jannauI use SYNC
20:18jannau0x2922b0024 is APPLE_WDT2_WD2_BITE_TIME on the t6000
20:19sven[cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b0010 (wdt[0], offset 0x10) = 0x0
20:19sven[cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b001c (wdt[0], offset 0x1c) = 0x4
20:19sven[cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b0014 (wdt[0], offset 0x14) = 0x0
20:19sven[cpu0][0xfffffe001340e5ac] MMIO: W.4 0x23d2b0010 (wdt[0], offset 0x10) = 0x0
20:19sventhat's what i see
20:19sven(and just after that the usb device disappears)
20:20svenyou could try to disallow any write to 0x1c and just print it instead
20:55jannauno writes to 0x1c before reset. macos' serial log ends with "IOPlatformHaltRestartAction -> AppleT6001PMGR"
20:56X-Scale has joined #asahi-dev
20:59kettenisit isn't inconceivable that they implemented a "proper" reset path for the new machines instead of abusing the watchdog timer
21:00X-Scale` has quit [Ping timeout: 480 seconds]
21:02svenoh, this is on the pro/max?
21:10jannauno need for a "proper" reset path on iphones and ipads which don't have UI reset
21:11jannauM1 seems to be really a ipad chip which somehow ended up in mac devices
21:19jannaua watchdog reset with empty battery (~5% here) is poweroff. poweroff in linux worked unexpectedly
21:50Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
22:45Dcow has joined #asahi-dev
22:58svenhah. 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
23:00kettenismaybe you should implement a battery status reader to see how fast you can drain your battery
23:00kettenisoh wait...
23:07kettenismeanwhile 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
23:32Dcow has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
…