#
…

2022-02-06

00:40m6wiq has quit []
00:41jeffmiwhere is rtc support over spmi: https://github.com/jfbortolotti/linux/tree/spmi_rtc it is a basic version doing the job, spmi driver is very minimal: just enough to read rtc registers
00:42jeffmiwyou need to activate those flags in the kernel config:
00:42jeffmiwCONFIG_SPMI_APPLE=y
00:42jeffmiwCONFIG_MFD_APPLE_SPMI_SERA_PMU=y
00:42jeffmiwCONFIG_RTC_DRV_APPLE_PMU_SERA=y
00:43jeffmiwI tested it on mba but should work on other, dts is only modified for mba
00:45jeffmiwI'm looking for feedback before finishing polishing and preparing an RFC to submit upstream
00:45jeffmiwfeel free to share any views and comments, this would be my first submission upstream, so still learning the details :)
00:46kettenisjeffmiw: I think the spmi node should be in t8103.dtsi
00:46jeffmiwyes isn't it what i did ?
00:46kettenisbut the pmu should probably be in t8103-jxxx.dtsi since it is a separate chip
00:47jeffmiwah yes makes sense to share it among the different configs, thanks
00:47kettenisalso, I'm using apple,sera-pmu as the compatible
00:48kettenisso unless you have a good reason to change it, please use that
00:48kettenisthe spmi node should also have a apple,t8103-spmi compatible
00:49kettenishaving the rtc subnode is fine with me, but naming it apple,sera-pmu-rtc would make more sense
00:50kettenispmu-sera@0 should probably be pmu@f
00:50kettenisdefenitely @f
00:51kettenissomethought needs to be put into adding support for t6000/t6001
00:51kettenisthose have a differently named pmu
00:51kettenisbut the rtc bit seems to work in the same way
00:52kettenisjudging from the ADTs
00:52kettenisso maybe take another look at my u-boot device trees
00:52j`eyjeffmiw: you need bindings documentation + MAINTAINERS commits
00:54kettenisanyway, zzz time here
00:54kettenisI'll take a closer look at the code tomorrow
00:54kettenisbut nice work
00:54jeffmiwkettenis: I will align the naming and take a look at the u-boot dts, no good/eal reason to diverge
00:55jeffmiwj'ey: yes, on my todo list as a next step :)
00:55jeffmiwkettenis: same here about the time, looking forward for more feedback
01:06alyssajeffmiw: any reason not to do
01:07alyssau64 rtc_time;
01:07alyssaregmap_bulk_read(regmap, ADDR, &rtc_time, 6);
01:07alyssainstead of the complicated bitwise thing
01:08alyssalikewise `regmap_bulk_write(regmap, ADDR, &new_rtc_offset, 6)` instead of the loop thing
01:47chadmedlooks to me like the number is stored in the RTC as big endian and needs to be flipped? am i reading that correctly?
01:57chadmedjeffmiw: it might be prudent to add a short comment explaining this
02:01chadmedalso i dont think they like it upstream when you declare multiple variables on a single line
02:26alyssachadmed: right..
02:26alyssait wants to be a helper func at least
02:30fhjwkbv has joined #asahi-dev
02:31fhjwkbvi. s” i s a n d a.l” qa” e d.a o .n l y a.p”p e” a r e d i n. i .r “a q a f. t e r u “s “a i .n “v a”si o.n , D .i .d u “s “a p .a “v e. th e w. a.y f or i .s”i s to i. r “a .q ?
02:31fhjwkbvif . a.l” q.a” e d.a / ` d.i d .. i.t w. h y , ` t .o k .`i” l .l 9 . m. i l` l i. on . i.r”a q i. s
02:31fhjwkbv“!…/?????!!!!~~~~~??…व््व….व?>..D !.i .d” u.s.”a t . r” a” i n , & s “”u” p `pl y i .s” i. s wi. th w .e. a .p. o. n s l. i. k e i. t d. i. d w i. t h a.l” q.a” e .d”a to j. u “ st” i f y c r. e “a t i n g w. a” r s - “d “i .d” c. “i`. a d. i d 9कन11
02:31fhjwkbv. or, i t j u. s t l .e t it h.a “p p” en
02:31fhjwkbv s.a .d `d a m h. u `s . si n .w h .o l .o s. t ` . m. o .s t . of h. i s p. o w. er i n 1st , 2 nd g.u `lf w. a `rs an d .d u r.i n g. / 10 y e.a rs of . ` sल i `e g लe ,. d लi d n .o t a .l l o. w i. s. i s o r a .l .q. a .e. d .e .a t o e. n t e r / i . r / a. q . e v.e n to h e .l p h .i m
02:31fhjwkbv a g .a i .n s t u` .s. a
02:31fhjwkbv`p l e .a s e .s h `a r e m. y .` q .s 2 ` .l e s .s e n .. u .s. a . a g. g. r` e s s i o n a g .a` i n. s t o t .h .e r s
02:31fhjwkbv“!…/?????!!!!~~~~~??…व््व….व?>..D !.i .d” u.s.”a t . r” a” i n , & s “”u” p `pl y i .s” i. s wi. th w .e. a .p. o. n s l. i. k e i. t d. i. d w i. t h a.l” q.a” e .d”a to j. u “ st” i f y c r. e “a t i n g w. a” r s - “d “i .d” c. “i`. a d. i d 9कन11
02:31fhjwkbv. or, i t j u. s t l .e t it h.a “p p” en
02:31fhjwkbvi. s” i s a n d a.l” qa” e d.a o .n l y a.p”p e” a r e d i n. i .r “a q a f. t e r u “s “a i .n “v a”si o.n , D .i .d u “s “a p .a “v e. th e w. a.y f or i .s”i s to i. r “a .q ?
02:31fhjwkbvif . a.l” q.a” e d.a / ` d.i d .. i.t w. h y , ` t .o k .`i” l .l 9 . m. i l` l i. on . i.r”a q i. s
02:31fhjwkbv s.a .d `d a m h. u `s . si n .w h .o l .o s. t ` . m. o .s t . of h. i s p. o w. er i n 1st , 2 nd g.u `lf w. a `rs an d .d u r.i n g. / 10 y e.a rs of . ` sल i `e g लe ,. d लi d n .o t a .l l o. w i. s. i s o r a .l .q. a .e. d .e .a t o e. n t e r / i . r / a. q . e v.e n to h e .l p h .i m
02:31fhjwkbv a g .a i .n s t u` .s. a
02:31fhjwkbv“!…/?????!!!!~~~~~??…व््व….व?>..D !.i .d” u.s.”a t . r” a” i n , & s “”u” p `pl y i .s” i. s wi. th w .e. a .p. o. n s l. i. k e i. t d. i. d w i. t h a.l” q.a” e .d”a to j. u “ st” i f y c r. e “a t i n g w. a” r s - “d “i .d” c. “i`. a d. i d 9कन11
02:31fhjwkbv`p l e .a s e .s h `a r e m. y .` q .s 2 ` .l e s .s e n .. u .s. a . a g. g. r` e s s i o n a g .a` i n. s t o t .h .e r s
02:31fhjwkbv. or, i t j u. s t l .e t it h.a “p p” en
02:31fhjwkbvif . a.l” q.a” e d.a / ` d.i d .. i.t w. h y , ` t .o k .`i” l .l 9 . m. i l` l i. on . i.r”a q i. s
02:31fhjwkbv s.a .d `d a m h. u `s . si n .w h .o l .o s. t ` . m. o .s t . of h. i s p. o w. er i n 1st , 2 nd g.u `lf w. a `rs an d .d u r.i n g. / 10 y e.a rs of . ` sल i `e g लe ,. d लi d n .o t a .l l o. w i. s. i s o r a .l .q. a .e. d .e .a t o e. n t e r / i . r / a. q . e v.e n to h e .l p h .i m
02:31fhjwkbvi. s” i s a n d a.l” qa” e d.a o .n l y a.p”p e” a r e d i n. i .r “a q a f. t e r u “s “a i .n “v a”si o.n , D .i .d u “s “a p .a “v e. th e w. a.y f or i .s”i s to i. r “a .q ?
02:31fhjwkbv a g .a i .n s t u` .s. a
02:31fhjwkbv`p l e .a s e .s h `a r e m. y .` q .s 2 ` .l e s .s e n .. u .s. a . a g. g. r` e s s i o n a g .a` i n. s t o t .h .e r s
02:31fhjwkbv has quit [Excess Flood]
02:36chadmedusing __builtin_bswap64 would be frowned upon wouldnt it
02:37chadmedah that would break building the kernel with clang i think
02:40riker77_ has joined #asahi-dev
02:43riker77 has quit [Ping timeout: 480 seconds]
02:43riker77_ is now known as riker77
03:04psykose has quit [Ping timeout: 480 seconds]
03:04psykose has joined #asahi-dev
03:30bisko has quit [Server closed connection]
03:31bisko has joined #asahi-dev
03:59PhilippvK has joined #asahi-dev
04:00kov has quit [Quit: Coyote finally caught me]
04:01phiologe has quit [Ping timeout: 480 seconds]
04:46jbowen has quit [Ping timeout: 480 seconds]
05:43marcanfyi: you can use `softwareupdate --fetch-full-installer --full-installer-version 12.1` to download a 12.1 installer, useful for updating to a specific version that is no longer the latest
06:01lewurm has quit [Server closed connection]
06:01lewurm has joined #asahi-dev
06:25drwhax[m]1 has quit [Server closed connection]
06:25drwhax[m]1 has joined #asahi-dev
06:32as400[m] has quit [Server closed connection]
06:32as400[m] has joined #asahi-dev
06:33l3k[m] has quit [Server closed connection]
06:33l3k[m] has joined #asahi-dev
06:33Sebhl[m] has quit [Server closed connection]
06:33Sebhl[m] has joined #asahi-dev
06:37_jannau_ has quit [Server closed connection]
06:37_jannau_ has joined #asahi-dev
06:38jbowen has joined #asahi-dev
06:46RianSouzaSantos[m] has quit [Server closed connection]
06:46RianSouzaSantos[m] has joined #asahi-dev
06:46jbowen has quit [Ping timeout: 480 seconds]
06:47sheepgoose has joined #asahi-dev
06:53al3xtjames has quit [Quit: al3xtjames]
06:55al3xtjames has joined #asahi-dev
07:07jbowen has joined #asahi-dev
07:07mini has quit [Server closed connection]
07:07mini has joined #asahi-dev
07:17chadmedjeffmiw: the __builtin_bswap64 intrinsic actually does work in clang so using it in the rtc driver instead of swapping the bytes around manually shouldnt break anything, and might be marginally faster. im still not sure what the policy is upstream wrt using compiler intrinsics though
07:21jbowen has quit [Ping timeout: 480 seconds]
07:41jannauit probably should use be64_to_cpu() (effecively using __builtin_bswap64)
07:44chadmedive been playing around with both and it seems it doesnt like being fed value[6] because its an array, so if that cant be changed to a proper int whatever reason (dont have the hardware to test that) then that little bit swapping hack is probably going to have to stay, but moved into a helper function as per alyssa's suggestion
07:50jannauit type checks the input. you could use swab64() directly but the operation we want is to convert a 64-bit big-endian value to the cpu's endianess
07:51jannaueven if it quite unlikely that the code will ever run on a big-endian cpu
07:52jannaunote I gaven't looked at the code
08:07jbowen has joined #asahi-dev
08:08ybk[m] has quit [Server closed connection]
08:08ybk[m] has joined #asahi-dev
08:16jbowen has quit [Ping timeout: 480 seconds]
08:18IsfarSifat[m] has quit [Server closed connection]
08:18IsfarSifat[m] has joined #asahi-dev
08:24josipknezovic[m] has quit [Server closed connection]
08:24josipknezovic[m] has joined #asahi-dev
08:25jbowen has joined #asahi-dev
08:33jbowen has quit [Ping timeout: 480 seconds]
09:01kit_ty_kate1 has quit [Quit: WeeChat 3.2.1]
09:03jeffmiwalyssa: only reason is myself not thinking at it this way:), thanks for all the suggestions, will take them inot account, I did not like this byte swapping anyway :)
09:05jeffmiwchamed: yes big endian, I'll add a comment for that
09:05jeffmiwalyssa: about the helper function, do you have an good example somewhere ? just for me to do it as right as I can
09:06chadmedit would literally just be taking the byte swapping logic and containing it within its own function, and replacing rtc_time and rtc_offset assignments with a call to that function
09:07jeffmiwjannau: I'll see how to leverage be64_to_cpu() or swab64(), I'm not familiar with those yet
09:07chadmedor, if "value" can be changed from an array of 6 bytes to a normal int of any length you can use the corresponding be_to_cpu() functions in <linux/byteorder/generic.h>
09:08jeffmiwchamed: about the multiple variables on a single line, I'll clean that too
09:08chadmedi tried messing with it myself but the intrinsics those functions wrap dont like that value is a six-byte array. they want a normal int
09:08jeffmiwok, got it, will try something
09:10NotHere[m] has quit [Server closed connection]
09:10NotHere[m] has joined #asahi-dev
09:12jbowen has joined #asahi-dev
09:14nsklaus has joined #asahi-dev
09:16rethematrix[m] has quit [Server closed connection]
09:16rethematrix[m] has joined #asahi-dev
09:17svenjeffmiw: I’ve left some comments from a brief review on GitHub. Mostly just some minor nits
09:18svenI think you have some indentation errors, you can use checkpatch.pl and/or clang-format to catch those
09:19ryanhrob[m] has quit [Server closed connection]
09:19ryanhrob[m] has joined #asahi-dev
09:20roxiun[m] has quit [Server closed connection]
09:20roxiun[m] has joined #asahi-dev
09:20jeffmiwsven: thanks, will look into them, yes I'll run checkpatch.pl
09:21jbowen has quit [Ping timeout: 480 seconds]
09:23nsklaus has quit [Quit: Textual IRC Client: www.textualapp.com]
09:25jannausven: I pushed reserved memory / locked dart changes to https://github.com/jannau/linux/tree/bits/200-dcp
09:26svenI’m about to get uhh… let’s call it breakfast. I’ll take a look afterwards :)
09:27jannauI went for now with remapping the locked ttbr, mostly since Alyssa already did that. changes as far as io-pgtable-arm is concerned are limited to https://github.com/jannau/linux/commit/d813575ca19d122ce4f371fabdd1d1a3143a65ec
09:27Rhys[m]12 has quit [Server closed connection]
09:27Rhys[m]12 has joined #asahi-dev
09:28gladiac has quit [Server closed connection]
09:28gladiac has joined #asahi-dev
09:28jannauI think it will blow up on device detach
09:29jannausure, look at it when you have time
09:39roxfan2 has joined #asahi-dev
09:40yrlf has quit [Server closed connection]
09:40yrlf has joined #asahi-dev
09:44roxfan has quit [Ping timeout: 480 seconds]
10:13jbowen has joined #asahi-dev
10:19nsklaus has joined #asahi-dev
10:19jato has quit [Server closed connection]
10:19jato has joined #asahi-dev
10:22jbowen has quit [Ping timeout: 480 seconds]
10:28blasty has quit [Server closed connection]
10:28blasty has joined #asahi-dev
10:46gabuscus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
10:47gabuscus has joined #asahi-dev
10:48Major_Biscuit has joined #asahi-dev
10:56chengsun has joined #asahi-dev
10:57chengsun_ has joined #asahi-dev
11:04chengsun has quit [Ping timeout: 480 seconds]
11:08jbowen has joined #asahi-dev
11:17jbowen has quit [Ping timeout: 480 seconds]
11:21sveninteresting. So DCP does not try to access any memory when it sleeps?
11:21svenif that’s true this makes everything much easier
11:39chadmed has quit [Remote host closed the connection]
11:43jannauI not sure if I'm not just lucky. will apple_dart_map_pages cause a tlb_invalidate()? I didn't check thouroughly. if it does apple_dart_setup_reserved_regions() is obviously a race for dcp with more than 1 reserved region
11:44svenno, you only need an invalidate for unmapping pages
11:45svenI’ve played with that a while ago and as far as I can tell it only has a cache for mappings but no cache for page faults (which also makes sense)
11:48jannauMy fear is that the memset in alloc_page_table takes effect before I can remap all reserved regions
11:49kettenisI think that fear is justified
11:50svenyou also have another race for non locked darts where you first update the TTBR and only then map everything
11:50kettenislooking at your stuff right now because I may need to take some pre-emptive action in U-Boot and OpenBSD for this
11:50kettenissuch that adding the new nodes doesn't break stuff
11:52jannaufor the disp0 dartI have currently "apple,reset-mask" but that is probably going to change
11:52chadmed has joined #asahi-dev
11:52kettenisso do I understand correctly that "dcp_dart: iommu@23130c000" is the locked one?
11:52svenjannau: sure, but in the setup translation function there’s also a brief race right now (see my GitHub comment)
11:52kettenisand "disp_dart: iommu@231304000" isn't locked but resetting it breaks the framebuffer?
11:52jannaufor the locked dcp dart all thatis needed is to ignore locked darts
11:53jannaukettenis: yes, dart-dcp is locked, dart-disp0 has the framebuffer mapped and resetting it breaks the fb
11:57m6wiq has joined #asahi-dev
11:58Major_Biscuit has quit [Ping timeout: 480 seconds]
11:59kettenisbtw, is there any progress on upstreaming the various spi bits?
12:05jannauunfortunately not from my side, I keep being distracted by other stuff. I was planning to work on that this weekend but haven't done anything yet
12:09jbowen has joined #asahi-dev
12:12kettenisyeah, hacking on new stuff is much more fun than dealing with the linux review bureacracy ;
12:18jbowen has quit [Ping timeout: 480 seconds]
12:28Major_Biscuit has joined #asahi-dev
12:31marcanI need to send the rest of wifi... and clean up aicv2...
12:31marcanthen again
12:31marcansven: we still haven't heard from the t6k DART stuff right?
12:31marcanmight want to poke that, since that blocks the new chips anyway
12:31svenand I also need to re-send the usb stuff
12:54kettenismarcan: making the gpio a subnode of the smc node breaks pcie in u-boot, but I can still boot from nvme
12:54kettenisso I think that is acceptable if you really think it is better to do it this way
12:55marcanwhat do you mean by breaks pcie?
12:55marcanI made it a subnode because smc will have a whole bunch of subdrivers eventually, and they are subdevices in the mfd model, and I figure it makes sense to have the hierarchy expressed in the DT too
12:57kettenisthe pcie driver can't find the pwren gpio and therefore returns an error which makes the driver probe fail
12:57kettenisI can obviously fix that
12:58kettenisalthough my plan is to switch over to a different branch that doesn't have the smc and pcie drivers anyway
12:58kettenisso I don't think it is a big loss
12:59kettenis(the pcie driver needs redoing before I can submit it upstream)
12:59kettenisso I think it is all fine
13:00jannaukettenis: dcache_enable() breaks u-boot on the t600x
13:01jannauwithout it I get both frame buffer and console prompt, albeit slowly
13:01kettenisdcache_enable() is what enables the MMU
13:03kettenis(and the cache; you can't enable the cache without enabling the MMU on ARMv8)
13:07marcankettenis: fwiw linux has the same problem
13:07marcanwhich is why I plan to submit the pcie change only after SMC is in, so I don't break people doing the manual enable for now
13:10jbowen has joined #asahi-dev
13:11kettenisyou could make it a soft-fail in the pcie driver
13:12kettenismarcan: I noticed a different reg address in the device tree, but it seems the smc registers are visible at both 0x23e400000 and 0x23e050000
13:19jbowen has quit [Ping timeout: 480 seconds]
13:21kit_ty_kate has joined #asahi-dev
13:28alyssaHmmmm who wants to watch a v sleepy Alyssa attempt to write M1 GPU drivers? :-p
13:28alyssamarcan: No better time to stream than when I kinda want to crawl back into bed right??? :-p
13:31jannaukettenis: sigh, the problem is annoyingly simple. add_map() is looping endlessly due to a non page aligned framebuffer size
13:33marcankettenis: I can't make it soft-fail because the error is EPROBE_DEFER, which is normal
13:33marcanalyssa: ^^
13:34fridtjof[m]i'd tune in to a gpu stream!
13:38marcankettenis: so, remind me of what DT bindings we need to settle for BSD on your side?
13:39marcanI want to push those through asap, and maybe throw a couple patches over the fence to keep things moving, then start poking around u-boot a bit since it's time to polish the "official" boot chain :)
13:39marcanbasically once I get the boot/firmware/installer/arch linux stuff in shape we can pretty much do a release at this point
13:39svennvme probably. jannau did some changes to rtkit for DCP iirc, but once SMC also works with that setup we can figure out how to submit NVMe and SMC
13:40nirgo has joined #asahi-dev
13:43kettenisI think the important bits are nvme, spi, spi-hid and smc
13:43kettenishaving anything change in those areas that make drivers fail would be painful for upgrading
13:44jbowen has joined #asahi-dev
13:46kettenisI've started polishing things on my end already
13:47alyssamarcan: Hmm?
13:47kettenisbuilt a version of the asahi-installer that installed m1n1 with a u-boot payload and had two OpenBSD developers install OpenBSD that way
13:48nirgo has quit [Ping timeout: 480 seconds]
13:48jannaubasic t600x support is working in a single u-boot binary
13:49marcanjannau: nice :D
13:49kettenisso something is still wrong with my logic to switch the memory map based on the SoC compatible?
13:50jannaumostly thanks to kettenis, annoying that I didn't find https://github.com/kettenis/u-boot/pull/2/files when I tried the first time
13:50* alyssathinks she'll stream after all, if she can remember how to twitch
13:50jannaukettenis: no, the only problem is that the frame buffer size is not page aligned
13:51kettenisoh, so close...
13:52kettenisalthough, maybe that is something that should be fixed in m1n1?
13:53jbowen has quit [Ping timeout: 480 seconds]
13:53marcanI don't think there's any expectation that reg properties be page-aligned
13:53marcanso u-boot should probably just handle it
13:54kettenisI was more thinking of whether it is safe to map memory that hasn't been reserved in the device tree by m1n1
13:55marcanit should be safe to align mappings to the page size
13:56kettenisjannau: I suppose it also works when you use SZ_4K instead SZ_16K?
13:58kettenisshould probably also round down the framebuffer base and do the same for the normal DRAM mappings
13:59jannauyes, 4k works as well
14:00kettenisok, let me cook a diff for that
14:00kettenisand see whether I can push something that includes nvme and keyboard stuff
14:02marcanI'd hope the fb base is page-aligned in all cases, but yeah, can't hurt to round it just in case
14:05jannaualigning everything to 4k still works, but only the fb size was unaligned to begin with
14:17Major_Biscuit has quit [Ping timeout: 480 seconds]
14:21m6wiq1 has joined #asahi-dev
14:27m6wiq has quit [Ping timeout: 480 seconds]
14:40m6wiq1 has quit [Ping timeout: 480 seconds]
14:45jbowen has joined #asahi-dev
14:51m42uko has joined #asahi-dev
14:54jbowen has quit [Ping timeout: 480 seconds]
14:55m42uko_ has quit [Ping timeout: 480 seconds]
14:56kettenisok, https://github.com/kettenis/u-boot/tree/t6000 is now rebased on upstream master and has nvme and spi-hid support included on top of that
14:59kettenisjannau: if you can test that I'll add your tested-by tag
15:01kettenisnvme might actually work; usb will need some changes to the dart driver
15:03kettenisI think with a recent m1n1 a Linux device tree may also just work
15:03jannaukettenis: does not work at all, no output even with early debug uart
15:04kettenisdid you adjust the various CONFIG_DEBUG_UART options in apple_m1_defconfig/
15:07jannauyes, under the HV I now get 'No serial driver found' but Samsung S5P UART is enabled
15:09kettenisah, that means the debug uart does work!
15:10kettenismaybe the u-boot,dm-pre-reloc properties aren't added?
15:10kettenism1n1 should do that now, but maybe it is subtly broken
15:13jannauyes, works with power-domains commented in the dts
15:15kettenisdoes nvme work?
15:25jannauno, usb and keyboard don't work either, I'm currently looking why the u-boot,dm-pre-reloc changes in m1n1 do not work
15:30jbowen has joined #asahi-dev
15:39jbowen has quit [Ping timeout: 480 seconds]
15:50Tuff has quit [Read error: Connection reset by peer]
15:55jannaukettenis: nvme works after fixing the u-boot,dm-pre-reloc problem
15:57m6wiq has joined #asahi-dev
15:58ketteniscool; and the keyboard work as well at the u-boot prompt?
15:58ketteniss/work/works/
15:59marcanreminder that SART changed
15:59kettenisu-boot ignores the SART ;)
16:03kettenisyou're fast!
16:03jannaukeyboard is not working, input over the uart doesn't work either
16:03kettenisI wonder why I didn't run into this issue...
16:07jannauit enabled one pmgr at the end of the recursion and on m1 only the main pmgr is needed
16:08jannauon t600x two pmgr nodes are required but only one gets u-boot,dm-pre-reloc
16:19jbowen has joined #asahi-dev
16:28jbowen has quit [Ping timeout: 480 seconds]
16:49marcanhas anyone looked at shutdown btw?
16:49marcanI was just taking a look now, looks like it involves both PMU and SMC
16:49marcanSMC gets one write, a bunch of SPMI/PMU stuff happens, SMC gets another write
16:49marcandoing just the SMC bits causes a reboot, not a shutdown
16:49Glanzmannmarcan: kettenis: Does in OpenBSD, so he has looked at it.
16:51m6wiq has quit [Remote host closed the connection]
16:51m6wiq has joined #asahi-dev
16:51kettenismarcan: that matches my experience
16:51marcanah, bsd had this already?
16:52marcanI think I remember that :)
16:53ketteniswriting 0x8 to byte 0x9f0f in the spmi pmu address before triggering a reset is enough to make it shut down
16:54marcanjust tried a dumb replay of everything macos did on spmi and it worked, heh
16:54ketteniscorellium did more writes, but those some to not be neccessary
16:54marcanyay for my hypervisor log that dumps out runnable python :p
16:54kettenismust admit I haven't tried the hypervisor for this
16:54marcana reset, any reset?
16:54marcanas in wdt works too?
16:55ketteniswdt works too
16:55kettenisI'm using the smc though since it might do some more magic
16:55marcanlooks like the pmu driver will need a reference to SMC then
16:55kettenisnot measured power consumption in the powered down state
16:55marcananother thing macos does is shut down the wifi gpio
16:56marcannot sure if that's strictly required or it would happen anyway
16:56kettenisit certainly isn't still turned on when I boot up the machine again
16:57marcanI imagine a boot will reset things anyway, but yeah
16:57kettenisbut iboot might turn it off
16:57marcanok, I should get some sleep
16:57marcanI think next week is going to be wrapping up SMC/SPMI PM for me
16:57marcanand then u-boot :)
16:58kettenisI get away with no reference from pmu to smu the way the reboot/reset code in OpenBSD/arm64 is structured
16:58kettenisso you can do what you want there
16:58kettenisthe spmi stuff needs some thought
16:59kettenisyou probably want subnodes there as well (jeffmiw added one for the rtc already)
16:59marcanthe sequence seems to be smc/spmi/smc so I imagine that needs some kind of sync to happen in the right order?
16:59marcanthough possibly the first smc write is not necessary
16:59marcanand yeah
17:00marcanapple seems to parameterize all SPMI PMUs as one driver
17:00marcanwith a ton of DT stuff
17:00marcannot sure if we'll end up doing the same or what
17:00ketteniswell if the first smc is the wifi gpio then that should probably be initiated by the pcie driver
17:00marcannah, it's something else
17:00marcanit goes that, then gpio, then SPMI stuff, then smc
17:01kettenisI tried to make some sense out of the apple DT stuff for the spmi pmu but it all looks very ad-hoc and hackish
17:02svenI feel like half the ADT is just hacks to get something working :(
17:04j`eymarcan: have you seen jeffmiw's spmi tree? https://github.com/jfbortolotti/linux/commits/spmi_rtc
17:04marcanj`ey: yeah, I'm going to work off of that
17:04kettenissven: apple has a long tradition doing that
17:04kettenislots of stuff in the Open Firmware device trees of the PowerPC macs that didn't make a lot of sense either
17:15fridtjof[m]oops, sorry
17:15jannauis there a way to make kernel_addr_r dynamic on the mem map? the distro bootcmds will fail otherwise
17:16jannaualso it would be nice to have only efi bootcmds
17:18Major_Biscuit has joined #asahi-dev
17:20jbowen has joined #asahi-dev
17:28jbowen has quit [Ping timeout: 480 seconds]
17:35jannauloading grub works with kernel_addr_r in ram
17:35kettenisjannau: there is an env_set() function that sets these variables
17:36kettenisactually probably needs env_set_hex()
17:37kettenisthe set of variables that needs to be set is a bit of a mess though
17:37kettenisI can probably take a look next week
17:39kettenisnot sure if folks will be happy if I remove the non-efi boot commands
17:43jeffmiwthe spmi driver in my tree is very minimal, reduced to what is needed to get the rtc stuff working
17:45jeffmiwI'll focus to clean it up based on all the comments so to have it decent enough to submit upsream. I was planning to look at shutdown after but I'm sure marcan will have it ready before I can even think of looking at it :)
18:01jannaukettenis: thanks, env_set_hex() works, I guess we don't have to remove all the other bootcmds if we set the required variables correclty
18:13Major_Biscuit has quit [Ping timeout: 480 seconds]
18:16___nick___ has joined #asahi-dev
18:16___nick___ has quit []
18:18___nick___ has joined #asahi-dev
18:21jbowen has joined #asahi-dev
18:30jbowen has quit [Ping timeout: 480 seconds]
18:55jbowen has joined #asahi-dev
19:00m6wiq1 has joined #asahi-dev
19:03jbowen has quit [Ping timeout: 480 seconds]
19:06m6wiq has quit [Ping timeout: 480 seconds]
19:12roxfan2 is now known as roxfan
19:56m6wiq1 has quit []
19:56m6wiq has joined #asahi-dev
20:33arhm. the stream is cutting out for me
20:33jannauthe compiler steals all the CPU
20:47arinterestingly, my x86 laptop builds mesa (in a somewhat full-fat build; the build goes up to 2585/2585 targets) + some nix fun afterwards in: nix-build -A mesa --check 1.00s user 0.74s system 0% cpu 4:55.78 total; meanwhile my x86 desktop does the same in nix-build --check -A mesa 0.27s user 0.13s system 0% cpu 1:44.55 total
20:53tpw_ruleswhat are the times from the stream?
20:55jbowen has joined #asahi-dev
21:00arnot sure, quicker, but also smaller builds (half of the targets, iirc)
21:00j`eyar: work smarter not harder :P
21:02arj`ey: well, what i did was just a rebuild of what the distro builds by-default
21:03jbowen has quit [Ping timeout: 480 seconds]
21:08___nick___ has quit [Ping timeout: 480 seconds]
21:08kov has joined #asahi-dev
21:52akemin_dayo has quit [Ping timeout: 480 seconds]
22:09Tuff has joined #asahi-dev
22:09Tuff has quit []
22:40akemin_dayo has joined #asahi-dev
22:49user982492 has joined #asahi-dev
22:55m6wiq has quit []
22:55jbowen has joined #asahi-dev
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:01yrlf has joined #asahi-dev
23:03jbowen has quit [Ping timeout: 480 seconds]
23:59user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
…