5 minutes
Lenovo Yoga C630 Progress
DO NOT WIPE THE WINDOWS PARTITION UNTIL YOU’VE PULLED THE FIRMWARE FROM IT.
Progress so far with the Lenovo Yoga C630
Thanks to Bamse we now have both USB-C ports working on the c630.
His branch is https://github.com/andersson/kernel/commits/wip/c630-5.7
What I’ve done so far to get it working:
This version of steps is what I use, you will likely want to skip Linus' tree, and just use bamse as the base, unless you want to deal with merge conflicts.
Option 1:
Option2:
Continue:
(all kinds of personal changes that I care about - you can find my config at https://dev.gentoo.org/~steev/files/lenovo-yoga-c630-5.7.0-rc5.config)
For my Kali systems - (and because I’m cross compiling):
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc) deb-pkg
For my Gentoo systems -
make -j$(nproc) && make modules_install && make dtbs_install && make install
In the original 5.2 kernels, the dtb file was expected to be laptop.dtb, with 5.7, the new dtb file for the c630 is sdm850-lenovo-yoga-c630.dtb so make sure that if you’re using the laptop.dtb symlink, it points to the correct one!
Bootloader/Kernel Command Line:
We need some arguments passed to boot, it doesn’t matter if you hard code them in, or if you pass them via the bootloader.
pd_ignore_unused
- Keep all power domains already enabled by bootloader on, even if no driver has claimed them.
clk_ignore_unused
- Keep boot clocks on, even if no driver has claimed them.
efi=novamap
- SetVirtualAddressMap() is not called after ExitBootServices()
An example grub setup could look something like this:
Note: if you are using the patches from Rob Clark above, you do not need
pd_ignore_unused
or clk_ignore_unused
- only efi=novamap
is required.
So you could do something like this instead
Firmware:
In terms of firmware, things get a wee bit funky. I’m a bit lazy, so I’ll use a script that Celliwig wrote (https://github.com/celliwig/lenovo-yoga-c630) This is all done on a c630 system, since we have to pull some signed firmware from the Windows partition(s?) - This script does require python2 as of 18 May 2020, so keep that in mind if you’re using something like Ubuntu 20.04 where python3 is the default.
We’re also going to need a copy of the linux-firmware git repo (though on Gentoo, the linux-firmware package is new enough)
git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/firmware/linux-firmware.git
Now lets move some files around…
Services
Now… we need some services, because the firmware are actually Hexagon binaries that run on a VM of the modem processor (If I understand it correctly, that is) As of 5.7, qrtr-ns is implemented in the kernel, however, because the other services depen on libqrtr.so from it, we still need to install it. qrtr-ns also detects whether you’re on > 5.7, and if so, it does nothing.
This isn’t the full setup, but it gets most of the steps there. I still haven’t fully looked into Grub as I’ve started off on the bionic image (and on my Kali installs, apt-mark hold grub-common grub-efi-arm64 grub-efi-arm64-bin grub2-common) so I’m not quite fully there on an installation just yet.
Update:
To get audio working, you’re going to need the ucm files as well, although there’s a bit of question about the proper place they go. People have had different results, I had to move mine into a specific directory that isn’t in the repo - if that doesn’t work, then you can try the same folder as mine, but typically you can check the dmesg output to see where it’s trying to load the files from - or like me, I just copy to both places…
Notes
X doesn’t run properly currently, you will get lots of screen flickering, however Wayland based DEs/WMs work fine. I’ve personally tested Sway and Gnome.
Update: Rob Clark was able to track the issue down in mesa.
Update for mesa 19.3.x - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5192 Update for mesa 20.0.x - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5190 Update for Mesa 20.1.x - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5188
Another thing to note, the reason why I’m cherry picking from robclark instead
of just merging in his wip/c630-5.7 branch, is because of commit f82139e
- you
absolutely can use it, however, you also need to use his dtbloader. I didn’t
want to but if you want to play around, he’s got prebuilt binaries at
https://people.freedesktop.org/~robclark/DtbLoader.efi and
https://people.freedesktop.org/~robclark/Shell.efi - and a readme for it can
be found at https://github.com/robclark/edk2/blob/dtbloader-chid/Readme.md