From Fedora Project Wiki

(→‎Booting: readd note about modprobe.blacklist=qcom_q6v5_pas - was still necessary)
 
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Page to keep track of Linux support development for Thinkpad X13s (SoC codename sc8280xp), the first Thinkpad with ARM CPU.
Page to keep track of Linux support development for Thinkpad X13s (SoC codename sc8280xp), the first Thinkpad with an Arm CPU.


Most of following informations come from #aarch64-laptops on OFTC, #fedora-arm on Libera.chat and arm[AT]lists.fedoraproject.org. Upstream infos change on daily basis, so this page may be outdated, therefore read it with pinch of salt / cum grano salis.
Most of the following information comes from #aarch64-laptops on OFTC, #fedora-arm on Libera.chat and arm[AT]lists.fedoraproject.org. Upstream information changes daily, so this page may be outdated.


==== Bootable images ====
==Installing an image==
Fedora developers are aiming for it being supportable/usable in time for Fedora 38, at some point before that, some consumable images will be released for testing.
Fedora 41 GA works relatively well OOTB. Unfortunately the Workstation Live ISO isn't available because there are some issues building it (described on [https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/32Q2BDBNN7YYTDNLAV3ZOW4NFMMZPHJX/#32Q2BDBNN7YYTDNLAV3ZOW4NFMMZPHJX this email thread]). Alternatives are the netinst image or the Workstation raw image.  


A Linaro's Debian image is available at [https://forums.lenovo.com/t5/Other-Linux-Discussions/Does-anybody-know-if-there-is-work-being-done-to-integrate-X13s-ARM-processor-with-linux/m-p/5175315?page=1#5771660 this link]. It provides a decent user experience, despite missing audio and suspension capabilities.
For the time being, the easiest way to install Fedora is to:
Power usage not yet optimized, so expect high battery drain
# `dd` the raw image to a USB thumb drive
# boot the x13s using the instructions below
# `dd` the raw image to the internal nvme drive.


==== Kernel development ====
=== Prerequisites ===
Some of work on the kernel can be seen in https://github.com/jhovold/linux repository, branches wip/sc8280xp
A recent firmware (BIOS) must be on the machine:
* Minimum: Version: N3HET84W (1.56)
* Latest: Version: N3HET91W (1.63)


==== GPU ====
Instructions for how to update the firmware without Windows [https://gitlab.com/TheOneWithTheBraid/x13s-firmware-update are on this GitHub repository.]
GPU hardware acceleration not yet available


==== Sound ====
BIOS configuration:
Kernel side implementation at [https://lore.kernel.org/lkml/20221121130403.161817-3-srinivas.kandagatla@linaro.org/T/ this link]
* Secure Boot should be disabled (Security > Secure Boot > Secure Boot)
Userland code still to be implemented
* Linux Support should be enabled (Config > Linux > Linux Boot (Beta))


==== Virtualization ====
=== Booting ===
Virtualization is not yet available. The UEFI is not yet exposing [https://developer.arm.com/documentation/102412/0102/Privilege-and-Exception-levels the EL2 (exception level)] which is required to run VMs
You must change the grub options to boot the workstation raw image successfully.


==== Webcam ====
Add the kernel parameters `arm64.nopauth clk_ignore_unused pd_ignore_unused`.
Not working


==== Wi-Fi ====
You also need to load the device tree (DTB). The workstation raw image already has the DTB included, add the line `devicetree /dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb`.
Working


==== Similar pages ====
Tip: You can tab complete the filename in grub to avoid typo-ing the DTB name.
https://github.com/ironrobin/archiso-x13s/wiki/Feature-Support
Alternatively, after `dd`-ing the raw image to the USB drive, mount the `/boot` partition from the USB drive and add the needed kernel options to the `/boot/loader/entries/*` files.


==== Rawhide hacking ====
If Fedora fails to boot with drive issues (eg BTRFS read errors), try adding `modprobe.blacklist=qcom_q6v5_pas` to the kernel commandline to prevent the USB subsystem from being reset during the boot. (This is needed for Fedora 40, but Fedora 41 should have fixed this behaviour.)
As of the 6.5RC series, official rawhide will boot given the following changes:
 
* Grub2 must have this patch applied https://src.fedoraproject.org/rpms/grub2/pull-request/27
=== Installing ===
* The kernel must be booted with 'arm64.nopauth clk_ignore_unused pd_ignore_unused`  
Once the image has booted, you can `dd` the raw image to the internal drive.
* A recent firmware must be on the machine, and the linux/DT mode must be selected in the FW menus.
 
** Recommend minimum version:
You can `dd` the image you just booted, but it's recommended to `dd` a clean copy of the raw image.
*** Version: N3HET84W (1.56 )
 
*** Release Date: 06/26/2023
Do not reboot once the `dd` is complete, you should configure grub to avoid needing to add the kernel options at every boot.
* A 6.5 device tree must be placed on the ESP of the internal NVMe disk and named sc8280xp-lenovo-thinkpad-x13s.dtb
 
** ex: /boot/efi/sc8280xp-lenovo-thinkpad-x13s.dtb
==== Loading the Device Tree by default ====
* USB boot is possible if qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn is removed from the USB boot image
There are two ways to load the correct device tree:
** And add_drivers+=" qrtr.ko" is added during initrd build
 
** Otherwise leave it alone if booting from NVMe
1. Tell grub about the correct DTB so that you don't have to manually copy the DTB to the ESP. This approach will let you install newer kernels via `dnf`.
* Appropriate GPU firmware is placed in /lib/firmware/qcom/a660_sqe.fw, and /lib/firmware/qcom/a690_gmu.bin
* Add a the following line to the `/boot/loader/entries/*` file(s): <pre>devicetree /dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb</pre>
** Acquire from: https://github.com/ironrobin/x13s-alarm/tree/trunk/x13s-firmware
* Edit `/etc/default/grub`:
* Due to the mainline nature of this kernel the following things may not work correctly:
** Add the kernel parameters listed above to `GRUB_CMDLINE_LINUX`.  
** Battery monitor in gnome
** Add a new line: <pre>GRUB_DEFAULT_DTB=/dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb</pre>
** Proper USB-C charging negotiation, will result in slow charging, or battery drain while plugged in.
* Edit `/etc/kernel/cmdline` and add the kernel parameters listed above. (Arguably only needed if using systemd-boot,  just covering all options)
*** Charging may not work at all though any number of USB-C hubs
 
** Keyboard rollover
2. Alternatively, enable the Linux Support boot option in the firmware boot menus and copy the `/boot/dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb` file to the root of the ESP partition.
** Bluetooth
* [https://wiki.debian.org/InstallingDebianOn/Thinkpad/X13s#Install_Device_Tree_Blob_on_the_EFI_System_Partition Debian has instructions on how to do this from windows]
** CPU cache size reporting
* After major kernel updates, you should update the dtb by running <pre>sudo cp /boot/dtb-`uname -r`/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb /boot/efi</pre>
** Keyboard LEDs (depends on HW revision?, fn-f1 may enable the mute + capslock at which point both leds will be toggled by caps lock)
 
** Audio
=== Post-Install ===
** External Displays
 
** efi variables
Once you reboot and run off the internal NVMe drive, installing the [https://copr.fedorainfracloud.org/coprs/jlinton/x13s/ x13s copr] will pull in the remaining dependencies and correct a few configuration items:
** USB device may drop offline following: arm-smmu 15000000.iommu: Unhandled context fault: fsr=0x402, iova=0xffffd081, fsynr=0x350013, cbfrsynra=0x563, cb=1
<pre>sudo dnf copr enable jlinton/x13s
** Screen may blank for a few seconds during boot
sudo dnf install x13s
** TPM support is missing
sudo reboot</pre>
** USB may not run at superspeed+ rates.
 
* All the above subject to change as patches are merged, this list is approximately correct as of the middle of August 2023
You can also resize the BTRFS partition at this point to use all of the space available on the NVMe drive.
** Try the https://fedoraproject.org/wiki/Thinkpad_X13s#Similar_pages link to get a few more things working.
 
== Known Problems ==
* TPM support is missing
* 5G Modem
** Need to follow the [https://modemmanager.org/docs/modemmanager/fcc-unlock/ documented] steps to unlock the modem
* Virtualization is not available. The UEFI is not yet exposing [https://developer.arm.com/documentation/102412/0102/Privilege-and-Exception-levels the EL2 (exception level)], which is required to run VMs
** There has been some work done to unlock it with https://github.com/TravMurav/slbounce. YMMV
* The system does not suspend correctly so you need to poweroff if leaving unused
* Camera is not working. There are patches going upstream. You need to add `cma=128M`
* Bluetooth doesn't always work
 
== Similar pages ==
* https://github.com/jhovold/linux/wiki/X13s
* https://github.com/ironrobin/archiso-x13s/wiki/Feature-Support
* https://wiki.debian.org/InstallingDebianOn/Thinkpad/X13s
* https://en.opensuse.org/HCL:ThinkpadX13s

Latest revision as of 22:16, 21 December 2024

Page to keep track of Linux support development for Thinkpad X13s (SoC codename sc8280xp), the first Thinkpad with an Arm CPU.

Most of the following information comes from #aarch64-laptops on OFTC, #fedora-arm on Libera.chat and arm[AT]lists.fedoraproject.org. Upstream information changes daily, so this page may be outdated.

Installing an image

Fedora 41 GA works relatively well OOTB. Unfortunately the Workstation Live ISO isn't available because there are some issues building it (described on this email thread). Alternatives are the netinst image or the Workstation raw image.

For the time being, the easiest way to install Fedora is to:

  1. dd the raw image to a USB thumb drive
  2. boot the x13s using the instructions below
  3. dd the raw image to the internal nvme drive.

Prerequisites

A recent firmware (BIOS) must be on the machine:

  • Minimum: Version: N3HET84W (1.56)
  • Latest: Version: N3HET91W (1.63)

Instructions for how to update the firmware without Windows are on this GitHub repository.

BIOS configuration:

  • Secure Boot should be disabled (Security > Secure Boot > Secure Boot)
  • Linux Support should be enabled (Config > Linux > Linux Boot (Beta))

Booting

You must change the grub options to boot the workstation raw image successfully.

Add the kernel parameters arm64.nopauth clk_ignore_unused pd_ignore_unused.

You also need to load the device tree (DTB). The workstation raw image already has the DTB included, add the line devicetree /dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb.

Tip: You can tab complete the filename in grub to avoid typo-ing the DTB name. Alternatively, after dd-ing the raw image to the USB drive, mount the /boot partition from the USB drive and add the needed kernel options to the /boot/loader/entries/* files.

If Fedora fails to boot with drive issues (eg BTRFS read errors), try adding modprobe.blacklist=qcom_q6v5_pas to the kernel commandline to prevent the USB subsystem from being reset during the boot. (This is needed for Fedora 40, but Fedora 41 should have fixed this behaviour.)

Installing

Once the image has booted, you can dd the raw image to the internal drive.

You can dd the image you just booted, but it's recommended to dd a clean copy of the raw image.

Do not reboot once the dd is complete, you should configure grub to avoid needing to add the kernel options at every boot.

Loading the Device Tree by default

There are two ways to load the correct device tree:

1. Tell grub about the correct DTB so that you don't have to manually copy the DTB to the ESP. This approach will let you install newer kernels via dnf.

  • Add a the following line to the /boot/loader/entries/* file(s):
    devicetree /dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb
  • Edit /etc/default/grub:
    • Add the kernel parameters listed above to GRUB_CMDLINE_LINUX.
    • Add a new line:
      GRUB_DEFAULT_DTB=/dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb
  • Edit /etc/kernel/cmdline and add the kernel parameters listed above. (Arguably only needed if using systemd-boot, just covering all options)

2. Alternatively, enable the Linux Support boot option in the firmware boot menus and copy the /boot/dtb/qcom/sc8280xp-lenovo-thinkpad-x13s.dtb file to the root of the ESP partition.

Post-Install

Once you reboot and run off the internal NVMe drive, installing the x13s copr will pull in the remaining dependencies and correct a few configuration items:

sudo dnf copr enable jlinton/x13s
sudo dnf install x13s
sudo reboot

You can also resize the BTRFS partition at this point to use all of the space available on the NVMe drive.

Known Problems

  • TPM support is missing
  • 5G Modem
    • Need to follow the documented steps to unlock the modem
  • Virtualization is not available. The UEFI is not yet exposing the EL2 (exception level), which is required to run VMs
  • The system does not suspend correctly so you need to poweroff if leaving unused
  • Camera is not working. There are patches going upstream. You need to add cma=128M
  • Bluetooth doesn't always work

Similar pages