#
…

2021-06-08

00:07yuyichao_ has joined #asahi
00:10adamcstephens has joined #asahi
00:11yuyichao has quit [Ping timeout: 480 seconds]
00:15bgb has joined #asahi
00:30bgb has quit [Ping timeout: 480 seconds]
01:19adamcstephens has quit [Quit: The Lounge - https://thelounge.chat]
01:35bgb has joined #asahi
01:59mini has quit [Ping timeout: 480 seconds]
01:59mini has joined #asahi
02:05mini_ has joined #asahi
02:05aquijoule_ has joined #asahi
02:09mini has quit [Ping timeout: 480 seconds]
02:09mini_ is now known as mini
02:09adamcstephens has joined #asahi
02:10richbridger has quit [Ping timeout: 480 seconds]
02:12PhilippvK has joined #asahi
02:15mini has quit [Remote host closed the connection]
02:15mini has joined #asahi
02:16phiologe has quit [Ping timeout: 480 seconds]
02:48adamcstephens has quit [Ping timeout: 480 seconds]
02:53adamcstephens has joined #asahi
03:01adamcstephens is now known as Guest1248
03:01adamcstephens has joined #asahi
03:06Guest1248 has quit [Ping timeout: 480 seconds]
03:10marvin24_ has joined #asahi
03:13marvin24 has quit [Ping timeout: 480 seconds]
03:42bloomIt's creation!
05:25VinDuv has joined #asahi
06:22VinDuv has quit [Quit: Leaving.]
07:03al3xtjames has joined #asahi
07:03al3xtjames has quit [Quit: Ping timeout (120 seconds)]
07:55EER has joined #asahi
08:09bisko has joined #asahi
08:17bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:17EmantorMy USB PD PCB arrived.
08:18EmantorNow waiting for Digikey to send the FUSB302 and USB connectors.
08:21sven[ 0.242694] nvme0n1: p1 p2 p3 p4 p5 p6
08:21svenstill a big fat hack though
08:21EmantorNice :-)
08:22j_eyare those partitions or?
08:22svenprobably
08:22Emantoryes, they are.
08:22sven(and, as usual, i'm just doing the plumbing. this is mostly based on arnd's nvme platform split)
08:23j_eyI forgot about that, did that land?
08:24svenit almost worked though ;)
08:24arndah, nice
08:25tomtastic has quit [Ping timeout: 480 seconds]
08:25tomtastic has joined #asahi
08:26arndmarcan had mentioned he would look into getting it to work in the near future when I initially created the patches, so I did not bother setting up an environment for testing the PCIe side of it, and I never got far enough with the mac in the office to actually try things out on that either
08:26sveni just had half an hour while waiting for something to install on my actual work machine and figured i'd give it a try
08:27sventhe pcie side is completely untested and the platform side needed two or three on line changes
08:27sven(plus all the apple specific stuff ofc)
08:27Firefox317 has joined #asahi
08:28Firefox317Hey guys! Do you know what's up with the m1n1 wiki? When I access https://github.com/AsahiLinux/m1n1/wiki I get redirected to https://github.com/AsahiLinux/m1n1
08:29j_eyI guess there isnt one?
08:29Firefox317j_ey: Aha, that is where all the information is. Thanks!
08:34bgbEmantor: DIY Arduino-based USB-PD interface ?
08:40bgbcool! I'd like to try it
08:42bgbEmantor: btw, which pcb tool do you use?
09:01Firefox317 has quit [Quit: Page closed]
09:24kettenis_sven: so we'll need to work on the NVMe and IOP mailbox DT bindings as well...
09:24kettenis_ is now known as kettenis
09:28svenkettenis: so i've been ignoring the mailbox for now and just let uboot handle that
09:28svenbut other than that... hea.
09:31kettenisthe mailboxes are "interesting"
09:32kettenisthey need some memory for logging
09:32kettenisso u-boot allocates some memory and reserves that memory in the memory map
09:32svenah, so they'll trash random memory that uboot left setup then? fun
09:32j_eyhow much memory>?
09:33pipcet[m]64 KB or so
09:33kettenisnot much, just a few pages
09:33kettenisthe current u-boot code reserves the memory in the EFI memory map
09:34pipcet[m]I think it's more interesting that you can't reboot the remote processors that you communicate with using the mailbox, so you can't leave the hardware in the state you found it.
09:34kettenisbut I'm not sure it does the right thing if you load linux kernels the non-EFI way
09:35svenwouldn't be surprised if this just trashes some random memory for me then ;)
09:35kettenisI haven't seen it write to the memory yet
09:40kettenispipcet[m]: it must be possible to reset the thing, since iBoot uses the NVMe storage but in U-Boot I had to start it up again
09:41pipcet[m]good point. we just don't know how.
09:42pipcet[m]by the way, I stole your code for barebox experiments and found I needed to reorder the device tree so the SMC mbox is initialized before the ANS mbox... any idea on how to represent that in the DT properly, if it's actually correct?
09:43pipcet[m]is there a generic "this device only works once that device does" mechanism, maybe?
09:45kettenisthere is a bug in the memory reservation code for the mailbox driver
09:46kettenisit shouldn't matter in which order the mailboxes are initialized, but currently it does
09:46kettenisnot gotten around to fixing that
09:51Graypup_ has quit [Quit: meow]
09:51Graypup_ has joined #asahi
09:51Graypup_ has quit []
09:52Graypup_ has joined #asahi
09:52Emantorpipcet[m]: can you gist your config somewhere? Really wondering why gadget/chainloading barebox from m1n1 is not working for me.
09:59pipcet[m]Emantor: https://gist.github.com/pipcet/8c4a019b2a9c6d242ef986c958cf051a, I'll put the device trees there in a second
10:03pipcet[m]you probably need to ignore the NVME/mbox/DART/i2c stuff unless you're using my repo, but framebuffer and USB gadget should work without those (as long as you chainload from a new m1n1)
10:04pipcet[m]and sven was saying usb host mode might work as well, I think :-)
10:07arndsven: if you boot into Linux with the nvme driver, are you able to run 'nvme id-ctrl /dev/nvme0n1'? I'm curious to see if it uses the host memory buffer (hmpre/hmmin/hmmaxd)
10:15sveni only have a very minimal ramdisk that comes without nvme. any other way to get that info?
10:25sveni patched the kernel to printk those values after nvme_identify_ctrl and i think they're all zero
10:33arndsven: ok, adding those printks would have been my first suggestion, all zeroes just means it has no HBM and presumably uses an internal DRAM cache like every high-end device does
10:40kettenispipcet[m]: I pushed a change that should fix the mailbox dependency issue
11:20os has quit [Quit: The Lounge - https://thelounge.chat]
11:26_jannau_arnd: but where is the dram cache? stolen from unified memory? the storage controller is integrated according to apple
11:28kettenisdumping the SART registers in m1n1 might provide a clue
11:33arnd_jannau_: my first guess would be in the same package as the NAND flash, at least if that comes in a custom package
11:34kettenisthe SART is a very simple IOMMU which gives the side-processor that handles NVMe access to the SOCs address space
11:34kettenisit has a few mappings that allow access to main memory regions
11:34kettenisSART 0x009e6e84/0xff018c6c
11:35kettenisthat is probably a mapping for some sort of DRAM cache
11:35arndah, so maybe they did their own version of HMB before it became a standard NVMe feature?
11:35kettenismaps a block of 0x18c6c 4K pages at physical address 0x9e6e84000
11:36ketteniswhich is part of the upper block of reserved memory
11:37kettenisarndb: likely; they can just have the firmware set it up
11:37kettenisdamn now im mixing up arnd with ardb
11:39arndkettenis: that happens a lot. if you use irccloud, you'll now see my picture next to what I write, it used to also assign the same colour icon to both of us
11:43arndkettenis: 400MB seems quite a lot for the cache, but that must be what it's used for. The Linux NVMe driver allocates at most 128MB unless you override it with a boot time or module option.
11:45os has joined #asahi
11:49kettenishard to imagine needing that much memory for anything else
11:50choozy has joined #asahi
12:00GreatGodvin has joined #asahi
12:01Emantorpipcet[m]: It was the serial driver, disabling that lets simple FB work.
12:01EmantorEven when chainloading.
12:02pipcet[m]Emantor: ah, that's good to know. do you want to write a keyboard driver for barebox on the MBP? ;-)
12:03Emantorpipcet[m]: I don't have a MBP, can't really without the hardware ;) But if ehci works you should be able to use a USB keyboard.
12:05pipcet[m]does that work for you? I tried briefly and it didn't immediately work, but I'm still using old phy sequences...
12:05EmantorEh, MMU also needs to be disabled.
12:05EmantorNo, I don't have any USB-C adapters here :D
12:06EmantorWith PCI XHCI on the Minis USB-A ports may also work.
12:06GreatGodvin has quit [Quit: GreatGodvin]
12:07GreatGodvin has joined #asahi
12:08bisko has joined #asahi
12:09svenonly if you do the pcie init dance that u-boot usually does
12:22adamcstephens has quit [Quit: The Lounge - https://thelounge.chat]
12:22adamcstephens has joined #asahi
12:37bisko has quit [Remote host closed the connection]
12:38bisko has joined #asahi
13:00marcanarnd: I was waiting for sven to get the dart stuff going for nvme :)
13:00marcan(and then got caught up in a hypervisor)
13:02marcanand yeah, a big next one is going to be IOP mailbox, especially since that's a dep for graphics too
13:02marcanand display, both
13:03marcanit's on my list, but if someone wants to tackle it while I work on the mmiotrace side by all means
13:03marcanI'll probably hack up some basic m1n1-based gpu driver scripts first before jumping into linux
13:04svennvme isn't behind a dart fwiw
13:04marcanoh, it isn't? I thought it was
13:04marcanah, then i was waiting for power/clocks at least
13:04marcanI remember now :p
13:05sventhis still heavily lies on u-boot to bring this all up ;)
13:05sven*relies
13:05marcanyeah, spin up the core etc
13:05marcanwe need that code in linux anyway, since it needs to do all the other ones
13:06marcan(unless we make m1n1 do it all, but... that kind of smells like relying on the bootloader a bit too much)
13:06marcan(especially since I fully expect resets to be necessary to get us out of trouble during development)
13:18svenyeah, probably
13:20bgb has quit [Ping timeout: 480 seconds]
14:22GreatGodvin has quit [Quit: GreatGodvin]
14:22GreatGodvin has joined #asahi
14:23GreatGodvin has quit []
14:23choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
14:35bgb has joined #asahi
14:47balrog has quit [Quit: Bye]
14:51bgb has quit [Ping timeout: 480 seconds]
14:53tomtastic has quit [Quit: ZNC - https://znc.in]
14:54tomtastic has joined #asahi
15:19bgb has joined #asahi
15:30svenarnd: https://github.com/AsahiLinux/linux/commit/69142df77238252d5ab52d940bcff054c4dcd551 that's all i had to fix i your patches to make nvme as a platform device work
15:31arndsven: wow, I was really lucky there, I fully expected some major screwup
15:32bgb has quit [Ping timeout: 480 seconds]
15:34arndsven: actually in my build tree, I added a hack to only allow building CONFIG_BLK_DEV_NVME_PLATFORM when CONFIG_PCI is also set
15:34arndwhich doesn't matter for the M1, but in theory those two should be completely separate
15:35sventrue, probably also makes sense to split this out of pci.c as well
15:36arndI did not want to take that last step in order to make rebasing easier until the nvme maintainers are ready to merge it
15:36svenmakes sense, that probably made the rebase i had to do relatively painless
15:37j_eywhat exactly is a platform device/driver?
15:39svenmy limited understanding is that a platform device is defined in a device tree (or possibly even in some code directly) as opposed to a device that can be enumerated on a bus
15:40EmantorNVMe didn'
15:41Emantort have support before because usual nvme devices are connected to the PCIe bus.
15:41EmantorAnd enumeration of devices on the bus is done by the PCIe bus driver.
15:42arndoriginally platform devices were always defined in board files or architecture code, such as
15:42arndarch/x86/kernel/rtc.c: platform_device_register(&rtc_device);
15:42jryans is now known as Guest1328
15:43arndwhen we converted embedded powerpc platform code to DT, we started out with having a separate device type for devices defined in there, but ended up merging the two as a ton of drivers ended up needing to support both board files and DT booting
15:45arndit's a bit of an anachronism now since only a few hundred non-DT boards remain, compared to over 2000 dts files in tree, and more that work with mainline kernels but were never submitted for inclusion
15:52EER_ has joined #asahi
15:57Guest1328 is now known as jryans
15:57jryans has quit [Quit: authenticating]
15:57jryans has joined #asahi
15:58EER has quit [Ping timeout: 480 seconds]
16:22choozy has joined #asahi
16:42pitust[m]how do i shrink the linux partition and give more to macos
16:43pitust[m]ah erasing twice worked
17:10aleasto has joined #asahi
17:14VinDuv has joined #asahi
17:17aleasto has quit [Quit: Konversation terminated!]
17:26aleasto has joined #asahi
17:29aleasto has quit []
17:29aleasto has joined #asahi
19:05arndsven: ah, now the build bot started reporting the !CONFIG_PCI failures on your tree that I had seen earlier. Curiously it doesn't happen on a defconfig build with PCI disabled, it needs some other config options that I have not analyzed yet.
19:08j_eyarnd: some build bot is running on the asahi github branches?
19:08arndj_ey: yes, the kernel zero-day bot builds all branches of git repos that feed into linux-next
19:09arndwith some heuristics, I think it only tests recent commits
19:09arndand there is a manual opt-in and opt-out
19:10j_eyarnd: oh cool, I didn't know asahi was feed into linux-next
19:11arndoh, actually it doesn't. In this case there must be some other heuristic, maybe they started building all trees with recent commits that forked from torvalds/linux.git
19:20Andalu30 has joined #asahi
19:36aleasto has quit [Remote host closed the connection]
19:52choozy has quit [Remote host closed the connection]
20:16bloom/scroll/scroll goto -10
20:17bloommarcan: I might take IOP
20:18bloomseems like a low hanging fruit and it'll get me to actually build a kernel for this thing
20:25kettenisthat's the u-boot driver
20:25svenarnd: ah, yes. still some cleanup work left to be done. i think that build bot might take any git url it finds in MAINTAINERS
20:25sveneither way, very useful bot :-)
20:25kettenisI wrote that after studying the corellium driver
20:26pipcet[m]it's essentially the state machine turned back into linear code, right?
20:27pipcet[m]or are there major differences in behavior?
20:27kettenisnot really
20:28kettenisI only implemented the states that are needed
20:28kettenisfor SMC and NVMe
20:29kettenisbut a linux driver should probably be interrupt-driven
20:35VinDuv has quit [Quit: Leaving.]
20:40Andalu30 has quit [Quit: Konversation terminated!]
20:59choozy has joined #asahi
21:05EER_ has quit [Remote host closed the connection]
22:30choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
22:46bloomkettenis: thanks
22:46bloom> writeq((msg[1] & ~0xffULL) | chan->id, priv->base + REG_A2I_MSG1);
22:47bloomI don't think the & here is really correct (though I know Corellium does that)
22:47bloomPhilosophically it doesn't make any sense to have a nonzero value in the first byte of msg[1], since the channel ID is supposed to be there.
22:51bloomBe assert()ive
23:10zopieux has quit [Quit: zopieux]
23:10zopieux has joined #asahi
…