Code Monkey home page Code Monkey logo

ga503qr-storaged3enable-dsdt-patch's Introduction

The 2021 ASUS ROG Zephyrus G15 (GA503Q models) ships with a broken ACPI DSDT table that will prevent s0ix suspend/resume from completing successfully. This script will extract and patch your DSDT and repack it into an initramfs that you can include during boot.

Installing:

Clone this repo and run build.sh, then copy the finished ramdisk image to /boot and add it to your kernel command line as shown on the Arch wiki like so:

[arglebargle@arch-zephyrus]$ cat /boot/loader/entries/30-linux-mainline.conf 
title Linux Mainline
linux /vmlinuz-linux-mainline
initrd /amd-ucode.img
initrd /GA503Q-ACPI-Override.img
initrd /initramfs-linux-mainline.img
...

See the Arch wiki for instructions for other bootloaders.

Resources:

How to make your own:

Go here: https://wiki.archlinux.org/title/DSDT#Recompiling_it_yourself and follow the steps to dump and decompile your DSDT.

Patch the NVM2 device as below (copy the stanza setting up StorageD3Enable from the functional NVME device just below it) and increment the DSDT revision in the header by 1 so the kernel will load it from the ramdisk we'll make later. The revision is a hexidecimal value so go punch the original into a hex -> decimal calculator, add 1 and then convert back to hex; this final hex value is your new revision.

Your changes should look something like this:

diff --git a/DSDT.dsl b/DSDT.dsl
index cdc8a5d..e407904 100644
--- a/DSDT.dsl
+++ b/DSDT.dsl
@@ -18,7 +18,7 @@
  *     Compiler ID      "INTL"
  *     Compiler Version 0x20190509 (538510601)
  */
-DefinitionBlock ("", "DSDT", 2, "ALASKA", "A M I ", 0x01072009)
+DefinitionBlock ("", "DSDT", 2, "ALASKA", "A M I ", 0x0107200A)
 {
     External (_SB_.ALS_, DeviceObj)
     External (_SB_.ALS_.LUXL, UnknownObj)
@@ -12125,6 +12125,19 @@ DefinitionBlock ("", "DSDT", 2, "ALASKA", "A M I ", 0x01072009)
             {
                 TPST (0x7053)
             }
+
+            Name (_DSD, Package (0x02)  // _DSD: Device-Specific Data
+            {
+                ToUUID ("5025030f-842f-4ab4-a561-99a5189762d0") /* Unknown UUID */, 
+                Package (0x01)
+                {
+                    Package (0x02)
+                    {
+                        "StorageD3Enable", 
+                        One
+                    }
+                }
+            })
         }
 
         Scope (GPP6)

The version number of the table may change with subsequent BIOS releases, be sure to always increment the hex value by one or Linux won't load your override table during boot.

Once your modifications are complete compile the AML table and build a CPIO archive (your ramdisk) as seen here: https://wiki.archlinux.org/title/DSDT#Using_a_CPIO_archive

and finally copy the ramdisk to /boot and add it to your kernel command line as shown on the Arch wiki like so:

[arglebargle@arch-zephyrus]$ cat /boot/loader/entries/30-linux-mainline.conf 
title Linux Mainline
linux /vmlinuz-linux-mainline
initrd /amd-ucode.img
initrd /GA503Q-ACPI-Override.img
initrd /initramfs-linux-mainline.img
...

Note that the amd-ucode.img ramdisk must be loaded first before any other ramdisks otherwise boot will fail. If there are any problems along the way the Arch Wiki DSDT page should have you covered. Good luck!

ga503qr-storaged3enable-dsdt-patch's People

Contributors

foundobjects avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

vvranjek josephcw

ga503qr-storaged3enable-dsdt-patch's Issues

windows instructions?

hi. i think i have this issue with my GA503QR on windows 10 and with two SSD. Bios ver. 410. - i get bsod/restart on resume from sleep/hibernate. any chance I can make this work on windows?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.