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
kettenis has quit [Ping timeout: 480 seconds]
kettenis has joined #asahi
AndrewLee[m] has joined #asahi
PhilippvK has joined #asahi
phiologe has quit [Ping timeout: 480 seconds]
jbowen_ has joined #asahi
jbowen has quit [Ping timeout: 480 seconds]
nico_32 has quit [Remote host closed the connection]
quarkyalice has quit [Remote host closed the connection]
nico_32 has joined #asahi
quarkyalice has joined #asahi
quarkyalice has quit [Quit: Leaving]
hexchain[m] has left #asahi [#asahi]
quarkyalice has joined #asahi
<amw>
marcan: Do you know what's required to get the keyboard going?
<amw>
The USB drive to run the M1 off is compact but the keyboard is annoyingly large
<sven>
SPI controller (iirc also based on something linux already has a driver for) + platform backend for the already existing driver
<sven>
oh, and probably gpio/pinctrl to make SPI work in the first place
<amw>
ok - so we don't need those pesky dart/ASC thingies - Yeah!
<sven>
that reminds me.. i should submit v5 of the dart driver
<pipcet[m]>
amw: I can answer questions about the corellium driver if that would help (and you don't want to look at it yourself)
<sven>
their platform backend for the keyboard driver is probably a good start. might even already be upstreamable directly
<amw>
pipcet[m]:That would be nice. If it doesn't compromise my ability to make PRs I would be happy to look at it.
<pipcet[m]>
amw: best ask marcan about that, I don't want to do anything to ruin the PR-ability of anyone's changes :-)
<amw>
ok - thanks - will do
Raqbit6 has joined #asahi
<kettenis>
the keyboard is allegedly the same as what is used in the most recent Intel Macs and does indeed use an SPI interface
<kettenis>
on Intel Macs there is some sort of ACPI abstraction for the SPI controller though
<kettenis>
so that will require a new driver of some sort
<kettenis>
shouldn't be too complex though
Raqbit has quit [Ping timeout: 480 seconds]
Raqbit6 is now known as Raqbit
<pipcet[m]>
a complete driver is fairly complex, I'd say: you need to mux the pins to the SPI interface, write a driver for the SPI chip, write a driver for the second GPIO chip so you can receive interrupts from the keyboard, and then you need to adjust applespi to handle real SPI rather than ACPI. (Just maybe you can get away with setting the pins to GPIO and bit-banging SPI over it, but that's really only good enough for boot loaders.)
<kettenis>
true
<pipcet[m]>
oh, and probably rely on m1n1 to bring up the clocks.
<kettenis>
or u-boot ;)
<_jannau_>
I see I need to stop slacking off on the pinctrl driver
<kettenis>
should be possible to implement pinctrl using mostly generic code
<pipcet[m]>
also some of it might be set up the right way already, but relying on Apple to keep things sane seems a problematic bet at best.
<amw>
Would the linux/drivers/input/keyboard/applespi.c be relevant?
<pipcet[m]>
very much so :-)
<alyssa>
amw: I believe the rule is if you look at corellium code, tell sven but don't tell marcan 😋
<kettenis>
hah
<alyssa>
kettenis: corellium didn't do DCP/AGX code so I'm clear 🙃
<pipcet[m]>
alyssa: btw, I'm playing around with the DCP stuff a little, but so far all I've found out is (1) the DCP doesn't like it if you fail to initialize the shared memory area to zero before giving it access (2) the magic numbers for setting the backlight brightness are "A352", 15, and 0x20d0000
jbowen_ has quit [Quit: leaving]
skipwich has joined #asahi
<alyssa>
fun :)
jbowen has joined #asahi
bronzie94 has joined #asahi
bronzie94 has left #asahi [#asahi]
Raito_Bezarius has quit [Ping timeout: 480 seconds]
neobrain has joined #asahi
Raito_Bezarius has joined #asahi
roxfan has joined #asahi
roxfan has quit [Read error: Connection reset by peer]
quarkyalice has quit [Remote host closed the connection]
quarkyalice has joined #asahi
quarkyalice has quit [Remote host closed the connection]
Andalu30 has joined #asahi
quarkyalice has joined #asahi
roxfan has joined #asahi
<marcan>
alyssa: I literally looked at corellium code on my stream the other day, where did this myth come from? >_>
<marcan>
pipcet[m]: those magic numbers are for what DCP firmware version? because as I said, the ABI is not stable, not even the call numbers
<marcan>
(which is yet another reason why we won't and cannot dual-boot within a single OS container :p)
<jix>
how does that work when you have different mac os versions installed?
<j_ey>
the firmware is per-boot
<j_ey>
I mean, per partition
<alyssa>
j_ey: that's a relief.
<jix>
ah, so at least it doesn't randomly change for linux then when you update mac os on another partition...
<marcan>
yes
<marcan>
this is why I'm going to declare certain macos versions (i.e. firmware bundles) golden for linux
<marcan>
and we will only support those
<j_ey>
marcan: I wonder if the DCP firmware and macos are in the same repo, or at least some shared headers
<alyssa>
almost certainly.
<j_ey>
(just out of curiosity)
<marcan>
I'm pretty sure they have some generator thing for the IPC
<marcan>
similar to what we'll do
<alyssa>
yeah
<alyssa>
marcan: I'm also wondering, like
<alyssa>
you joke about splitting a driver down the middle and putting half on each processor
<alyssa>
is it possible they literally have a single driver src tree and it's just compiled for heterogenous processor etc?
<marcan>
alyssa: printRegs does... nothing
<alyssa>
hm.
<marcan>
and nah I don't think they're that smart
<marcan>
but they do obviously share code
<marcan>
probably via copy and paste :p
<alyssa>
Pff
<marcan>
it's A444 on 12.0-beta3 fwiw
<marcan>
so poll: should I spend some time writing an install script so we can actually switch versions without doing a full macos install, and without a gian partition and waiting for an hour?
<marcan>
or should I keep that on the stack and go straight to working on AGX?
* alyssa
coughs #2
<j_ey>
I mean, the choice is obvious for me :P
<alyssa>
i am admittedly biased towards getting to try out my 3d drivers on linux ;p
<marcan>
have you verified that they work after updating macos btw? maybe some of the stuff you have to deal with in userspace is also firmware-dependent :p
<alyssa>
hnnnngh
<alyssa>
it worked between two versions within 11.x ...
<kettenis>
the benefit of #1 could be that more people start hacking on Linux kernel code
<marcan>
time to put on 12.0-betaX!
<marcan>
since you'll need that for DCP anyway
<marcan>
:p
<alyssa>
marcan: thanks for volunteering to test ahead of time
<kettenis>
but I'm not sure if that will really be the case
<marcan>
well, I don't think writing an installer should take *that* long, unless I hit a showstopper, in which case I could shelve it and come back later
<marcan>
main thing I need to verify is that you *can* use machine owner credentials from another installed OS for bputil/kmutil, I'm not entirely sure about that yet
<alyssa>
kettenis: as much of a PITA the macos dual install is, it's far more newbie friendly than linux kernel hacking :(
<marcan>
if you can't that kind of breaks my current idea
<j_ey>
marcan: prototype installer to test assumption, then AGX >:D
<marcan>
sure :p
<marcan>
also if anyone knows of a portable python3 bundle thingy I can just download and run on macos/arm64, that would be helpful, since I'd much rather write this in python than, uh, shellscripts and C tools?
<kettenis>
the recovery environment doesn't have python?
<marcan>
nope
<marcan>
it has perl but just... no.
<kettenis>
heh
* alyssa
coughs agx
<kettenis>
regarding the dcp and agx code, it would be nice if that could would end up being evailable under a non-GPL license (dual licensed or using the same license as the i915/radeon/amdgpu code) such that we can use it in *BSD
<marcan>
we do not load those blobs from the OS
<marcan>
they are loaded from the bootloader
<marcan>
oh you mean the drivers?
<marcan>
everything will be MIT
<marcan>
(dual MIT/GPL)
<marcan>
I made the decision at the start to MIT everything for this and other reasons :-)
<roxfan2>
i think xcode has python3, maybe you can make a minimal env from that one somehow
roxfan2 is now known as roxfan
<marcan>
AIUI this is already the case for the core drm/kms code and the big drivers
<kettenis>
yup
<kettenis>
just making sure alyssa is on board with that as well ;)
erincandescent has quit [Remote host closed the connection]
<brentr123[m]>
<VinDuv_ "MacPorts can create install pack"> Could just brew install python3 and copy the directory with the files in it and zip it up
<marcan>
the point being I want to be able to download the package directly so I don't have to
<marcan>
:p
<marcan>
ideally if the installer is python we shouldn't even need to build this on a mac
<marcan>
anyway, I'm off to sleep
pg12_ has joined #asahi
pg12 has quit [Ping timeout: 480 seconds]
fedx[m] has joined #asahi
fedx[m] has left #asahi [#asahi]
fedx[m] has joined #asahi
<fedx[m]>
I have a 16" MacBook Pro, does Asahi have the drivers I need to install Linux, and is it even possible to install Linux?
<Serentty[m]>
That's Intel.
<Serentty[m]>
Asahi is about the ARM ones.
<Serentty[m]>
You can install Linux on what you have, but it will be very different. If you just do some googling it shouldn't be that hard to find out what you need. Drivers might be slightly painful.
<fedx[m]>
The issue is it has a T2 chip which controls audio, keyboard, and most importantly storage. It is similar to an M1, and M1 Macs did away with a T2 because they have the functionality built in.
<fedx[m]>
It seemed reasonable to think Asahi would work on a T2.
<Serentty[m]>
Yeah, I've heard that that can cause driver pain.
<Serentty[m]>
<fedx[m] "It seemed reasonable to think As"> Unfortunately, everything is really different. The M1 Macs are much more like iOS devices.
<fedx[m]>
Huh, so this is more like jailbreaking or Project Sandcastle and a T2 is just drivers?
<Serentty[m]>
There's no jailbreaking necessary.
<Serentty[m]>
But porting and writing drivers, yes.
marvin24 has joined #asahi
<pipcet[m]>
marcan: well, yes, that's why I said A352 rather than applyProperty. I have no idea whether it even is applyProperty here, because of the firmware version dependency.
<fedx[m]>
Ok, any good place to get help with T2 drivers?