marcan changed the topic of #asahi to: Asahi Linux: porting Linux to Apple Silicon macs | Not ready for end users / self contained install yet. Soon. | General project discussion | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Topics: #asahi-dev #asahi-re #asahi-gpu #asahi-stream #asahi-offtopic | Keep things on topic | Logs: https://alx.sh/l/asahi
<chadmed> Glanzmann: on virtually all platforms, PCI is "turned on" by the firmware and kernel mode drivers just probe the bus for devices hanging off the root hub. neither openbsd nor the linux kernel have to have a specific system for "turning on" the bus
m6wiq has quit []
<jeffmiw> Glanzmann: rtc support over spmi is here : https://github.com/jfbortolotti/linux/tree/spmi_rtc , you need the following flags in your kernel config: CONFIG_SPMI_APPLE=y CONFIG_MFD_APPLE_SPMI_SERA_PMU=y CONFIG_RTC_DRV_APPLE_PMU_SERA=y
<jeffmiw> tested on mba for now, branch only have the changes for t8103
<jeffmiw> this enables to boot with current time set in rtc, and rtc is updated is system date/time is changed
myon98 has joined #asahi
jmr2 has joined #asahi
<jmr2> jeffmiw: Thanks for sharing. Good to see another area making progress.
<jmr2> jeffmiw: you seem to have a mix of tabs & spaces in your files. Depending on the editor, the alignments are wrong.
<jmr2> (and typo: only one R in Corellium)
jmr2 has quit [Quit: Page closed]
tomtastic_ has joined #asahi
tomtastic has quit [Ping timeout: 480 seconds]
riker77_ has joined #asahi
riker77 has quit [Ping timeout: 480 seconds]
riker77_ is now known as riker77
reillyeon has quit [Quit: The Lounge - https://thelounge.github.io]
reillyeon has joined #asahi
psykose has quit [Ping timeout: 480 seconds]
psykose has joined #asahi
bisko has quit [Server closed connection]
bisko has joined #asahi
PhilippvK has joined #asahi
kov has quit [Quit: Coyote finally caught me]
phiologe has quit [Ping timeout: 480 seconds]
darkapex has quit [Ping timeout: 480 seconds]
jbowen has quit [Ping timeout: 480 seconds]
<PthariensFlame[m]> Seems like there's some confusion on the mailing list.
marvin24_ has joined #asahi
marvin24 has quit [Ping timeout: 480 seconds]
<marcan> it does
<Glanzmann> jeffmiw: Thank you, trying now.
<marcan> pretty sure agraf knows, he'll probably reply
<Glanzmann> chadmed / marcan: If every other system turns on PCI in the firmware, why don't we turn it on in m1n1, but kettenis appears to implement in OpenBSD, as I heard we're planning on doing that in the linux kernel?
<marcan> you may have noticed a pattern that these systems are a bit different from "every other system" ;)
<marcan> linux needs an SMC driver anyway, and being able to turn off PCI devices might be important in the future, e.g. if it interacts with sleep
<Glanzmann> marcan: I see. Will brcmfmac/brcmutil call SMC to do the same or will SMC do it bytiself?
<marcan> the PCI core will handle that
<marcan> sifive already does this
<marcan> so in fact there is already one other system like this
<Glanzmann> I see.
dfip^ has quit [Remote host closed the connection]
lewurm has quit [Server closed connection]
lewurm has joined #asahi
threerik[m] has quit [Server closed connection]
threerik[m] has joined #asahi
drwhax[m]1 has quit [Server closed connection]
drwhax[m]1 has joined #asahi
as400[m] has quit [Server closed connection]
as400[m] has joined #asahi
l3k[m] has quit [Server closed connection]
l3k[m] has joined #asahi
Sebhl[m] has quit [Server closed connection]
Sebhl[m] has joined #asahi
<Glanzmann> jeffmiw: RTC works for me on the macbook air. I tested by disabling wifi and rebooting several times, 'date' shows the real time. I did not see anything in dmesg though. dmesg: https://pbot.rmdir.de/rvz9mbw7L4rnmohnYaQ9FA
<Glanzmann> jeffmiw: The kernel options were turned on automatically for me when doing olddefconfig. I did not need to update the device tree in u-boot.
<Glanzmann> jeffmiw: I can test on the mini as well, once you adopted the code.
_jannau_ has quit [Server closed connection]
_jannau_ has joined #asahi
<Glanzmann> If someone else wants to try rtc (currently probably only works on macbook air), here it is: https://tg.st/u/rtc.txt
jbowen has joined #asahi
RianSouzaSantos[m] has quit [Server closed connection]
RianSouzaSantos[m] has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
al3xtjames has quit [Quit: al3xtjames]
al3xtjames has joined #asahi
jelly has quit [Server closed connection]
jbowen has joined #asahi
mini has quit [Server closed connection]
mini has joined #asahi
jelly has joined #asahi
bradfier has quit [Server closed connection]
bradfier has joined #asahi
mattmurr[m] has quit [Server closed connection]
mattmurr[m] has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
darkapex has joined #asahi
ofl^ has joined #asahi
jbowen has joined #asahi
ciggi has joined #asahi
<mps> Glanzmann: on which branch you applied rtc patches, asahi or smc/work?
<Glanzmann> mps: I applied it on top of asahi, but I assume any branch will be fine.
<Glanzmann> mps: ANd I think it will work on any system 2020 system.
<Glanzmann> I try the mini right now with debian live.
<mps> Glanzmann: thanks for info, I will try on MBP
ciggi_ has quit [Ping timeout: 480 seconds]
Bicet[m] has quit [Server closed connection]
Bicet[m] has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
BlazinWeed[m] has quit [Server closed connection]
BlazinWeed[m] has joined #asahi
josipknezovic[m] has quit [Server closed connection]
josipknezovic[m] has joined #asahi
jbowen has joined #asahi
<mps> rtc doesn't work on MBP in my case
<Glanzmann> mps: I see, let me check if it works on the mini.
<Glanzmann> If it does, I'll send you the debian live you can boot it from a usb stick and see if it works then.
<Glanzmann> Need to rebuild everything because I forgot to enable the parameters ...
<mps> Glanzmann: I applied them on top of smc/work branch
<Glanzmann> mps: I see. I look forward to having wifi for axboe and poweroff for us. :-)
<Glanzmann> I did not try smc yet, because it is just plumbining.
jbowen has quit [Ping timeout: 480 seconds]
<mps> Glanzmann: I will revert to asahi branch and try again
<Glanzmann> mps: Wait 5 more minutes.
<Glanzmann> Than I can tell you if it works on the mini.
<mps> ok, will wait but anyway I have to revert to asahi and try to report f2fs 'issue' to upstream
<Glanzmann> I see.
<Glanzmann> mps: Does __not__ work for me on the mini.
<Glanzmann> jeffmiw: We tried mba, mbp 2020 and mini. Mba works, the other two not.
<jeffmiw> jmr2: thanks. Noted.I'll fix both tab/spaces & Corellium typo.
<mps> Glanzmann: thanks for checking
<jeffmiw> Glanzmann: thanks for the feedback. I'll see how to figure out what is missing for mbp 2020 and mini
<Glanzmann> jeffmiw: If it helps, I can give you remote access to the m1n1.
<Glanzmann> mini
kit_ty_kate1 has quit [Quit: WeeChat 3.2.1]
<jannau> Glanzmann: it doesn't work out of the box on the mac mini?
<jeffmiw> Glanzmann: yes that will help
NotHere[m] has quit [Server closed connection]
NotHere[m] has joined #asahi
elosant[m] has quit [Server closed connection]
elosant[m] has joined #asahi
ytg has quit [Server closed connection]
ytg has joined #asahi
jbowen has joined #asahi
lemonsus[m] has quit [Server closed connection]
lemonsus[m] has joined #asahi
nsklaus has joined #asahi
rethematrix[m] has quit [Server closed connection]
rethematrix[m] has joined #asahi
yoodee[m] has quit [Server closed connection]
yoodee[m] has joined #asahi
GenieLotion[m] has quit [Server closed connection]
GenieLotion[m] has joined #asahi
ryanhrob[m] has quit [Server closed connection]
ryanhrob[m] has joined #asahi
<mps> hmm, probably I don't get rtc because I didn't applied dts part of patch to u-uboot
roxiun[m] has quit [Server closed connection]
roxiun[m] has joined #asahi
<mps> jeffmiw: right?
jbowen has quit [Ping timeout: 480 seconds]
nsklaus has quit [Quit: Textual IRC Client: www.textualapp.com]
fionera[m] has quit [Server closed connection]
fionera[m] has joined #asahi
<jeffmiw> mps: may be, i'm not familiar with the u-boot flow, i'm using m1n1 to kernel flow, with u-boot, how is provided the DT built with the kernel to the kernel ?
why2[m] has quit [Server closed connection]
why2[m] has joined #asahi
<mps> jeffmiw: u-boot load DTB and don't use kernel DTB
dek[m] has quit [Server closed connection]
dek[m] has joined #asahi
<mps> and I used DTBs from u-boot when created m1n1+u-boot+dtb payload
cavoirom[m] has quit [Server closed connection]
cavoirom[m] has joined #asahi
Rhys[m]12 has quit [Server closed connection]
Rhys[m]12 has joined #asahi
gladiac has quit [Server closed connection]
gladiac has joined #asahi
<mps> I will try to use DTBs from kernel and rebuild u-boot and recreate payload
<jannau> please stop testing kernel changes with device tree changes with u-boot
<Glanzmann> jannau: No, it does not.
<mps> jannau: yes, I know, but ... sorry
<Glanzmann> jeffmiw: Do you have IPv6?
mlq_ has quit [Server closed connection]
mlq_ has joined #asahi
<jeffmiw> Glanzmann: honestly never check or used it, my internet connection should have it, but local network is not really setup for it.
<Glanzmann> jeffmiw: Lets go with IPv4 then.
<Glanzmann> jeffmiw: So I ahve Debian testing with mini/u-boot/grub, should I prepare anything else?
roxfan2 has joined #asahi
yrlf has quit [Server closed connection]
yrlf has joined #asahi
roxfan has quit [Ping timeout: 480 seconds]
<jannau> Glanzmann: seems to work for me as expected on a mac mini
<jannau> [ 1.170688] apple-pmu-sera-rtc 23d0d9300.spmi:pmu-sera@0:rtc@0: setting system clock to 2022-02-06T09:53:02 UTC (1644141182)
<jannau> I would expect that it works on the 13-inch mbp and imac as well
malvo has quit [Ping timeout: 480 seconds]
<mps> jannau: it crashed on boot in my case on MBP and kernel doesn't finish booting machine
JoshuaAshton has quit [Server closed connection]
JoshuaAshton has joined #asahi
<Glanzmann> jannau: Than I did a mistake. Did you use u-boot chain?
<jannau> no. please stop testing kernel changes with device tree changes with u-boot!
<jannau> verify it first by directly booting the kernel and the dtb from the kernel build
<Glanzmann> jannau: I did not modify u-boot. I just tried to boot the kernel. But I'll test it like that.
<Glanzmann> jannau: On the u-boot, I just installed the kernel and it worked.
<jannau> if that works you can proceed to testing it u-boot. if it fails there you have the wrong dtb embedded in the m1n1+u-boot binary
<Glanzmann> I see.
<jannau> the nvme u-boot device tree already has spmi nodes but those look incompatible with the driver
<kettenis> jannau: already pointed that out to jeffmiw; hopefuly we can work out the dt bindings for this together
jbowen has joined #asahi
nsklaus has joined #asahi
jato has quit [Server closed connection]
jato has joined #asahi
<jeffmiw> kettenis: just pushed a new version with compatible aligned to the one you mentioned yesterday, need to double check. as discussed, I have to move the nodes around the .dtsi
jbowen has quit [Ping timeout: 480 seconds]
<kettenis> use both "apple,t8103-spmi" and "apple,spmi" in the compatible string (in that order) and make the driver match on "apple,spmi"
<kettenis> if the SPMI block on t6000/t6001 is the same, that will get "apple,t6000-spmi", "apple,spmi"
<kettenis> that way your spmi driver will work there as well, but we can still distinguish the two if we discover some subtle difference at a later stage
blasty has quit [Server closed connection]
<kettenis> (sorry if I wasn't clear about this last night)
blasty has joined #asahi
<amw> marcan: Compile fix for marcan/smc/work : https://paste.debian.net/1229768/
<as400[m]> Glanzmann: I've seen you tried OpenBSD. How would you compare its state to Linux ? On m1 of course.
<amw> When I tried to boot that kernel with my older blessed m1n1+u-boot it can't find the nvme drive, looks like compatible's have changed apple,t8103-ans-nvme => apple,nvme-ans2
<Glanzmann> as400[m]: kettenis is probably a better source of reference.
<amw> presumably others sigh, Might get a chance to chase down or re-do the m1n1 + u-boot bless thing next week, was hoping to get battery status
<Glanzmann> So OpenBSD has the following that Linux does not have: an installer, poweroff and battery readings.
<kettenis> kettenis is biassed ;)
<Glanzmann> Linux has the follwing which OpenBSD does not have: DCP driver.
<Glanzmann> Oh and the nvme is faster on OpenBSD than on Linux.
<as400[m]> But dcp driver is needed only for mini, right ?
<Glanzmann> But to be honest the OpenBSD experience was very smooth. I had my desktop running in like 30 minutes. And kettenis talked me through the partitioning and the framebuffer.
<Glanzmann> as400[m]: Yes.
<Glanzmann> as400[m]: I mean in the end we want the dcp driver everywhere.
<Glanzmann> But on the mini you really need it.
<Glanzmann> At least if you don't have a 1080p monitor or want rotation.
<Glanzmann> Oh and OpenBSD has chrome.
<Glanzmann> But it has no firefox.
<Glanzmann> as400[m]: I probably will do a video showing of the installation.
gabuscus has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
gabuscus has joined #asahi
<as400[m]> Glanzmann: great idea. Or a simple step by step text.
<Glanzmann> I also wrote a poor mans debian installer for 1tr. But this is pre-alpha: https://tg.st/u/pmdi.pl
Major_Biscuit has joined #asahi
<Glanzmann> as400[m]: The simple step by step, I already have: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/m1-debian/blob_plain/HEAD:/doc/OpenBSD.txt
<Glanzmann> I also thought about adding a small wiki article with a more polished guide.
<as400[m]> Glanzmann: how did you boot installer ?
<Glanzmann> Of course I did.
<as400[m]> Yeah but how ? Usb ?
<Glanzmann> marcan hooked mps and me with having pci enablement in u-boot. since then we are happy u-boot user.
<Glanzmann> as400[m]: Yes,
<Glanzmann> s/marcan/kettenis/
<Glanzmann> as400[m]: U-boot only works with the 2020 models. Quickstart see here. I also have some videos on the debian wiki page. https://github.com/AsahiLinux/docs/wiki/U-Boot
<as400[m]> So you boot the installer from usb by means of uboot right ?
<Glanzmann> as400[m]: So you use the asahi installer to get the stub. Than you install there m1n1/dtb/u-boot instead of just m1n1.
<Glanzmann> as400[m]: Yes. It does that by default if you don't have a esp partition on the nvme.
<Glanzmann> If you have you can interrupt and say run bootcmd_usb0
<Glanzmann> I also put all that information in the wiki.
<as400[m]> No OpenBSD for me then. I got 2021 mbp :(
<Glanzmann> as400[m]: I also build a debian live system and a modified debian installer which can also be booted by usb.
<Glanzmann> as400[m]: wait a little bit longer I'm sure u-boot will work on the pro/max soon.
<as400[m]> Yeah, I will.
chengsun has joined #asahi
<jannau> the dcp driver is not really ready though. I pushed changes which require a modified m1n1 and I expect churn in the devicetree changes so it will probably be painful to follow along
<Glanzmann> jannau: I decided to wait until you ping me or it is merged in asahi.
<mps> does m1n1+kernel+dtb payload work on 2021 machines
<Glanzmann> mps: nope
<Glanzmann> u-boot crashes, I heard.
<jannau> mps: sure
<mps> Glanzmann: I mean without u-boot
chengsun_ has joined #asahi
<mps> if that works then as400[m] could try this
<Glanzmann> mps: no wifi without a second machine
<mps> Glanzmann: ah, same as on 2020 boxes
<Glanzmann> mps: But I hope that marcan or someone else adds the 4 lines of code that are missing to poweron wifi soon. And than we can use the 2021 models with mini. And most important we can onboard Jens Axboe.
<as400[m]> mps: yes, I did already booted my mbp with Linux. Just wanted to try OpenBSD
<marcan> I'm literally adding the 4 lines of code right now
<marcan> it'll get done faster without IRC pings ;)
<mps> Jens? io_uring author?
* Glanzmann is going to the playground with the kids to not disturb you.
<Glanzmann> mps: Yes and fio author.
<mps> Glanzmann: ah nice, some time ago I had communication with him about io_uring patching for musl
<mps> helpful person
<Glanzmann> mps: I see. I'm just a regular fio user. And I had a lot of fusion io cards in a project 12 years ago.
<as400[m]> marcan: it was a friendly ping by Glanzmann I guess :)
<kettenis> maybe I should reach out and see if I can get some money donated to get an m1 pro machine
<jannau> as400[m]: check first if openbsd supports m1 pro/max, not sure if the openbsd kernel supports the linux boot protocol
<kettenis> I'm willing to soend some of my own money on it, but not *that* much money ;)
<Glanzmann> kettenis: You don't have a m1 pro machine?
<kettenis> jannau: no
LaurentiuCosma[m] has quit [Server closed connection]
LaurentiuCosma[m] has joined #asahi
<kettenis> Glanzmann: no, I don't
chengsun has quit [Ping timeout: 480 seconds]
<as400[m]> kettenis: so m1 pro is not supported at all in OpenBSD ?
<Glanzmann> What a pitty, I thought you have one. So how much money do you want to spend on it?
<mps> two or three months ago I tested one of this new machines in the reseller shop, well not impressed with this money increased
<kettenis> don't think I want to discuss that here
<chadmed> mps: its not justifiable if you dont plan on exercising the GPU or codec blocks. if you do though the extra power is well worth the money imo
<mps> chadmed: right, and that could be exercised with macos and I'm not interested to use macos for any work
jbowen has joined #asahi
<mps> so I should say 'not worth to spend these money for me'
mlq_ has quit [Quit: WeeChat 2.3]
<Glanzmann> kettenis: I send you an email.
jbowen has quit [Ping timeout: 480 seconds]
chadmed has quit [Remote host closed the connection]
chadmed has joined #asahi
m6wiq has joined #asahi
Major_Biscuit has quit [Ping timeout: 480 seconds]
jbowen has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
<marcan> pushed the SMC GPIO stuff to smc/work; tested on t6000
<marcan> should bring up the PCIe power stuff properly without any m1n1 games
<j`ey> mini games :D
Major_Biscuit has joined #asahi
<j`ey> marcan: what's the msleep() change about in pcie?
<marcan> it has a comment :)
<marcan> min time from power up to PERST release is 100ms
<kettenis> which actually makes sense ;)
<j`ey> oh woops, missed the change in comment
<j`ey> (and the fact that it's ms vs us)
<marcan> it should actually be a bit more, depending on how long the rails take to stabilize
<marcan> but we have no idea how long that is
<kettenis> is Tpvperl really what that's called in the PCIe standard?
<marcan> yes
<marcan> at least in 2.0
<marcan> I don't have 5.0
<kettenis> it is in 4.0
<Glanzmann> marcan: Is that ready for testing?
<Glanzmann> Than I try to take u-boot out of the chain and see if wifi still works.
c41e3a has joined #asahi
<marcan> Glanzmann: yes
<Glanzmann> Compiling. I do two tests. One with u-boot and one without.
jbowen has joined #asahi
<Glanzmann> So I tested the smc with u-boot and linux, and I have no wifi. Now I try the untethered m1n1.
jbowen has quit [Ping timeout: 480 seconds]
<landscape15[m]> With this config https://tg.st/u/m1-config-2022-01-27 I get stuck at black screen and asahi logo after booting
kit_ty_kate has joined #asahi
<Glanzmann> landscape15[m]: What hardware?
<Glanzmann> Which tree?
<marcan> Glanzmann: reminder that "not working" is not a useful bug report. logs please.
nirgo has joined #asahi
<Glanzmann> marcan: Okay, I send the dmesg.
<Glanzmann> landscape15[m]: I can reproduce.
jbowen has joined #asahi
<Glanzmann> marcan: untethered is also not working for me. I did the following: https://pbot.rmdir.de/XsA2SL5hPt9AQQstpxKSXQ
nirgo has quit [Ping timeout: 480 seconds]
<marcan> I need boot logs, please use the hypervisor if you have no framebuffer
<marcan> and you need to enable SMC in the .config if you haven't already
<marcan> along with the GPIO stuff
<Glanzmann> marcan: About the u-boot, I did not update the dtb. But if it should work anyway, than let me give you the dmesg: https://pbot.rmdir.de/t3AyXlHxSDpUvNc8s60W6w
jbowen has quit [Ping timeout: 480 seconds]
<Glanzmann> marcan: Maybe that's it.
<Glanzmann> landscape15[m]: I can reproduce your issue. Probably smc config options is missing.
<marcan> the looks like you're missing the driver
<marcan> and you definitely need the new devicetrees
<Glanzmann> marcan: I checked my config. So I have CONFIG_GPIO_MACSMC=y CONFIG_APPLE_SMC=y CONFIG_APPLE_SMC_RTKIT=y CONFIG_ARCH_NR_GPIO=2048
<Glanzmann> That should be fine, so I'm going to try the hypevisor.
<Glanzmann> Never used the hypervisor before.
<marcan> [ 1.838044] macsmc-rtkit 23e050000.smc: error (____ptrval____): No SRAM region
<marcan> that sounds like your devicetree is bad
<Glanzmann> marcan: That was the u-boot. The other one does not show me the framebuffer.
<Glanzmann> I'm not touching u-boot device tress, Everytime I tried, I failed. So now I wait until it is merged into asahi than I ping kettenis.
<Glanzmann> marcan: But I'll debug the one without u-boot.
<Glanzmann> And there I included every device tree I could find.
<Glanzmann> That was this one. https://pbot.rmdir.de/XsA2SL5hPt9AQQstpxKSXQ
<Glanzmann> j`ey: You have this oneliner for the hypervisor, can you please share it again?
<j`ey> it's basically the same as linux.py, but with run_guest.py ^
<Glanzmann> I see, thanks.
<Glanzmann> marcan: This is what I get on the hypevisor: https://pbot.rmdir.de/7mjQS7bkr5h8EzXDUTLf_w
<marcan> you need a macho for the hypervisor
<Glanzmann> I see. Let me try again.
<marcan> you also need to watch the secondary USB device with picocom or whatever if you want to see anything
mavericks has quit [Quit: The Lounge - https://thelounge.chat]
mavericks has joined #asahi
<Glanzmann> Okay, let me do that, too. And here is the output of the hypervisor console: https://pbot.rmdir.de/hjvWNogul__stPlexRQNqg
Major_Biscuit has quit [Ping timeout: 480 seconds]
c41e3a has quit [Quit: c41e3a]
m6wiq1 has joined #asahi
c41e3a has joined #asahi
m6wiq has quit [Ping timeout: 480 seconds]
<mps> Glanzmann: a day or two ago I copied t8103.dtsi and t8103-jxxx.dtsi to u-boot tree, rebuilt u-boot and booted smc/work with it fine, except no wifi
<Glanzmann> mps: I see. For me and landscape15[m] the kernel appears to be crashing early.
<Glanzmann> Maybe I should compile in earlycon.
<mps> and I got this in dmesg `macsmc-rtkit 23e400000.smc: RTKit: Initializing (protocol version 12)` and `macsmc-rtkit 23e400000.smc: Initialized (1495 keys #KEY (0x234b4559)..zETM (0x7a45544d))`
<mps> and `macsmc-gpio macsmc-gpio: First GPIO key: gP01 (0x67503031)`
<mps> if the pcie enable is added to m1n1 maybe wifi will work if I rebuild it and add to u-boot payload
<mps> I'll check again when come from the hike
m6wiq1 has quit [Ping timeout: 480 seconds]
jbowen has joined #asahi
m42uko has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
m42uko_ has quit [Ping timeout: 480 seconds]
<marcan> Glanzmann: I found an issue on the mac mini, but it has nothing to do with the point where your logs stop
<marcan> I have no idea how you always manage to run into strange problems...
<Glanzmann> Okay, do you have config for me that I can try?
<marcan> I'm fixing the but but I have no idea how it ended up stopping halfway through CPU bringup for you
<marcan> *bug
<Glanzmann> I see.
<Glanzmann> landscape15 has the same problem btw. We're both using my config.
<Glanzmann> marcan: I assume you also run the 12.1 stub?
<Glanzmann> marcan: Maybe I did something stupid. But this how you can reproduce: https://pbot.rmdir.de/XsA2SL5hPt9AQQstpxKSXQ
<landscape15[m]> Glanzmann: sorry for the late response. Yeah it immediately crash. I’m using 12.1 stub partition
<landscape15[m]> MacBook Pro 13 2020
<landscape15[m]> It crashes also if I don’t compile modules
<marcan> pushed a fix for the SMC issue
<povik> 16:02 <@marcan> I have no idea how you always manage to run into strange problems...
<povik> some people have the power
<povik> they make for good early testers...
<j`ey> marcan: off by power of 2 :P
<marcan> off by one half the time actually :p
<j`ey> bah :)
<marcan> needed to round the other way to avoid an infinite loop
<j`ey> I'll rebuild, sounds different to the issue I'm seeing
<kettenis> oh, your loop for bisecting the available gpio keys was off?
<marcan> yeah, *again*
<marcan> algorithms are hard :D
<marcan> it was infinite looping on the count=2 condition
<kettenis> that's why I prefer brute force ;)
<marcan> lol
<povik> at least we know what would be in a hypothetical asahi job interview
<j`ey> theres only 1k keys!
c41e3a has quit [Quit: c41e3a]
<sven> :D
<marcan> Glanzmann: if it's dying during CPU bringup the kernel/configs are irrelevant
<marcan> and obviously m1n1 in the hypervisor works for me
<marcan> are you sure you didn't, like, bump the cable or something?
<Glanzmann> marcan: I used two different machines.
<marcan> and it always stops on that CPU thing?
<Glanzmann> macbook air and mini
c41e3a has joined #asahi
<Glanzmann> At least twice, but let me try a few more times.
<Glanzmann> Also landscape15[m] Has the same issue and he probabaly also did an untethered one.
<Glanzmann> So this is with a superspeed cable that came with my eizo and worked before.
<Glanzmann> I used the newest m1n1 and installed in 1tr. I'm not chainloading.
<marcan> you should be if you're using the hypervisor, but I checked your versions and there shouldn't be any breaking changes there
jbowen has joined #asahi
<landscape15[m]> Glanzmann: yeah but I’m using linux-asahi branch with your config. Still no luck
<landscape15[m]> I have to make a clean config, and then it works
<marcan> Glanzmann: ^c the hypervisor and type bt / cpu(0) / bt / cpu(5) / bt in separate lines
<Glanzmann> okay.
<Glanzmann> marcan: So, I tried one more time and now the kernel boots. at least sometimes.
jbowen has quit [Ping timeout: 480 seconds]
<Glanzmann> marcan: You have that fancy reset tool, how do I use that, so that I don't have to poweroff the mini for every test?
<marcan> you can ^C and `reboot` in the hypervisor
<Glanzmann> I see.
<marcan> that kernel log sounds like you're missing the gpio driver
<mps> nice, reboot works with latest smc/work on MBP
<Glanzmann> mps: reboot worked for me for a long time.
<mps> Glanzmann: really, how? with patch?
<mps> ah, need coffee
<Glanzmann> mps: No, always.
<mps> Glanzmann: yes also for me, but I forgot
<Glanzmann> hrhr.
<mps> have to check poweroff
c41e3a_ has joined #asahi
<Glanzmann> mps: I did not see anything in the code, but maybe I'm mistaken.
c41e3a has quit [Ping timeout: 480 seconds]
c41e3a_ has quit []
c41e3a has joined #asahi
<marcan> there is no poweroff yet
<mps> right, I was just tired and issued reboot while I thought about poweroff
<mps> anyway smc/work boots on MBP
<Glanzmann> mps: I also have dreams about powering off m1 machines ...
<Glanzmann> marcan: So with your altest fixups my system boots, but the framebuffer stays off.
<Glanzmann> Maybe due to hypervisor. Let me try without.
<Glanzmann> Oh and I don't have PCI
Tuff has quit [Read error: Connection reset by peer]
<Glanzmann> So I hope, I'm now down to some config options are missing.
<mps> Glanzmann: eh, I have too much dreams :)
<landscape15[m]> Glanzmann: how did you make it work?
<mps> got SMC working with u-boot
<marcan> [ 0.480189] pcie-apple 690000000.pcie: Link up on /soc/pcie@690000000/pci@0,0
<marcan> that means PCI is up
<Glanzmann> landscape15[m]: Marcan fixed something and than I did a git pull.
<marcan> you're probably missing the broadcom driver...
<Glanzmann> I see. Yes, that might be the problem.
<landscape15[m]> Glanzmann: ok then. I’m compiling
<Glanzmann> Because I compiled the kernel not on the system.
<mps> now have to try to add rtc again on top of smc/work
<marcan> Glanzmann: please avoid remaking configs all the time, it's a waste of time
<marcan> if you had a kernel that worked with the m1n1 smc enable stuff you can use that config, add the smc options, and try it
<marcan> that's what I expect when I ask people to test things
<Glanzmann> marcan: This is what I did.
<marcan> not brand new configs with brand new problems which have nothing to do with the thing at hand
<marcan> well, it looks like you have no wifi driver...
<jeffmiw> kettenis: about the spmi compatible, I got it now :), just like marcan did for spi. just fixed it.
<Glanzmann> I have it, but I compiled the kernel on the air and have not installed it on the mini
<Glanzmann> So I'm missing all the modules.
<marcan> then don't tell me it doesn't work :p
m6wiq has joined #asahi
<Glanzmann> It works perfectly fine. :-)
<Glanzmann> So let me install the kernel and see if I have a framebuffer afterwards.
<Glanzmann> marcan: It works.
<Glanzmann> I also have a framebuffer.
<Glanzmann> Now let me tried the untethered boot on the macbook air.
<j`ey> works for me too, bye pcie_enable_devices.py!
<Glanzmann> Let's ship it.
<Glanzmann> marcan: I tested on air and mini. It works.
<Glanzmann> marcan: Have you tested on the new pro/max machines?
<Glanzmann> Than I send Jens Axboe an email that he can now have wifi without tethered boot on the m1 max/pro.
<marcan> yes, it works on pro
<Glanzmann> Perfect. Let's ship it. :-)
jbowen has joined #asahi
<Glanzmann> So when I boot untethered, I get some serial consoles, but I no longer get the serial consoles from my tethered m1n1. Any workaround?
<Glanzmann> I'm missing the ACM consoles https://pbot.rmdir.de/iLs8SJ8oONcXH9SR9nxULA
jbowen has quit [Ping timeout: 480 seconds]
<Glanzmann> mps: I stay on u-boot with a non smc kernel until smc is merged into asahi and kettenis modifies u-boot to work with the new kernel.
<Glanzmann> I'm sick of booting in 1tr to update a kernel.
<mps> Glanzmann: I made smc kernel with u-boot working
<mps> s/made/got/
<mps> only RTC doesn't work, rest is ok
<Glanzmann> mps: For my curiosity, can you share you instructions to do so?
<Glanzmann> mps: I hope that rtc will also be merged in asahi.
<mps> have this in klog when press power button `macsmc-rtkit 23e400000.smc: RTKit: syslog message: apComms.cpp:373: SMC HID Event: 01 06 01`
<jeffmiw> mps: interested to better understand your config/setup with RTC not working
<Glanzmann> jeffmiw: We boot using u-boot.
<mps> Glanzmann: copied t8103.dtsi and t8103-jxxx.dtsi to u-boot and build u-boot, that's all
<jeffmiw> you are on mini ? used u-boot or m1n1 chainloading kernel ? if u-boot which DT ?
<mps> jeffmiw: I use MBP 2020
<Glanzmann> jeffmiw: SO on the air, rtc works for me. with the default u-boot dtb.
<kettenis> the hardware is identical on all M1 machines
<mps> maybe I missing something in .config for RTC, idk
<mps> have no idea what to try to enable
<Glanzmann> mps: I see. Thanks.
<Glanzmann> mps: Here are the config options: https://pbot.rmdir.de/BeWvRX0_gaxL4wg4Pu0bBQ
<mps> Glanzmann: I have these enabled
<Glanzmann> mps: So jannau made the rtc work in a tethered setup on the mini.
<Glanzmann> jeffmiw: Are you using u-boot?
m6wiq has quit [Remote host closed the connection]
m6wiq has joined #asahi
<mps> Glanzmann: CONFIG_RTC_INTF_DEV_UIE_EMUL is not set, do you have this in .config or enabled
<Glanzmann> mps: I have no rtc build root at the moment.
<Glanzmann> But if you want I can try it with tethered.
<Glanzmann> marcan: Have a good night sleep and don't forget to power off your system. :-)
<marcan> I actually never power off my systems
<marcan> who cares :p
<mps> Glanzmann: please don't waste time on my setup, work on task you started
<marcan> the targets are low power and I don't power down my main machine
<Glanzmann> marcan: Neither do I. it was a smc joke.
<mps> looks like I have to arrange small lab for working on these things, but desk is too small
<marcan> Glanzmann: I ran experiments/smc_shutdown.py just for you :p
<jeffmiw> Glanzmann: not I'm not using u-boot
<jeffmiw> mps: do you have the RTC enables in your kernel config ? CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y CONFIG_RTC_HCTOSYS_DEVICE="rtc0" CONFIG_RTC_SYSTOHC=y CONFIG_RTC_SYSTOHC_DEVICE="rtc0" CONFIG_RTC_INTF_SYSFS=y CONFIG_RTC_INTF_PROC=y CONFIG_RTC_INTF_DEV=y
<Glanzmann> jeffmiw: So mps use the air/pro has Laptop under Linux. U-boot makes our live easy when we need to install a new kernel. Also u-boot is the official boot chain at some point.
<mps> jeffmiw: yes, all
<jeffmiw> I'm asking to understand the differences, I did not spend time to have u-boot config yet, focusing on getting some code uptstream :)
<mps> jeffmiw: `grep "^CONFIG_RTC" /boot/config-5.16.0-smc-16k-2 | tpaste` => https://tpaste.us/OrD6
mlq has joined #asahi
Major_Biscuit has joined #asahi
jbowen has joined #asahi
caleb010[m] has joined #asahi
<caleb010[m]> Hello. I'm not well experienced with Linux kernel compiling. Correct me if i'm wrong. After cloning Linux from Asahi repo, i compile defconfig, change some options (or use makeconfig), then i do ```make Image modules dtbs```, and that's it? or i need to also install modules?
jbowen has quit [Ping timeout: 480 seconds]
<jeffmiw> mps: if you use u-boot, your DT(device tree) is coming from u-boot and from the one I modified, and my initial patches were not aligned with u-boot naming.
<landscape15[m]> caleb010: well, that should be enough. Then you need to chainload kernel and dtbs
<jeffmiw> you can check this by looking at the device-tree compatible entries in the sysfs under the spmi node: /sys/firmware/devicetree/base/soc/spmi@023d0d9300
<caleb010[m]> landscape15: ah, but i think you still have to install modules right? maybe with modules_install?
<jeffmiw> from there, find . -name compatible -exec cat {} \; if the strings are not matching the ones in the patches you took, it won't work. I updated my branch with what I understood from kettenis but did not check u-boot source code yet
<caleb010[m]> Sorry to have interrupted you :)
<mps> jeffmiw: yes, I copied t8103.dtsi with your patches to u-boot and built it
<mps> jeffmiw: probably need something else to add to u-boot
<mps> jeffmiw: and I used your latest commits also
<Glanzmann> caleb010[m]: Do you want to boot an m1 machine using another Linux machine (teethered) or do you want it to build Linux by itself?
<Glanzmann> caleb010[m]: Which m1 machine (m1 or m1 pro/max)?
<caleb010[m]> Glanzmann: I'd like to use tethered one. With linux.py or chainload.py
<caleb010[m]> I'm on an m1 air
<Glanzmann> So with the m1 air you can do tethered and untethered.
<Glanzmann> caleb010[m]: But to answer your question, if you compile a kernel with modules, you either have to put them in the ramdisk or transfer them to the machine.
<Glanzmann> caleb010[m]: For the tethered quickstart look at tg.st/u/asahi.txt or if you want more to read: https://github.com/AsahiLinux/docs/wiki/Developer-Quickstart-2.0
<Glanzmann> caleb010[m]: If you want to install Debian, look at https://github.com/AsahiLinux/docs/wiki/Debian
<Glanzmann> You can also use the Debian livesystem to install any other distro that has a rootfs archive that you can extract.
<Glanzmann> I hope that gets you started in whatever you want to do.
<caleb010[m]> Glanzmann: Thanks! So you don't need to install modules to run Linux properly?
<Glanzmann> caleb010[m]: On the air the following works: unaccelerated but fast framebuffer with xorg in full screen resolution, wifi, nvme, usb with usb 2.0 speed and audio jack, trackpad and keyboard. See also: https://github.com/AsahiLinux/docs/wiki/Feature-Support
<Glanzmann> caleb010[m]: So what mps and I'm doing is we use the m1n1+dtb+u-boot chain to load grub and grub loads the kernel and the initrd.
<Glanzmann> So we run it like any other Linux. This is also what the final bootchain looks like more or less.
<Glanzmann> caleb010[m]: But most people use tethered setup because it is much more practical to run experiments, put macos or Linux in the hyeprvisor.
<Glanzmann> And reverse engineer what is going on.
<caleb010[m]> Glanzmann: Ok, so you need an EFI partitiom?
<Glanzmann> caleb010[m]: I'm not 100% sure if you really need it, because u-boot can read ext4, but this is what we want in the end, because that is what most distros do.
<jeffmiw> mps: I had an issue in some of my commits, good one to take is https://github.com/AsahiLinux/linux/commit/32b2ffdb7972fb3bb867e0579ea6e7bf8dc08ae4
<Glanzmann> It also makes it easier for us to transfer the wifi blog from macos to Linux, because we're not allowed to redistribute it.
<landscape15[m]> caleb010: if you run u-boot, it will first search for an EFI partition to boot from
<jeffmiw> mps: if rtc still not working on your mbpro, can you send the output of the find cmd above
<caleb010[m]> Glanzmann: Is it possible to build a full linux image containing also compiled modules?
<jeffmiw> it is not just this patch, it is the whole series that is needed, there are changes in the drivers that are going with the dts change
<mps> jeffmiw: yes, just noticed that new commit
<Glanzmann> caleb010[m]: So when you build a linux kernel you have three options: n,y,m So yes you can build a statically linked kernel.
<mps> give me 5 minutes to build and check again
<caleb010[m]> Glanzmann: And then how do i build everything inside an Image.gz (that can be accepted by tethered boot)?
<Glanzmann> If you decide to build modules, you can either install them in the root filesystem in /lib/modules/`uname -r` (what make modules_install does) or you put it in a ramdisk.
<Glanzmann> caleb010[m]: Multiple options, two of them: You set every option that you want into your kernel to =y or you use a ramdisk and put the modules there.
<Glanzmann> The ramdisk can also contain a whole system. That is what I did when I build the Debian livesystem, It is just waht you would find in a a regular system in a 200 MB ramdisk.
<caleb010[m]> The ramdisk is the rootfs?
<Glanzmann> caleb010[m]: It can be, but in most cases the ramdisk contains modules that are necessary to mount the rootfs (that would be in our case for example the nvme driver and the ext4 driver but could also involve raid or device mapper crypt).
<Glanzmann> mps: If you get it running, let me know, I'll reproduce.
<caleb010[m]> Glanzmann: So if i make my mac running Linux without installing modules and then inside it i do "make modules_install" with the recompiled kernel it's the same thing right?
ciggi_ has joined #asahi
ciggi has quit [Ping timeout: 480 seconds]
jmr has joined #asahi
jmr has quit [Remote host closed the connection]
jmr2 has joined #asahi
<jmr2> caleb010[m]: go back to "make menuconfig", and in the main page, disable "Enable loadable module support". Everything defined as to be built as a module will become built-in. Less memory efficient, but much simpler to manage.
<mps> Glanzmann: jeffmiw: rtc again crashed kernel on boot, will post image later, now really 'must' go and prepare another coffee for me
<caleb010[m]> jmr2: Thanks a lot. This means that it will take more space?
Major_Biscuit has quit [Ping timeout: 480 seconds]
<Glanzmann> caleb010[m]: The kernel is not everything, you also need a root file system. This is where you binaries, libraries, configs and files live.
<jmr2> It'll use more RAM, since everything will be loaded from the get-go, instead of on-demand.
<Glanzmann> caleb010[m]: If you have never build a Linux from scratch or compiled a linux kernel. You'll have a steep learning curve.
<landscape15[m]> jmr2: why don’t you simply install modules inside rootFS?
<caleb010[m]> Glanzmann: Yeah i know. I made a Debian rootfs
<Glanzmann> caleb010[m]: Asahi is not ready for end users, but we're very close. So you can either wait, or if you can't, than this might be of help: https://github.com/AsahiLinux/docs/wiki/Debian . It still has a few sharp edges, but it might get you going.
<Glanzmann> There are three video, maybe you want to watch them. That is for the u-boot part but it also shows you the asahi installer which you need for m1n1.
___nick___ has joined #asahi
<Glanzmann> I'll soon improve these instructions and rerecord all videos with bigger front sizes and more straight forward. Sometimes I struggle to instlal grub for example ...
___nick___ has quit []
<jmr2> landscape15[m]; because it's one more operation, because I don't have access to the rootfs from my development machine, and because it can cause weird bugs if for some reasons, your kernel image become un-synchronized with the modules.
<landscape15[m]> jmr2: yeah it’s not the best way
___nick___ has joined #asahi
<caleb010[m]> <jmr2> "caleb010: go back to "make..." <- Is this like making a bundle of Image.gz dtbs and modules together?
<jmr2> caleb010[m]: no.
jbowen has joined #asahi
<caleb010[m]> jmr2: So what does it do exactly?
<jmr2> caleb010[m]: it's a graphical tool to edit your kernel .config file.
<jmr2> With all due respect, I'd encourage you to read a bit on how to build a linux kernel. This is nothing asahi-specific.
<caleb010[m]> jmr2: yeah i know what is menuconfig. I don't know what that option do. As you said i need to find more information online, because i'm not experienced
<caleb010[m]> "Enable loadable module support" loads all compiled modules?
<mps> jeffmiw: this is image of kernel crash https://arvanta.net/2x3d1kfg/rtc-crash.jpg
<jmr2> Perfect. Then go in menuconfig, and read the help description of that option ?
jbowen has quit [Ping timeout: 480 seconds]
<caleb010[m]> jmr2: ok, i read it. To me it seems the same as installing those modules inside the ramdisk
<landscape15[m]> jmr2: Do you want to build a monolithic kernel then?
<landscape15[m]> s/jmr2/caleb010/
<j`ey> jeffmiw: that crash that mps posted is weird, I was sure its fine to sleep in probe..
ciggi_ has quit [Ping timeout: 480 seconds]
<caleb010[m]> landscape15: What do you mean?
<Glanzmann> caleb010[m]: A monotlithic kernel is a kernel without modules, I assume.
<Glanzmann> caleb010[m]: Anyway. What I did 24 years ago is build a Linux distribution using linuxfromscratch.org. Do that and it will jumpstart you. ;-)
<caleb010[m]> Glanzmann: I'd like to do the opposite i think. Building a kernel with modules installed in it
<sven> oh god. I remember doing that maybe 15 years ago. After that gentoo was almost fun and simple :D
jbowen has joined #asahi
<landscape15[m]> caleb010: As jmr2 said, if you disable “Enable load able module support”, every declared module will be built in the kernel
<landscape15[m]> s/load/loadable/, s/able//
m6wiq1 has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
<mps> jeffmiw: j`ey: I built driver as module and loaded it manually, it crashes again but machine continue to work, dmesg out is here
m6wiq has quit [Ping timeout: 480 seconds]
<jmr2> landscape15[m]: yes. To each his/her own, but I'm in-line with the topic: "Not ready for end users / self contained install yet. Soon." For me, modules will start to make sense when the DeviceTree will have stabilized. Until then, tethered boot it is. (Which is why I believe we should directly steer newcomers toward tethered boot by default for now.)
ciggi has joined #asahi
roxfan2 is now known as roxfan
<caleb010[m]> jmr2: So with tethered boot i don't need to install modules?
<jmr2> caleb010[m]: "Building a kernel with modules installed in it" <-- That kind of doesn't make sense. Either your drivers are built into the Image.gz file ("y" in menuconfig), or they're in separate files ("m" in menuconfig). If in separate file, *you* have the responsibility to make sure that the kernel finds those while booting. There's multiple ways to do that, but they all require additional steps. Save yourself the tr
<j`ey> jmr2: message cut off at 'save yourself the tr'
<jmr2> You need drivers for both tethered and non-tethered boot. Modules only define where those modules live.
<jmr2> Ah. Save yourself the trouble, and go build-in for now.
<jmr2> Thanks
<jmr2> Woops... Should have been Modules only define where those *drivers" live.
<caleb010[m]> jmr2: Thanks a lot. Now i get it. This means that i don't need to do "make modules" with “Enable loadable module support” disabled right?
<jmr2> Yes!
<jmr2> Since there's no module to build.
<jmr2> Errr... Yes, you're right...
<caleb010[m]> Ok, i will do that
jmr2 has quit [Quit: Page closed]
malvo has joined #asahi
m6wiq1 has quit []
m6wiq has joined #asahi
mlq has quit [Quit: WeeChat 2.3]
mlq has joined #asahi
c41e3a has quit []
jbowen has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
Raito_Bezarius has quit [Ping timeout: 480 seconds]
___nick___ has quit [Ping timeout: 480 seconds]
kov has joined #asahi
Raito_Bezarius has joined #asahi
<mixi> j`ey, jeffmiw: while it is allowed to sleep in *_probe, regmap_raw_read takes the regmap lock (a spin lock because apple-spmi-sera-pmu sets regmap_config.fast_io = true) -> we are in an atomic context and may not sleep anymore
<j`ey> mixi: and if you have fast_io = false, what happens?
<mixi> j`ey: the regmap lock will be a mutex instead, which means we will not end up in an atomic context and will be allowed to sleep
<j`ey> mixi: cool thanks, sounds like an easy fix to just remove fast_io then!
<mps> j`ey: yes
<mps> now it works
akemin_dayo has quit [Ping timeout: 480 seconds]
<mps> ` apple-sera-pmu-rtc 23d0d9300.spmi:pmu-sera@f:rtc@0: setting system clock to 2022-02-06T21:50:56 UTC (1644184256)`
Latrina_ has joined #asahi
Latrina has quit [Remote host closed the connection]
Latrina_ is now known as Latrina
<jeffmiw> thanks mixi / mps / j'ey , I do not like this msleep, I'll see if I can come up with something else ... in the meantime I'll set fast_io to false
<mps> jeffmiw: I just deleted this line
Tuff has joined #asahi
Tuff has quit []
<mps> jeffmiw: btw, thank you for making rtc
ofl^ has quit [Ping timeout: 480 seconds]
<jeffmiw> yes by default fast_io is false iirc
akemin_dayo has joined #asahi
<mixi> yes, the default for fields left out in designated initializers is 0 ("the same as objects that have static storage duration") -> fast_io is 0 / false if it is left out of the initializer
ofl^ has joined #asahi
user982492 has joined #asahi
m6wiq has quit []
jbowen has joined #asahi
yrlf has quit [Quit: The Lounge - https://thelounge.chat]
yrlf has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
<jannau> https://github.com/jannau/u-boot/tree/t6000 has u-boot with nvme support for m1 pro/max, USB and keyboard are not working, no SMC, needs m1n1 from main boots with the dtb from the kernel build
user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]