Jump to content

Tracing back the AMD GPU wakeup issue to its origin


Mieze
368 posts in this topic

Recommended Posts

Another confirmation, after couple of days spending the time to figuring out what's what, I finally managed to activate my Sapphire Radeon HD 7790 with the DSDT patch that @Mieze found and a big thanks to her :)

I didn't inject anything (No InjectATI, no framebuffer or Ati Connectors Controller) via my config.plist.

 

 

 

Scope (_SB.PCI0.PEGP.GFX0)

    {
        Device (GFX0)
        {
            Name (_ADR, Zero)  // _ADR: Address
            OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
            Field (PCIB, AnyAcc, NoLock, Preserve)
            {
                Offset (0x10), 
                BAR0,   32, 
                BAR1,   32, 
                BAR2,   64, 
                BAR4,   32, 
                BAR5,   32
            }
           Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                Store (Package (0x1A)
                    {
                        "AAPL,slot-name", 
                        Buffer (0x07)
                        {
                            "Slot-1"
                        }, 
 
                        "@0,name", 
                        Buffer (0x0B)
                        {
                            "ATY,Baladi"
                        }, 
 
                        "@1,name", 
                        Buffer (0x0B)
                        {
                            "ATY,Baladi"
                        }, 
 
                        "@2,name", 
                        Buffer (0x0B)
                        {
                            "ATY,Baladi"
                        }, 
 
                        "@3,name", 
                        Buffer (0x0B)
                        {
                            "ATY,Baladi"
                        }, 
 
                        "ATY,Card#", 
                        Buffer (0x11)
                        {
                            "113-1E253120-O46"
                        }, 
 
                        "ATY,Copyright", 
                        Buffer (0x25)
                        {
                            "© 1988-2017, AMD Technologies Inc."
                        }, 
 
                        "ATY,Rom#", 
                        Buffer (0x36)
                        {
                            "C58203 Bonaire XT A1 GDDR5 1GB 64Mx32 300e/150m"
                        }, 
 
                        "ATY,VendorID", 
                        Buffer (0x02)
                        {
                             0x02, 0x10                                     
                        }, 
 
                        "ATY,DeviceID", 
                        Buffer (0x02)
                        {
                             0x5C, 0x66                                     
                        }, 
 
                        "device_type", 
                        Buffer (0x11)
                        {
                            "ATY,BaladiParent"
                        }, 
 
                        "model", 
                        Buffer (0x1B)
                        {
                            "HD 7790 Sapphire Dual-X OC"
                        }, 
 
                        "hda-gfx", 
                        Buffer (0x0A)
                        {
                            "onboard-1"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
 
            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (LEqual (BAR5, Zero))
                {
                    Store (BAR2, Local0)
                }
                Else
                {
                    Store (BAR5, Local0)
                }
 
                OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFFFFFFFFFF0), 0x8000)
                Field (GREG, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x6800), 
                    GENA,   32, 
                    GCTL,   32, 
                    LTBC,   32, 
                    Offset (0x6810), 
                    PSBL,   32, 
                    SSBL,   32, 
                    PTCH,   32, 
                    PSBH,   32, 
                    SSBH,   32, 
                    Offset (0x6848), 
                    FCTL,   32, 
                    Offset (0x6EF8), 
                    MUMD,   32
                }
 
                Store (Zero, FCTL)
                Store (Zero, PSBH)
                Store (Zero, SSBH)
                Store (Zero, LTBC)
                Store (One, GENA)
                Store (Zero, MUMD)
            }
        }
 
        Device (HDAU)
        {
            Name (_ADR, One)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                Store (Package (0x02)
                    {
                        "hda-gfx", 
                        Buffer (0x0A)
                        {
                            "onboard-1"
                        }
                    }, Local0)
                DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
            }
        }
 
        OperationRegion (DGFX, PCI_Config, Zero, 0xF0)
        Field (DGFX, DWordAcc, Lock, Preserve)
        {
            Offset (0x0B), 
            LNKV,   8
        }
 
        Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
        {
            Return (GPRW (0x09, 0x04))
        }
    }

 

 

 

 

Thanks to @Matthew82's R9 290X settings because my 7790 is working well with Baladi farmebuffer I just edited the essential information for my GPU.

The only thing is that this patch only worked on my Asus P8H77-L ME which has UEFI support but still no luck on my GA-EP45-DS3R.

 

There is no PEGP or GFX in the DSDT and I don't know what was used on older pc BIOS's ACPI tables to address the GPU.

 

CSM is enabled and Boot from PCIe/PCI Expansion Devices is set to legacy.

 

Thanks again for this solution :)

mind making a SSDT for my 290x im not good with this stuff zxv did good above

Link to comment
Share on other sites

mind making a SSDT for my 290x im not good with this stuff zxv did good above

The one cyberdevs did should work. Just verify that ATY,DeviceID matches your GPU and that the correct number of framebuffer ports (@0…@n) are allotted.

 

Oh, and make sure PEGP is renamed to GFX0 (easy enough to do within Clover).

  • Like 3
Link to comment
Share on other sites

The one cyberdevs did should work. Just verify that ATY,DeviceID matches your GPU and that the correct number of framebuffer ports (@0…@n) are allotted.

 

Than you zxv for pointing me to the right direction. I altered it for my RX 480, can someone tell me why MaciASL keeps adding that "External (PEGP, DeviceObj)" on the top of the file?

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20161210-64(RM)
 * Copyright (c) 2000 - 2016 Intel Corporation
 * 
 * Disassembling to non-symbolic legacy ASL operators
 *
 * Disassembly of iASLnHUIqY.aml, Sun Nov  5 18:59:58 2017
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x00000299 (665)
 *     Revision         0x02
 *     Checksum         0xA1
 *     OEM ID           "INTEL"
 *     OEM Table ID     "radeon"
 *     OEM Revision     0x00003000 (12288)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20161210 (538317328)
 */
DefinitionBlock ("", "SSDT", 2, "INTEL", "radeon", 0x00003000)
{
    External (_SB_.PCI0.PEG0, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.PEG0.PEGP, DeviceObj)    // (from opcode)
    External (PEGP, DeviceObj)    // (from opcode)

    Scope (\_SB.PCI0.PEG0)
    {
        Scope (PEGP)
        {
            OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
            Field (PCIB, AnyAcc, NoLock, Preserve)
            {
                Offset (0x10), 
                BAR0,   32, 
                BAR1,   32, 
                BAR2,   64, 
                BAR4,   32, 
                BAR5,   32
            }

            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (LEqual (BAR5, Zero))
                {
                    Store (BAR2, Local0)
                }
                Else
                {
                    Store (BAR5, Local0)
                }

                OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFFFFFFFFFF0), 0x8000)
                Field (GREG, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x6800), 
                    GENA,   32, 
                    GCTL,   32, 
                    LTBC,   32, 
                    Offset (0x6810), 
                    PSBL,   32, 
                    SSBL,   32, 
                    PTCH,   32, 
                    PSBH,   32, 
                    SSBH,   32, 
                    Offset (0x6848), 
                    FCTL,   32, 
                    Offset (0x6EF8), 
                    MUMD,   32
                }

                Store (Zero, FCTL)
                Store (Zero, PSBH)
                Store (Zero, SSBH)
                Store (Zero, LTBC)
                Store (One, GENA)
                Store (Zero, MUMD)
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x14)
                {
                    "AAPL,slot-name", 
                    Buffer (0x07)
                    {
                        "Slot-1"
                    }, 

                    "@0,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "@0,AAPL,boot-display", 
                    Buffer (One)
                    {
                         0x00                                           
                    }, 

                    "@1,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "@2,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "@3,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "ATY,VendorID", 
                    Buffer (0x02)
                    {
                         0xC7, 0x00                                     
                    }, 

                    "ATY,DeviceID", 
                    Buffer (0x02)
                    {
                         0xDF, 0x67                                     
                    }, 

                    "model", 
                    Buffer (0x12)
                    {
                        "AMD Radeon RX 480"
                    }, 

                    "hda-gfx", 
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }
        }

        Device (HDAU)
        {
            Name (_ADR, One)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x04)
                {
                    "layout-id", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "hda-gfx", 
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }
        }
    }
}


Anyone with RX 480 and Device ID 0x67df may use this.

Link to comment
Share on other sites

The one cyberdevs did should work. Just verify that ATY,DeviceID matches your GPU and that the correct number of framebuffer ports (@0…@n) are allotted.

 

Oh, and make sure PEGP is renamed to GFX0 (easy enough to do within Clover).

I used 67B0 for his GPU which is the device ID for R9 290X, when I opened the ROM file @WarDoc posted it says 285X0500.OU5 so I thing VisionTek uses a custom BIOS for their R9 290X cards. Here's more info on the rom just in case

 

 

 

Read file: 131072 bytes, ROM size: 65536 bytes

-- Analyzing ROM BIOS --
> HEADER offs: 0x20C
> PCIR struct offs: 0x230
> DATA offs: 0xA024, 83 entries
> MASTER offs: 0xA0CA, 37 entries
> CRC table offs: 0x255
> CLOCK table offs: 0xA1F8
Core clock is 300.00 MHz
Memory clock is 150.00 MHz
Reference clock is 27.00 MHz
> TV table offs: 0x0
> OverDrive6 table:VR2[3276.75 .. 3299.57], VR4[13.60 .. 13.60]
> VESA BIOS Extension 3.00, Rev. 15.42:
Vendor: © 1988-2010, Advanced Micro Devices, Inc.
Product: HAWAII, Rev. 01.00
OEM: AMD ATOMBIOS
Memory size: 256 Mb
> ASIC config:
0x75 = 0xC5, 0x74 = 0x0A, 0x7C = 0x96
> Secure VBIOS details:
! Digest is not found! :( Don't modify this BIOS!
This BIOS has hidden (by RaBiT) data
-- ROM BIOS info --
Desc: C67101 Hawaii XT A0 GDDR5 4GB 64Mx32 300e/150m
Info: , 285X0500.OU5, 12/12/13 01:55
! Chipset family: Unknown
! Script deadlock detected, cancel running...
-- Found hardware registers values: --
> PLL(00): 0x00000000
> PLL(04): 0x00000000
-- User changes followed --
 

 

 

Link to comment
Share on other sites

Than you zxv for pointing me to the right direction. I altered it for my RX 480, can someone tell me why MaciASL keeps adding that "External (PEGP, DeviceObj)" on the top of the file?

The device isn't defined directly in this SSDT, as it's likely already in one's DSDT—no need to duplicate definitions. Per my understanding, the ACPI interpreter compiles all tables together during OS boot. External references are basically used to notify the ACPI interpreter that the definition exists, but must be found elsewhere.

 

Not sure why it's adding that ext ref though when _SB_.PCI0.PEG0.PEGP is already there (mine doesn't). Could be the particular version of iasl you're using (I'm using 20170929). Shouldn't hurt anything though, just a minor redundancy.

 

I used 67B0 for his GPU which is the device ID for R9 290X, when I opened the ROM file @WarDoc posted it says 285X0500.OU5 so I thing VisionTek uses a custom BIOS for their R9 290X cards. Here's more info on the rom just in case

 

 

 

Read file: 131072 bytes, ROM size: 65536 bytes

-- Analyzing ROM BIOS --

> HEADER offs: 0x20C

> PCIR struct offs: 0x230

> DATA offs: 0xA024, 83 entries

> MASTER offs: 0xA0CA, 37 entries

> CRC table offs: 0x255

> CLOCK table offs: 0xA1F8

Core clock is 300.00 MHz

Memory clock is 150.00 MHz

Reference clock is 27.00 MHz

> TV table offs: 0x0

> OverDrive6 table:VR2[3276.75 .. 3299.57], VR4[13.60 .. 13.60]

> VESA BIOS Extension 3.00, Rev. 15.42:

Vendor: © 1988-2010, Advanced Micro Devices, Inc.

Product: HAWAII, Rev. 01.00

OEM: AMD ATOMBIOS

Memory size: 256 Mb

> ASIC config:

0x75 = 0xC5, 0x74 = 0x0A, 0x7C = 0x96

> Secure VBIOS details:

! Digest is not found! :( Don't modify this BIOS!

This BIOS has hidden (by RaBiT) data

-- ROM BIOS info --

Desc: C67101 Hawaii XT A0 GDDR5 4GB 64Mx32 300e/150m

Info: , 285X0500.OU5, 12/12/13 01:55

! Chipset family: Unknown

! Script deadlock detected, cancel running...

-- Found hardware registers values: --

> PLL(00): 0x00000000

> PLL(04): 0x00000000

-- User changes followed --

 

 

 

His 290X probably has the same devID (67B0). IIRC there are some brands of some cards that diverge on this, but it's fairly uncommon.

Link to comment
Share on other sites

The device isn't defined directly in this SSDT, as it's likely already in one's DSDT—no need to duplicate definitions. Per my understanding, the ACPI interpreter compiles all tables together during OS boot. External references are basically used to notify the ACPI interpreter that the definition exists, but must be found elsewhere.

 

Not sure why it's adding that ext ref though when _SB_.PCI0.PEG0.PEGP is already there (mine doesn't). Could be the particular version of iasl you're using (I'm using 20170929). Shouldn't hurt anything though, just a minor redundancy.

 

His 290X probably has the same devID (67B0). IIRC there are some brands of some cards that may diverge on this, but it's fairly uncommon.

Thanks. I thought that "Scope (PEGP)" would be able to get resolved by the parent _SB_.PCI0.PEG0, but it doesn't. Anyway, as you say it's obviously just safety redeclaration.

Link to comment
Share on other sites

Inject the missing device properties. For an example, please see http://www.insanelymac.com/forum/topic/328549-tracing-back-the-amd-gpu-wakeup-issue-to-its-origin/?p=2525983

 

Mieze

 

 

@Mieze:

 

modzilla over at hackintosh-forum.de  is exploring using your DSDT/SSDT approach to also transfer custom connector info to a frame buffer aka DSDT-Connector-Patch.

 

Do you think that might be possible?

  • Like 1
Link to comment
Share on other sites

@Mieze:

 

modzilla over at hackintosh-forum.de  is exploring using your DSDT/SSDT approach to also transfer custom connector info to a frame buffer aka DSDT-Connector-Patch.

 

Do you think that might be possible?

No, because Whatevergreen.kext picks up the properties you inject und patches the kext. Without the kext they are useless.

 

Mieze

Link to comment
Share on other sites

No, because Whatevergreen.kext picks up the properties you inject und patches the kext. Without the kext they are useless.

 

Mieze

how to display the correct graphic name? sorry.i cant do that via config.plist.

Link to comment
Share on other sites

how to display the correct graphic name? sorry.i cant do that via config.plist.

 

Edit the AMD9510Controllerkext.

 

You can edit the kext AMD9510controllerkext. Right click on it and select "show package contents" then open the macOS folder and drag the controller to desktop. download iHex (free) and open it, drag controller to iHex window. Go to top tool bar and select "Edit" scroll to "Find" and then scroll right to "find". on the top left of iHex window select "text" mode. Type in AMD R9 xxx. then type in AMD RX 580 in the second window. Go to right side of window and select "Next" just hit it once. The script R9 xxx should light up yellow. Now hit the "replace" tab once ( if you hit it twice it will add the new name twice and corrupt the file). It willl flash once and it will change to RX 580. Close iHex and hit save option. Now drag the edited controller back to macOS folder and replace.    MAKE SURE TO GET REPLCE PROMPT IF NOT HIT CANCEL AND REPEAT.   Run kext Wizard before reboot. I've done this many times, and it works until the next update. save a copy of the original kext in a folder before you do the edit in case you need to replace it again.

  • Like 1
Link to comment
Share on other sites

Edit the AMD9510Controllerkext.

 

You can edit the kext AMD9510controllerkext. Right click on it and select "show package contents" then open the macOS folder and drag the controller to desktop. download iHex (free) and open it, drag controller to iHex window. Go to top tool bar and select "Edit" scroll to "Find" and then scroll right to "find". on the top left of iHex window select "text" mode. Type in AMD R9 xxx. then type in AMD RX 580 in the second window. Go to right side of window and select "Next" just hit it once. The script R9 xxx should light up yellow. Now hit the "replace" tab once ( if you hit it twice it will add the new name twice and corrupt the file). It willl flash once and it will change to RX 580. Close iHex and hit save option. Now drag the edited controller back to macOS folder and replace.    MAKE SURE TO GET REPLCE PROMPT IF NOT HIT CANCEL AND REPEAT.   Run kext Wizard before reboot. I've done this many times, and it works until the next update. save a copy of the original kext in a folder before you do the edit in case you need to replace it again.

thanks..but i prefer to solve via config.plist 

Link to comment
Share on other sites

attach your SSDT that you are using and what would you like for it to say?

i used the ssdt-amd.aml provided by slice in this thread. but it only display amd r9xxx 8g  not rx 580 8g....so how to resolve it...thanks...sorry for my bad english.

Link to comment
Share on other sites

Than you zxv for pointing me to the right direction. I altered it for my RX 480, can someone tell me why MaciASL keeps adding that "External (PEGP, DeviceObj)" on the top of the file?

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20161210-64(RM)
 * Copyright (c) 2000 - 2016 Intel Corporation
 * 
 * Disassembling to non-symbolic legacy ASL operators
 *
 * Disassembly of iASLnHUIqY.aml, Sun Nov  5 18:59:58 2017
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x00000299 (665)
 *     Revision         0x02
 *     Checksum         0xA1
 *     OEM ID           "INTEL"
 *     OEM Table ID     "radeon"
 *     OEM Revision     0x00003000 (12288)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20161210 (538317328)
 */
DefinitionBlock ("", "SSDT", 2, "INTEL", "radeon", 0x00003000)
{
    External (_SB_.PCI0.PEG0, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.PEG0.PEGP, DeviceObj)    // (from opcode)
    External (PEGP, DeviceObj)    // (from opcode)

    Scope (\_SB.PCI0.PEG0)
    {
        Scope (PEGP)
        {
            OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
            Field (PCIB, AnyAcc, NoLock, Preserve)
            {
                Offset (0x10), 
                BAR0,   32, 
                BAR1,   32, 
                BAR2,   64, 
                BAR4,   32, 
                BAR5,   32
            }

            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (LEqual (BAR5, Zero))
                {
                    Store (BAR2, Local0)
                }
                Else
                {
                    Store (BAR5, Local0)
                }

                OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFFFFFFFFFF0), 0x8000)
                Field (GREG, AnyAcc, NoLock, Preserve)
                {
                    Offset (0x6800), 
                    GENA,   32, 
                    GCTL,   32, 
                    LTBC,   32, 
                    Offset (0x6810), 
                    PSBL,   32, 
                    SSBL,   32, 
                    PTCH,   32, 
                    PSBH,   32, 
                    SSBH,   32, 
                    Offset (0x6848), 
                    FCTL,   32, 
                    Offset (0x6EF8), 
                    MUMD,   32
                }

                Store (Zero, FCTL)
                Store (Zero, PSBH)
                Store (Zero, SSBH)
                Store (Zero, LTBC)
                Store (One, GENA)
                Store (Zero, MUMD)
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x14)
                {
                    "AAPL,slot-name", 
                    Buffer (0x07)
                    {
                        "Slot-1"
                    }, 

                    "@0,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "@0,AAPL,boot-display", 
                    Buffer (One)
                    {
                         0x00                                           
                    }, 

                    "@1,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "@2,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "@3,name", 
                    Buffer (0x0C)
                    {
                        "ATY,Orinoco"
                    }, 

                    "ATY,VendorID", 
                    Buffer (0x02)
                    {
                         0xC7, 0x00                                     
                    }, 

                    "ATY,DeviceID", 
                    Buffer (0x02)
                    {
                         0xDF, 0x67                                     
                    }, 

                    "model", 
                    Buffer (0x12)
                    {
                        "AMD Radeon RX 480"
                    }, 

                    "hda-gfx", 
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }
        }

        Device (HDAU)
        {
            Name (_ADR, One)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x04)
                {
                    "layout-id", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "hda-gfx", 
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }
        }
    }
}


Anyone with RX 480 and Device ID 0x67df may use this.

RX 580 can use this ? :)

Link to comment
Share on other sites

×
×
  • Create New...