Jump to content

Multi booting causing sleep to be erratic when using a SSDT-PORTS.aml file


1 post in this topic

Recommended Posts

My USB ports configurations, on most of my hacks, are embedded in a SSDT-Ports.aml file, duly placed in the ACPI section of the OC file construct.

To stay within the port limit of 15, a number of ports have to be disabled, with a code snippet as below:

 

           Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (_OSI ("Darwin"))
                {
                    Return (Zero)
                }
                Else
                {
                    Return (0x0F)
                }
            }

 

Ports configured thus will consequently NOT be visible/accessible  when operating in a macOS environment, yet these intentionally disabled ports would be configured and visible/accessible in a Windows, Linux or any other non Darwin based opsys.

 

On the surface and in theory this seems to be fine, however the non Darwin based opsyses naturally use memory for the configuration of all ports visible to it, including those that are intentionally disabled for a Darwin environment, this seems fine and acceptable.

 

The problem arises when one returns to the macOS platform of ones choice, the ports unwanted in a Darwin environment, continue to occupy memory that Linux, Windows or whatever used/reserved for it's own purpose, resulting in a flaky operation of sleep when back in macOS.

 

Between boots memory is not properly cleared and or reset, leaving remnants behind that the previous non Darwin opsys claimed for itself, or is it merely a memory phenomenon also referred to as retentivity ?

 

To get sleep working again, as desired, a workaround is to shutdown the hack, isolate it from mains and allow the memory to clear itself through starvation of juice or is it hardware oxygen , this can be speeded up by pressing the power button for a few seconds during the period that the machine is actually isolated from power.

 

This is rather cumbersome and annoying and defeats the seamless operation one expects of a properly configured multi-boot environment.

 

A workaround, that works for me, is to allow Linux, Windows and whatever, to also only see the USB ports that one configured for macOS. This in turn can be accomplished by not using the Darwin code snippet at all but rather disabling individual ports with a code snippet such as below:

 


        Scope (\_SB.PCI0.XHC.RHUB.HS01)
        {
            Name (INFO, "F_U32C USB-C header on mobo. Cannot be extended to top panel of Blikbrain case therfore disabled")
            Name (_UPC, Package (0x04)  // _UPC: USB Port Capabilities
            {
                Zero, 
                Zero, 
                Zero, 
                Zero
            })
            Name (_PLD, Package (0x01)  // _PLD: Physical Location of Device
            {
                Buffer (0x14)
                {
                    /* 0000 */  0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                    /* 0008 */  0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                    /* 0010 */  0x00, 0x00, 0x00, 0x00                         
                }
            })
        }


The first "Zero", in the 4 position port designation block above, disables this particular port, for all operating systems,

 

This port isolation method greatly enhances the sleep experience when one is working in a multi-boot environment, obviating the need to clear memory first when one returns from Windows, Linux or whatever, to ones favourite macOS platform.

 

Greetings Henties
 

 

 

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...