ChanServ changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
<alyssa> Crikey
<alyssa> Hmm still not seeing anything
<alyssa> pipcet[m]: "(* means broken)" that's reassuring
<pipcet[m]> I'm running that code and I'm definitely seeing a USB device and a network interface from the Linux/Intel side
<pipcet[m]> I think what's broken is the missing dropbear package in that image so you can't actually log in :-)
<alyssa> ahh
<alyssa> Nothing enabled under vv right?
<alyssa> > Device Drivers > USB support > USB Gadget Support > USB Peripheral Controller ───────────────────────────────────────────────────────────
<pipcet[m]> anything in dmesg after you do the echo ...dwc... > .../UDC thing?
<alyssa> also CONFIG_TYPEC_UCSI: seems important
<alyssa> relevant dmesg "udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers"
<alyssa> right...
<pipcet[m]> anything in /sys/class/udc?
<alyssa> no, empty. you?
<pipcet[m]> 502280000.dwc3
<alyssa> Oooo
<pipcet[m]> tried unloading/reloading the driver?
<alyssa> i'm assuming i'm missing a config
<alyssa> uhmmm
<pipcet[m]> anything from the dwc3 driver in dmesg? it should probably complain about a DT/configuration mismatch...
<alyssa> uhhh
<alyssa> No.. :|
<alyssa> probably a device tree issue
<pipcet[m]> quite possible :/
<alyssa> dr_mode = "host"
<alyssa> sven: thanks
<alyssa> Ok, now I have a gadget device but my host mode is broken. 🙃
<alyssa> "dr_mode forced to gadget" ...right
<pipcet[m]> you need that for the keyboard, right?
<alyssa> rootfs but yeah
<alyssa> dont need the keyboard if I have ssh
<alyssa> (and would rather do that replacement since I will be losing the display soon ;-))
<pipcet[m]> don't need rootfs if you have nfsroot-over-usb! uh...
<alyssa> lolololol
<alyssa> dwc3 says Configuration mismatch
<alyssa> up debug central uhmmmm
<alyssa> it.. should be possible to have host mode on one port and gadget on the other right?
<pipcet[m]> I don't know, to be honest, I don't think I've done both at the same time.
<pipcet[m]> you can always just move to a large initrd, though you need to change a few lines in the m1n1 proxyclient code to allow it...
<alyssa> hehehe
<amw> alyssa: Might be a lots easier to by a USB hub - mine works fine for keyboard + USB drive, might be limited to USB2 support though...
<amw> *connect via a USB hub I mean
<alyssa> I do have a hub
<amw> Aah you don't have an Ethernet or WiFi USB dongle
ihaveamac has quit [Quit: fail]
ihaveamac has joined #asahi
<alyssa> Oh oops was missing a device tree thing
<alyssa> let's try this
<alyssa> [10767.980519] usb 7-1: can't set config #1, error -110
<alyssa> incidentally broken on host side, wee
<pipcet[m]> I think that's a timeout?
Emantor has quit [Quit: ZNC - http://znc.in]
Emantor has joined #asahi
<alyssa> "fixed" the m1 dmesg error so the port is in OTG mode but still no UDC, what
<alyssa> er no maybe that's just racey
<alyssa> still no host mode
<alyssa> right... it's failing to do the role switch
<pipcet[m]> force the roles?
<pipcet[m]> alyssa: uhm, I got a bit carried away, I was just going to write some pseudocode for the mailbox/ASC/DCP+SMC/brightness+gpio stack, but then I hacked on it a bit more and things actually work here now
quarkyalice has joined #asahi
phiologe has joined #asahi
PhilippvK has quit [Ping timeout: 480 seconds]
yuyichao has joined #asahi
quarkyalice_ has joined #asahi
quarkyalice has quit [Remote host closed the connection]
<alyssa> pipcet[m]: Nya
<alyssa> So I can stop writing a DCP driver, work is done? 😋
alyssa has quit [Remote host closed the connection]
marvin24_ has joined #asahi
marvin24 has quit [Ping timeout: 480 seconds]
quarkyalice_ has quit [Quit: Leaving]
chadmed has quit [Quit: Konversation terminated!]
chadmed has joined #asahi
chadmed has quit [Quit: Konversation terminated!]
<pipcet[m]> s/stop/start/, I think :-)
chadmed has joined #asahi
chadmed has quit [Quit: Konversation terminated!]
bisko has joined #asahi
bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bisko has joined #asahi
bisko has quit []
bisko has joined #asahi
chadmed has joined #asahi
bisko has quit []
dung[m] has joined #asahi
<j_ey> are the LB and LR partitions needed currently?
<tophevich[m]> j_ey: (disclaimer: I've no clue what I'm talking about.) But as far as I gathered from marcan's last stream regarding installer script, you need an LB, LR and Data/System flagged partions for the group to be seen selectable as a boot option.
<j_ey> oh, I didn't remember hearing that, but ok!
alyssa has joined #asahi
<pipcet[m]> alyssa: figured out how to get ssh to work?
<pipcet[m]> alyssa: there's code at https://github.com/pipcet/linux/commit/dd4c7abffd71318cb2a2c31514ae0ad29eeed3c3 if you want to have a look, but of course it's perfectly okay if you don't and do your own thing instead :-)
<alyssa> eyes
<sven> ugh.. and now we've done duplicated work :(
<tophevich[m]> sven: but doing it yourself means you understand the problemspace better right? :D ... so not for nothing :P
<tophevich[m]> (just wanted to give it a postive spin)
<pipcet[m]> sven: no, I looked at yours first!
<pipcet[m]> sven: (and I figured the way I decided to do it wouldn't fly anyway, so let's wait and see whether anything was really duplicated :P)
<sven> no, i mean, i have some WIP code to split asc to mailbox and clients. if i had known that you worked on this i could've focused on gpio/pinctrl/or any of the other stuff that's left to do
<pipcet[m]> sven: sorry, I'll try to be clearer next time
<j_ey> pipcet[m]: are you planning on working to upstream yoru code?
<pipcet[m]> j_ey: ideally, yes, but I certainly don't want to inconvenience anyone by getting incompatible changes included
<pipcet[m]> (and it's been a really long time since I last got stuff included in the kernel)
<tophevich[m]> (you could use the github/asahilinux issue tracker to tracker open tasks and who does what + WIP:PRs linked to that for better visibility)
<alyssa> pipcet[m]: I'd encourage you to try to upstream the WDT driver
<alyssa> It's useful functionality, and a lot simpler than the whole web of ASC+DART+DCP+etc so a lot less bikeshedding on the LKML :)
<pipcet[m]> alyssa: will do once I can test it on the mainline kernel and see that it still works. Thanks! :-)
<alyssa> pipcet[m]: Cc me when you send out the email :)
<alyssa> (Obviously the code needs some clean up before a v1 -- #if 0 is going to be a no-no, etc -- but that's the easy part)
<pipcet[m]> definitely.
<pipcet[m]> I think the wdt driver should work without the clk stuff, too, but we need those for the fpwm (keyboard backlight) driver.
alyssa has left #asahi [#asahi]
<j_ey> does kmutil copy m1n1.macho somewhere?
<j_ey> it seems like m1n1.macho doesnt have to be at a particular location when you use kmutil configure-boot?
<sven> i'm pretty sure it does
<tophevich[m]> don't know if that helps you, but in the last stream this is the section where he does configure-boot on m1n1.macho: https://youtu.be/uqPLyBS20PA?t=7568
<tophevich[m]> (searched through auto-transcript)
<j_ey> cool, seems like it can be anywhere then!
<j_ey> although I can't seem to get curl to work :/
<j_ey> it just never recievs any data
<j_ey> would help if you typed the address correctly...
<tophevich[m]> yeah the last 2 times he did it on stream it seems to take forever
<j_ey> i just typed 192.68 instead of 192.168 :)
<tophevich[m]> ;)
<j_ey> woot, booted into m1n1!
<j_ey> what folder do you have to be in, to execute shell.py for example?
<j_ey> I get "ImportError: attempted relative import with no known parent package"
<j_ey> if I execute it from the top level m1n1 directory, now I get: ModuleNotFoundError: No module named 'serial.tools', even though I ran: python3.9 -m pip install serial construct serial.tool
<pipcet[m]> there's probably a better way, but what I do is cd to m1n1/proxyclient, then python3 -m m1n1.shell
<j_ey> turns out I needed pyserial, not serial, fixed the wiki
<j_ey> trying to boot gives me https://paste.gg/p/anonymous/22c5bc397c4349cfafd0da1d4b6656ce it looks like it's using some serial lib from the distro, not the one from pip?
<svenpeter[m]> Did you boot over usb? Because that USB port will disappear
<j_ey> Oh
<svenpeter[m]> It shouldn’t fail with an exception but if your OS does something weird that might happen
<j_ey> Im confused then, I can't use a single USB cable to load linux, and then have access to the Linux serial output?
<j_ey> I dont think the kernel actually runs, at least it never writes to the framebuffer
zopieux has quit [Ping timeout: 480 seconds]
zopieux has joined #asahi
<svenpeter[m]> I’m just guessing here fwiw :)
<svenpeter[m]> But I run uart and usb over a single cable. I believe you have to pass the uart node with -t
<j_ey> pass it to what?
<svenpeter[m]> Linux.oh
<svenpeter[m]> *.py
<svenpeter[m]> It’ll switch to uart after sending the boot request over usb then
<j_ey> got an example?
<svenpeter[m]> Not at home right now
<j_ey> anyway i confirmed that Linux is actually running by putting a `hvc` somewhere
<j_ey> ok no worries, maybe when amw is around again theycan help
<svenpeter[m]> Do you have a hardware uart?
<j_ey> nope
<svenpeter[m]> I don’t think the hv emulates the uart interface enough for Linux to use it fwiw
<j_ey> 'Under the hypervisor you can get the console output from linux via the 2nd ttyACM1 device generated by the m1n1 HV' from https://github.com/AsahiLinux/docs/wiki/SW%3ALinux
<svenpeter[m]> Ah, I’ve never done that. No idea what’s wrong then
<j_ey> svenpeter[m]: what your -t uart node thing only relevant for hardware uart?
<svenpeter[m]> Yes
<svenpeter[m]> But I still think that the uart emulated in the HV is not enough for Linux
<svenpeter[m]> It didn’t emulate interrupts last time I checked
<j_ey> derp, compiled out the simple-framebuffer console
Andalu30 has joined #asahi
roxfan2 is now known as roxfan
<j_ey> I have a kernel and initramfs that I can use with qemu and get to a busybox shell, but when trying with m1n1, it cant seem to find files in the initramfs :/
<j_ey> sigh, my initramfs.cpio.gz.. wasn't actually gziped, was just a cpio
Andalu30 has quit [Quit: Konversation terminated!]
kallsyms has quit [Ping timeout: 480 seconds]
kenzie has quit [Quit: The Lounge - https://thelounge.chat]
kenzie has joined #asahi
<marcan> j_ey: LB/LR are just placeholders for linux partitions
<marcan> LB is intended to be a FAT32 EFI partition for u-boot/grub/kernel, LR would be reformatted as ext4 for / or whatever, but that's just one possible set-up
<j_ey> ok cool, I made them anyways
<j_ey> marcan: was https://paste.gg/p/anonymous/22c5bc397c4349cfafd0da1d4b6656ce one of the errors related to some python version issues?
<marcan> that looks normal
<marcan> once m1n1 hands off control USB is dead
<j_ey> Ok, I'll try again, see if it boots to the same point as when I used run_guest. when I previously tried it just seemed to be stuck at the apple logo
<marcan> if you don't get a framebuffer that sounds like a kernel config problem
<marcan> gotta get some sleep :)
<marcan> I think I've mostly recovered from the second shot
<j_ey> marcan: i get the fb with rum_guest now at least!
<marcan> that's interesting that you don't without it then :D
<j_ey> marcan: sounds like you had pretty much the exact same symptoms/reactions as my gf, she had thw 2nd shot y/day too!
<marcan> hah!
<j_ey> well i gave up with linux.py a few hours ago, can retry soon!
opticron has quit [Ping timeout: 480 seconds]
<marcan> yeah, 12h after the shot (at night) I got a fever, 38.5 ish, hitting 39 at times. then it went down to 37.5 and fluctuated; the first half of the next day I was tired / sore. It fluctuated a bit, shot up to 38 again briefly in the afternoon, then seems to have just gone away. <37 now.
<marcan> so I guess overall 36h total effect after the shot
<marcan> starting 12h and continuing for 24h after that
<marcan> *at 12h
<marcan> and see, this is why I really should spend some time building an installer and a kernel merge/something pipeline and simple docs that work for everyone
<marcan> people actually want to run this stuff now and it's silly that everyone has to fight with one thing or another :-)
opticron has joined #asahi
<j_ey> the fighting was kinda fun, apart from 2h on just not realising my .cpio.gz wasn't actually compressed. I haven't understand the src/payload.c code yet, but it seems to not handle uncompressed initramfs', but I didnt see an error :/
<marcan> yeah, it needs to know the size and currently makes no attempt at walking a cpio to find the end
<marcan> so it requires compression
<marcan> since you can concatenate multiple things and it needs to be able to find the next one
<marcan> printf("Uncompressed cpio archives not supported\n");
<marcan> you *should* have gotten that
<j_ey> does that go both to the framebuffer and the python shell?
<j_ey> hmmm yeah so, it returns NULL, but then it just carries on loading
<marcan> if you're using the hypervisor it will go to the secondary iface as vuart; if you're just chainloading it won't go anywhere because after the chainload is done your connection drops and presumably you aren't reconnecting quickly enough after that to get the spew before linux boots
<marcan> yes, it's not a fatal error. maybe it should be :)
<j_ey> ok then I probably wasnt paying enough attention to the vuart, but I think it would be better to error out, than just return NULL and carry on
<j_ey> ^^
<marcan> the thing is, e.g. having the *kernel* uncompressed as the last payload *is* legal
<marcan> and that does return NULL because it means it can't find the next payload if there were one, but it *does* boot it
<marcan> this is because the kernel header has a size that isn't the real file size, it's padded, so it's no good for finding the next thing, but it's good enough for loading the kernel
<marcan> so I'd need a separate error return for stop with error vs last payload, continue booting
<j_ey> that's jsut a simple matter of programming
<j_ey> :P
<marcan> sure :p
<marcan> anyway, sleep ;)
<j_ey> ciao!