Linux on the Lenovo Yoga Slim 7x

This repository tracks my personal endeavor in getting linux running on the Lenovo Yoga Slim 7x, a laptop with an arm64 Snapdragon X Elite processor.

!! Created on Sept 6th 2024. This may be super out of date by now: things are moving very quickly. !!

Compatibility matrix

Hardware Does it work? Notes
CPU frequency scaling, power control
Framebuffer (without GPU accel)
NVME
GPU acceleration
Keyboard
Trackpad
Touchpad
Battery monitoring
Wifi
USB 2.0
USB 3.0
Webcam
Internal speakers
Bluetooth
DP alt-mode (i.e. HDMI dongle)
PCI tunneling over USB4
Suspend to RAM
Suspend to disk

Kernel

Use kernel from [here](https://github.com/jhovold/linux) and use the following commit

e92057c615fec749fefcca4ab28ee5c425e3691b

Apply the following patches:

1
2
3
https://github.com/linux-surface/kernel/commit/fd9dc26bac9b2ca2331f6ca35c9180efcec82aed.patch
https://github.com/linux-surface/kernel/commit/431363f94cc23fc3a923cc73758b619a657b75f9.patch
https://github.com/linux-surface/kernel/commit/caa65dd351ed735b33371f26fbbd02d37a1d2098.patch

Use firmware from [here](https://github.com/anonymix007/x1e-firmware).

initramfs

For the initramfs only load the following modules (in that order):

# for keyboard
i2c_hid
i2c_hid_of
i2c_qcom_geni

# for nvme
nvme
phy_qcom_qmp_pcie
pcie_qcom

# for usb
usb_storage
phy_qcom_qmp_combo
phy_qcom_snps_eusb2
phy_qcom_eusb2_repeater

# required for both nvme and usb
tcsrcc_x1e80100

Other modules will cause the screen to blank after two minutes.

Linux installation

I boot straight into an Ubuntu 22.04 installation from the initramfs. I installed Ubuntu via debootstrap. Systemd and udev will then load all the other kernel modules to get things like GPU, Wifi etc. working.

IMPORTANT: If you boot from USB then don't let udev load any other modules as one of them (likely qcom_q6v5_pas, but haven't confirmed this) will cause the USB bus to reset, rendering your root and boot device inoperable. For my USB image I just copied over ath12k modules and their dependencies and none of the other modules that were built with the kernel above. When booting from nvme you can load all the modules just fine.

GPU

Just use bleeding edge mesa.

Battery indicator

Make sure you have pd-mapper daemon running from [here](https://github.com/linux-msm/pd-mapper/tree/e7c42e1522249593302a5b8920b9e7b42dc3f25e). Create a systemd service file for it and ensure that it launches during boot.

Bluetooth

To get bluetooth working, I switched over to this repo:

https://github.com/anonymix007/linux-x1e/tree/wip/x1e80100-6.11-rc6

with branch wip/x1e80100-6.11-rc6. This enables bluetooth. Unfotunately, the branch has one downside: if you boot into an emergency console in the initramfs, the screen will blank after two minutes. Fully booting into the OS is fine when booting from nvme. I suspect booting from USB may not work as no additional modules are loaded with my USB hack explained above. Not sure what exactly is causing this. In the future, I'll simply apply the bluetooth commits to jhovold's repo and see if that works.

DP alt mode

Apparently this works with latest DP patches from [here](https://git.codelinaro.org/abel.vesa/linux/-/commits/x1e-next-20240906/?ref_type=heads) but haven't tried this yet.

Resources

https://git.codelinaro.org/linaro/qcomlt/demos/debian-12-installer-image
Most important link (basically followed the nix source code): https://github.com/kuruczgy/x1e-nixos-config/
https://gist.github.com/joske/52be3f1e5d0239706cd5a4252606644b

Edit
Pub: 06 Sep 2024 19:27 UTC
Views: 118