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.
<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
<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)
<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.
<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.
<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>
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 :)
<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>
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: 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?
<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
<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…]