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: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:32marcanyou need to have previously resized macos or otherwise made empty space or have a new APFS container
08:53___nick___ has quit []
09:00marcanheh, an AC2 restore just failed halfway through with a USB dropout, just like I saw with idevicerestore a few times
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:58___nick___ has joined #asahi
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: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: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: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: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: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: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:34gladiac is now known as Guest1113
10:34gladiac has joined #asahi
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:36marcane.g. "write a register, get current time" might give you a time before the register actually got written without a barrier
10:40Guest1113 has quit [Ping timeout: 480 seconds]
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: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: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:44marcanpovik: also M1-specific, since it's cache-coherent as I said, don't bother with uncached memory or any of that
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:52chadmed has quit [Quit: Konversation terminated!]
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
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:30poviki have been happily running with no cpus=, which should effectively be the same, wonder if there's a difference
11:37alyssamaz: "make sure you use of_iomap to get your register ranges mapped" ...or the devm all in one ;)
11:39chadmed has joined #asahi
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:49povikthose starting their exam block should be forced in contact with those 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
12:02klangeit would make a lot of sense if it was just another codec/pipe/port alongside everything else
12:12marcanhttps://mrcn.st/t/j457ap.adt.txt https://mrcn.st/t/j456ap.adt.txt https://mrcn.st/t/j313ap.adt.txt https://mrcn.st/t/j293ap.adt.txt https://mrcn.st/t/j274ap.adt.txt
12:17poviki thought the phandle refers to /arm-io/nco, saw no macos pokes to the region, and called it a day
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:21povikhttps://github.com/AsahiLinux/m1n1/blob/2736f0dd0751592a5c31ba6d1ba3f6958997c177/proxyclient/experiments/speaker_amp.py#L164
12:25marcanyes, it's likely the mclk input, and the two settings are switching between different (hardcoded, likely) dividers of NCO output
12:35___nick___ has quit [Ping timeout: 480 seconds]
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:40nsklaus_which is not updated much unfortunately, but, i was was wondering what are some of the big tasks to be done,
12:42svennsklaus_: usb 3, thunderbolt, secure enclave, GPU are the big ones that come to my mind (in order of increasing complexity :D)
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: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: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: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:54kettenisand if your CPU is fast enough and GPU memory is cache coherent, that is good enough for a normal desktop environment
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: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: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:45alyssa(Particularly on display controllers with writeback support. I don't think DCP does wb though.)
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: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:52bgb_ has joined #asahi
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: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:22marcanand all that applies regardless of which of 4 peripheral modes you put it in (0=gpio, or 3 peripheral pin selects)
15:23marcanI wish we could get the "select" mappings somewhere for this kind of stuff though... pinselects for this, clockselects for those registers...
15:36marcanI actually thought it was 8 at first, then realized the next bit was actually part of pull config
15:39kettenisso you might need to bring out that multimeter again if you didn't write things down ;)
15:40j_eykettenis: yeah, that's what I think too, since we havent needed any of these yet for i2c, spi, pcie etc
15:46bgb_ has joined #asahi
15:54bgb_ has quit [Ping timeout: 480 seconds]
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: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)
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: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: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: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:24kettenisone thing we should consider before doing that is to move the interrupt-parent to the root of the tree
17:26jbowen has quit [Ping timeout: 480 seconds]
17:27Fruit has joined #asahi
17:32jbowen has joined #asahi
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: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:36svenand the absolute worst case that has happened to be was losing maybe the last 5 minutes or so of modifications
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: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: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: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:28jbowen has quit [Ping timeout: 480 seconds]
18:32jbowen has joined #asahi
18:37Glanzmannmarcan: install fails in 1tr because their is no xattr see above, so try again from macos with step2
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: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:17bgb_ has quit [Ping timeout: 480 seconds]
20:26bgb_ has joined #asahi
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:42bgb_ has joined #asahi
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: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:53bgb_ has quit [Ping timeout: 480 seconds]
20:54jbowen has quit [Quit: leaving]
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: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: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: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:26povikhttps://github.com/AsahiLinux/m1n1/blob/2736f0dd0751592a5c31ba6d1ba3f6958997c177/proxyclient/m1n1/hw/pmgr.py#L5
21:30aleasto has joined #asahi
21:37povikbtw, you think it's time to change default M1N1DEVICE to /dev/ttyACM0 or is it still soon yet?
21:40bgb_ has quit [Ping timeout: 480 seconds]
21:41aleasto has quit [Quit: Konversation terminated!]
21:42aleasto has joined #asahi
21:49bgb_ has joined #asahi
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]