Contribute
Register

[Guide] Patching LAPTOP DSDT/SSDTs

Hi @RehabMan , long time no see :)
Just dump ioreg from a new MacBook. Found something interesting in PNP0C01 for Haswell/Broadwell graphics:
OS X requires MEM2 instead of TPMX in DSDT. Without patching TPMX in DSDT, PNP0C01 will not be loaded correctly. And so does the IOAccelMemoryInfoUserClient. So, here's the patch I made:
Code:
#Credit syscl @ github.com/syscl: iGPU use MEM2 instead of TPMX, and r/w memory instead of r/o memory.
#syscl_iGPU_MEM2.txt

into device label TPMX remove_entry;
into device label PCI0 insert
begin
Device (MEM2) // iGPU use MEM2 instead of TPMX, and RW memory. syscl\n
{\n
    Name (_HID, EisaId ("PNP0C01"))\n
    Name (_UID, 0x02)\n
    Name (_STA, 0x0F)\n
    Name (_CRS, ResourceTemplate ()\n
    {\n
        Memory32Fixed (ReadWrite, 0x20000000, 0x00200000, )\n
        Memory32Fixed (ReadWrite, 0x40000000, 0x00200000, )\n
    })\n
}\n
end;

After applying the MEM2 patch, the PNP0C01 on various laptops will be loaded correctly by OS X, here's the screenshot of the change:
View attachment 200946
View attachment 200947
Can you upload this patch in your git(so popular) so that more people will benefit from it.
Best wishes,
syscl.

Please post native ACPI files (DSDT at least).
 
Hi @RehabMan , long time no see :)
Just dump ioreg from a new MacBook. Found something interesting in PNP0C01 for Haswell/Broadwell graphics:
OS X requires MEM2 instead of TPMX in DSDT. Without patching TPMX in DSDT, PNP0C01 will not be loaded correctly. And so does the IOAccelMemoryInfoUserClient. So, here's the patch I made:
Code:
#Credit syscl @ github.com/syscl: iGPU use MEM2 instead of TPMX, and r/w memory instead of r/o memory.
#syscl_iGPU_MEM2.txt

into device label TPMX remove_entry;
into device label PCI0 insert
begin
Device (MEM2) // iGPU use MEM2 instead of TPMX, and RW memory. syscl\n
{\n
    Name (_HID, EisaId ("PNP0C01"))\n
    Name (_UID, 0x02)\n
    Name (_STA, 0x0F)\n
    Name (_CRS, ResourceTemplate ()\n
    {\n
        Memory32Fixed (ReadWrite, 0x20000000, 0x00200000, )\n
        Memory32Fixed (ReadWrite, 0x40000000, 0x00200000, )\n
    })\n
}\n
end;

After applying the MEM2 patch, the PNP0C01 on various laptops will be loaded correctly by OS X, here's the screenshot of the change:
View attachment 200946
View attachment 200947
Can you upload this patch in your git(so popular) so that more people will benefit from it.
Best wishes,
syscl.

I don't think this patch has general applicability. My u430 has no PNP0C01. The 4540s has a PNP0C01 but is named MEM2.

I can't find any documentation on PNP0C01...

Also, if you just want to rename:
Code:
into device label TPMX set_label begin MEM2 end;
 
I don't think this patch has general applicability. My u430 has no PNP0C01. The 4540s has a PNP0C01 but is named MEM2.

I can't find any documentation on PNP0C01...

Also, if you just want to rename:
Code:
into device label TPMX set_label begin MEM2 end;

That makes two of us, I can't find any documentation on PNP0C01...

Weird, Asus FX50JX(i5-4200H, BCM43124, OS X 10.11.5/Win10) has the same name TPMX as M3800. I will upload the ACPI tables for you later since he is far from me now.

After applying the MEM2 patch, the brightness of M3800 has been reset.
Here's some difference between TPMX and new Macbook's MEM2:
M3800(i7-4712HQ, BCM4350, OS X 10.11.5/Win10)
Code:
Device (TPMX)
            {
                Name (_HID, EisaId ("PNP0C01"))  // _HID: Hardware ID
                Name (_UID, One)  // _UID: Unique ID
                Name (CRS, ResourceTemplate ()
                {
                    Memory32Fixed (ReadOnly,
                        0xFED40000,         // Address Base
                        0x00005000,         // Address Length
                        )
                })
                Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                {
                    Return (CRS)
                }

                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If (TPMF)
                    {
                        Return (Zero)
                    }

                    Return (0x0F)
                }
            }

new MacBook(2016):
Code:
Device (^^MEM2)
                {
                    Name (_HID, EisaId ("PNP0C01"))  // _HID: Hardware ID
                    Name (_UID, 0x02)  // _UID: Unique ID
                    Name (CRS, ResourceTemplate ()
                    {
                        Memory32Fixed (ReadWrite,
                            0x20000000,         // Address Base
                            0x00200000,         // Address Length
                            )
                        Memory32Fixed (ReadWrite,
                            0x40000000,         // Address Base
                            0x00200000,         // Address Length
                            )
                    })
                    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
                    {
                        Return (CRS)
                    }
                }

I will try to find information about PNP0C01.

Best wishes,
syscl
 
Hi there RehabMan, I have this DSDT that I'm trying to decompile without errors but I keep getting these 4 Errors one of which I fixed by deleting the many lines of 'Zero' that were in one spot. I tried and tried to fix these errors but just can't so I want to kindly ask for your help in resolving them. I am using ACPI Specification 5.0A but it comes up with these errors in ACPI 5.1 as well. I decompiled with the newest version of iasl which I got from Bitbucket and I got an error:
ACPI Exception: AE_ALREADY_EXISTS, while adding external to namespace [_SB_.PCI0.PEG0.PEGP.SGPO] (20160422/dmextern-1012)
so i had to remove SSDT-4X.aml from the folder to get a successful decompilation. I read in another forum that you suggested to another user who had a similar problem to me, to find the duplicate SSDT so that's what I did and only when SSDT-4X.aml is deleted does it compile. If i try deleting others one-by-one it doesn't decompile successfully. I did everything according to your guide in post 1 and I used the refs.txt and the appropriate command to decompile. I have attached a screenshot of the errors that I get after removing the zeros. I have also attached the SSDT-4X.aml separately in case you need it. If you need anything else, please just tell me. Thank you in advance!

Screen Shot 2016-07-01 at 17.51.11.png


Laptop: Razer Blade 2015
CPU: Intel Core i7 4720HQ
RAM: 8 GB DDR3L
GPU: GTX 970M / Intel Integrated HD Graphics 4600
Sound Card: Realtek ALC 283
Wi-Fi: AzureWave AW-CE123H
 

Attachments

  • DSDT-Decompiled and 'Zero's Fixed.zip
    96.9 KB · Views: 112
  • SSDT-4x.aml
    1.4 KB · Views: 158
Hi there RehabMan, I have this DSDT that I'm trying to decompile without errors but I keep getting these 4 Errors one of which I fixed by deleting the many lines of 'Zero' that were in one spot. I tried and tried to fix these errors but just can't so I want to kindly ask for your help in resolving them. I am using ACPI Specification 5.0A but it comes up with these errors in ACPI 5.1 as well. I decompiled with the newest version of iasl which I got from Bitbucket and I got an error:
ACPI Exception: AE_ALREADY_EXISTS, while adding external to namespace [_SB_.PCI0.PEG0.PEGP.SGPO] (20160422/dmextern-1012)
so i had to remove SSDT-4X.aml from the folder to get a successful decompilation. I read in another forum that you suggested to another user who had a similar problem to me, to find the duplicate SSDT so that's what I did and only when SSDT-4X.aml is deleted does it compile. If i try deleting others one-by-one it doesn't decompile successfully. I did everything according to your guide in post 1 and I used the refs.txt and the appropriate command to decompile. I have attached a screenshot of the errors that I get after removing the zeros. I have also attached the SSDT-4X.aml separately in case you need it. If you need anything else, please just tell me. Thank you in advance!

View attachment 201499

Laptop: Razer Blade 2015
CPU: Intel Core i7 4720HQ
RAM: 8 GB DDR3L
GPU: GTX 970M / Intel Integrated HD Graphics 4600
Sound Card: Realtek ALC 283
Wi-Fi: AzureWave AW-CE123H

There are no errors in your DSDT.dsl when using the tools linked from my guide (ACPI 6.1).

There is no need to do anything with dynamic SSDTs such as SSDT-4x.aml.

Make sure you read the guide carefully.
 
There are no errors in your DSDT.dsl when using the tools linked from my guide (ACPI 6.1).

There is no need to do anything with dynamic SSDTs such as SSDT-4x.aml.

Make sure you read the guide carefully.

Thanks a lot! Will try to read the guides better in the future before asking.
 
Thanks a lot! Will try to read the guides better in the future before asking.

Sorry to bother you again RehabMan, but I am trying to patch SSDT-10.dsl to disable the NVIDIA graphics card. The problem is that when i try to compile without having done any patching, even with ACPI 6.1, I still get a single error which is shown in the screenshot. Could you please take a look at it and help me solve it? Thank you!

Screen Shot 2016-07-02 at 22.42.53.png
 
Sorry to bother you again RehabMan, but I am trying to patch SSDT-10.dsl to disable the NVIDIA graphics card. The problem is that when i try to compile without having done any patching, even with ACPI 6.1, I still get a single error which is shown in the screenshot. Could you please take a look at it and help me solve it? Thank you!

View attachment 201651

So I just tried to fix it by removing the problematic line and the other three around it and that seemed to fix it. I get no more errors. Is what I did a proper fix or is it wrong and will cause problems?

Code:
Scope (\_SB.PCI0)
    {
        Device (WMI1)
        {
            Name (_HID, "PNP0C14")  // _HID: Hardware ID
            Name (_UID, "OPT1")  // _UID: Unique ID
            Name (_WDG, Buffer (0x14)
            {
                /* 0000 */  0x3C, 0x5C, 0xCB, 0xF6, 0xAE, 0x9C, 0xBD, 0x4E,
                /* 0008 */  0xB5, 0x77, 0x93, 0x1E, 0xA3, 0x2A, 0x2C, 0xC0,
                /* 0010 */  0x4D, 0x58, 0x01, 0x02                        
            })
            Method (WMMX, 3, NotSerialized)
            {
                CreateDWordField (Arg2, Zero, FUNC)
                If (LEqual (FUNC, 0x534F525F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x08))
                    {
                        CreateDWordField (Arg2, 0x04, ARGS)
                        CreateDWordField (Arg2, 0x08, XARG)
                        Return (\_SB.PCI0.PEG0.PEGP._ROM (ARGS, XARG))
                    }
                }

                If (LEqual (FUNC, 0x4D53445F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x1C))
                    {
                        CreateField (Arg2, Zero, 0x80, MUID)
                        CreateDWordField (Arg2, 0x10, REVI)
                        CreateDWordField (Arg2, 0x14, SFNC)
                        CreateField (Arg2, 0xE0, 0x20, XRG0)
                        If (CondRefOf (\_SB.PCI0.GFX0._DSM))
                        {
                            Return (\_SB.PCI0.GFX0._DSM)
                            MUID
                            REVI <---------------------------------------- This is the problematic line.
                            SFNC
                            XRG0
                        }
                    }
                }

                Return (Zero)
            }
        }
    }
}

Something I attempted but not sure if it is the proper fix:
Code:
Scope (\_SB.PCI0)
    {
        Device (WMI1)
        {
            Name (_HID, "PNP0C14")  // _HID: Hardware ID
            Name (_UID, "OPT1")  // _UID: Unique ID
            Name (_WDG, Buffer (0x14)
            {
                /* 0000 */  0x3C, 0x5C, 0xCB, 0xF6, 0xAE, 0x9C, 0xBD, 0x4E,
                /* 0008 */  0xB5, 0x77, 0x93, 0x1E, 0xA3, 0x2A, 0x2C, 0xC0,
                /* 0010 */  0x4D, 0x58, 0x01, 0x02                        
            })
            Method (WMMX, 3, NotSerialized)
            {
                CreateDWordField (Arg2, Zero, FUNC)
                If (LEqual (FUNC, 0x534F525F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x08))
                    {
                        CreateDWordField (Arg2, 0x04, ARGS)
                        CreateDWordField (Arg2, 0x08, XARG)
                        Return (\_SB.PCI0.PEG0.PEGP._ROM (ARGS, XARG))
                    }
                }

                If (LEqual (FUNC, 0x4D53445F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x1C))
                    {
                        CreateField (Arg2, Zero, 0x80, MUID)
                        CreateDWordField (Arg2, 0x10, REVI)
                        CreateDWordField (Arg2, 0x14, SFNC)
                        CreateField (Arg2, 0xE0, 0x20, XRG0)
                        If (CondRefOf (\_SB.PCI0.GFX0._DSM))
                        {
                            Return (\_SB.PCI0.GFX0._DSM)
                          
                        }
                    }
                }

                Return (Zero)
            }
        }
    }
}
 
So I just tried to fix it by removing the problematic line and the other three around it and that seemed to fix it. I get no more errors. Is what I did a proper fix or is it wrong and will cause problems?

Code:
Scope (\_SB.PCI0)
    {
        Device (WMI1)
        {
            Name (_HID, "PNP0C14")  // _HID: Hardware ID
            Name (_UID, "OPT1")  // _UID: Unique ID
            Name (_WDG, Buffer (0x14)
            {
                /* 0000 */  0x3C, 0x5C, 0xCB, 0xF6, 0xAE, 0x9C, 0xBD, 0x4E,
                /* 0008 */  0xB5, 0x77, 0x93, 0x1E, 0xA3, 0x2A, 0x2C, 0xC0,
                /* 0010 */  0x4D, 0x58, 0x01, 0x02                       
            })
            Method (WMMX, 3, NotSerialized)
            {
                CreateDWordField (Arg2, Zero, FUNC)
                If (LEqual (FUNC, 0x534F525F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x08))
                    {
                        CreateDWordField (Arg2, 0x04, ARGS)
                        CreateDWordField (Arg2, 0x08, XARG)
                        Return (\_SB.PCI0.PEG0.PEGP._ROM (ARGS, XARG))
                    }
                }

                If (LEqual (FUNC, 0x4D53445F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x1C))
                    {
                        CreateField (Arg2, Zero, 0x80, MUID)
                        CreateDWordField (Arg2, 0x10, REVI)
                        CreateDWordField (Arg2, 0x14, SFNC)
                        CreateField (Arg2, 0xE0, 0x20, XRG0)
                        If (CondRefOf (\_SB.PCI0.GFX0._DSM))
                        {
                            Return (\_SB.PCI0.GFX0._DSM)
                            MUID
                            REVI <---------------------------------------- This is the problematic line.
                            SFNC
                            XRG0
                        }
                    }
                }

                Return (Zero)
            }
        }
    }
}

Something I attempted but not sure if it is the proper fix:
Code:
Scope (\_SB.PCI0)
    {
        Device (WMI1)
        {
            Name (_HID, "PNP0C14")  // _HID: Hardware ID
            Name (_UID, "OPT1")  // _UID: Unique ID
            Name (_WDG, Buffer (0x14)
            {
                /* 0000 */  0x3C, 0x5C, 0xCB, 0xF6, 0xAE, 0x9C, 0xBD, 0x4E,
                /* 0008 */  0xB5, 0x77, 0x93, 0x1E, 0xA3, 0x2A, 0x2C, 0xC0,
                /* 0010 */  0x4D, 0x58, 0x01, 0x02                       
            })
            Method (WMMX, 3, NotSerialized)
            {
                CreateDWordField (Arg2, Zero, FUNC)
                If (LEqual (FUNC, 0x534F525F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x08))
                    {
                        CreateDWordField (Arg2, 0x04, ARGS)
                        CreateDWordField (Arg2, 0x08, XARG)
                        Return (\_SB.PCI0.PEG0.PEGP._ROM (ARGS, XARG))
                    }
                }

                If (LEqual (FUNC, 0x4D53445F))
                {
                    If (LGreaterEqual (SizeOf (Arg2), 0x1C))
                    {
                        CreateField (Arg2, Zero, 0x80, MUID)
                        CreateDWordField (Arg2, 0x10, REVI)
                        CreateDWordField (Arg2, 0x14, SFNC)
                        CreateField (Arg2, 0xE0, 0x20, XRG0)
                        If (CondRefOf (\_SB.PCI0.GFX0._DSM))
                        {
                            Return (\_SB.PCI0.GFX0._DSM)
                         
                        }
                    }
                }

                Return (Zero)
            }
        }
    }
}


I think I finally fixed it. Used the 'Cleanup/Fix Errors (SSDT)' Fix and Voila!
 
Back
Top