ThinkPad X13s

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

ThinkPad X13s is an ARM64 powered 13in laptop.

Hardware

ThinkPad X13s Specifications

CPU Qualcomm Snapdragon 8cx Gen 3

Graphics Qualcomm Adreno 690 (integrated)

Memory 16GB LPDDR4X-4266

Storage 512GB PCIe Gen 4 SSD

Display 13.3-inch, 1920 x 1200, 16:10

Networking Qualcomm WCN685x Wi-Fi 6E, Qualcomm Snapdragon X55 5G, Bluetooth 5.1

Ports 2x USB Type-C 3.2 Gen 2, 3.5 mm headphone jack, SIM card slot, Kensington lock slot

Camera 5 megapixel camera, infrared

Battery 49.5 WHr

Power Adapter 65 W

Dimensions (WxDxH) 11.76 x 8.13 x 0.53 inches / 298.7 x 206.4 x 13.4 mm

Weight 2.35 pounds / 1.06 kg

Installation

Installing Gentoo on the ThinkPad X13s is very similar to how one installs Gentoo on just about any EFI-based laptop. The main parts that need special attention are the GPU and the kernel (plus firmware blobs).

Bootloader

No u-boot here, just EFI BIOS firmware and any of the usual EFI bootloaders (here we use grub).

Install to internal storage

To boot from the internal storage

initrd

When generating an initrd make sure the following kernel modules are included and loaded early, to ensure the display output is working:

  • nvme

The above list is based off this script from the reference image. Depending on which tool you use to generate the initrd, all or some of those might be included automatically.

When using dracut to build the initrd, add a configuration file that looks like this:

FILE /etc/dracut.conf.d/20_mnt-reform-2.conf
force_drivers+=" reset_imx7 mux_mmio fixed i2c-imx fan53555 i2c_mux_pca954x pwm_imx27 pwm_bl panel_edp ti_sn65dsi86 imx-dcss phy-fsl-imx8-mipi-dphy nwl-dsi mxsfb usbhid imx8mq-interconnect nvme "

Kernel

Since kernel patches are still in the patch queue/review process, the working patch set is in one of steev's repos.

It is recommended to clone with a depth of 1 initially.

f0 respawning

With a default arm64 system, error messages like this will appear both on the default TTY in the system log:

Id "f0" respawning too fast: disabled for 5 minutes

To get rid of those, edit the inittab at /etc/inittab and remove or comment out the last line, that looks something like this:

FILE /etc/inittab
# Architecture specific features
f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100

Then, restart the system.

Clock loses time on reboot

The Reform has two Real-time clocks installed in the system - a battery backed up PCF8523 and an on-CPU SNVS. The SNVS clock is powered by the same rail as the i.MX8M CPU and will reset together with the system.

By default, the hwclock is using /dev/rtc0, which might be the wrong clock.

To fix this issue, either remove the rtc-snvs kernel driver, or edit the following line in the /etc/conf.d/hwclock file:

FILE /etc/conf.d/hwclock
clock_args="--rtc /dev/rtc1"

Check which RTC has been assigned to which device by looking at the kernel ring buffer:

user $ dmesg | grep --ignore-case rtc
[    3.556883] rtc-pcf8523 2-0068: registered as rtc0
[    3.563641] rtc-pcf8523 2-0068: setting system clock to 2020-07-13T17:27:26 UTC (1594661246)

In the above example, the PCF8523 is the only RTC and it is assigned to /dev/rtc0.

Boot from (internal) eMMC using initrd

At some point you will probably want to be able to start the laptop without having an SD card inserted. Also, if you are booting from an encrypted disk, which really you should, you will need a mechanism to open the disk at startup. This chapter will explain how you can achieve both of these goals.