This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Lenovo ThinkPad X1 Yoga 2nd Generation

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
Resources

Hardware

root #lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:5904] (rev 02)
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 620 [8086:5916] (rev 02) => i915
00:08.0 System peripheral [0880]: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model [8086:1911]
00:13.0 Non-VGA unclassified device [0000]: Intel Corporation Sunrise Point-LP Integrated Sensor Hub [8086:9d35] (rev 21) => intel_ish_ipc
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller [8086:9d2f] (rev 21) => xhci_hcd
00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Thermal subsystem [8086:9d31] (rev 21)
00:15.0 Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 [8086:9d60] (rev 21)
00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-LP CSME HECI #1 [8086:9d3a] (rev 21) => mei_me
00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 [8086:9d10] (rev f1) => pcieport
00:1c.2 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 [8086:9d12] (rev f1) => pcieport
00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 [8086:9d14] (rev f1) => pcieport
00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 [8086:9d18] (rev f1) => pcieport
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:9d4e] (rev 21)
00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-LP PMC [8086:9d21] (rev 21)
00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21) => snd_hda_intel
00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-LP SMBus [8086:9d23] (rev 21) => i801_smbus
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (4) I219-LM [8086:15d7] (rev 21) => e1000e
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS525A PCI Express Card Reader [10ec:525a] (rev 01) => rtsx_pci
04:00.0 Network controller [0280]: Intel Corporation Wireless 8265 / 8275 [8086:24fd] (rev 88) => iwlwifi
05:00.0 Non-Volatile memory controller [0108]: Lenovo Device [17aa:0004] => nvme
root #lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 138a:0097 Validity Sensors, Inc.
Bus 001 Device 003: ID 04f2:b5ce Chicony Electronics Co., Ltd
Bus 001 Device 002: ID 8087:0a2b Intel Corp.
Bus 001 Device 005: ID 056a:50b8 Wacom Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Standard

Device Make/model Status Vendor ID / Product ID Kernel driver(s) Kernel version Notes
VGA compatible controller Intel Corporation HD Graphics 620 Works i915 4.15.7
Ethernet network controller Intel Corporation Ethernet Connection (4) I219-LM (rev 21) Works 8086:15d7 e1000e 4.12.12-gentoo
Wireless network controller Intel Corporation Wireless 8265 / 8275 (rev 88) Works 8086:24fd iwlwifi 4.12.12-gentoo
Bluetooth Intel Corporation Wireless Works 8087:0a2b btusb 4.12.12-gentoo
Touchscreen Wacom Serial Pen and Multitouch Sensor Works 056a:50b8 usbhid 4.12.12-gentoo
Card Reader Realtek RTS525A PCI Express Card Reader Works 10ec:525a rtsx_pci 4.12.12-gentoo
Audio device Intel Corporation Sunrise Point-LP HD Audio Works snd_hda_intel 4.15.7
Integrated Webcam Chicony Electronics Co.,Ltd. Webcam Works 04f2:b5ce uvcvideo 4.15.7
Thunderbolt Intel Corporation JHL6540 Thunderbolt 3 NHI Works 2222:1111 thunderbolt 4.15.7
NVME Disk Lenovo Device Works nvme 4.15.7
Fingerprint reader Validity Sensors, Inc. Fingerprint Sensor Not tested 138a:0097 4.12.12-gentoo
WWAN & GPS Qualcomm Snapdragon X7 LTE-A (Sierra Wireless EM7455) Not tested 1199:9079 cdc_mbim 4.15.9
NFC ? Not discovered likely a i2c device
Thunderbolt 3 Dock Ethernet Realtek RTL8152 USB Ethernet Adapter Works 17ef:3069 r8152 4.15.7

Accessories

Device Make/model Status Vendor ID / Product ID Kernel driver(s) Kernel version Notes
Dock ThinkPad Thunderbolt Dock Works - - - -

Installation

Apply the additional lines below to the make.conf file of Portage.

Note
To get up-to-date CPU_FLAGS_X86, discover the flags for your CPU with cpuid2cpuflags!
FILE /etc/portage/make.conf
# for i7-7600U
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

# for i5-7300U
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

INPUT_DEVICES="libinput wacom"
VIDEO_CARDS="intel i965"
GRUB_PLATFORMS="efi-64"

Then you should update the world to recompile all installed packages with the new flags.

root #emerge --ask --changed-use --deep @world

Firmware

Install the package sys-kernel/linux-firmware which contains the wifi device driver.

root #emerge --ask sys-kernel/linux-firmware

Kernel

KERNEL NVME SSD
Device Drivers  --->
   <*>  NVM Express block device
KERNEL ACPI
Generic Driver Options  --->
   [*] X86 Platform Specific Device Drivers  --->
      <*>   ThinkPad ACPI Laptop Extras
      [*]     Console audio control ALSA interface
      [ ]     Maintainer debug facilities
      [ ]     Verbose debug mode
      [ ]     Allow control of important LEDs (unsafe)
      [*]     Video output control support
      [*]     Support NVRAM polling for hot keys
KERNEL Ethernet controller
Generic Driver Options  --->
   [*] Network device support  ---
      [*]   Ethernet driver support  --->
         [*]   Intel devices
         <*>     Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support


Building the following device driver as module may be appropriate as it requires firmware during initialization.

KERNEL Wireless network controller
Generic Driver Options  --->
   [*] Network device support  ---
      [*]   Wireless LAN  --->
         [*]   Intel devices
         <M>     Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi)
         <M>       Intel Wireless WiFi MVM Firmware support
KERNEL Audio device
Generic Driver Options  --->
   <*> Sound card support  --->
      <*>   Advanced Linux Sound Architecture  --->
         [*]   PCI sound devices  --->
               HD-Audio  --->
                  <*> HD Audio PCI
                  <*> Build Conexant HD-audio codec support
KERNEL Bluetooth
-*- Networking support  --->
   <*>   Bluetooth subsystem support  --->
            Bluetooth device drivers  --->
               <*> HCI USB driver
               [*]   Broadcom protocol support
KERNEL Touchscreen
No special options needed.
KERNEL USB 3.0 & USB-C
USB_PCI=y
USB_OTG=y
USB_XHCI_HCD=y
USB_STORAGE=y
TYPEC=y
TYPEC_UCSI=y
KERNEL PCIe Card reader
MISC_RTSX_PCI=y
MMC_REALTEK_PCI=y
MMC_SDHCI=y
KERNEL Integrated Sensor Hub
INTEL_ISH_HID=y
KERNEL Thunderbolt Dock
CONFIG_THUNDERBOLT=y
CONFIG_THUNDERBOLT_NET=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_RTL8152=y

Emerge

Fingerprint reader is recognized by the following library.

root #emerge --ask sys-auth/libfprint

Configuration

(Explain any additional configuration or special customization for this hardware platform. Could be anything from BIOS settings to assigning proper media key functionality.)

Finger/Pen Input

For X11 to work with finger/pen input, pull in x11-drivers/xf86-input-wacom by inserting wacom argument into the indicated variable in the file shown below and run the following command for the configuration to emerge.

FILE /etc/portage/make.conf
INPUT_DEVICES="... wacom"
root #emerge --ask --deep --newuse @world

Trackpoint scrolling

Add the following Xorg configuration file so that the driver is selected for the devices we want.

FILE /etc/X11/xorg.conf.d/90-libinput.conf
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

After a reboot/xorg-server restart, trackpoint scrolling should work.

Hotkeys

Most of the hotkeys are available and can be configured by an X hotkey daemon like sxhkd.

Note
The Audio example functions only work if using PulseAudio.
Function key Function name Macro Example function Notes
F1 Mute audio XF86AudioMute pactl set-sink-mute 0 toggle The LED works as well.
F2, F3 Volume -/+ XF86AudioLowerVolume, XF86AudioRaiseVolume pactl set-sink-volume 0 -/+5%
F4 Mute microphone XF86AudioMicMute pactl set-source-mute 1 toggle The LED works as well.
F5, F6 Brightness -/+ XF86MonBrightnessDown, XF86MonBrightnessUp xbacklight -dec 5 / xbacklight -inc 5
F7 Recognize Monitors XF86Display xrandr --output HDMI1 --auto --below eDP1
F8 Enable/Disable Wifi XF86WLAN Works without any additional config.
F9 Settings / Tools XF86Tools
F10 Enable/Disable Bluetooth XF86Bluetooth Works without any additional config.
F11 Switch Keyboard layout Not working
F12 Set Bookmark Not Working

Updates

fwupd

Firmware of the X1 Yoga 2nd can be updated with fwupd: https://fwupd.org/lvfs/device/9ca89fa5-ce05-47ac-bdf3-5b0b6f21d07a

You need to build fwupd with the uefi useflag (and boot with UEFI).

BIOS/UEFI

You can use fwupd to update the BIOS and other firmware. As an alternative, you can update the X1 Yoga BIOS/UEFI from Linux with an USB drive.

user $geteltorito -o image.bin downloaded.iso
  • Flash the raw image to USB drive, make sure it's the right device...
root #dd if=image.bin of=/dev/sdx
  • Boot from the USB drive and install the update

Thunderbolt Firmware

You can update the Lenovo Thunderbolt Firmware right from Linux very easily!

View the current firmware version:

root #cat /sys/bus/thunderbolt/devices/0-0/nvm_version
15.0

Upload the update:

root #dd if=/tmp/Thunderbolt/TBT.bin of=/sys/bus/thunderbolt/devices/0-0/nvm_non_active0/nvmem
496+0 records in
496+0 records out
253952 bytes (254 kB, 248 KiB) copied, 0.00235085 s, 108 MB/s

Trigger the update:

root #echo 1 > /sys/bus/thunderbolt/devices/0-0/nvm_authenticate

The screen may flicker and hang, just wait a bit (<20s). Now you should have a newer version!

root #cat /sys/bus/thunderbolt/devices/0-0/nvm_version
27.0


Thunderbolt Dock Firmware

From Linux, you can update the firmware of the USB-C Dock itself with Wine!

user $wine thinkpad_usb_c_dock_firmware.exe

              ThinkPad USB-C Dock FW Utility v3.7
   Package including(BB:0.1.0.23 HX3:1.14.7.183 DK:1.3.40 DP:3.12.005)
======================================================================== 
Update date:Sat 04/22/2017 
Update time:02:36 PM

Checking current Dock FW version  
BillBoard Version: 0.1.0.23 
Hx3 Version: 1.14.7.183 
CCG4 Version: 1.3.40 
DP Hub FW: 3.12.005

Current Dock FW is newer, no need to update.

Troubleshooting

<to be filled>