Jump to content

Asus G750JX: porting DSDT patches to SSDT or OC ACPI patches


osxfr33k

Recommended Posts

  • Moderators

No need, I see the difference in the vanilla DSDT vs the Level patch DSDT.

I made a typo here

^^PCI0.LPCB.EC0.WRAM (0x0448, Local1)

 

should be 

^^PCI0.LPCB.EC0.WRAM (0x044B, Local1)

 

See if that makes a different, you're right, there's no rename needed

  • Like 1
Link to comment
Share on other sites

OMG Jake Lo you did it you got this working as an SSDT patch this is a huge accomplishment, huge!!  How can I thanks you for this.  All thats left is the Battery Patch have to read over Rehabman's Hotpatch for Battery.  I understand the original DSDT patch but porting this to Opencore rename and SSDT is a huge task.  Also the Wifi\BT LED Sleep/Wake Fix that patch is kinda all over the DSDT not sure how I can get that one to work.   Two more patches to go and I am DSDTless!!

 

Thanks Again!

Link to comment
Share on other sites

@Jake Lo

 

Hi Jake Lo I was successful creating the SSDT Battery Patch all that is left now is this "WiFi BT Boot/Sleep Status patch".  I tried to insert the patch into the SSDT-XOSI.aml hoping it would work that way but it didn't unless I have done it wrong?  WFBT is also inserted in " Method (_WAK, 1, Serialized)". Would I need to insert this entire code into its own SSDT and rename _WAK to SWAK for example or is there an easier way?

 

WFBT () gets inserted in two places in the DSDT code below.

 

The "Method (WFBT, 0, NotSerialized)" is easy since this is a new method this should be easy to have in its own SSDT but adding the WFBT () method in _Wak and "    Method (_INI, 0, NotSerialized)' at the end of OSYS is a challenge to say the least.   Besides the code below please find the TXT patch and my SSDT-XOSI-WFBT.aml modified with the patch except where the code is inserted in _wak method so I did not include it in the XOSI SSDT, trying to figure out how I can do that part to work in an all in one SSDT?

 

I missed something there is also a WBTS Object added with the patch.  I added the code at the end below to have a look at.   This really looks a bit more complicated must be a better way to patch on the fly with SSDT?  There are the native methods in the DSTD OWLD and OBTD to complicate this even more.  I don't know if I have the Scope correct or the code the way I tried to write it.

 

The way to patch is suppose to work is on Boot the Led is lit and on Wake from Sleep the Led will be lit again.  I don't know what is more complicated the Battery patch or this one now?

 

Its starting to look like how the SSDT Bat patch similar editing will need the two methods, mentioned already inserted into the SSDT and renamed in DSDT the _Wak method and the new one I inserted below the _Reg and figure and the WFBT in _OSI once I do that it should work or not?  Have to try it is all I can do.  I know the Scopes and Externals are tricky for me.

 

The other dilemma is placing WFBT () in XOSI is out of Scope, not sure what the work around is for that?

 

 

 

 

 

 

Sections in patched DSDT:

 

Method (_WAK, 1, Serialized)  // _WAK: Wake
    {
        If ((ICNF & 0x10))
        {
            If ((\_SB.PCI0.GFX0.TCHE & 0x0100))
            {
                If ((\_SB.IAOE.ITMR == One))
                {
                    If (((\_SB.IAOE.IBT1 & One) && (\_SB.IAOE.WKRS & 0x02)))
                    {
                        \_SB.PCI0.GFX0.STAT = ((\_SB.PCI0.GFX0.STAT & 0xFFFFFFFFFFFFFFFC) | One)
                    }
                    Else
                    {
                        \_SB.PCI0.GFX0.STAT &= 0xFFFFFFFFFFFFFFFC
                    }
                }
                ElseIf (((\_SB.IAOE.IBT1 & One) && (\_SB.IAOE.WKRS & 0x02)))
                {
                    \_SB.PCI0.GFX0.STAT = ((\_SB.PCI0.GFX0.STAT & 0xFFFFFFFFFFFFFFFC) | One)
                }
                Else
                {
                    \_SB.PCI0.GFX0.STAT &= 0xFFFFFFFFFFFFFFFC
                }
            }

            If (CondRefOf (\_SB.IAOE.PTSL))
            {
                \_SB.IAOE.PTSL = Zero
            }

            If ((\_SB.IAOE.ITMR == Zero)){}
            If (CondRefOf (\_SB.IAOE.ECTM))
            {
                \_SB.IAOE.ECTM = Zero
            }

            If (CondRefOf (\_SB.IAOE.RCTM))
            {
                \_SB.IAOE.RCTM = Zero
            }
        }

        WFBT ()
        WAK (Arg0)
        ADBG ("_WAK")
        If (((Arg0 == 0x03) || (Arg0 == 0x04)))
        {
            If ((GBSX & 0x40))
            {
                \_SB.PCI0.GFX0.IUEH (0x06)
            }

            If ((GBSX & 0x80))
            {
                \_SB.PCI0.GFX0.IUEH (0x07)
            }
        }

        If (((Arg0 == 0x03) || (Arg0 == 0x04)))
        {
            \_SB.PCI0.XHC.XWAK ()
        }

        Return (Package (0x02)
        {
            Zero, 
            Zero
        })
    }





     Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            OSYS = 0x07DC
            If (CondRefOf (\_OSI, Local0))
            {
                If (_OSI ("Linux"))
                {
                    OSYS = 0x03E8
                }

                If (_OSI ("Windows 2001"))
                {
                    OSYS = 0x07D1
                }

                If (_OSI ("Windows 2001 SP1"))
                {
                    OSYS = 0x07D1
                }

                If (_OSI ("Windows 2001 SP2"))
                {
                    OSYS = 0x07D2
                }

                If (_OSI ("Windows 2001.1"))
                {
                    OSYS = 0x07D3
                }

                If (_OSI ("Windows 2006"))
                {
                    OSYS = 0x07D6
                }

                If (_OSI ("Windows 2009"))
                {
                    OSYS = 0x07D9
                }

                If (_OSI ("Windows 2012"))
                {
                    OSYS = 0x07DC
                }

                If (_OSI ("Windows 2013"))
                {
                    OSYS = 0x07DD
                }
            }
            ElseIf (MCTH (_OS, "Microsoft Windows"))
            {
                OSYS = 0x07CE
            }
            ElseIf (MCTH (_OS, "Microsoft WindowsME: Millennium Edition"))
            {
                OSYS = 0x07D0
            }
            ElseIf (MCTH (_OS, "Microsoft Windows NT"))
            {
                OSYS = 0x07D0
            }
            Else
            {
                OSYS = 0x07D1
            }

            WFBT ()
        }


 Method (WFBT, 0, NotSerialized)
    {
        If (\_SB.PCI0.LPCB.EC0.WBTS)
        {
            OWLD (One)
            Sleep (0x0DAC)
            OBTD (One)
        }
        Else
        {
            OWLD (Zero)
            Sleep (0x0DAC)
            OBTD (Zero)
        }
    }



         Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If ((Arg0 == 0x03))
                {
                    ECFL = Arg1
                }
            }

            Name (WBTS, One)
        }
    

     Method (OWLD, 1, Serialized)
        {
            \_SB.WRST = Arg0
            Arg0 ^= One
            If (((\_SB.ATKD.WAPF && 0x05) == Zero))
            {
                SGPL (0x1C, One, Arg0)
            }
        }

        Method (OBTD, 1, Serialized)
        {
            \_SB.BRST = Arg0
            SGPL (0x39, One, Arg0)
            SGPL (0x0F, One, Arg0)
        }

 

 

 

 

 

SSDT-XOSI-WFBT.aml.zip WiFi BT Boot:Sleep Status patch.zip

Link to comment
Share on other sites

I did the modifications I spoke about above and I should at least have the WFBT LED Lit on boot maybe my Scope/Externals are off can you have a look?  I will tackle the LED Wake from Sleep later.

 

Decompiled DSDT with command "./iasl-stable -l DSDT.aml" to get hex code find _REG and replace to XREG verified with hex-friend _REG 5F 52 45 47 02 is unique as well as XREG 58 52 45 47 02.  Added rename patch to Config.plist.  Boot and checked System DSDT,  _REG is renamed to XREG and inserted this method into SSDT.

 

Can you have a look at my modified SSDT I had to place the code for XOSI into a scope since WFBT() is inserted there with the patch when I compile there is a compile error that WFBT ().

 

Used MacIASL in terminal ./iasl-stable -l DSDT.aml

    93BD: 70 01 45 43 46 4C 4B 49 4E 49                    // p.ECFLKINI

            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {

    93C7: 14 12 5F 52 45 47 02                             // .._REG.

 

 

Edited:

 

Modified SSDT placed the  Method (WFBT, 0, NotSerialized) under Scope (SB) still no WIFI LED at boot.

 

 

 

SSDT-XOSI-WFBT.aml.zip

SSDT-XOSI-WFBT2.aml.zip

Link to comment
Share on other sites

I see your point on that I added it have a look had to fulfill more Externals checked DSDT if they are IntObj, FieldUnitObj, MethodObj and DeviceObj I think I have them correct and the SSDT Scope's follows along with what is in the DSDT and for the Scope _SB, I added for the Patch Method "Method (WFBT, 0, NotSerialized)" that seem to be where the patch was in DSDT.  Does Scope (_SB.PCI0) seem correct for Method XOSI, I believe this was the Scope in DSDT if it's wrong what would most likely be broken for XOSI?

 

LED still not on after boot.

 

Edited:

 

Screwed up can't change _INI to XINI there were too many methods with _INI have to fix that, I have to add 1C, find  1C 5F 49 4E 49 00 replace 1C 58 49 4E 49 00.  Funny when searched in Hex-Friend only found "5F 49 4E 49 00" once weird.

 

Edited add the 1C to make it unique checked DSDT its all good now but still no LED.

 

 

         Method (XINI, 0, NotSerialized)
            {
                If ((MSOS <= OSME))
                {
                    ECFL = One
                }

                KINI
            }

            Method (XREG, 2, NotSerialized)
            {
                If ((Arg0 == 0x03))
                {
                    ECFL = Arg1
                }
            }
        }
    }

 

 

 

 

See attached.

SSDT-XOSI-WFBT3.aml.zip

Link to comment
Share on other sites

Just tried now didn't work off to work in a bit.  I noticed XWAK is being used in a couple of places already should I use something else instead of X?

 

Here are the areas in the DSDT where _Wak and XWAK is being used before I apply the patch so XWAK is being used in other areas.

 

 

Edited:

 

I used ZWAK for the first method below not sure why those others are named XWAK before the patching?  Is this the one I need to rename?  Still no WIFI Led thanks for helping me I know this one is tricky.  After boot only this one is renamed to ZWAK "Method (ZWAK, 1, Serialized)"

 

 

 

    Method (_WAK, 1, Serialized)  // _WAK: Wake
    {
        If ((ICNF & 0x10))
        {
            If ((\_SB.PCI0.GFX0.TCHE & 0x0100))
            {
                If ((\_SB.IAOE.ITMR == One))
                {
                    If (((\_SB.IAOE.IBT1 & One) && (\_SB.IAOE.WKRS & 0x02)))
                    {
                        \_SB.PCI0.GFX0.STAT = ((\_SB.PCI0.GFX0.STAT & 0xFFFFFFFFFFFFFFFC) | One)
                    }
                    Else
                    {
                        \_SB.PCI0.GFX0.STAT = (\_SB.PCI0.GFX0.STAT & 0xFFFFFFFFFFFFFFFC)
                    }
                }
                ElseIf (((\_SB.IAOE.IBT1 & One) && (\_SB.IAOE.WKRS & 0x02)))
                {
                    \_SB.PCI0.GFX0.STAT = ((\_SB.PCI0.GFX0.STAT & 0xFFFFFFFFFFFFFFFC) | One)
                }
                Else
                {
                    \_SB.PCI0.GFX0.STAT = (\_SB.PCI0.GFX0.STAT & 0xFFFFFFFFFFFFFFFC)
                }
            }

            If (CondRefOf (\_SB.IAOE.PTSL))
            {
                \_SB.IAOE.PTSL = Zero
            }

            If ((\_SB.IAOE.ITMR == Zero)){}
            If (CondRefOf (\_SB.IAOE.ECTM))
            {
                \_SB.IAOE.ECTM = Zero
            }

            If (CondRefOf (\_SB.IAOE.RCTM))
            {
                \_SB.IAOE.RCTM = Zero
            }
        }

        WAK (Arg0)
        ADBG ("_WAK")
        If (((Arg0 == 0x03) || (Arg0 == 0x04)))
        {
            If ((GBSX & 0x40))
            {
                \_SB.PCI0.GFX0.IUEH (0x06)
            }

            If ((GBSX & 0x80))
            {
                \_SB.PCI0.GFX0.IUEH (0x07)
            }
        }

        If (((Arg0 == 0x03) || (Arg0 == 0x04)))
        {
            \_SB.PCI0.XHC.XWAK ()
        }

        Return (Package (0x02)
        {
            Zero, 
            Zero
        })
    }



           Method (XWAK, 0, Serialized)
            {
                If (((XUSB == One) || (XRST == One)))
                {
                    XSEL ()
                }
            }



            Method (XWAK, 0, Serialized)
            {
                If (((XUSB == One) || (XRST == One)))
                {
                    XSEL ()
                }
            }




 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...