Jump to content
Sign in to follow this  
Followers 0
chatelp

OC: Overriding _STA method from DSDT in SSDT (EC0 disable)

4 posts in this topic

Recommended Posts

Posted (edited)

Hi all !

 

I'm migrating from Clover to OpenCore and stuck on an ACPI error at boot:

ACPI Error [_STA] Namespace lookup failure, AE_ALREADY_EXISTS

This comes from trying to load my custom SSDT-EC tables.

 

From what I gather, the preferred method of dealing with EC0 for Desktops with OC is to add an _STA method to EC0 to change return code to 0, and then to add a new fake EC device. Both done via SSDT-EC.

 

Problem is, my EC0 defined in the system DSDT already has an _STA method. And it looks like it can't be overridden through SSDT redefinition at boot. Is this excepted ACPI behavior? Is it not possible to override/redefine methods like _STA? If so, what other option do I have?

 

Here is the original EC0 device in DSDT

Device (EC0)
            {
                Name (_HID, EisaId ("PNP0C09"))  // _HID: Hardware ID
                Name (_UID, One)  // _UID: Unique ID
                Name (_GPE, 0x6E)  // _GPE: General Purpose Events
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

....

 

Here is my very standard SSTD-EC for Skylake:

 

/*
 * AppleUsbPower compatibility table for Skylake+.
 *
 * Be warned that power supply values can be different
 * for different systems. Depending on the configuration
 * these values must match injected IOKitPersonalities
 * for com.apple.driver.AppleUSBMergeNub. iPad remains
 * being the most reliable device for testing USB port
 * charging support.
 *
 * Try NOT to rename EC0, H_EC, etc. to EC.
 * These devices are incompatible with macOS and may break
 * at any time. AppleACPIEC kext must NOT load.
 * See the disable code below.
 *
 * Reference USB: https://applelife.ru/posts/550233
 * Reference EC: https://applelife.ru/posts/807985
 */
DefinitionBlock ("", "SSDT", 2, "ACDT", "SsdtEC", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)

    /*
     * Uncomment replacing EC0 with your own value in case your
     * motherboard has an existing embedded controller of PNP0C09 type.
     *
     * While renaming EC0 to EC might potentially work initially,
     * it connects an incompatible driver (AppleACPIEC) to your hardware.
     * This can make your system unbootable at any time or hide bugs that
     * could trigger randomly.
     */

    
    External (_SB_.PCI0.LPCB.EC0, DeviceObj)

    Scope (\_SB.PCI0.LPCB.EC0)
    {
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            If (_OSI ("Darwin"))
            {
                Return (0)
            }
            Else
            {
                Return (0x0F)
            }
        }
    }

    Scope (\_SB)
    {
        Device (USBX)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg2 == Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                             // .
                    })
                }

                Return (Package (0x08)
                {
                    "kUSBSleepPowerSupply",
                    0x13EC,
                    "kUSBSleepPortCurrentLimit",
                    0x0834,
                    "kUSBWakePowerSupply",
                    0x13EC,
                    "kUSBWakePortCurrentLimit",
                    0x0834
                })
            }
        }

        Scope (\_SB.PCI0.LPCB)
        {
            Device (EC)
            {
                Name (_HID, "ACID0001")  // _HID: Hardware ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If (_OSI ("Darwin"))
                    {
                        Return (0x0F)
                    }
                    Else
                    {
                        Return (Zero)
                    }
                }
            }
        }
    }
}

 

I saw this other similar post but can't find a working solution in it: https://www.insanelymac.com/forum/topic/341585-hpet/?_fromLogin=1

 

 

Edited by chatelp

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

I am having the exact same problem with trying to override my `_PWR` method.

DefinitionBlock ("", "SSDT", 2, "HPENVY", "_GLAN", 0x00000000)
{
    External (_SB_.PCI0.GLAN, DeviceObj)
    External (GPRW, MethodObj)
    
    Method (\_SB.PCI0.GLAN._PRW, 0, NotSerialized)
    {
        Return (\GPRW (0x6D, 0x00))
    }
}

Meaning, that I get `ACPI Error [_PRW] Namespace lookup failure, AE_ALREADY_EXISTS`

Edited by Denicio

Share this post


Link to post
Share on other sites

So, I just realized that you need to rename the method you want to override in ACPI patches first, then the override will be successful.

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/7/2020 at 11:06 AM, chatelp said:

Hi all !

 

I'm migrating from Clover to OpenCore and stuck on an ACPI error at boot:


ACPI Error [_STA] Namespace lookup failure, AE_ALREADY_EXISTS

This comes from trying to load my custom SSDT-EC tables.

 

From what I gather, the preferred method of dealing with EC0 for Desktops with OC is to add an _STA method to EC0 to change return code to 0, and then to add a new fake EC device. Both done via SSDT-EC.

 

Problem is, my EC0 defined in the system DSDT already has an _STA method. And it looks like it can't be overridden through SSDT redefinition at boot. Is this excepted ACPI behavior? Is it not possible to override/redefine methods like _STA? If so, what other option do I have?

 

Here is the original EC0 device in DSDT


Device (EC0)
            {
                Name (_HID, EisaId ("PNP0C09"))  // _HID: Hardware ID
                Name (_UID, One)  // _UID: Unique ID
                Name (_GPE, 0x6E)  // _GPE: General Purpose Events
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }

....

 

Here is my very standard SSTD-EC for Skylake:

 


/*
 * AppleUsbPower compatibility table for Skylake+.
 *
 * Be warned that power supply values can be different
 * for different systems. Depending on the configuration
 * these values must match injected IOKitPersonalities
 * for com.apple.driver.AppleUSBMergeNub. iPad remains
 * being the most reliable device for testing USB port
 * charging support.
 *
 * Try NOT to rename EC0, H_EC, etc. to EC.
 * These devices are incompatible with macOS and may break
 * at any time. AppleACPIEC kext must NOT load.
 * See the disable code below.
 *
 * Reference USB: https://applelife.ru/posts/550233
 * Reference EC: https://applelife.ru/posts/807985
 */
DefinitionBlock ("", "SSDT", 2, "ACDT", "SsdtEC", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)

    /*
     * Uncomment replacing EC0 with your own value in case your
     * motherboard has an existing embedded controller of PNP0C09 type.
     *
     * While renaming EC0 to EC might potentially work initially,
     * it connects an incompatible driver (AppleACPIEC) to your hardware.
     * This can make your system unbootable at any time or hide bugs that
     * could trigger randomly.
     */

    
    External (_SB_.PCI0.LPCB.EC0, DeviceObj)

    Scope (\_SB.PCI0.LPCB.EC0)
    {
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            If (_OSI ("Darwin"))
            {
                Return (0)
            }
            Else
            {
                Return (0x0F)
            }
        }
    }

    Scope (\_SB)
    {
        Device (USBX)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg2 == Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                             // .
                    })
                }

                Return (Package (0x08)
                {
                    "kUSBSleepPowerSupply",
                    0x13EC,
                    "kUSBSleepPortCurrentLimit",
                    0x0834,
                    "kUSBWakePowerSupply",
                    0x13EC,
                    "kUSBWakePortCurrentLimit",
                    0x0834
                })
            }
        }

        Scope (\_SB.PCI0.LPCB)
        {
            Device (EC)
            {
                Name (_HID, "ACID0001")  // _HID: Hardware ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If (_OSI ("Darwin"))
                    {
                        Return (0x0F)
                    }
                    Else
                    {
                        Return (Zero)
                    }
                }
            }
        }
    }
}

 

I saw this other similar post but can't find a working solution in it: https://www.insanelymac.com/forum/topic/341585-hpet/?_fromLogin=1

 

 

 

 

 Try edit your DSDT like that:

Device (EC0)
            {
                Name (_HID, EisaId ("PNP0C09"))  // _HID: Hardware ID
                Name (_UID, One)  // _UID: Unique ID
                Name (_GPE, 0x6E)  // _GPE: General Purpose Events
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If (_OSI ("Darwin"))
                    {
                     Return (0)
                    }
                    Else
                    {
                     Return (0x0F)
                    }

Add this SSDT-EC-USBX.aml to ACPI folder and edit config.plist.

DefinitionBlock ("", "SSDT", 2, "ACDT", "SsdtEC", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)

    Scope (\_SB)
    {
        Device (USBX)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If ((Arg2 == Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                             // .
                    })
                }

                Return (Package (0x08)
                {
                    "kUSBSleepPowerSupply", 
                    0x13EC, 
                    "kUSBSleepPortCurrentLimit", 
                    0x0834, 
                    "kUSBWakePowerSupply", 
                    0x13EC, 
                    "kUSBWakePortCurrentLimit", 
                    0x0834
                })
            }
        }

        Scope (\_SB.PCI0.LPCB)
        {
            Device (EC)
            {
                Name (_HID, "ACID0001")  // _HID: Hardware ID
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    If (_OSI ("Darwin"))
                    {
                        Return (0x0F)
                    }
                    Else
                    {
                        Return (Zero)
                    }
                }
            }
        }
    }
}

Theoretically should work.

Edited by hardcorehenry

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

Announcements

  • Similar Content

    • By rawmassen
      Hi there,
       
      If anyone could help I'd be very grateful, I'm trying to move from Clover to OC but have hit a brick wall for the last 2 days.
       
      It's an ACPI table error: SB_.PCIO.XHC_RHUB.HS11, Namespace lookup failure.
       


      Skylake Build:
      OpenCore 0.5.9
      Mojave 10.14.6, iMac17,1
      Asus Maximus Hero VIII
      6700K
       
      I've attached the config.plist and ACPI folder.
       
      EFI Drivers: OpenRuntime.efi and HfsPlus.efi
      Kexts: IntelMausi, Lilu, VirtualSMC, Whatevergreen
       
      Things I've tried...
       
      1) Clearing NVRAM (as it was previously booted by Clover)
       
      2) Hackintool USB Mapping: both the SSDT files and the USBPorts.kext
       
      3) USBInjectAll.kext (with and without SSDT files)
       
      4) SSDT-RHUB.aml. This seems to be directly involved, spent a long time with this but with no luck.
       
      I followed this guide:
       
      https://dortania.github.io/Getting-Started-With-ACPI/Universal/rhub-methods/manual.html
       
      Everything is XHC in my DSDT, except these definitions at the top (line 72 and 73):
       
          External (_SB_.PCI0.XHC_.DUAM, MethodObj)    // Warning: Unknown method, guessing 0 arguments     External (_SB_.PCI0.XHC_.RHUB.INIR, MethodObj)    // Warning: Unknown method, guessing 0 arguments  
      So I edited the SSDT-RHUB.dsl to this:
       
      /* * Goal of this SSDT is to shut off the RHUB to force macOS into * manually building ports when the ACPI is screwed up */ DefinitionBlock ("", "SSDT", 2, "DRTNIA", "RhubOff", 0x00001000) { External (_SB_.PCI0.XHC.RHUB, DeviceObj) // Full pathing to RHUB, change to yours Scope (_SB.PCI0.XHC.RHUB) // Full pathing to RHUB, change to yours { Method (_STA, 0, NotSerialized) { If (_OSI ("Darwin")) { Return (Zero) // This disables the device only in macOS } Else { } } } } Which results in this AML version:
      DefinitionBlock ("", "SSDT", 2, "DRTNIA", "RhubOff", 0x00001000) { External (_SB_.PCI0.XHC_.RHUB, DeviceObj) Scope (_SB.PCI0.XHC.RHUB) { Method (_STA, 0, NotSerialized) // _STA: Status { If (_OSI ("Darwin")) { Return (Zero) } Else { } } } } But I get the same error. 
       
      I'm at a complete loss, can anyone help?
       
       
      config.plist
      ACPI.zip
    • By MaLd0n
      -EFI OpenCore Folder Desktop 10th Intel Processors
      Paste this EFI folder in EFI partition in your USB STICK
      https://tinyurl.com/ybwr9kq3
       
      -Tutorial
      https://tinyurl.com/re2c9sz
       
      -Post Installation
      Paste EFI folder into EFI Partition in your SSD, reboot and extract one full dump with this app and post here!
      https://tinyurl.com/ybwr9kq3
      RunMe.app
      https://tinyurl.com/y9562hz7
       
      --DSDT PATCHES--
       
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE ID -DMAC -REMOVE LINES, PROBLEMATIC and UNUSED -FIX K.P in REBOOT -NVRAM -REAL TIME CLOCK -SLPB -DARWIN / WINDOWS -XHCI -PLUGIN TYPE -HDEF -ARTC -IPIC -TIMR -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -PMCR -PPMC -XSPI -GMM -kUSBCompanionIndex -io-device-location -IMEI -EC -PNLF -ARPT -GFX0 -NVME -ACPI-WAKE-GPE -DTGP -ACQUIRE MUT0 0XFFFF -MUTEX MUT0 0x00 -EXTERNAL REFERENCES -UNKNOWNOBJ -HDMI / HDAU -FULL RENAMED DEVICES  
      --SCREENSHOTS--
       









































       
       
      Big Thanks to XLR and your Badass Motherboard, Ultrafast CPU, Coolest Heatsink, Huge Graphics Card, Tonnes of RAM,
      Gigantic Hard Drive, Lightspeed Disk Burner, Professional Sound Card, Massive LCD Display.
       
       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
       
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad, headkaze, onemanosx, erroruser, Jenny David, Sampath007, Facebook Hackintosh community, Facebook Olarila community, SchmockLord, daliansky and many, many, many others!
       
      We're all here to have fun and learn from each other!
    • By MaLd0n
      ---USB---
      https://pikeralpha.wordpress.com/2016/07/13/simple-skylake-usb-fix-no-kexts-required/
       
      ---CLOVER FOLDER---
      https://www.olarila.com/topic/5676-clover-folder-for-all-chipsets/
       
       
      --MOBO
      GigaByte Z390 M Gaming



      --PROCESSOR
      Intel Core i9-9900K


      --COOLER
      CoolerMaster MasterLiquid ML120R RGB


      --MEMORY
      Corsair Dominator Platinum 16GB (2 x 8GB)


      --GPU
      Sapphiretech Radeon RX 590 8 GB GDDR5


       
      --SSD
      Samsung 970 EVO NVMe M2 Flash Drive


      --POWER SUPPLY
      EVGA 750 N1, 750W


      --WIRELESS
      TP-Link Archer T9E


      --BLUETOOTH
      Orico BTA-403


      --CASE
      Thermaltake View 21 Tempered Glass Edition


      --DSDT Patches--
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE 10 ID -DMAC -REMOVE 22K LINES, PROBLEMATIC and UNUSED -FIX K.P in REBOOT -NVRAM -REAL TIME CLOCK -SLPB -DARWIN / WINDOWS 2015 -XHCI -PLUGIN TYPE -HDAS to HDEF -HDEF -REAL TIME CLOCK -ARTC -IRQs -SBUS -MIKEY -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -PMCR -PPMC -XSPI -GMM -IMEI -EC -PNLF -ARPT -GFX0 -NVME -DTGP -ACQUIRE MUT0 0XFFFF -OPERATION REGION GPIO -MUTEX MUT0 0x00 -EXTERNAL REFERENCES -UNKNOWNOBJ -HDMI / HDAU -FULL RENAMED DEVICES  
      --SCREENSHOTS--





























      --BruceX--
       
      --USB-C-- test with SanDisk Ultra USB-STICK 128gb


       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad, Sampath007, onemanosx, erroruser, Jenny David, Olarila Facebook Community, Hackintosh Facebook Community and many others!
      We're all here to have fun and learn from each other!
    • By MaLd0n
      First...
      If you need DSDT edits... -Extract tables with F4 key in Clover boot screen! -Run it and send me files! RunMe.app   Installation --Create a bootable copy of El Capitan /  Sierra / High Sierra / Mojave https://github.com/chris1111/Create-Install-Media/releases   --Install Clover in USB stick https://github.com/CloverHackyColor/CloverBootloader/releases   --Replace with my Clover folder https://www.olarila.com/topic/5676-clover-folder-for-all-chipsets/   --Install EL Capitan / Sierra / High Sierra and boot into system!     Post Installation   --Install Clover and replace with my folder   https://www.olarila.com/topic/5676-clover-folder-for-all-chipsets/     --Reboot and activate video!   Bingo! Now you need a fine tune! DSDT Time!   My DSDT GA P35-DS3   DSDT.MaLd0n.zip     Patches -FIX ERRORS AND WARNINGS -HPET -SATA -SLPB -DARWIN -LPC -HDEF -RTC -EHCI -UHCI -IRQs -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -LAN -EC -PNLF --Native Power Management
       
      Use Clover, check Generate P and C States
       
      --Brightness
      Install .app, select the required permission and reboot. Work in F1 / F2 keys!
      NativeDisplayBrightness.app.zip


      https://github.com/Bensge/NativeDisplayBrightness/releases
      *in some cases .app don't work, check patches in config.plist inside Clover folder Post Install
       
      --AUDIO
       
      Device HDEF + AppleAlc + Lilu
       
      --install Lan driver by Mieze
        -Atheros   http://www.insanelymac.com/forum/files/file/313-atherose2200ethernet/   -Intel   http://www.insanelymac.com/forum/files/file/396-intelmausiethernet/   -Realtek   http://www.insanelymac.com/forum/files/file/88-realtekrtl8111-binary/   --Links   -FakeSMC   https://bitbucket.org/RehabMan/os-x-fakesmc-kozlek   -Audio   https://github.com/vit9696/AppleALC http://www.insanelymac.com/forum/topic/293863-applehda-patch-requests/   -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!   Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!   We're all here to have fun and learn from each other!   ENJOY!  
    • By Preet
      I am getting only one syntax compile error after patching with the rehab man Skylake generic and hp g6 2221ss.
      Error: syntax error, unexpected PARSEOP_ARG1
      Error example on Tony Mac ( Link - https://www.tonymacx86.com/threads/solved-unable-to-compile-dsdt-syntax-error-unexpected-parseop_arg1.201774/)
      I found a guide on using refs.txt but I do not know how to use it with the new maciASL on this GitHub (link -https://github.com/acidanthera/MaciASL/releases). 
      System Info Pavillion AU003tx. (Skylake i5, intel HD520)
      Please respond, I would love to have the battery status working. Thanks in advance!!
×