first part from https://delta-xi.net/#056
Reboot, enter your BIOS/UEFI. Go to Config - Thunderbolt (TM) 3 - set Thunerbolt BIOS Assist Mode to Enabled. It has also been reported that Security - Secure Boot must be disabled.
Install iasl (Intel's compiler/decompiler for ACPI machine language) and cpio from your distribution.
Get a dump of your ACPI DSDT table.
$ cat /sys/firmware/acpi/tables/DSDT > dsdt.aml
Decompile the dump, which will generate a .dsl source based on the .aml ACPI machine language dump.
$ iasl -d dsdt.aml
Download the patch and apply it against dsdt.dsl:
$ patch --verbose < x1_dsdt.patch
Plan B: If this does not work (patch is rejected): It has been the case, that certain UEFI settings may lead to different DSDT images. This means that it may be possible that the above patch doesn't work at all with your decompiled DSL. If that is the case, don't worry: Go through the .patch file in your editor, and change your dsdt.dsl by hand. This means locating the lines which are removed in the patch and removing them in your dsl. The patch contains only one section at the end which adds a few lines - these are important and make the sleep magic happen. The v1.15 bios patch provided in this gist contains the minimum changes needed.
Make sure that the hex number at the end of the first non-commented line is incremented by one (reading DefinitionBlock, should be around line 21). E.g., if it was 0x00000000 change it to 0x00000001. Otherwise, the kernel won't inject the new DSDT table.
Recompile your patched version of the .dsl source.
$ iasl -ve -tc dsdt.dsl
move the compiled patch to your boot folder
$ cp dsdt.aml /boot
Create a custom acpi loader for grub 2
cat <<+ > /etc/grub.d/01_acpi
#! /bin/sh -e
# Uncomment to load custom ACPI table
GRUB_CUSTOM_ACPI="/boot/dsdt.aml"
# DON'T MODIFY ANYTHING BELOW THIS LINE!
prefix=/usr
exec_prefix=\${prefix}
datadir=\${exec_prefix}/share
. \${datadir}/grub/grub-mkconfig_lib
# Load custom ACPI table
if [ x\${GRUB_CUSTOM_ACPI} != x ] && [ -f \${GRUB_CUSTOM_ACPI} ] \\
&& is_path_readable_by_grub \${GRUB_CUSTOM_ACPI}; then
echo "Found custom ACPI table: \${GRUB_CUSTOM_ACPI}" >&2
prepare_grub_to_access_device \`\${grub_probe} --target=device \${GRUB_CUSTOM_ACPI}\` | sed -e "s/^/ /"
cat << EOF
acpi (\\\$root)\`make_system_path_relative_to_its_root \${GRUB_CUSTOM_ACPI}\`
EOF
fi
+
Make it executable
$ chmod 0755 /etc/grub.d/01_acpi
update GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
to include mem_sleep_default=deep
GRUB_CMDLINE_LINUX_DEFAULT="quiet mem_sleep_default=deep"
Regenerate your grub file.
Uefi
$ grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
grub2 legacy boot
$ grub2-mkconfig -o /boot/grub2/grub.cfg
update-grub
Reboot
check dsdt
cat /sys/firmware/acpi/tables/DSDT > dsdt.dat
iasl -d dsdt.dat
This should match the dsdt.dat you made ealier
check your sleep state the brackets should be around deep for s3 sleep
cat /sys/power/mem_sleep
should print out this
s2idle [deep]
If the brakets are still around s2idle check your grub file for quiet mem_sleep_default=deep chances are you generated to the wrong one or forgot to add it.
Thanks for your detailed guide. If I'm right, this is a hot patch through GRUB, which only works with a Linux distro. I'm trying to make S3 work on a TPX1 Tablet 3rd gen running Windows 10. Is is possible to patch the binary directly on board? Or the correct signature is required to write the firmware so GRUB is still required for a hot patch?