#
…

2021-09-27

00:01boardwalk has joined #asahi
00:20boardwalk9 has joined #asahi
00:23boardwalk has quit [Ping timeout: 480 seconds]
00:23boardwalk9 is now known as boardwalk
01:03tomtastic_ has joined #asahi
01:06tomtastic has quit [Ping timeout: 480 seconds]
02:42PhilippvK has joined #asahi
02:45phiologe has quit [Ping timeout: 480 seconds]
03:10marvin24_ has joined #asahi
03:13marvin24 has quit [Ping timeout: 480 seconds]
03:23bgb has joined #asahi
03:31bgbmarcan: I'm using vdmtool with arduino, ttyUSB0 is the USB2Serial module, seems my FUSB302 board is broken
03:39bgbmarcan: btw, I think it's possible to send cmd to arduino(with vdmtool) in python code. I want to write a simple Mac reboot cmd in python, and tried ser = serial.Serial("/dev/ttyACM0", 500000) ser.write(b"5AC8012,0105,80000000\n"), it didn't work. is there any difference from the Ardunio Terminal tool?
04:04bgb has quit [Ping timeout: 480 seconds]
04:07bgb has joined #asahi
04:26tomtastic_ has quit [Read error: Connection reset by peer]
04:27tomtastic has joined #asahi
04:31bgb has quit [Ping timeout: 480 seconds]
04:36chadmed has joined #asahi
04:47chadmed has quit [Quit: Konversation terminated!]
04:47chadmed has joined #asahi
05:58chadmed has quit [Quit: Konversation terminated!]
06:00chadmed has joined #asahi
06:05chadmed has quit []
06:21chadmed has joined #asahi
06:23bgb has joined #asahi
06:32tomtastic has quit [Quit: ZNC - https://znc.in]
06:32tomtastic has joined #asahi
07:06bgb_ has joined #asahi
07:11bgb has quit [Ping timeout: 480 seconds]
07:17aleasto has joined #asahi
07:23bgb_ has quit [Ping timeout: 480 seconds]
07:24bgb_ has joined #asahi
07:30jannaubgb_: my areboot: `echo "5AC8012,0105,80000000" | picocom -c -b 500000 --imap lfcrlf -qrx 1000 /dev/vdm`
07:40___nick___ has joined #asahi
07:47Hotswap has quit [Ping timeout: 480 seconds]
07:55Glanzmannmarcan: I would like to try your new installer, is the process documented somewhere? I only found the git repository with a stub readme.
07:56Hotswap has joined #asahi
08:04mort_ has joined #asahi
08:14bgb_jannau: works well, thanks.
08:23_jannau_bgb_: had had in the beginning also issues which led me to believe my fusb32 board was broken. I was wrong but I can't remember the details
08:25bgb_yeah, fails several time before working, do not know why
08:31marcanbgb_: mine is just
08:31marcanstty 500000 </dev/ch340
08:32marcanecho > /dev/ch340
08:32marcanecho 5AC8012,0105,80000000 > /dev/ch340
08:32j_eywhats ch340?
08:32j_eyoh the arduino?
08:32marcanjust an alias for the serial converter in my arduino
08:32marcanGlanzmann: it isn't, but try curl -L mrcn.st/alxsh | sh
08:32marcanyou need to have previously resized macos or otherwise made empty space or have a new APFS container
08:50bgb_marcan: ah, works well too, thanks :)
08:52bgb_weird thing is the python code begins to work too, seems the hw needs "warmup"...
08:53___nick___ has quit []
08:58marcanbgb_: yes, I always open a terminal to the ch340 first so I can see the init output
08:58marcanthe arduino resets on DTR or something like that
09:00marcanheh, an AC2 restore just failed halfway through with a USB dropout, just like I saw with idevicerestore a few times
09:01marcanlooks like that's just flaky USB hardware in these things... :/
09:01marcanseems gadget mode in macos isn't quite as stable as it should be
09:01j_eyC-a C-t sends a DTR toggle in picocom, so you could try that twice, or C-a C-p once (that pulses DTR) to try reset the arduino
09:26marcanhm, seems Apple both fixed the role swap issue in 12.0, and also gimped it to USB2
09:26marcan11.6 restores in USB3 (10Gb/s), 12.0 always seems to go to 480Mb/s with the same cable
09:26marcan(even with a Linux host and idevicerestore)
09:26marcanthat's sad, USB3 makes the restore more than 2x faster
09:40j_eyhopefully not an operation you have to do often
09:58___nick___ has joined #asahi
10:14marcanit's not too bad though, ~5m USB3 ~10M USB2
10:22povikmarcan: what do i need to know about m1's memory to write drivers?
10:22povikassume i have been writing drivers on microcontrollers
10:22povikso have been spared issues like cache coherence, write ordering
10:25marcanwell... the good news is everything is cache coherent on the M1, as far as we know
10:27marcanthen the other good news is you get to watch Will's talks!
10:27nsklaus_povik: i would like to ask (noob question) why a driver to handle memory is needed ? i mean, we've seen asahi already able to run up to desktop graphical session and all, how was that even possible if asahi on M1 didn't know how to handle available memory ?
10:27povikthanks :)
10:28nsklaus_or maybe just a subset of available memory was being used at the moment ? meaning that most of the ram wasn't usable so far ?
10:29poviknsklaus_: no no, i am writing a driver for audio, not a "memory driver"
10:29nsklaus_aah ok it was a misunderstanding on my part then, thank for correcting
10:29j_eybut an audio driver has to write to memory
10:29povikbut i am using memory and memory-mapped io, and i am wondering what assupmtions i can make about memory accesses and how they will be carried out
10:30poviknsklaus_: it's not a bad question at all
10:30nsklaus_i would have thought memory allocation even for drivers was handled by the kernel
10:30j_eynsklaus_: it is!
10:31j_eybut this is about the instructions used to write to those areas of memory, and what *attributes* the kernel sets on that memory while mapping it
10:31marcanpovik: thankfully for a "typical" driver you don't need to worry *too* much about this, other than standard locking/concurrency primitives
10:32nsklaus_j_ey: hmm i think i see the nuance now, thanks
10:32marcanthe main thing is to use readl_relaxed/writel_relaxed *unless* you are doing something that needs to be ordered with respect to DMA
10:33marcanthen you use readl/writel or dma_ barriers
10:34marcanso if you have a sequence of operations that is like "okay, stuff got written to RAM, now tell the device about it", then that needs a barrier or the first MMIO to tell the device about it needs to be a non-_relaxed
10:34kettenisnothing M1 specific there really
10:34marcansimilarly, if you have "okay, the device wrote stuff to RAM and told us about it, so go read it", that needs a barrier or non-_relaxed
10:34marcanand yes, none of this is M1-specific, this basically goes for all architectures
10:34marcancertainly all ARMv8
10:34gladiac is now known as Guest1113
10:34gladiac has joined #asahi
10:35povikwhat about mmio read/writes wrt to each other? no funny business there?
10:35marcannope, those are all ordered
10:35mazsimilar requirements for ARMv7, only that most cores are too strongly ordered to show any difference.
10:36marcanhowever, the CPU does speculate, so don't assume any writes or reads actually happened in later non-memory code
10:36marcanthis mostly only matters if you're dealing with timestamps
10:36marcane.g. "write a register, get current time" might give you a time before the register actually got written without a barrier
10:36povikwell but that is a mmio read/write reordered, no?
10:37marcan"get current time" is a CPU system register, not MMIO
10:38marcanM1-specific, make sure you use of_iomap to get your register ranges mapped
10:38marcanthat will make sure the memory attributes are set up properly
10:38j_ey8.6 has those CPU sys regs but self-synchronising versions that dont need an ISB
10:39marcanj_ey: and Apple already has those as impdefs in M1 (we think)
10:39j_eyoh interesting
10:40mazj_ey: go forth and review the series dealing with that on the list! :D
10:40Guest1113 has quit [Ping timeout: 480 seconds]
10:40maz(the 8.6 stuff, nothing M1 specific)
10:40marcanj_ey: see CNTPCT_ALIAS_EL0 CNTVCT_ALIAS_EL0 in apple_regs.json
10:40marcanwe haven't validated the ordering semantics, but the only real reason for them to exist is a pre-standard version of that...
10:42povikwhat presents the cpu from speculatively reading a read-sensitive mmio register? an mmu attribute on that range?
10:42sven+1 on will's talk. they're great!
10:42marcansame thing that makes mmio ordered wrt itself
10:42marcan(as opposed to normal memory)
10:43marcanthat too, if you have DMA descriptors in normal memory that need to have flags set in a given order (e.g. ownership flags) or things like that, that needs barriers too
10:43marcansince that isn't mmio
10:43marcansee memory-barriers.txt, that has some obvious examples
10:43j_eymaz: I did wonder why you added a nop, in the arch_timer_read funcs? or maybe I should ask on the list
10:43mazj_ey: because alternatives must use the same number of instructions.
10:44marcanpovik: also M1-specific, since it's cache-coherent as I said, don't bother with uncached memory or any of that
10:44marcanthat would just slow things down
10:44mazj_ey: so you go from isb+read to nop+read.
10:44j_eymaz: oh, I hadnt noticed that before
10:44povikmarcan: noted
10:47kettenisso how does audio output work? is it I2S with a separate DMA controller?
10:49kettenisand a separate mixer/codec chip controlled over I2C?
10:49poviki assume there's something i would call mixer on the chip, before it's sent out over i2s
10:49povikbut i don't understand that part yet
10:50j_eypovik: marcan said to use of_iomap, but youre probably going to use devm_platform_ioremap_resource to map the memory, which does the right thing too
10:50marcanyeah, both of those work
10:51poviki will do one better, i have devm_platform_get_and_ioremap_resource in code
10:52j_eyyou need the resource separately?
10:52poviknot as far as i know
10:52chadmed has quit [Quit: Konversation terminated!]
10:53poviki guess i can drop the *get* part and it does the same
10:54j_eyyeah, devm_platform_ioremap_resource just calls devm_platform_get_and_ioremap_resource(dev, index, NULL)
10:54kettenispovik: typically there are multiple I2S channels on a SoC, but only one of those tends to be connected to the external codec
10:56povikon mini, there's one i2s channel connected to codec/speaker-amp driving the speaker, another channel connected to a codec driving the audio jack
10:56marcanon these machines I'd expect at least separate outputs for speaker, headphone jack, and possibly s/pdif if they're still doing that over those jacks
10:57marcanand then whatever they're doing with microphones, pretty sure these machines have at least two
10:57marcanthere's also HDMI audio, which I assume is somehow internally routed into the display block
10:57mazprobably something routed to hdmi as well.
10:58mazmaybe even BT, unless that's just an analog routing.
10:59marcannah, BT is all software
10:59marcandon't think I've ever seen that done in hardware on any laptop
11:01klangeover in x86/pc land, hdmi audio is generally presented as an independent device; usually a separate pci function from the gpu that carries it
11:02povikthere's something called mca/mca-switch standing between the audio dma and the i2s channels
11:02poviki expect it routes the channels and controls the i2s serialization
11:02povikbtw anyone knows what mca might stand for?
11:03mazMulti Codec Adapter?
11:03maz(I hope it doesn't refer to the ancient IBM bus... :D)
11:04povikgood guess, had to google if it's an established term
11:04povikseems not
11:04mazmulti channel audio is probably a better name, actually.
11:04poviki like the first one better
11:05mazmake up your own name, it will be debated to death on the list anyway.
11:06phireM could be multimedia
11:08dottedmagmagnetic core amplifier, FWIW
11:22bgb_marcan: for smp-hypervisor, can i set cpus=8 ?
11:27j_eybgb_: yes
11:29bgb_I always fail with AOP:ALSOPDriver..... then panic
11:30poviki have been happily running with no cpus=, which should effectively be the same, wonder if there's a difference
11:35bgb_povik: ah, boot 8 cores without cpus= :)
11:35povikthere you go
11:36povikwe should make a note of it in the wiki
11:37alyssamaz: "make sure you use of_iomap to get your register ranges mapped" ...or the devm all in one ;)
11:38alyssaoh j_ey already said
11:39povikyeah, we already discussed the nuances of this :)
11:39alyssado I review code or show up to class on time hmm
11:39chadmed has joined #asahi
11:39povikwhat's more interesting?
11:43* povikis learning for an exam in parallel, recommends showing up in class
11:43povikthat's what i would recommend my past me
11:45chadmedskipping classes is great until its exam block and youre cramming 13 weeks of boring ass content 36 hours out from your massive 70% exam
11:47alyssaok, reviewed the series, onto class :-p
11:48chadmedall students here have a duty to keep each other honest
11:49povikthose starting their exam block should be forced in contact with those starting their lectures
11:49psykosethose are the same group, though
11:50povik*nominally starting their lectures
11:53chadmedyeah just be responsible with your skipping i guess. i skipped a histology prac class last week thinking i had plenty of time until the exam, turns out its actually almost the end of the semester and that was our last chance to practice microtomy before we're assessed on the skill lmao
11:54chadmeddont let that be you
12:02marcanklange: I think here HDMI audio is integrated into the SoC audio stuff
12:02klangeit would make a lot of sense if it was just another codec/pipe/port alongside everything else
12:10povikare there some public ADT dumps from the mba/pro?
12:10povikor could someone send me the parts having to do with admac/mca/codecs?
12:11svenfwiw, your wifi passphrases are in the ADT dump
12:12j_eypovik: theres a python script in m1n1/tools to dump the adt
12:12marcanyou can just dump them from an IPSW
12:12poviki know, but i don't have the hw
12:12marcanthose are unpersonalized, so they lack some info
12:12poviksven: one does not ask for full ADT in polite company
12:13marcanbut most of the hardware stuff is there
12:13povikmarcan: thanks
12:14marcanthe function-i2s_route stuff sounds useful
12:14marcan(those are referencing mca-switch; the first number is the phandle)
12:15povikright, on this page i have a question related to clocks, let me look it up
12:16povikin /arm-io/mca3/mac3a, i have
12:16povik> function-mclk_frequency = Container: phandle = 113 name = u'NCOf' (total 4)
12:17poviki thought the phandle refers to /arm-io/nco, saw no macos pokes to the region, and called it a day
12:17marcanahh, now we know what the NCOs are for
12:17marcanI was wondering
12:17marcanso this is audio
12:17povikdon't be so quick just yet
12:17poviki also know i need to poke a register which is listed as #113 in boot clocks
12:17povikfrom your script
12:17povikand that would check out to be mclk
12:18povikbut then there's the name='NCOf' part which puzzles me
12:18povikso either it refers to /arm-io/nco, in which case the boot clock poke would be a coincidence, or it refers to the boot clock, but then why there's nco in the name
12:19povikor -- there's some connection between the boot clock index and device phandle in ADT
12:19povik(i don't know what those boot clocks are supposed to mean exactly)
12:20marcanso the NCOs are 72~75 in the clocks
12:21povikhere's the boot clock #113 poke
12:21poviknote i can switch between 48/96 ksps through this register
12:23marcanyeah, that's changing a clock mux
12:23poviksure, but to me it means that is the mclk clock
12:25marcanyes, it's likely the mclk input, and the two settings are switching between different (hardcoded, likely) dividers of NCO output
12:25marcanthis is on the mini, and which mca?
12:26povikmini, /arm-io/mca3/mca3a
12:27marcanmclk-config also has the NCO index in the low bits
12:28marcanit's entirely possible 113 is a coincidence, and the clock offset is hardcoded somewhere
12:29povikmeaning the phandle refers to /arm-io/nco ?
12:30marcanit would be extremely weird if it didn't
12:30marcanand an NCO is exactly what I expect to be driving an audio block
12:33povikmarcan: why is the list called boot clocks?
12:33povik(in dump_pmgr.py)
12:33marcanbecause (hopefully) it lists the clock config at boot
12:33marcanobviously some things can change
12:35___nick___ has quit [Ping timeout: 480 seconds]
12:39marcanso the question is how does it know about that clock reg
12:39marcanand the answer might well be "it's hardcoded somewhere"
12:39poviknot a tough sell
12:40nsklaus_i was looking at the wiki's tasks list here :https://github.com/AsahiLinux/docs/wiki/Tasks
12:40sventhe CIO (thunderbolt crap) "reclock" (i doubt it's a clock) is just hardcoded in some kext fwiw
12:40marcan addr = 0x000000003B0400D4
12:40marcan size = 0x0000000000000018, Container:
12:40marcanthere you go
12:40svenbut ofc still listed in that pmgr devices array with all entries set to zero
12:40marcanmca-switch has a regblock pointing riiight into the clocks at the right place
12:40nsklaus_which is not updated much unfortunately, but, i was was wondering what are some of the big tasks to be done,
12:41povikmarcan: of course, missed that
12:41nsklaus_i see : touchbar, touchpad, camera.. is there any other left ?
12:41marcannot sure why mca3 would be offset 1 in that though, probably referenced somewhere
12:42nsklaus_then i saw this: "Unified Memory Controller" one.. is that one done already ?
12:42j_eynsklaus_: sound, touch id, emp etc
12:42svennsklaus_: usb 3, thunderbolt, secure enclave, GPU are the big ones that come to my mind (in order of increasing complexity :D)
12:42svenoh, and nvme. but that's mostly getting the driver in a shape that allows reviews
12:42j_eynvme is done(tm)
12:43nsklaus_j_ey: sound seems to be being worked on, with some success already
12:43marcan0x18 size though, so that's exactly 6 clocks, which matches up with 6 MCA clusters
12:43j_eynsklaus_: yeah but that's just a Proof of concept, still some way to a driver
12:43marcanpovik: you sure this was mca3 and not mca1?
12:43nsklaus_i understand gpu part need a lot more work, but for starters if it have wworking accelerated 2d, it's already nice
12:44marcanI guess this means I get to write a clocksel driver after all...
12:45povikmarcan: no, got confused, it's mca1/mca1a driving the speaker in ADT
12:45marcanwell that explains it then
12:45povikit does
12:45marcan6 consecutive clocks, one for each mca
12:45nsklaus_j_ey: that part i do not understand, how come linux already work on M1 if the M1 memory is "unified memory" and linux doesn't know how to handle that and have no driver for it already ?
12:46j_eynsklaus_: Im not sure what that TODO list was meant to suggest
12:46sveni think that's because that item doesn't make much sense
12:46nsklaus_sven: ah thanks for clarification :)
12:47marcannsklaus_: accelerated 2D is not a thing
12:47marcanthese GPUs are 3D only
12:47marcan"2D" acceleration is just 3D with no depth
12:47nsklaus_marcan: you mean the gpu on M1 use 3D function to display 2d too ?
12:48nsklaus_hmm i see
12:48marcanyes, 2D acceleration hasn't really been a thing in a while
12:48marcanand yes, that "unified memory controller" thing doesn't make any sense unless you mean stuff like the perf switching driver I have to write
12:48marcanas in "things we might have to deal with in the memory controller"
12:49marcanit doesn't mean memory doesn't work
12:49nsklaus_marcan: i might have been living under a rock for some time, that may explains things
12:50nsklaus_(about 2D acceleration)
12:51marcanpovik: I'll put a clocksel driver on my list, having the audio driver poke that register directly is very ugly
12:52nsklaus_hmm, so in essence what we have for display driver in asahi at the moment, is a plain unaccelerated framebuffer, and no gpu driver , is that it ?
12:53nsklaus_kettenis: i see, thanks for acknowledgement
12:53j_eynsklaus_: and alyssa is working on the display driver which is part of that stack
12:53marcan(and yet it's still faster than other ARM chips *with* acceleration...)
12:54kettenisand if your CPU is fast enough and GPU memory is cache coherent, that is good enough for a normal desktop environment
12:55j_eymarcan: even when running at 600mhz for the big cores :P
12:57nsklaus_i did follow alyssa xorg conference/talk, and the various progress made on that front too, i think things are progressing quickly and i'm very happy about that. and even using plain framebuffer for starters would be fine by me
12:58j_eyyou dont even need her dcp driver for that, I think the simple-framebuffer works fine for a DE too?
13:00kettenisyes, you're just stuck at whatever resolution iBoot gave you
13:00ketteniswhich is fine on the laptops, but not on the mini with a 4K screen
13:06bgb_ has quit [Ping timeout: 480 seconds]
13:14bgb_ has joined #asahi
13:15povikmarcan: as i remeber it you can switch to 96 ksps through another register, this time in the mca range proper
13:15povikdoes that mean we still need a clocksel driver?
13:15povikseeing as we may need that clock mux in one fixed position only
13:21kettenisthat'll certainly make things simpler
13:22bgb_ has quit [Ping timeout: 480 seconds]
13:24jbowen has joined #asahi
13:30bgb_ has joined #asahi
13:38bgb_ has quit [Ping timeout: 480 seconds]
13:47bgb_ has joined #asahi
13:53yuyichao_ has quit [Ping timeout: 480 seconds]
14:04bgb_ has quit [Ping timeout: 480 seconds]
14:11bgb_ has joined #asahi
14:21yuyichao_ has joined #asahi
14:25bgb_ has quit [Ping timeout: 480 seconds]
14:34bgb_ has joined #asahi
14:42bgb_ has quit [Ping timeout: 480 seconds]
14:43alyssasven: SEP is harder than Thunderbolt?
14:44alyssamarcan: I might argue overlay planes count as a /very/ primitive form of 2D accel
14:45alyssa(Particularly on display controllers with writeback support. I don't think DCP does wb though.)
14:45alyssakettenis: correct
14:45alyssa(You also get tearing.)
14:47svenalyssa: i think so. thunderbolt is mostly just reading some linux code to understand how the DT is supposed to look like and then it's just uncovering ATC PHY's magic tricks
14:47svenSEP is a bit more annoying because it has an ipc protocol over another ipc protocol :(
14:48svenit also at least needs APFS read support for something they call "gigalocker" (containing anti replay tokens and maybe more stuff)
14:49svenand then ofc it needs userland support so that you can store SSH keys or your nvme encryption keys
14:51sveni actually think most of SEP will be userland fwiw
14:51alyssaDelightful
14:51alyssahow much can we share with 'normal' TPMs?
14:52svenno idea, but chances are not much
14:52bgb_ has joined #asahi
14:55sorearcan more be shared with userland SEP support on macOS for ssh etc?
14:56svenno, because that all talks to the SEPUserClient kext or however it's called
14:57marcanpovik: if the clock mux never changes, we might not need a clocksel driver
14:57marcanbut either way, I intend to spend tomorrow marathoning small kernel drivers (finally), so if I get to it, why not
15:01bgb_ has quit [Ping timeout: 480 seconds]
15:01FireFox317 has joined #asahi
15:02FireFox317marcan: on stream? :D
15:03FireFox317was lurking via the whitequark logs xd
15:05povikmarcan: i will not stop you :)
15:05povikalso, i lobby for a gpio driver
15:06povik(don't know what's the state of the art on that)
15:06j_eygpio/pinctrl is on the list
15:06povikfor review? great
15:06j_eypovik: i assume you need it for i2c/audio?
15:07povikyes, for toggling a reset pin, which probably isn't strictly necessary
15:07povikbut it makes me sleep better at night
15:15alyssapovik: you also have M1 kernel nightmares?
15:17marcanFireFox317: yeah
15:17marcanpovik: I spent some quality time with a multimeter on a call with j_ey the other day to figure out the gpio bits :)
15:18marcan(I used the UART TX pin as a guinea pig, since I could poke that externally)
15:18j_eyI got to watch marcan fiddle with a multimeter for a few hours
15:19marcanand a scope!
15:20svenoh, uart tx is also exposed as a gpio pin?
15:21marcanmost jellybean IO pins are, yes
15:21marcanuart0 tx is at 0x23c100280
15:21sveninteresting
15:21marcanwhich is actually in the adt!
15:21marcan function-tx = 102:GPIO(0xa0, 0x102)
15:22marcanbut yeah, it's not really gpio regs, it's pinctrl overall
15:22marcanit even has 16 (!) drive strengths to pick from
15:22marcanand a schmitt trigger input mode (with a really low hysteresis...)
15:22marcanand pull-ups/downs (two pull-up strengths to choose from)
15:22marcanand all that applies regardless of which of 4 peripheral modes you put it in (0=gpio, or 3 peripheral pin selects)
15:23marcanwas fun to figure out all that :D
15:23marcanI wish we could get the "select" mappings somewhere for this kind of stuff though... pinselects for this, clockselects for those registers...
15:24marcanit's really hard to work that out by guesswork
15:25svenyou mean what those three peripherals are for each pin?
15:25marcanperipheral.pin
15:25marcanwe know e.g. at least some uarts can have rts/cts broken out
15:25marcan function-rts = 102:GPIO(0x94, 0x2)
15:25marcan function-tx = 102:GPIO(0x92, 0x102)
15:33kettenisah, so my guess that there actually are 4 functions for the pins was right?
15:34povikalyssa: not yet
15:36marcankettenis: yeah, it's two bits
15:36marcan0 is just gpio
15:36marcanI actually thought it was 8 at first, then realized the next bit was actually part of pull config
15:36marcanI'd confused myself going too fast on that
15:37kettenisthere are standard DT properties for pull up/down, drive strength and schmitt-trigger
15:37kettenisthose should be used if we add support for this to the pinctrl driver
15:38kettenisonly down side is that they require you to specify things in physical units
15:39kettenisso you might need to bring out that multimeter again if you didn't write things down ;)
15:40marcanI did write them down :-)
15:40marcanthough I didn't do all 16 drive strengths
15:40kettenisprobably best to keep things simple for the initial pinctrl driver
15:40j_eykettenis: yeah, that's what I think too, since we havent needed any of these yet for i2c, spi, pcie etc
15:44kettenisprobably because iBoot configures the pins already
15:44marcan(and clocks etc)
15:44j_eyI think it would be fun to write a m1n1 randomiser to just setup the hw in random states
15:45povikthat sounds just needlessly cruel
15:45j_eyonly cruel to us
15:46bgb_ has joined #asahi
15:54bgb_ has quit [Ping timeout: 480 seconds]
15:57kettenismarcan: you still need a DT binding for the pmgr stuff
15:57marcanyou mean the doc?
15:57marcanI'm going to wrap up all these jellybean drivers tomorrow if I can
15:57marcancpufreq too
15:58marcanlooks like I should have a relatively uninterrupted day :p
15:58kettenisyup, the doc (in the form of a schema)
15:59kettenisonce that is sorted out, we should see if we can somehow get a more complete device tree
16:00marcanI think we should add these blocks piece by piece, but at least the deps we use right now, yeah
16:00kettenisthings are diverging a bit, which is hurting some of the people who are not too familliar with device trees
16:00marcanonce these things are done, the next thing I want to do is do a merge branch to put all this in order
16:05Orsira has quit [Read error: Connection reset by peer]
16:27bgb_ has joined #asahi
16:33jhweruyuw has joined #asahi
16:36bgb_ has quit [Ping timeout: 480 seconds]
16:44bgb_ has joined #asahi
16:48kdrag0n[m] has joined #asahi
16:52bgb_ has quit [Ping timeout: 480 seconds]
16:56alyssamarcan: Any idea in what ways a TV is "special" compared to a monitor? (Both over HDMI)
16:56alyssanot only did the DCP driver not work on a TV I tried briefly, the iBoot framebuffer didn't even come up (no Apple at boot)
16:57sventhe iboot framebuffer at least worked on my tv over hdmi
16:57alyssamaybe this was an "extra special" tv then
16:57svenlovely
17:01mazkettenis: victory is yours! :D
17:01alyssaWooooot!
17:01milek7tv might want YPbPr colors
17:02alyssathat "shouldn't" be AP visible but who knows with this cursed interface
17:02bgb_ has joined #asahi
17:02alyssa/var/log/kern.log looks totally normal -- DCP booted, did a mode set to 4k ("Wait. That TV looked awfully low quality for 4K") ...
17:04kettenismaz: did the pcie binding go in as well? Only seeing the messages about the MSI controller YAMLfication bits
17:05svenhe said just as the email confirming that arrived :)
17:08mazkettenis: everything.
17:09mazok, maybe not the last one, but I'm happy to pick that one.
17:09j_eythe last one says "DART (IOMMU) references are left out at the moment and will be added once the appropriate bindings have been settled upon", they can be added now?
17:10bgb_ has quit [Ping timeout: 480 seconds]
17:10sventhey'd only be missing the power-domains, but those can be added later anyway
17:11mazI'll try and respin a pcie series tomorrow, including Mark's patch including the pcie node.
17:15sveni guess we should add the DART nodes to make it actually work. maybe kettenis can just add an additional commit or something for those
17:16svenor wasn't there already a commit to add those floating around somewhere?
17:17mazI have such a patch in my tree. I'll write a commit message and add it as well.
17:18alyssaWoop woop!
17:20svenlooks like i2c and tipd will also make it into the next merge window. that should also give us working usb-c ports then
17:22jhweruyuw has quit []
17:22svenso that should make the mini useful for some tasks already, and if someone writes a SPI driver we could also have a somewhat useable system on the macbooks then
17:22j_eysven: patch 1/N for nvme will be in 5.15 too :p
17:22kettenisyeah, the dart stuff just didn't make it into the tree I was working from yet
17:23kettenisand the actual device tree changes have to go through marcan's tree anyway I believe
17:24kettenisone thing we should consider before doing that is to move the interrupt-parent to the root of the tree
17:24kettenisthat way we don't have to repeat it in every device node
17:26svensounds good to me
17:26jbowen has quit [Ping timeout: 480 seconds]
17:27Fruit has joined #asahi
17:29alyssasven: realistically will people be using mainline on any m1 before, like, 6.x?
17:29alyssa(Pure mainline I mean, not mainline+patches)
17:32jbowen has joined #asahi
17:32svenif we get dcp and nvme and usb3 into 5.17 i could see people using just that
17:32alyssa's fair, yeah
17:32alyssaand also spi and cpufreq and reboot/wdt ...
17:32alyssathough those should all be minor afaiu
17:32svenyeah. i think the biggest one is probably dcp
17:32alyssahonestly nvme and dcp are the only Scary ones for short term
17:33alyssa(DCP is more code than NVMe but the NVMe code is errr scarier :-p)
17:33kettenisreboot/wdt is probably important ;)
17:33svenfor nvme i just need to stop being lazy for a weekend and split that single "WIP: nvme" commit into smaller ones that can be reviewed
17:34j_eyas well as spi, they actual keyboard driver needs moifying to be OF aswell as ACPI
17:34svennvme isn't _that_ scary fwiw. there are still a few parts where I'm not sure what's going on but I understand most of it now
17:34alyssasven: nvme is inherently scary for eating data risk
17:34kettenisalyssa: not really
17:34svenah, but that's the fun part: all the really scary things are handled by the nvme core
17:35etamm, tasty data
17:36svenand the absolute worst case that has happened to be was losing maybe the last 5 minutes or so of modifications
17:36svenand that involved crashing ANS
17:36kettenisi've hacked on various disk drivers in OpenBSD over the years, and I don't think I've ever had code that ate any data
17:36svens/be/me/
17:36kettenismostly the issue was data not landing on the disk for various reasons ;)
17:36sven^-- yeah, that :)
17:36kettenisnow hacking filesystems code...
17:39alyssakettenis: heh, nice.
17:52Glanzmannmarcan: At lest I though so, but once I powered on the system again, it went to recovery because there was a problem. After executing the installer, poweroff, poweron it should show the m1n1 logo, shouldn't it?
17:53yuyichao has joined #asahi
17:56Glanzmannmarcan: Btw. This was a mac mini, freshly erased and installed with macos, all updates applied.
17:57GlanzmannI freed up space using: diskutil apfs resizeContainer disk0s2 200GB
17:57GlanzmannThis is 11.6.
17:58yuyichao_ has quit [Ping timeout: 480 seconds]
17:59Glanzmannmarcan: If I boot to the Linux 'stub' my Eizo (HDMI connected) says going into powersafe and shows a black screen after a few seconds it shows the apple logo and boots into recovery.
18:14svenGlanzmann: the last line in that log you posted says "Press enter to continue.". have you done that?
18:16GlanzmannYes, I did that, got the boot picker, selected linux stub, entered my password
18:16GlanzmannAnd the system rebooted or powered off.
18:16GlanzmannI'll now try to in 1tr, make the partition writable and update m1n1, maybe that resolves my issue. Keep you posted.
18:17svenhm... if you did this from outside recovery it should've printed something about running step2.sh from 1tr
18:17GlanzmannThan I did not see that.
18:17GlanzmannThat might be the problem.
18:18svenyeah, probably
18:23GlanzmannFrom 1tr, it also did not works for me: https://ab34.de/u/IMG_20210927_202237314.jpg
18:25* alyssadebates cherry pciking wifi
18:28jbowen has quit [Ping timeout: 480 seconds]
18:28alyssaM1 is not happy with my usb ethernet apparently.
18:29ketteniswired ethernet not working for you?
18:30Glanzmannmarcan / sven: I misse step 2, trying again from 1tr with the partitions deleted.
18:32jbowen has joined #asahi
18:34alyssakettenis: I need to be able to also connect to my board
18:34alyssawhich I can't do over LAN because... remind me again? >_>
18:37Glanzmannmarcan: install fails in 1tr because their is no xattr see above, so try again from macos with step2
18:39alyssakettenis: the real issue of course is that the LAN is beyond broked.
18:42kettenisyou mean the bit outside of the mini?
18:48bgb_ has joined #asahi
18:49povik has quit [Remote host closed the connection]
18:57Glanzmannsven: Thank you for the tip. Running the installer from macos but run step2.sh from 1tr did the trick.
18:59povik has joined #asahi
19:01bgb_ has quit [Ping timeout: 480 seconds]
19:04yuyichao_ has joined #asahi
19:08yuyichao has quit [Ping timeout: 480 seconds]
19:11bgb_ has joined #asahi
19:27bgb_ has quit [Ping timeout: 480 seconds]
19:27aleasto has quit [Ping timeout: 480 seconds]
19:35bgb_ has joined #asahi
19:43bgb_ has quit [Ping timeout: 480 seconds]
19:52kedde[m] has joined #asahi
19:53bgb_ has joined #asahi
20:01bgb_ has quit [Ping timeout: 480 seconds]
20:09Glanzmannalyssa: I tried the steps you wrote me a few days ago. And I'm able to boot the kernel. But the last thing I see is the kernel boot output. Than it appears to switch modes my screen goes blank and python chokes on me: https://pbot.rmdir.de/T089FN2mccBtW9gaPNgyEA any ideas?
20:09bgb_ has joined #asahi
20:10GlanzmannI use m1n1 from the installer, than chainload m1n1 with your patch https://rosenzweig.io/0001-HACK-enable-ANS-clocks.patch. Monitor is connected using HDMI.
20:14alyssaGlanzmann: Hmm. definitely sounds like a DCP driver bug
20:15alyssapython choking is normal if you don't have a hardware UART or you're not running in the hypervisor
20:15alyssaoh, important storry --- what version of macOS is installed (on the partition m1n1 is installed to)
20:16Glanzmannalyssa: This is the last output I get before I can't see anything: https://ab34.de/u/screenshot-t490-2021-09-27-22_16_08.png
20:16Glanzmannalyssa: Here the video I took using a hdmi grabber: https://ab34.de/u/output.mkv
20:17Glanzmannalyssa: 11.5
20:17GlanzmannI installed it fresh yesterday and applied all updates.
20:17bgb_ has quit [Ping timeout: 480 seconds]
20:18alyssaoh... joy.
20:18alyssaI think I might be 11.4 here. ugh.
20:18alyssathis is why we hate DCP, kids.
20:19alyssawill need to check. ugh. 😢
20:19alyssayou can disable CONFIG_DRM_APPLE in the mean time for no DCP but.. yeah
20:20GlanzmannI try now and let you know how it went.
20:22Glanzmannalyssa: This worked. Got a login prompt from the rootfs from the USB.
20:23* alyssasighs at DCP
20:23alyssamarcan: Do we know how to detect DCP fw version at runtime?
20:26svenhm, i think the hash or something of the firmware is in the ADT if all else fails
20:26bgb_ has joined #asahi
20:27alyssasven: Awful :p
20:27svenohhh. i have another idea! i'm sure you'll like it! :>
20:27alyssanope, i won't
20:27svenyou could trigger a recoverable crash to get the version from the crashlog!
20:27alyssasven: We know each so well ;-)
20:31svenyou just never like my best idea :<
20:32FireFox317 has quit [Quit: Page closed]
20:34bgb_ has quit [Ping timeout: 480 seconds]
20:36Glanzmannalyssa: I was able to 'cp -ax' the rootfs onto the nvme and boot from it. Thanks a lot. These are the steps I did roughly: https://ab34.de/u/asahi.txt
20:38alyssaGlanzmann: 👍
20:38j_ey`git checkout many-hacks`
20:39alyssaj_ey: look I don't do false advertising
20:40j_eynew branch: more-many-hacks
20:42bgb_ has joined #asahi
20:43GlanzmannWhen installing packages the nvme appears to be slow, does someone know why that is?
20:45GlanzmannBut with hdparm -tT I get 2 GB/s / 1 GB/s Memory appears way to slow for the machine. I think it should be around 20 GB/s at least this is the number I have in my head for runing the same test under macos.
20:46alyssathere are some power registers needed to upclock
20:46alyssathere's a python script in m1n1 you can run before boot
20:48GlanzmannI read that in the irc backlog. Will try that.
20:49Glanzmannalyssa: I tried to run 'startx' but the xserver did not start. Do you have any instructions on getting this to run. I'll paste the output soon.
20:49alyssayou want a DRM driver
20:49alyssafailing CONFIG_DRM_APPLE, there's a CONFIG_DRM_SIMPLEFB you can enable (grep for it..)
20:50GlanzmannTrying now.
20:51Glanzmannalyssa: I assume you mean CONFIG_SYSFB_SIMPLEFB, correct?
20:52alyssadont have kernel in front of me, am doing Panfrost right now
20:52alyssawhy am I on IRC? that's a good question
20:52* alyssacloses window
20:53bgb_ has quit [Ping timeout: 480 seconds]
20:53j_eyGlanzmann: CONFIG_DRM_SIMPLEDRM
20:53j_eyI think
20:54jbowen has quit [Quit: leaving]
20:55Glanzmannj_ey: I see, found it. Thank you. Will try it.
21:02bgb_ has joined #asahi
21:03Glanzmannj_ey: I set it, but now I don't have a console anylonger, however Linux has booted and I see the asahi logo in the middle of the screen. Probably I have disabled to much.
21:04j_eyIve never tried it
21:05GlanzmannI see. Btw, after applying the pstates, nvme performance is improving a lot: https://pbot.rmdir.de/NDpwSeDyw7qGXfR79GClZA . Factor 13 for memory througput (fater than macos) and factor 3 from what I meassured before.
21:07GlanzmannSo thanks for all the help, I'll try to get the framebuffer x running tomorrow and hit bed now. With the pstates installing packages also appears faster.
21:09alyssawish you could just use DCP and have it Just Work
21:09kettenisalyssa: marcan's plan was to only support certain firmware releases
21:10alyssathat's long term, what's the short term?
21:11Glanzmannalyssa: I'll try once you have something ready for the new macos. Or I retry on a macbook air. There the update does not apply because 'it could customize the update for me' ...
21:11GlanzmannOh and NVMe is very slow. single thread 4k random is 50 IOPS, 80 concurrent threads is 2000 IOPS.
21:12kettenisalyssa: you pick a version and tell everybody that's the only version that's guaranteed to work ;)
21:12alyssakettenis: 11.4 baby! :-p
21:12GlanzmannTested with: fio --ioengine=sync --direct=0 --fsync_on_close=1 --randrepeat=0 --nrfiles=1 --name=randwrite --rw=randwrite --bs=4K --size=1G --end_fsync=1 --fallocate=none --overwrite=0 --numjobs=80 --sync=1 --directory=/mnt --loops=10
21:12Glanzmannalyssa: Will try tomorrow on my macbook air and let you know how it went.
21:13alyssaDCP on MacBook is so far untested
21:13alyssagood luck
21:13GlanzmannIt's about to be tested. :-)
21:13* alyssahas been writing Panfrost patches on her M1
21:14alyssafrom GNOME and whatever
21:14alyssait's nice to eat dogfood
21:14alyssawill need to use the pstate hack though :-p
21:14Glanzmannyes, that certainly boosts cpu and memory performance.
21:24poviki seem to remember marcan found some general method to reset on-die peripherals
21:24povikhigher bits of a pmgr register
21:24povikanyone can point me in the right direction?
21:26povikthis will be it
21:30aleasto has joined #asahi
21:32povikand it works!
21:32povik(applies to the admac block as well)
21:32povikthis is great
21:36povikha, for a moment it seemed like m1n1 can serve two python clients concurrently
21:36povikfor a moment...
21:37povikbtw, you think it's time to change default M1N1DEVICE to /dev/ttyACM0 or is it still soon yet?
21:37alyssai am in favour
21:39povikokay who opens the PR
21:39poviki will get my +1 reaction ready
21:39alyssapovik: thanks for volunteering
21:40bgb_ has quit [Ping timeout: 480 seconds]
21:41aleasto has quit [Quit: Konversation terminated!]
21:42aleasto has joined #asahi
21:45povikmay should have tested first
21:49bgb_ has joined #asahi
21:56povikbetter.
21:57bgb_ has quit [Ping timeout: 480 seconds]
22:04DarkShadow44 has quit [Quit: ZNC - https://znc.in]
22:04DarkShadow44 has joined #asahi
22:04jelly has quit [Remote host closed the connection]
22:05bgb_ has joined #asahi
22:13bgb_ has quit [Ping timeout: 480 seconds]
22:18aleasto has quit [Quit: Konversation terminated!]
22:21bgb_ has joined #asahi
22:24jelly has joined #asahi
22:25X-Scale has joined #asahi
22:31X-Scale` has quit [Ping timeout: 480 seconds]
22:34jhweruyuw has joined #asahi
22:35jhweruyuw has quit [Remote host closed the connection]
22:35jhweruyuw has joined #asahi
22:42bgb_ has quit [Ping timeout: 480 seconds]
22:53bgb_ has joined #asahi
23:01bgb_ has quit [Ping timeout: 480 seconds]
23:05riker77_ has joined #asahi
23:10riker77 has quit [Ping timeout: 480 seconds]
23:10riker77_ is now known as riker77
23:25bgb_ has joined #asahi
23:31DarkShadow4444 has joined #asahi
23:34bgb_ has quit [Ping timeout: 480 seconds]
23:35DarkShadow44 has quit [Ping timeout: 480 seconds]
23:45bgb_ has joined #asahi
23:53bgb_ has quit [Ping timeout: 480 seconds]
…