#asahi-dev · 2022-02-09 13:40
marcanhm, but then RTC would end up chopped into bits#asahi-dev · 2022-02-09 13:39
marcanand sure, I could just do two custom properties for the two fallback offsets#asahi-dev · 2022-02-09 13:39
marcanthe idea so far is rtc and a shutdown handler node (not sure what node type that one should be, maybe it could be a kitchen sink "power manager" thing that also covers the power loss mode?)#asahi-dev · 2022-02-09 13:38
marcanthat's what we're doing now#asahi-dev · 2022-02-09 13:37
marcanahh, looks like "pm setting" might be the "restart on power loss" flag#asahi-dev · 2022-02-09 13:33
marcanif we need to split things up in the future we could add more reg names, like an associated scratchpad#asahi-dev · 2022-02-09 13:33
marcanin which case the offset reg would just not overlap rtc for those chips#asahi-dev · 2022-02-09 13:33
marcanand I *might* guess that some implementation *could* put the RTC offset in a random scratchpad that's not part of the RTC block#asahi-dev · 2022-02-09 13:32
marcanthey do not overlap the LEG_SCRPAD which is the other area which will have a driver at this point (to make shutdown work)#asahi-dev · 2022-02-09 13:32
marcanthere's some irq/pm setting stuff that I'm not sure about yet#asahi-dev · 2022-02-09 13:32
marcankind of, see: https://mrcn.st/p/RU2LWh3g#asahi-dev · 2022-02-09 13:29
marcanthey kind of have to in this kind of case, unfortunately#asahi-dev · 2022-02-09 13:28
marcanand we'd have compatibles like "apple,maverick-pmu-rtc", "apple,spmi-pmu-rtc"#asahi-dev · 2022-02-09 13:27
marcanand then the generic driver would only use those#asahi-dev · 2022-02-09 13:27
marcanso something like reg-names = "rtc", "time", "offset"; where rtc covers everything and the other two are just those two registers?#asahi-dev · 2022-02-09 13:24
marcanjust the offset changes#asahi-dev · 2022-02-09 13:23
marcanthose two are consistent AFAICT#asahi-dev · 2022-02-09 13:23
marcanand say alarm support needs an up to date driver#asahi-dev · 2022-02-09 13:23
marcanwe could do the middle ground thing and just have props for RTC time and RTC offset, to at least make the RTC work#asahi-dev · 2022-02-09 13:23
marcanyou mean bits for alarm and stuff? I think they're consistent at this point, but I'm okay with using compatibles for features like that#asahi-dev · 2022-02-09 13:22
marcanand the SMC sharing thing would be a bit of a hack at the very least#asahi-dev · 2022-02-09 13:22
marcanyeah... I think it could work for current machines, but if Apple decides to use the SPMI controller for something else or the PMU needs to do more interesting stuff in the future, then we have a sharing issue#asahi-dev · 2022-02-09 13:21
marcanit also means now EFI need to take care of shutdown to make that work, and since that involves both SMC and PMU, EFI needs to talk to SMC, which means we need to figure out how to share that sanely#asahi-dev · 2022-02-09 13:20
marcanthat would imply EFI owning that SPMI host and everything under it, which might be a problem in the future... unless we do a sharing thing...#asahi-dev · 2022-02-09 13:20
marcanare you suggesting we do all the RTC stuff in EFI?#asahi-dev · 2022-02-09 13:20
marcanthat it does#asahi-dev · 2022-02-09 11:56
marcanand that would be used as a fallback#asahi-dev · 2022-02-09 11:56
marcanit would make more sense to have the RTC node do that via the compatible, and then have the RTC time and offset regs explicitly specified via props#asahi-dev · 2022-02-09 11:56
marcanI don't know about splitting off alarm though, that's logically part of RTC#asahi-dev · 2022-02-09 11:55
marcanshutdown would be generic, since that seems to be a scratch area and always the same offset/bit#asahi-dev · 2022-02-09 11:41
marcanmaverick I guess made it into part of the RTC component#asahi-dev · 2022-02-09 11:41
marcanseems that was introduced recently#asahi-dev · 2022-02-09 11:41
marcanthe offset is just scratch RAM though, which is why it was separate from the RTC on older chips#asahi-dev · 2022-02-09 11:41
marcanI think they're real registers#asahi-dev · 2022-02-09 11:08
marcanthey sure do like moving registers around#asahi-dev · 2022-02-09 11:07
marcanbut that's about it#asahi-dev · 2022-02-09 11:07
marcanthat suggests the pattern that the irq pair is adjacent and RTC/ALARM are adjacent holds#asahi-dev · 2022-02-09 11:07
marcankettenis: https://mrcn.st/p/RU2LWh3g#asahi-dev · 2022-02-09 10:57
marcanthankfully iDevices are a thing#asahi-dev · 2022-02-09 10:55
marcanlet me dig up other device trees ;)#asahi-dev · 2022-02-09 10:52
marcanso there are some groups that seem to stick together, but n=2#asahi-dev · 2022-02-09 10:52
marcanhttps://mrcn.st/p/VkC9Umqd offsets a bit more readable#asahi-dev · 2022-02-09 10:41
marcan(until explicitly supported)#asahi-dev · 2022-02-09 10:41
marcanor we could split the difference and only explicitly specify the time and time offset reg addresses somehow, and say that future chips only get that and not alarm/etc functionality#asahi-dev · 2022-02-09 10:40
marcanor we could just use the compatible, but it's a bit sad if we can't support even basic RTC functionality in future hardware#asahi-dev · 2022-02-09 10:40
marcanwe could do the same with custom properties, or with a bunch of reg ranges, one per register (named in reg-names)#asahi-dev · 2022-02-09 10:40
marcanrobher: another one where you might have some input. looks like Apple generalized their PMU/RTC driver by outright having the register offsets in the ADT#asahi-dev · 2022-02-09 10:38
marcancontrol etc#asahi-dev · 2022-02-09 10:38
marcanhoweverm, the other regs differ#asahi-dev · 2022-02-09 10:37
marcanhope we can rely on that one