2022-02-13
00:12mtjzh has quit [Ping timeout: 480 seconds]
00:18user982492 has joined #asahi-dev
00:37mtjzh has joined #asahi-dev
00:47axboe has quit [Quit: leaving]
00:53chadmed has quit [Quit: Konversation terminated!]
00:56chadmed has joined #asahi-dev
03:02user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:32grgy has joined #asahi-dev
03:33PhilippvK has joined #asahi-dev
03:37phiologe has quit [Ping timeout: 480 seconds]
03:46kov has quit [Quit: Coyote finally caught me]
03:46kov has joined #asahi-dev
04:16marcanerr... the low 16 bits of the raw RTC time I read are always constant, and the RTC time returned by SMC is << 15, not <<16, and does have active low bits
04:19marcanoh wait, on the m1pro & friends it always goes via SMC anyway. let's see about the mac mini..
04:25user982492 has joined #asahi-dev
04:52marcanso the fractional part of the RTC time is somewhere else on maverick... dumping registers now :/
05:43the_lanetly_052 has joined #asahi-dev
06:59AstaraOS has joined #asahi-dev
07:03* AstaraOShey mind to do some coding advise at channel #0dev , let me know if anyone interested , lets code together
07:28* AstaraOSi am bot ? i am skraito the earthquake guy ... .just Repent https://tjc.org , before it's too late
07:31* AstaraOSif you want support from AstaraOS i am here or on another network #0dev or https://worldhacker.org
07:34* AstaraOS[ Astara ] Team 0day request ... . https://worldhacker.org ... . https://worldhacker.org/index.php/irc-server/ ... . let's go code together :) and make some buck , i will wait ... .
07:37AstaraOS was banned on #asahi-dev by marcan [*!*@180.241.255.245]
07:37AstaraOS was kicked from #asahi-dev by marcan [AstaraOS]
08:02user982492 has quit [Remote host closed the connection]
08:02user982492 has joined #asahi-dev
08:08the_lanetly_052 has quit [Ping timeout: 480 seconds]
08:25user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:43the_lanetly_052 has joined #asahi-dev
08:58the_lanetly_052 has quit [Ping timeout: 480 seconds]
08:59user982492 has joined #asahi-dev
09:00user982492 has quit []
09:38marcankettenis/robher: I think I'm going to drop the idea of making the RTC forwards compatible and just use per-PMU compatibles and have the driver hardcode all the regs
09:38marcanI'm getting the feeling that Apple is moving towards doing this all in SMC anyway, given they're already outsourcing RTC reads to SMC for Maverick and apparently somehow the RTC pulls fractional seconds out of thin air
10:22marcanif I wait for the PMU second to roll over, then read SMC, the SMC is a few milliseconds *behind* in its count, still on the previous second
10:22marcanmaybe it reads the PMU RTC on startup and then just free-runs off of some other clock in SMC?
10:31kettenismarcan: so what I found out is that the CLKM SMC key is present on the mini that I upgraded to 12.x but not there on the macbook pro that is still on 11.x
10:33marcannow I almost want to just wait until 13.x and see if we can just put the RTC driver in SMC...
10:33kettenisregarding the shifts, I did quite a bit of experimentation and convinced myself the shifts in the OpenBSD driver are correct
10:34marcanwhich you can tell because if you start reading at the seconds offset, the time never updates
10:40marcanthe problem is the SMC is still providing sub-second resolution, and the offset also provides sub-second resolution
10:41marcanmost RTCs will reset the sub-second counter when you write to them, but we can't emulate that behavior without knowing when the second rolls over, which is annoying
10:42marcanso while linux will do sub-second updates when syncing to NTP on most RTCs, we can't implement that sanely here without hooking up the PMU driver to SMC
10:42marcanbut I guess for now this will have to do; if in 13.x they switch to a full SMC based solution we can just implement that and deprecate the PMU mechanism, and if they don't we can think of doing what macOS does and having the drivers talk to each other
10:44kettenisthese days having the correct time is important such that you can do DNSSEC to lookup the ntp server
10:46gabuscus_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
10:47gabuscus has joined #asahi-dev
10:55marcankettenis: yeah, it always reads the clock from SMC then immediately writes the offset to the PMU
11:00marcanbecause if it's just free-running, it would fall out of sync with the real PMC clock, unless it continuously updates the PMC clock? but it's not writable as far as I can tell...
11:01marcanpolling from m1n1 until the PMU rolls over, then reading SMC, I get: 001115b48005 (PMU) 001115b47fa8 (SMC)
11:14kettenisso maybe the way to solve this is to make the RTC a subnode of the SMC and reference the offset in the pmu through an nvmem-cells property
11:15marcanthat said, there's a decent argument for doing that anyway, since we won't support alarms yet, and just hope 13.0 lets us do everything from SMC
11:16marcanand then I can also move the power sequencing stuff to SMC, that needs to poke at other PMU bits
11:16marcanit does kind of make sense to do it all in one driver under SMC and treat the PMU as dumb memory in this case
11:16marcanI'd be okay with saying no alarms in 12.x if 13.x comes around with everything doable from SMC
11:18kettenisthe sole reason for having alarm support is to be able to schedule a wakeup from suspend isn't it?
11:20marcanalso looking at the nvmem stuff, that eliminates the entire question about how to represent this in the PMU binding since it just lets you define address ranges for cells
11:20marcanwhich means we can just treat the entire PMU as an nvmem device (a lot of it is), though I'd still make it an mfd so that if in the future we need to throw other things in there we can
11:31kettenisthe SMC keys are discoverable, so if at some point a key to read/write the offset appears the SMC RTC driver can just use that
11:33kettenisbasically the clock uses some arbitrary epoch and the offset is used to turn that into an offset from 1970
12:15mtjzh has quit [Remote host closed the connection]
12:16mtjzh has joined #asahi-dev
12:23mtjzh has quit [Remote host closed the connection]
12:23mtjzh has joined #asahi-dev
12:30mtjzh has quit [Remote host closed the connection]
12:36mtjzh has joined #asahi-dev
12:37mtjzh has quit [Remote host closed the connection]
13:14mtjzh has joined #asahi-dev
13:21marcangeneric spmi-mfd-nvmem driver is done, going to write the SMC RTC driver now hooking into it
13:21marcanI also added a bunch more nvmem/flag details I could gather around from the ADT and the PMU driver
13:21marcanI'm going to make the reboot driver handle the boot failure stuff properly too, since otherwise something could complain or decide to go into recovery mode or something
13:23marcanthere's one somewhat hacky thing in there, the RTC "nvmem" area actually covers the whole RTC including the counter, so you get the RTC included in the /nvmem file in sysfs if you cat it
13:24marcan(this is also why I *am* splitting it into 3 at least; if you try to cover the entire 64K PMU space with one NVMEM block, you get the whole thing when you cat the file, and that's bound to cause trouble)
13:28mtjzh has quit [Remote host closed the connection]
13:31mtjzh has joined #asahi-dev
13:36mtjzh has quit [Remote host closed the connection]
14:07mtjzh has joined #asahi-dev
14:31kettenisI question the wisdom of exposing hardware like that through sysfs, but that's not going to help you ;)
14:32alyssalet's not have a repeat of the infamous UEFI linux systems where "rm ... /" would brick the machine ;P
14:36mtjzh has quit [Remote host closed the connection]
15:50alyssa has quit [Quit: leaving]
16:10the_lanetly_052 has joined #asahi-dev
17:00the_lanetly_052__ has joined #asahi-dev
17:06the_lanetly_052 has quit [Ping timeout: 480 seconds]
17:14refi64 has quit [Quit: The Lounge - https://thelounge.chat]
17:16refi64 has joined #asahi-dev
17:36sheepgoose has joined #asahi-dev
17:46the_lanetly_052__ has quit [Ping timeout: 480 seconds]
17:48sheepgoose has quit [Ping timeout: 480 seconds]
19:17chengsun_ has joined #asahi-dev
19:24chengsun has quit [Ping timeout: 480 seconds]
19:59user982492 has joined #asahi-dev
20:07philhug has joined #asahi-dev
20:24grgy has quit [Quit: ZNC 1.8.2 - https://znc.in]
20:26grgy has joined #asahi-dev
20:27grgy has quit []
20:35grgy has joined #asahi-dev
21:35AstaraOS has quit [autokilled: This host violated network policy. Contact support@oftc.net for further information and assistance. (2022-02-13 21:35:21)]
21:46user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:01auwooo has joined #asahi-dev
22:05* auwooogreeting all , how are you all ? night morning afernoon all , i have setup base here for United Nations , incase you need me just go to channel #astara and leave me a message , i will see your president from there , tell me which country are you from ... .
22:12auwooo has quit [Remote host closed the connection]
22:32auwooo has joined #asahi-dev
22:36auwooo has quit []
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:43yrlf has joined #asahi-dev