Lenovo Ideapad 330 (Ryzen)

Following article aims to make the Lenovo Ideapad 330(-15ARR) usable on Gentoo.

UEFI updates
Before removing Windows from the laptop, run the latest UEFI updates from Lenovo, as there is no way to do so once Linux is running.

Legacy boot
Do not use Compatibility Support Module (CSM) legacy boot services to run Linux, there are some firmware bugs preventing CPU frequency scaling from working.

Use rEFInd USB stick to boot into a UEFI installation media, or, to convert an existing system to EFI boot. This is beyond the scope of the article.

Firmware
The package is required as it provides the firmware for the AMDGPU driver and Atheros WiFi adapter.

Kernel
As of kernel version 4.19.x, everything is functional including the touchpad. To make the touchpad work, use this Kernel Configuration Files.

If the `amdgpu` module and its firmware are not included in the initramfs, the module may fail to load later due to a race condition and neither X nor virtual terminals will be accessible. This is random, and it may or may not fail. However, adding the amdgpu driver to the initramfs does prevent this issue entirely.

Rebuild initramfs using dracut.

Compiler settings
More info is available at:


 * GCC optimization
 * MAKEOPTS
 * EMERGE_DEFAULT_OPTS

Packages settings
For more info: CPU_FLAGS_X86

As of August 2018, your mileage may vary with released versions of Mesa, libdrm, and xf86-video-amdgpu. Adding to ACCEPT_KEYWORDS using `**` will bring in the latest code that has many unreleased fixes at the expense of random compile failures.

USE flags
With AMDGPU as video driver and libinput as input driver add the USE flag  and remove any NVIDIA-specific USE flags that may cause issues later.

Battery charge thresholds
Use:. Example econfig and instructions can be found at: github.com/teleshoes/tpacpi-bat.

fan control
I was unable to make fan control work, but the plumbing is all there and it claims to be supported. Here's some tips.

Use:.