New laptop - Yoga 14s AMD version
Contents
As my old laptop ages, the condition of it keeps degrading (broken chassis/hinge, wear-out battery, nonfunctional numpad, etc.). Recently I switched to a new laptop - yoga 14s AMD version.
AMD YES
AMD Ryzen CPUs are much more powerful than Intel’s. With this low voltage mobile CPU Ryzen 4800U, it can even beat Intel’s high-end desktop CPUs.
Not to mention AMD’s CPUs are affected by less vulnerabilities as well. Finally I can drop mitigations=off
from the kernel command line.
|
|
Update BIOS firmware from Linux
⚠️ WARNING: If there is an error during the BIOS update process, it may cause unrecoverable consequences. If you are worried about these consequences, stop reading and consult the technicians in Lenovo’s service center. If you understand and accept the risks, and want to do it yourself (DIY), continue the read.
Updating BIOS firmware from Linux could be tricky. It’s better to update the BIOS firmware from Windows first, then erase Windows and install Linux.
Yoga 14s AMD Ryzen doesn’t have firmware on Linux Vendor Firmware Service, and the updater is released as an executable instead of a bios update iso image (link to Lenovo’s site). I have to follow https://wiki.archlinux.org/index.php/Flashing_BIOS_from_Linux#Using_a_windows_PE. The tricky parts are:
- The laptop only boots from UEFI. (So the FreeDOS based methods doesn’t work.)
- The BIOS updater has secure update enabled, and can not mount the ESP partition.
To fix these problems, I have to disable the secure update function for the BIOS updater, and make an UEFI bootable Windows PE image.
Firstly, install the needed tools
|
|
Download the BIOS updater executable from Lenovo’s site. Use innoextract
to extract the BIOS updater.
|
|
The extracted files are in codeGetExtractPath
folder. Inside it there is an executable WIN64.exe
. Extract it.
|
|
Edit the updater/platform.ini
file, find and change viaESP=1
to viaESP=0
.
|
|
Follow https://wiki.archlinux.org/index.php/Windows_PE#Creating_a_bootable_Windows_PE_image to create the Windows PE image using mkwinpeimg
, use the --overlay
option to include contents in updater
folder to the image.
|
|
Then make the image UEFI bootable by following https://wiki.archlinux.org/index.php/Windows_PE#Prepare_a_bootable_Windows_PE_USB_key_for_UEFI_systems.
Reboot, hold F12 key, choose to boot from the Windows PE. The Windows command line will pop up. Go to the root folder of Windows PE, and run the actual updater H2OFFT-Wx64.exe
, the BIOS updater will start and do it’s job.
|
|
Enabling S3 suspend-to-RAM
For some laptop models, there is an option in BIOS to switch the sleep mode between Windows and Linux.
To check whether S3 is recognized and usable by Linux, run
|
|
For BIOS version DMCN32WW, S3 doesn’t appear in the output, and there is no option to switch the sleep mode, which means I have to modify the DSDT table to enable S3 suspend.
Firstly, install the needed tools.
|
|
Dump the DSDT table.
|
|
De-compile the dumped table.
|
|
Get and apply the patch.
|
|
Recompile the patched DSDT source.
|
|
Create an CPIO archive.
|
|
Copy the CPIO archive to /boot
.
|
|
Edit the boot loader’s configuration file, add the initrd for CPIO archive initrd /acpi_override
and add mem_sleep_default=deep
to kernel’s command line arguments.
|
|
Reboot, and check the S3 state again.
|
|
The S3 suspend is recognized and used.
References
- https://wiki.archlinux.org/index.php/Flashing_BIOS_from_Linux
- https://wiki.archlinux.org/index.php/Windows_PE
- https://www.reddit.com/r/linuxhardware/comments/i28nm5/ideapad_14are05_s3_sleep_fix/
- https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Yoga_(Gen_3)#Verifying_S3
- https://gist.github.com/zurohki/4b859668c901e6ba13e8187a0d5d734c