Contribute
Register

SSDT syntax error

Status
Not open for further replies.
Joined
May 30, 2016
Messages
980
Motherboard
Gigabyte Z490 Vision G
CPU
i9-10900K
Graphics
RX 5700 XT
Mac
  1. iMac
  2. MacBook
  3. MacBook Pro
  4. Mac mini
Classic Mac
  1. PowerBook
  2. Quadra
Mobile Phone
  1. iOS
I'm a total n00b trying to apply principles from someone else's build into mine (pcie renaming to get my Z170 build more inline with a true imac 17,1)

So what am I missing here (syntax-wise)
Code:
DefinitionBlock ("", "SSDT", 1, "Z170", "PCI-Inject", 0x00000000)
{
    External (_SB_.PCI0.RP03.PXSX.ARPT, DeviceObj)
   
    Scope (_SB.PCI0.RP03.PXSX.ARPT)
    {
        OperationRegion (PCIS, PCI_Config, Zero, 0x0100)
        Field (PCIS, AnyAcc, NoLock, Preserve)
        {
            PVID,   16,
            PDID,   16
        }

        Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
        {
            Return (GPRW (0x69, 0x04))
        }

        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            Store (Package (0x0E)
                {
                    "built-in",
                    Buffer (One)
                    {
                         0x00                                          
                    },

                    "device-id",
                    Buffer (0x04)
                    {
                         0xBA, 0x43, 0x00, 0x00                        
                    },

                    "AAPL,slot-name",
                    Buffer (0x07)
                    {
                        "Slot-5"
                    },

                    "device_type",
                    Buffer (0x13)
                    {
                        "AirPort Controller"
                    },

                    "model",
                    Buffer (0x4A)
                    {
                        "BCM943602CS 802.11 a/b/g/n/ac + Bluetooth 4.0 Controller"
                    },

                    "compatible",
                    Buffer (0x0D)
                    {
                        "pci14e4,43ba"
                    },

                    "name",
                    Buffer (0x10)
                    {
                        "AirPort Extreme"
                    }
                }, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }
    }
?
 
I'm a total n00b trying to apply principles from someone else's build into mine (pcie renaming to get my Z170 build more inline with a true imac 17,1)

So what am I missing here (syntax-wise)
Code:
DefinitionBlock ("", "SSDT", 1, "Z170", "PCI-Inject", 0x00000000)
{
    External (_SB_.PCI0.RP03.PXSX.ARPT, DeviceObj)
  
    Scope (_SB.PCI0.RP03.PXSX.ARPT)
    {
        OperationRegion (PCIS, PCI_Config, Zero, 0x0100)
        Field (PCIS, AnyAcc, NoLock, Preserve)
        {
            PVID,   16,
            PDID,   16
        }

        Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
        {
            Return (GPRW (0x69, 0x04))
        }

        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            Store (Package (0x0E)
                {
                    "built-in",
                    Buffer (One)
                    {
                         0x00                                         
                    },

                    "device-id",
                    Buffer (0x04)
                    {
                         0xBA, 0x43, 0x00, 0x00                       
                    },

                    "AAPL,slot-name",
                    Buffer (0x07)
                    {
                        "Slot-5"
                    },

                    "device_type",
                    Buffer (0x13)
                    {
                        "AirPort Controller"
                    },

                    "model",
                    Buffer (0x4A)
                    {
                        "BCM943602CS 802.11 a/b/g/n/ac + Bluetooth 4.0 Controller"
                    },

                    "compatible",
                    Buffer (0x0D)
                    {
                        "pci14e4,43ba"
                    },

                    "name",
                    Buffer (0x10)
                    {
                        "AirPort Extreme"
                    }
                }, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }
    }
?

Your code is missing the final closing bracket:
Code:
}

And it refers to GPRW and DTGP that are not defined in the file.
I suppose you meant to use 'External' to access them:
Code:
    External(GPRW, MethodObj)
    External(DTGP, MethodObj)
 
Your code is missing the final closing bracket:
Code:
}

And it refers to GPRW and DTGP that are not defined in the file.
I suppose you meant to use 'External' to access them:
Code:
    External(GPRW, MethodObj)
    External(DTGP, MethodObj)


Thanks Rehabman!

This compiles but does not have the produce the intended result. Trying to figure that one out. (Which UUID is referenced in the DTGP block, does it matter?)

Code:
DefinitionBlock ("", "SSDT", 1, "NICO", "X299", 0x00000000)
{
    External (_SB_.PCI0.RP03.ARPT, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.RP03.PXSX, DeviceObj)    // (from opcode)
    External (DTGP, MethodObj)    // 5 Arguments (from opcode)
    External (GPRW, MethodObj)    // 2 Arguments (from opcode)

    Scope (_SB.PCI0.RP03.ARPT)
    {
        OperationRegion (PCIS, PCI_Config, Zero, 0x0100)
        Field (PCIS, AnyAcc, NoLock, Preserve)
        {
            PVID,   16,
            PDID,   16
        }

        Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
        {
            Return (GPRW (0x69, 0x04))
        }

        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            Store (Package (0x0E)
                {
                    "built-in",
                    Buffer (One)
                    {
                         0x00                                          
                    },

                    "device-id",
                    Buffer (0x04)
                    {
                         0xBA, 0x43, 0x00, 0x00                        
                    },

                    "AAPL,slot-name",
                    Buffer (0x07)
                    {
                        "Slot-5"
                    },

                    "device_type",
                    Buffer (0x13)
                    {
                        "AirPort Controller"
                    },

                    "model",
                    Buffer (0x4A)
                    {
                        "BCM943602CS 802.11 a/b/g/n/ac + Bluetooth 4.0 Controller"
                    },

                    "compatible",
                    Buffer (0x0D)
                    {
                        "pci14e4,43ba"
                    },

                    "name",
                    Buffer (0x10)
                    {
                        "AirPort Extreme"
                    }
                }, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }
    }

    Name (_SB.PCI0.RP03.PXSX._STA, Zero)  // _STA: Status
    Method (DTGP, 5, NotSerialized)
    {
        If (LEqual (Arg0, ToUUID ("e68fdd9d-933d-4d1b-abe0-1800040393e3")))
        {
            If (LEqual (Arg1, One))
            {
                If (LEqual (Arg2, Zero))
                {
                    Store (Buffer (One)
                        {
                             0x03                                          
                        }, Arg4)
                    Return (One)
                }

                If (LEqual (Arg2, One))
                {
                    Return (One)
                }
            }
        }

        Store (Buffer (One)
            {
                 0x00                                          
            }, Arg4)
        Return (Zero)
    }
}
 
Thanks Rehabman!

This compiles but does not have the produce the intended result. Trying to figure that one out. (Which UUID is referenced in the DTGP block, does it matter?)

Code:
DefinitionBlock ("", "SSDT", 1, "NICO", "X299", 0x00000000)
{
    External (_SB_.PCI0.RP03.ARPT, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.RP03.PXSX, DeviceObj)    // (from opcode)
    External (DTGP, MethodObj)    // 5 Arguments (from opcode)
    External (GPRW, MethodObj)    // 2 Arguments (from opcode)

    Scope (_SB.PCI0.RP03.ARPT)
    {
        OperationRegion (PCIS, PCI_Config, Zero, 0x0100)
        Field (PCIS, AnyAcc, NoLock, Preserve)
        {
            PVID,   16,
            PDID,   16
        }

        Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
        {
            Return (GPRW (0x69, 0x04))
        }

        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            Store (Package (0x0E)
                {
                    "built-in",
                    Buffer (One)
                    {
                         0x00                                        
                    },

                    "device-id",
                    Buffer (0x04)
                    {
                         0xBA, 0x43, 0x00, 0x00                      
                    },

                    "AAPL,slot-name",
                    Buffer (0x07)
                    {
                        "Slot-5"
                    },

                    "device_type",
                    Buffer (0x13)
                    {
                        "AirPort Controller"
                    },

                    "model",
                    Buffer (0x4A)
                    {
                        "BCM943602CS 802.11 a/b/g/n/ac + Bluetooth 4.0 Controller"
                    },

                    "compatible",
                    Buffer (0x0D)
                    {
                        "pci14e4,43ba"
                    },

                    "name",
                    Buffer (0x10)
                    {
                        "AirPort Extreme"
                    }
                }, Local0)
            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
            Return (Local0)
        }
    }

    Name (_SB.PCI0.RP03.PXSX._STA, Zero)  // _STA: Status
    Method (DTGP, 5, NotSerialized)
    {
        If (LEqual (Arg0, ToUUID ("e68fdd9d-933d-4d1b-abe0-1800040393e3")))
        {
            If (LEqual (Arg1, One))
            {
                If (LEqual (Arg2, Zero))
                {
                    Store (Buffer (One)
                        {
                             0x03                                        
                        }, Arg4)
                    Return (One)
                }

                If (LEqual (Arg2, One))
                {
                    Return (One)
                }
            }
        }

        Store (Buffer (One)
            {
                 0x00                                        
            }, Arg4)
        Return (Zero)
    }
}

You seem to be doing something you don't even need to be doing... (no ACPI changes required for Broadcom WiFi).
What are you trying to accomplish?
 
You seem to be doing something you don't even need to be doing... (no ACPI changes required for Broadcom WiFi).
What are you trying to accomplish?


You're right, I don't -need- to be doing it. (I'm trying to get my devices to properly show up in the PCI devices pane of the system profiler.)
For instance my GFX card doesn't shot up on Slot-1. Was inspired by KGPs work on his X299 build and figured (with too little knowledge) I'd see what I could do with my build.
 

Attachments

  • Screen Shot 2018-02-09 at 6.58.12 PM.png
    Screen Shot 2018-02-09 at 6.58.12 PM.png
    143.6 KB · Views: 270
You're right, I don't -need- to be doing it. (I'm trying to get my devices to properly show up in the PCI devices pane of the system profiler.)
For instance my GFX card doesn't shot up on Slot-1. Was inspired by KGPs work on his X299 build and figured (with too little knowledge) I'd see what I could do with my build.

If you disassemble your patchmatic -extract output, you might discover your mistake (likely duplicate _DSM, duplicate DTGP, or other).

Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
(it explains how to use patchmatic -extract)

Then disassemble your patchmatic output: iasl -da -dl *.aml

Note: If you're only trying to populate the PCIe of System Information.app, you should avoid some of the things you're doing (eg. ACPI identity renames, device-id inject, etc). Focus only on injection of properties related to System Information (AAPL,slot-name, model, etc).
 
If you disassemble your patchmatic -extract output, you might discover your mistake (likely duplicate _DSM, duplicate DTGP, or other).

Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
(it explains how to use patchmatic -extract)

Then disassemble your patchmatic output: iasl -da -dl *.aml

Note: If you're only trying to populate the PCIe of System Information.app, you should avoid some of the things you're doing (eg. ACPI identity renames, device-id inject, etc). Focus only on injection of properties related to System Information (AAPL,slot-name, model, etc).


Thanks @RehabMan i definitely have everything to learn so that’s a good starting point.
 
If you disassemble your patchmatic -extract output, you might discover your mistake (likely duplicate _DSM, duplicate DTGP, or other).

Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
(it explains how to use patchmatic -extract)

Then disassemble your patchmatic output: iasl -da -dl *.aml

Note: If you're only trying to populate the PCIe of System Information.app, you should avoid some of the things you're doing (eg. ACPI identity renames, device-id inject, etc). Focus only on injection of properties related to System Information (AAPL,slot-name, model, etc).

Hi Rehabman!

Finally have some time to mess with this again. I've done all of the above and I'm ready to take a shot at this. Do you know of any tutorials/How To's for injecting those properties, or should I be accept that it might be biting off more than I can chew?
(I checked out the Clover instructions for clover injection of APPL,Slot-Name but I couldn't make sense of their logic)

Thanks!
-C
 
Hi Rehabman!

Finally have some time to mess with this again. I've done all of the above and I'm ready to take a shot at this. Do you know of any tutorials/How To's for injecting those properties, or should I be accept that it might be biting off more than I can chew?
(I checked out the Clover instructions for clover injection of APPL,Slot-Name but I couldn't make sense of their logic)

Thanks!
-C

No need to inject those properties anyway (the results are only cosmetic).
If you don't understand how to do it (and are unwilling to do the required research), don't do it...
 
No need to inject those properties anyway (the results are only cosmetic).
If you don't understand how to do it (and are unwilling to do the required research), don't do it...

Cool. I'm willing to do the research, but I feel like I lack a lot of the fundamentals, so learning an entire field of study for cosmetic reasons doesn't seem to be the best use of time :) (wish I had kept up with computer science in school though) Thanks @RehabMan
 
Status
Not open for further replies.
Back
Top