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: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:49kettenishaving the rtc subnode is fine with me, but naming it apple,sera-pmu-rtc would make more sense
00:54jeffmiwkettenis: I will align the naming and take a look at the u-boot dts, no good/eal reason to diverge
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?
02:01chadmedalso i dont think they like it upstream when you declare multiple variables on a single line
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 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`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: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“!…/?????!!!!~~~~~??…व््व….व?>..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: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`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: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: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
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: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: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: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: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: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:28jannaudart reserved memory is in https://github.com/jannau/linux/commit/09e83ed9f30b999c00aea08726c6d91d32a6408b
09:28gladiac has joined #asahi-dev
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: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: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: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:52jannaufor the disp0 dartI have currently "apple,reset-mask" but that is probably going to change
11:52chadmed has joined #asahi-dev
11:52svenjannau: sure, but in the setup translation function there’s also a brief race right now (see my GitHub comment)
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]
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:54kettenismarcan: making the gpio a subnode of the smc node breaks pcie in u-boot, but I can still boot from nvme
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:58kettenisalthough my plan is to switch over to a different branch that doesn't have the smc and pcie drivers anyway
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: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: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:34fridtjof[m]i'd tune in to a gpu stream!
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:43kettenishaving anything change in those areas that make drivers fail would be painful for upgrading
13:44jbowen has joined #asahi-dev
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: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:53jbowen has quit [Ping timeout: 480 seconds]
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:58kettenisshould probably also round down the framebuffer base and do the same for the normal DRAM mappings
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: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
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:57m6wiq has joined #asahi-dev
16:19jbowen has joined #asahi-dev
16:28jbowen has quit [Ping timeout: 480 seconds]
16:51m6wiq has quit [Remote host closed the connection]
16:51m6wiq has joined #asahi-dev
16:53ketteniswriting 0x8 to byte 0x9f0f in the spmi pmu address before triggering a reset is enough to make it shut down
16:58kettenisI get away with no reference from pmu to smu the way the reboot/reset code in OpenBSD/arm64 is structured
16:59marcanthe sequence seems to be smc/spmi/smc so I imagine that needs some kind of sync to happen in the right order?
17:00ketteniswell if the first smc is the wifi gpio then that should probably be initiated by the pcie driver
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:04j`eymarcan: have you seen jeffmiw's spmi tree? https://github.com/jfbortolotti/linux/commits/spmi_rtc
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:18Major_Biscuit has joined #asahi-dev
17:20jbowen has joined #asahi-dev
17:28jbowen has quit [Ping timeout: 480 seconds]
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: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:55jbowen has joined #asahi-dev
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…]