#
…

2022-02-09

00:07nyx_o has quit [Quit: WeeChat 3.3]
00:08thermoblue[m] has joined #asahi-dev
00:14user982492 has joined #asahi-dev
00:26yuyichao has joined #asahi-dev
01:21jbowen has joined #asahi-dev
01:30jbowen has quit [Ping timeout: 480 seconds]
01:51rowang077[m] has quit [Server closed connection]
01:51rowang077[m] has joined #asahi-dev
02:03jbowen has joined #asahi-dev
02:19JuniorJPDJ has quit [Server closed connection]
02:20JuniorJPDJ has joined #asahi-dev
02:31perigoso[m] has quit [Server closed connection]
02:32perigoso[m] has joined #asahi-dev
03:29kov has quit [Quit: Coyote finally caught me]
03:29kov has joined #asahi-dev
03:54nyx_o has joined #asahi-dev
03:55phiologe has joined #asahi-dev
03:59PhilippvK has quit [Ping timeout: 480 seconds]
04:05psykose has quit [Remote host closed the connection]
04:10psykose has joined #asahi-dev
04:33user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:38sheepgoose has joined #asahi-dev
04:39user982492 has joined #asahi-dev
05:05the_lanetly_052__ has joined #asahi-dev
05:24petermlyon[m] has joined #asahi-dev
05:25ar88kk[m] has quit [Server closed connection]
05:25ar88kk[m] has joined #asahi-dev
05:25davay[m] has joined #asahi-dev
05:27DanielHuisman[m] has joined #asahi-dev
05:28Emantor[m] has joined #asahi-dev
05:28Liam[m] has joined #asahi-dev
05:28Ferluci[m] has joined #asahi-dev
05:29fried_dede[m] has joined #asahi-dev
05:30javier_varez[m] has quit [Server closed connection]
05:30javier_varez[m] has joined #asahi-dev
05:30lovesegfault has quit [Server closed connection]
05:30lovesegfault has joined #asahi-dev
05:32HaoYanQi[m] has quit [Server closed connection]
05:32HaoYanQi[m] has joined #asahi-dev
05:32DanStrong[m] has quit [Server closed connection]
05:32DanStrong[m] has joined #asahi-dev
05:33peerp[m] has quit [Server closed connection]
05:33peerp[m] has joined #asahi-dev
05:33RasmusEneman[m] has quit [Server closed connection]
05:33RasmusEneman[m] has joined #asahi-dev
05:33pulpy_orange2[m] has quit [Server closed connection]
05:33pulpy_orange2[m] has joined #asahi-dev
05:33retonlage[m] has quit [Server closed connection]
05:33retonlage[m] has joined #asahi-dev
05:34sikkileo[m] has quit [Server closed connection]
05:34sikkileo[m] has joined #asahi-dev
05:35spot[m] has quit [Server closed connection]
05:35spot[m] has joined #asahi-dev
05:35Synth[m] has quit [Server closed connection]
05:36Synth[m] has joined #asahi-dev
05:36uur[m] has quit [Server closed connection]
05:36uur[m] has joined #asahi-dev
05:37GregoryRWarnes[m] has quit [Server closed connection]
05:37GregoryRWarnes[m] has joined #asahi-dev
05:37xiaomingcc[m] has quit [Server closed connection]
05:37xiaomingcc[m] has joined #asahi-dev
05:37Xichao[m] has quit [Server closed connection]
05:37Xichao[m] has joined #asahi-dev
05:37YichaoYu[m] has quit [Server closed connection]
05:37YichaoYu[m] has joined #asahi-dev
06:25jeffmiw has joined #asahi-dev
07:01msmith12[m] has quit [Server closed connection]
07:01msmith12[m] has joined #asahi-dev
07:04zbotpath[m] has quit [Server closed connection]
07:04zbotpath[m]1 has joined #asahi-dev
07:16user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:22arekm has quit [Quit: leaving]
07:22arekm has joined #asahi-dev
07:39MajorBiscuit has joined #asahi-dev
07:46Major_Biscuit has joined #asahi-dev
07:48MajorBiscuit has quit [Ping timeout: 480 seconds]
09:34CDFH has joined #asahi-dev
09:51marcanjeffmiw: I want to get it wrapped up this week, but I think at this point it's going to be a bit of a rewrite given what we found out about how the different PMUs should be unified
09:52marcanfor the SPMI MFD driver I'm outright making a generic one a la simple-mfd-i2c, because it's silly having what is basically an empty driver for just apple
09:52marcanthe RTC and power control stuff will have to change to use reg properties to know where things are, since it changes from PMU to PMU
09:54marcanas for the SPMI driver, it's kind of barebones at the moment and I want to whether it makes sense to make it interrupt-driven or not; it could use a bit of reverse engineering to narrow things down
09:59kettenismy OpenBSD is based on what I learned from the corellium code, but for the functionality I implemented it made enough sense for me to not explore things much further
10:00kettenisbut proper RE is always welcome ;)
10:36marcankettenis: https://mrcn.st/p/XgcR64lQ the ADT nodes, parsed a bit less horribly
10:37marcanlooks like rtc, alarm being consecutive at least is consistent
10:37marcanhope we can rely on that one
10:38marcanhoweverm, the other regs differ
10:38marcancontrol etc
10:40marcanrobher: 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
10:40marcanwe could do the same with custom properties, or with a bunch of reg ranges, one per register (named in reg-names)
10:40marcanor we could just use the compatible, but it's a bit sad if we can't support even basic RTC functionality in future hardware
10:41marcanor 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
10:41marcan(until explicitly supported)
10:52marcanhttps://mrcn.st/p/VkC9Umqd offsets a bit more readable
10:52marcanso there are some groups that seem to stick together, but n=2
10:54kettenisand you need at least n=3 for proper statistics ;)
10:55marcanlet me dig up other device trees ;)
10:57marcanthankfully iDevices are a thing
11:07marcanthat suggests the pattern that the irq pair is adjacent and RTC/ALARM are adjacent holds
11:07marcanbut that's about it
11:08marcanthey sure do like moving registers around
11:23ketteniswonder if these registers are real hardware registers or just SRAM that's updated by the firmware
11:26kettenisif it is the latter, the firmware team didn't get the memo ;)
11:31the_lanetly_052__ has quit [Ping timeout: 480 seconds]
11:38int16h has quit [Remote host closed the connection]
11:41marcanI think they're real registers
11:41marcanthe offset is just scratch RAM though, which is why it was separate from the RTC on older chips
11:41marcanseems that was introduced recently
11:41marcanmaverick I guess made it into part of the RTC component
11:47kettenisI agree that having the basic RTC and shutdown support generic would be nice to have
11:48kettenisalmost asks for implementing the RTC alarm stuff as a separate subnode
11:55marcanshutdown would be generic, since that seems to be a scratch area and always the same offset/bit
11:56marcanI don't know about splitting off alarm though, that's logically part of RTC
11:56marcanit 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
11:56marcanand that would be used as a fallback
12:59gladiac is now known as Guest80
12:59gladiac has joined #asahi-dev
13:05Guest80 has quit [Ping timeout: 480 seconds]
13:18robhermarcan: EFI provides a RTC protocol, right?
13:20marcanthat it does
13:20marcanare you suggesting we do all the RTC stuff in EFI?
13:20marcanthat 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...
13:21marcanit 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
13:21robherthat would solve the future h/w support issue, but sharing generally doesn't work with EFI...
13:22marcanyeah... 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
13:22marcanand the SMC sharing thing would be a bit of a hack at the very least
13:22robherAre all the masks consistent or you need properties for those too?
13:23marcanyou 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
13:23marcanwe could do the middle ground thing and just have props for RTC time and RTC offset, to at least make the RTC work
13:23marcanand say alarm support needs an up to date driver
13:23marcanthose two are consistent AFAICT
13:24marcanjust the offset changes
13:25robherI'm okay with the offsets in 'reg' if you want to go that route.
13:27marcanso something like reg-names = "rtc", "time", "offset"; where rtc covers everything and the other two are just those two registers?
13:27marcanand then the generic driver would only use those
13:28marcanand we'd have compatibles like "apple,maverick-pmu-rtc", "apple,spmi-pmu-rtc"
13:28robherhumm, it would be a bit odd if the reg entries overlap themselves.
13:29marcanthey kind of have to in this kind of case, unfortunately
13:31robherare the rtc regs interleaved with other things?
13:32marcanthere's some irq/pm setting stuff that I'm not sure about yet
13:32marcanthey do not overlap the LEG_SCRPAD which is the other area which will have a driver at this point (to make shutdown work)
13:33marcanand I *might* guess that some implementation *could* put the RTC offset in a random scratchpad that's not part of the RTC block
13:33marcanin which case the offset reg would just not overlap rtc for those chips
13:33marcanif we need to split things up in the future we could add more reg names, like an associated scratchpad
13:37marcanahh, looks like "pm setting" might be the "restart on power loss" flag
13:38robherYou might want to have a mfd type node with rtc being a child node. I don't think having something like 'reg = <4 4>, <20 4>, <0 0x1000>;' would be a good idea. If you have that, I'd just have a custom offsets property with the offsets you need.
13:38marcanthat's what we're doing now
13:39marcanthe 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?)
13:39marcanand sure, I could just do two custom properties for the two fallback offsets
13:40robherWith an MFD node, it would define the full range of the block and then the child nodes define reg within the MFD range, but not overlapping with child node 'reg'.
13:40marcanhm, but then RTC would end up chopped into bits
13:40marcan0x0000D000 ALARM_CTRL
13:40marcan0x0000D001 PM_SETTING
13:40marcan0x0000D002 RTC
13:40marcanif PM_SETTING is handled by another node, then it either needs to overlap RTC or RTC needs to have a hole in it
13:42marcanjust 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
13:42marcanthen under that MFD we'd have nodes for chip features
13:45arndMaking it an MFD is probably the most flexible, but if this is still conceptually just an RTC with some extra bits, I would make it a single node and a single driver that registers to the RTC subsystem and that also provides some other in-kernel interfaces.
13:46arndthe question is whether this device is conceptually one main function with a few extra bits, or you would think of it as a collection of individual interfaces that are all equally important
13:46marcanit's a PMU, it does lots of things, but *most* of those are managed by SMC
13:46marcanbut not all, thanks apple
13:46marcanhence why we need to talk to some little bits directly
13:47marcanit has regulators, analog inputs, temperature inputs, GPIO, RTC, and even runs firmware (cortex-m0 or something)
13:47marcanbut 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
13:47marcannor do I know if the pm setting stuff is tweakable via SMC
13:48arndDoes a regmap based interface fit, where you only provide a set of registers to each child node, or does the main driver also need to talk to it directly?
13:48robherI have to wonder if Apple wasn't disciplined enough for consistent register offsets, is the rest of the h/w functionality consistent? The answer for most vendors is very much a NO.
13:49marcanwell, they do have one driver themselves with all the offsets in the ADT
13:49marcanand I haven't seen the driver inspect the PMU model or compatible to make decisions yet
13:51marcanthere is also, uh, something related to bluetooth somehow that interacts with this
13:55marcanpatent 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
13:57marcanah, but that might be for iphones only
13:57marcanso we don't care
13:57marcanthere is some bluetooth subsystem interaction though, somehow
13:58alyssamarcan: You don't want Exposure Notifications on your MacBooks???
13:58robhermarcan: BTW, are you aware of power/reset/syscon-poweroff.yaml? Might be useful for shutdown here.
13:58alyssaWhat if you're exposed to COVID at a coffee shop with your Asahi Linux Mac and aren't vaccinated because it's still 2020 but there's definitely Asahi Linux already
13:59marcanrobher: it's not *quite* that because it's not actually a poweroff trigger, it's a pre-poweroff trigger
14:00marcanthere's a dance that needs to happen between SMC and PMU, and it fits in nicely with that callback chain stuff
14:01marcanfirst 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
14:01marcanwithout the PMU poke it ends up rebooting instead
14:45yuyichao has quit [Ping timeout: 480 seconds]
15:03yuyichao has joined #asahi-dev
15:22kettenis has quit [Server closed connection]
15:22kettenis has joined #asahi-dev
15:28Andre[m]1 has quit [Server closed connection]
15:28Andre[m]1 has joined #asahi-dev
15:31Jamie[m]1 has quit [Server closed connection]
15:31Jamie[m]1 has joined #asahi-dev
15:45Hinata[m] has quit [Server closed connection]
15:45Hinata[m] has joined #asahi-dev
15:56ey3ball[m] has quit [Server closed connection]
15:56ey3ball[m] has joined #asahi-dev
16:09spokv[m] has joined #asahi-dev
16:14kettenismarcan: looks like the "CLKM" SMC key was introduced by Apple with some 12.x firmware
16:16Redecorating[m] has quit [Server closed connection]
16:16Redecorating[m] has joined #asahi-dev
16:21blassphemy[m] has quit [Server closed connection]
16:21blassphemy[m] has joined #asahi-dev
16:24rusty-nail[m] has quit [Server closed connection]
16:24rusty-nail[m] has joined #asahi-dev
16:25thasti has quit [Server closed connection]
16:25thasti has joined #asahi-dev
16:28BastienSaidi[m] has quit [Server closed connection]
16:28BastienSaidi[m] has joined #asahi-dev
16:37kovmarcan, could that LPEM thing be for bluetooth wake up? mac os has a setting for that
16:37marcannah, I think it's an iphone thing
16:40DmitrySboychakov[m]it's might be a helper for airpods. they connect it to iphones/macbooks really fast. might be UWB or that
16:55jbowen has quit [Ping timeout: 480 seconds]
17:07jbowen has joined #asahi-dev
17:18Major_Biscuit has quit [Ping timeout: 480 seconds]
17:18jbowen_ has joined #asahi-dev
17:22jbowen has quit [Ping timeout: 480 seconds]
17:27Nspace has quit [Server closed connection]
17:27Nspace has joined #asahi-dev
17:29jbowen_ has quit [Ping timeout: 480 seconds]
18:05jbowen has joined #asahi-dev
18:16marcan has quit [Server closed connection]
18:16marcan has joined #asahi-dev
18:19vafanlig1arde has quit [Server closed connection]
18:19vafanlignarde has joined #asahi-dev
18:19lonjil has quit [Server closed connection]
18:20lonjil has joined #asahi-dev
18:34zelig_[m] has quit [Server closed connection]
18:34zelig_[m] has joined #asahi-dev
18:39gladiac is now known as Guest111
18:39gladiac has joined #asahi-dev
18:42user982492 has joined #asahi-dev
18:45Guest111 has quit [Ping timeout: 480 seconds]
18:52mazmarcan: I'm starting queuing stuff for 5.18, so if you wanted to repost the fast-IPI stuff to reduce the queue, now would be the time! ;-)
18:55___nick___ has joined #asahi-dev
19:06thermoblue[m]I genuinely hope I can get to the point where I can not only comprehend but contribute to this sort of development
19:06thermoblue[m]I really do enjoy scripting but I can't even begin to understand reverse engineering a system to work for an operating system. I'd imagine you guys do a whole lot of work in C?
19:06thermoblue[m]Any information is appreciated
19:06thermoblue[m]* enjoy scripting, but
19:07thermoblue[m]* enjoy scripting, but, * engineering a closed system to, * for an open operating system.
19:09thermoblue[m]* is appreciated - resources in order to learn how to start, etc. etc.
19:15jbowen has quit [Quit: leaving]
19:18feeleep[m] has quit [Server closed connection]
19:18feeleep[m] has joined #asahi-dev
19:24minecrell has quit [Server closed connection]
19:24minecrell has joined #asahi-dev
19:35DmitrySboychakov[m] has quit [Server closed connection]
19:35DmitrySboychakov[m] has joined #asahi-dev
19:40DragoonAethis has quit [Quit: hej-hej!]
19:41DragoonAethis has joined #asahi-dev
19:46jbowen has joined #asahi-dev
20:00jeffmiwmarcan: ok. does that help if I try to do a bit re on te SPMI ? or do you see something else I can do to help ?
20:05LilleCarl[m] has quit [Server closed connection]
20:05LilleCarl[m] has joined #asahi-dev
20:05user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:29user982492 has joined #asahi-dev
20:39___nick___ has quit []
20:41___nick___ has joined #asahi-dev
20:43grange_c has joined #asahi-dev
20:48pg12 has quit [Server closed connection]
20:48pg12 has joined #asahi-dev
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:15TheLink has quit [Server closed connection]
21:15TheLink has joined #asahi-dev
21:17aleasto has quit [Server closed connection]
21:17aleasto has joined #asahi-dev
21:21BenPetterborg[m] has quit [Server closed connection]
21:21BenPetterborg[m] has joined #asahi-dev
21:26vimsos[m] has quit [Server closed connection]
21:26vimsos[m] has joined #asahi-dev
21:30jeffmiw has quit [Ping timeout: 480 seconds]
21:34FireFox317 has quit [Server closed connection]
21:36FireFox317 has joined #asahi-dev
21:42user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:45M1bn3mar[m] has quit [Server closed connection]
21:45M1bn3mar[m] has joined #asahi-dev
22:27user982492 has joined #asahi-dev
22:38mixi has quit [Server closed connection]
22:38mixi has joined #asahi-dev
22:43eragon has quit [Server closed connection]
22:43eragon has joined #asahi-dev
23:22Deewiant has quit [Server closed connection]
23:22Deewiant has joined #asahi-dev
23:48commandoline_ has quit [Quit: Bye!]
23:49commandoline has joined #asahi-dev
…