#asahi-dev · 2022-02-13 09:38
marcanI'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#asahi-dev · 2022-02-13 09:38
marcankettenis/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#asahi-dev · 2022-02-13 05:24
marcanand I can't find it, lovely#asahi-dev · 2022-02-13 04:52
marcanso the fractional part of the RTC time is somewhere else on maverick... dumping registers now :/#asahi-dev · 2022-02-13 04:23
marcanand the LSB is always 0 so it's clearly <<15 either way#asahi-dev · 2022-02-13 04:23
marcanah, it does work on the mac mini/sera, interesting#asahi-dev · 2022-02-13 04:19
marcanoh wait, on the m1pro & friends it always goes via SMC anyway. let's see about the mac mini..#asahi-dev · 2022-02-13 04:16
marcanI'm smelling another "corellium did it wrong and everyone copied them" here...#asahi-dev · 2022-02-13 04:16
marcanerr... 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#asahi-dev · 2022-02-12 13:11
marcanI can follow up though#asahi-dev · 2022-02-12 13:11
marcanneed to check my mail again :)#asahi-dev · 2022-02-12 13:11
marcanI have talked with them, but I don't remember if I emphasized the 16K issue#asahi-dev · 2022-02-12 13:08
marcantbh we can probably just get ALARM to override that for us#asahi-dev · 2022-02-12 13:08
marcanyeah, makes sense#asahi-dev · 2022-02-12 13:05
marcanyeah, jemalloc again...#asahi-dev · 2022-02-12 13:05
marcanthere's going to be a bunch of breakage due to 16K pages, yes; my plan is to not care for the first release so we can gather up everything that's broken :-)#asahi-dev · 2022-02-10 10:39
marcanunless they were like muxed or something which would make zero sense#asahi-dev · 2022-02-10 10:39
marcan_jannau_: it's not physically possible for the HID microcontroller to have anything to do with the M1's FPWM#asahi-dev · 2022-02-10 07:10
marcan*simplified#asahi-dev · 2022-02-10 07:10
marcanhaven't seen pipcet in a while though, no idea what he's up to#asahi-dev · 2022-02-10 07:10
marcanalso I'm a bit sad that the driver is GPL-only, though for such a simple driver it doesn't really matter, but we try to upstream everything as GPL+MIT to make sure other OSes can use our work too#asahi-dev · 2022-02-10 07:09
marcan... remove callback (simplifies error paths); I don't think linux/slab.h is needed (linux/device.h might be a better idea, instead)#asahi-dev · 2022-02-10 07:09
marcanah-[m]: there are a bunch of things that need fixing there; it needs runtime-pm support to actually make use of the power domain; there should be a generic compatible instead of binding to per-SoC compatibles; all those writel should be writel_relaxed; the ioremap should be splified into devm_platform_ioremap_resource; the clk removal should be done via devm_add_action_or_reset instead of the ...#asahi-dev · 2022-02-10 06:51
marcanwe don't do pull requests for the asahi branch either, that's a volatile branch that gets rebased frequently and pull requests don't work#asahi-dev · 2022-02-09 16:37
marcannah, I think it's an iphone thing#asahi-dev · 2022-02-09 14:01
marcanwithout the PMU poke it ends up rebooting instead#asahi-dev · 2022-02-09 14:01
marcanfirst SMC does a pre-poweroff signal (may not be required?), then PMU writes the value to set the system to poweroff, then SMC does a call that actually powers down the system#asahi-dev · 2022-02-09 14:00
marcanthere's a dance that needs to happen between SMC and PMU, and it fits in nicely with that callback chain stuff#asahi-dev · 2022-02-09 14:00
marcanthe way I'm doing it actually depends on this patchset: https://lore.kernel.org/linux-m68k/20220130233718.21544-1-digetx@gmail.com/#asahi-dev · 2022-02-09 13:59
marcanrobher: it's not *quite* that because it's not actually a poweroff trigger, it's a pre-poweroff trigger#asahi-dev · 2022-02-09 13:58
marcanlol#asahi-dev · 2022-02-09 13:57
marcanthere is some bluetooth subsystem interaction though, somehow#asahi-dev · 2022-02-09 13:57
marcanso we don't care#asahi-dev · 2022-02-09 13:57
marcanah, but that might be for iphones only#asahi-dev · 2022-02-09 13:55
marcanpatent search says LPEM is "Low Power Express Mode" and has to do with near field comms, so I guess this is possibly some lower power mode where some radio stays active#asahi-dev · 2022-02-09 13:51
marcanthere is also, uh, something related to bluetooth somehow that interacts with this#asahi-dev · 2022-02-09 13:49
marcanand I haven't seen the driver inspect the PMU model or compatible to make decisions yet#asahi-dev · 2022-02-09 13:49
marcanwell, they do have one driver themselves with all the offsets in the ADT#asahi-dev · 2022-02-09 13:47
marcannor do I know if the pm setting stuff is tweakable via SMC#asahi-dev · 2022-02-09 13:47
marcanbut all the inputs/sensors/GPIO are abstracted out via SMC, and even RTC is readable it seems... but I haven't figured out a way to write it#asahi-dev · 2022-02-09 13:47
marcanit has regulators, analog inputs, temperature inputs, GPIO, RTC, and even runs firmware (cortex-m0 or something)#asahi-dev · 2022-02-09 13:46
marcanhence why we need to talk to some little bits directly#asahi-dev · 2022-02-09 13:46
marcanbut not all, thanks apple#asahi-dev · 2022-02-09 13:46
marcanit's a PMU, it does lots of things, but *most* of those are managed by SMC#asahi-dev · 2022-02-09 13:42
marcanthen under that MFD we'd have nodes for chip features#asahi-dev · 2022-02-09 13:42
marcanjust for reference, this is an SPMI device and I'm actually just making a generic SPMI regmap MFD driver because there's already two that are almost like that and it's silly to keep reinventing that stub driver wheel for every manufacturer#asahi-dev · 2022-02-09 13:40
marcanif PM_SETTING is handled by another node, then it either needs to overlap RTC or RTC needs to have a hole in it#asahi-dev · 2022-02-09 13:40
marcan0x0000D002 RTC#asahi-dev · 2022-02-09 13:40
marcan0x0000D001 PM_SETTING#asahi-dev · 2022-02-09 13:40
marcan0x0000D000 ALARM_CTRL