Contribute
Register

USB-C Hotplug Questions

Status
Not open for further replies.
No clue at all. My real macs are a few years old so they have TB but not TB3.

I have a MacBookAir6,2 (TB2, I think). I don't recall ever seeing the express card menu/icon.
The menu you have is for the entire TB controller? Or individual devices connected to it?
 
I have a MacBookAir6,2 (TB2, I think). I don't recall ever seeing the express card menu/icon.
The menu you have is for the entire TB controller? Or individual devices connected to it?

It doesn't show connected devices and simply says 'USB Controller' in the menu. The only adapter I have is a USB-C to USB3.0 one so I don't know if there is any variation to the theme. The icon stays until I unplug the adapter regardless of whether or not I eject the drive or swap devices.
 

Attachments

  • ExpressCardIcon.jpg
    ExpressCardIcon.jpg
    656.5 KB · Views: 281
It doesn't show connected devices and simply says 'USB Controller' in the menu. The only adapter I have is a USB-C to USB3.0 one so I don't know if there is any variation to the theme. The icon stays until I unplug the adapter regardless of whether or not I eject the drive or swap devices.

So, I think it is showing you an entry for the USB controller that is part of the TB controller.
 
So, I think it is showing you an entry for the USB controller that is part of the TB controller.

Yeah, I just meant that it doesn't show anything further down the chain. I'm mildly curious to know if it shows up for an actual TB3 device, but not enough to buy one. lol.
 
I'm mildly curious to know if it shows up for an actual TB3 device, but not enough to buy one. lol.

I'm in the same boat.
TB3 devices expensive, but not compelling.
 
@RehabMan & @jhax01,

Thanks for all the tips and examples ... by collating the information you have provided and the SSDT here :-

https://github.com/wmchris/DellXPS1...dvanced/DSDT-HotPatches/Patches/SSDT-TYPC.dsl

I've made some good progress .... from the comments in that SSDT it seems that changing the _RMV method to Return (One) instead of (TARS) is what is responsible for making the port act like a PCI Express card ..

In my case i modified the RP05 _RMV method in my DSDT to this ...

Code:
Device (PXSX)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
                    {
                        Return (GPRW (0x69, 0x04))
                    }

                    Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                    {
                        If (LAnd (LEqual (TBTS, One), LEqual (SBNR, TBUS)))
                        {
                            Return (One)
                        }
                        Else
                        {
                            Return (HPCE)
                        }
                    }
                }

With only this change made to my DSDT (no USBC SSDT) I can boot the system without a usb device in the TB/USBC combo port and the PCI express helper icon is in the menu (even though no usb device plugged in), if i plug in a USB device it works fine until i eject it .... without this patch the only way the TB/USBC port could be used was to boot with a device plugged in.

So this was a step forward ... but the port can only be used once

As Rehabman pointed out there where no AHCI names for the RP05 device tree ... by using the examples he provided I've now got PCI device RP05 now looking something like it should, i changed the Device names to the same as the example IO Reg @jhax01 sent me.

Screen Shot 2017-09-02 at 12.10.04.png
This is my SSDT Code :-

Code:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20161117-64(RM)
* Copyright (c) 2000 - 2016 Intel Corporation
*
* Disassembling to non-symbolic legacy ASL operators
*
* Disassembly of iASL9oGNWl.aml, Sat Sep  2 12:12:34 2017
*
* Original Table Header:
*     Signature        "SSDT"
*     Length           0x000002B3 (691)
*     Revision         0x02
*     Checksum         0x36
*     OEM ID           "hack"
*     OEM Table ID     "TYPC"
*     OEM Revision     0x00000000 (0)
*     Compiler ID      "INTL"
*     Compiler Version 0x20161117 (538317079)
*/
DefinitionBlock ("", "SSDT", 2, "hack", "TYPC", 0x00000000)
{
    External (_SB_.PCI0.RP05.PXSX, DeviceObj)    // (from opcode)

    Scope (_SB.PCI0.RP05.PXSX)
    {
        Device (EP00)
        {
            Name (_ADR, Zero)  // _ADR: Address
        }

        Device (EP01)
        {
            Name (_ADR, 0x00010000)  // _ADR: Address
        }

        Device (EP02)
        {
            Name (_ADR, 0x00020000)  // _ADR: Address
        }
    }

    Scope (_SB.PCI0.RP05.PXSX.EP02)
    {
        Device (TXHC)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x6D,
                Zero
            })

            Device (RHUB)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Device (HS01)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (One, 0x14))
                    }
                }

                Device (HS02)
                {
                    Name (_ADR, 0x02)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (Zero, 0x15))
                    }
                }

                Device (SS01)
                {
                    Name (_ADR, 0x03)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (One, 0x14))
                    }
                }

                Device (SS02)
                {
                    Name (_ADR, 0x04)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (Zero, 0x15))
                    }
                }

                Method (GPLD, 2, Serialized)
                {
                    Name (PCKG, Package (0x01)
                    {
                        Buffer (0x10) {}
                    })
                    CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                    Store (One, REV)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
                    Store (Arg0, VISI)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x57, 0x08, GPOS)
                    Store (Arg1, GPOS)
                    Return (PCKG)
                }

                Method (TPLD, 2, Serialized)
                {
                    Name (PCKG, Package (0x01)
                    {
                        Buffer (0x10) {}
                    })
                    CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                    Store (One, REV)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
                    Store (Arg0, VISI)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x57, 0x08, GPOS)
                    Store (Arg1, GPOS)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x4A, 0x04, SHAP)
                    Store (One, SHAP)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x20, 0x10, WID)
                    Store (0x08, WID)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x30, 0x10, HGT)
                    Store (0x03, HGT)
                    Return (PCKG)
                }

                Method (GUPC, 1, Serialized)
                {
                    Name (PCKG, Package (0x04)
                    {
                        Zero,
                        0xFF,
                        Zero,
                        Zero
                    })
                    Store (Arg0, Index (PCKG, Zero))
                    Return (PCKG)
                }

                Method (TUPC, 1, Serialized)
                {
                    Name (PCKG, Package (0x04)
                    {
                        One,
                        Zero,
                        Zero,
                        Zero
                    })
                    Store (Arg0, Index (PCKG, One))
                    Return (PCKG)
                }
            }
        }
    }
}

Although my SSDT works and the tree now has proper AHCI names it does not help to solve the hot swap issue, once (a working) USB device is ejected the TB/USBC combo port is unusable but the PCI Express helper icon stays in the menu .. if i select 'Power off Card' the icon disappears .. but still the port still remains inactive ??

The RHUB Methods GPLD, GUPC, TPLD, TUPC i copied from my DSDT as the GUPC method in jhax01 example had two parameters passed where as the one in my DSDT only excepts one, i modified the calls to GUPC for the SSXX & HSXX accordingly, i know this is not optimal i did try a version with those methods externalised like i explained in post #34 but i lost the AHCI devices , probably doing it wrong maybe something to do with the Scope method ... so i went back to the above.

Not sure if thats the cause of the issue or not ?

In the DSDT RHUB Device there seems to be some power states defined :-

Code:
Method (_PS0, 0, Serialized)  // _PS0: Power State 0
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS0X))
                    {
                        PS0X ()
                    }
                }

                Method (_PS2, 0, Serialized)  // _PS2: Power State 2
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS2X))
                    {
                        PS2X ()
                    }
                }

                Method (_PS3, 0, Serialized)  // _PS3: Power State 3
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS3X))
                    {
                        PS3X ()
                    }
                }
I wonder if these (or something similar for the RP05 RHUB device) could be the missing part of the puzzle ? ... i'm not sure how i would go about adding these to my SSDT as they reference pointers in the DSDT .... i think these could be important ...?

Anther issue is that the whole device tree disappears after a sleep ... so i tried adding a _PWR method to the TXHC device like in the linked example but it does not seem to work ... maybe related to above power states ?

Have pretty much exhausted my SSDT/DSDT experience so need a few more pointers on where to go from here ..

@RehabMan ... do you think i need to add USB Power Properties (Sierra Method) ?... My clover config.plist has the Inject USB options enabled but not sure if this would work in this case ... Latest IO REG dump attached.

My DSDT Has a EC Device but the _STA Returns 0

Code:
Scope (_SB.PCI0.LPCB)
    {
        Device (H_EC)
        {
            Name (_HID, EisaId ("PNP0C09"))  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Store (0x03, ^^^IGPU.CLID)
                Return (Zero)
            }

            Name (B1CC, Zero)
            Name (B1ST, Zero)
            Name (B2CC, Zero)
            Name (B2ST, Zero)
            Name (CFAN, Zero)
            Name (CMDR, Zero)
            Name (DOCK, Zero)

No trace of AppleBusPowerControllerUSB in my io reg .... not sure if this is critical or just ensure correct current on USB Ports, have not had any issues using USB devices other than the hot swap issues on the TB/USBC combo port.

Any more suggestions or thoughts ?

Cheers
Jay
 

Attachments

  • HPX360-RP05_Renames.ioreg
    4.1 MB · Views: 180
Last edited:
@RehabMan & @jhax01,

Thanks for all the tips and examples ... by collating the information you have provided and the SSDT here :-

https://github.com/wmchris/DellXPS1...dvanced/DSDT-HotPatches/Patches/SSDT-TYPC.dsl

I've made some good progress .... from the comments in that SSDT it seems that changing the _RMV method to Return (One) instead of (TARS) is what is responsible for making the port act like a PCI Express card ..

In my case i modified the RP05 _RMV method in my DSDT to this ...

Code:
Device (PXSX)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
                    {
                        Return (GPRW (0x69, 0x04))
                    }

                    Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                    {
                        If (LAnd (LEqual (TBTS, One), LEqual (SBNR, TBUS)))
                        {
                            Return (One)
                        }
                        Else
                        {
                            Return (HPCE)
                        }
                    }
                }

With only this change made to my DSDT (no USBC SSDT) I can boot the system without a usb device in the TB/USBC combo port and the PCI express helper icon is in the menu (even though no usb device plugged in), if i plug in a USB device it works fine until i eject it .... without this patch the only way the TB/USBC port could be used was to boot with a device plugged in.

What is the value of HPCE?
Use ACPIDebug.kext so you can understand what you're actually returning from the _RMV method.
According to the ACPI spec, only two values are valid (1 and 0).

So this was a step forward ... but the port can only be used once

As Rehabman pointed out there where no AHCI names for the RP05 device tree ... by using the examples he provided I've now got PCI device RP05 now looking something like it should, i changed the Device names to the same as the example IO Reg @jhax01 sent me.

View attachment 276250
This is my SSDT Code :-

Code:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20161117-64(RM)
* Copyright (c) 2000 - 2016 Intel Corporation
*
* Disassembling to non-symbolic legacy ASL operators
*
* Disassembly of iASL9oGNWl.aml, Sat Sep  2 12:12:34 2017
*
* Original Table Header:
*     Signature        "SSDT"
*     Length           0x000002B3 (691)
*     Revision         0x02
*     Checksum         0x36
*     OEM ID           "hack"
*     OEM Table ID     "TYPC"
*     OEM Revision     0x00000000 (0)
*     Compiler ID      "INTL"
*     Compiler Version 0x20161117 (538317079)
*/
DefinitionBlock ("", "SSDT", 2, "hack", "TYPC", 0x00000000)
{
    External (_SB_.PCI0.RP05.PXSX, DeviceObj)    // (from opcode)

    Scope (_SB.PCI0.RP05.PXSX)
    {
        Device (EP00)
        {
            Name (_ADR, Zero)  // _ADR: Address
        }

        Device (EP01)
        {
            Name (_ADR, 0x00010000)  // _ADR: Address
        }

        Device (EP02)
        {
            Name (_ADR, 0x00020000)  // _ADR: Address
        }
    }

    Scope (_SB.PCI0.RP05.PXSX.EP02)
    {
        Device (TXHC)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x6D,
                Zero
            })

            Device (RHUB)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Device (HS01)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (One, 0x14))
                    }
                }

                Device (HS02)
                {
                    Name (_ADR, 0x02)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (Zero, 0x15))
                    }
                }

                Device (SS01)
                {
                    Name (_ADR, 0x03)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (One, 0x14))
                    }
                }

                Device (SS02)
                {
                    Name (_ADR, 0x04)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (Zero, 0x15))
                    }
                }

                Method (GPLD, 2, Serialized)
                {
                    Name (PCKG, Package (0x01)
                    {
                        Buffer (0x10) {}
                    })
                    CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                    Store (One, REV)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
                    Store (Arg0, VISI)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x57, 0x08, GPOS)
                    Store (Arg1, GPOS)
                    Return (PCKG)
                }

                Method (TPLD, 2, Serialized)
                {
                    Name (PCKG, Package (0x01)
                    {
                        Buffer (0x10) {}
                    })
                    CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                    Store (One, REV)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
                    Store (Arg0, VISI)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x57, 0x08, GPOS)
                    Store (Arg1, GPOS)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x4A, 0x04, SHAP)
                    Store (One, SHAP)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x20, 0x10, WID)
                    Store (0x08, WID)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x30, 0x10, HGT)
                    Store (0x03, HGT)
                    Return (PCKG)
                }

                Method (GUPC, 1, Serialized)
                {
                    Name (PCKG, Package (0x04)
                    {
                        Zero,
                        0xFF,
                        Zero,
                        Zero
                    })
                    Store (Arg0, Index (PCKG, Zero))
                    Return (PCKG)
                }

                Method (TUPC, 1, Serialized)
                {
                    Name (PCKG, Package (0x04)
                    {
                        One,
                        Zero,
                        Zero,
                        Zero
                    })
                    Store (Arg0, Index (PCKG, One))
                    Return (PCKG)
                }
            }
        }
    }
}

Although my SSDT works and the tree now has proper AHCI names it does not help to solve the hot swap issue, once (a working) USB device is ejected the TB/USBC combo port is unusable but the PCI Express helper icon stays in the menu .. if i select 'Power off Card' the icon disappears .. but still the port still remains inactive ??

The RHUB Methods GPLD, GUPC, TPLD, TUPC i copied from my DSDT as the GUPC method in jhax01 example had two parameters passed where as the one in my DSDT only excepts one, i modified the calls to GUPC for the SSXX & HSXX accordingly, i know this is not optimal i did try a version with those methods externalised like i explained in post #34 but i lost the AHCI devices , probably doing it wrong maybe something to do with the Scope method ... so i went back to the above.

Not sure if thats the cause of the issue or not ?

You should check your UsbConnector values in ioreg to see if they make sense for the physical ports.

In the DSDT RHUB Device there seems to be some power states defined :-

Code:
Method (_PS0, 0, Serialized)  // _PS0: Power State 0
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS0X))
                    {
                        PS0X ()
                    }
                }

                Method (_PS2, 0, Serialized)  // _PS2: Power State 2
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS2X))
                    {
                        PS2X ()
                    }
                }

                Method (_PS3, 0, Serialized)  // _PS3: Power State 3
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS3X))
                    {
                        PS3X ()
                    }
                }
I wonder if these (or something similar for the RP05 RHUB device) could be the missing part of the puzzle ?

Those seem like they are for XHC, therefore nothing to do with TB USB.

Anther issue is that the whole device tree disappears after a sleep

I really think we need a way to keep the TB controller on the PCIe bus at all times, like on a real Mac.
(at startup, after ejecting all devices, and after sleep).
There is probably a setting/register for this somewhere within the chipset that we can set in an _INI method.

do you think i need to add USB Power Properties (Sierra Method)

I'm not certain those properties are used for anything but XHC, but yes, you should do it.
 
@RehabMan & @jhax01,

Thanks for all the tips and examples ... by collating the information you have provided and the SSDT here :-

https://github.com/wmchris/DellXPS1...dvanced/DSDT-HotPatches/Patches/SSDT-TYPC.dsl

I've made some good progress .... from the comments in that SSDT it seems that changing the _RMV method to Return (One) instead of (TARS) is what is responsible for making the port act like a PCI Express card ..

In my case i modified the RP05 _RMV method in my DSDT to this ...

Code:
Device (PXSX)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
                    {
                        Return (GPRW (0x69, 0x04))
                    }

                    Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                    {
                        If (LAnd (LEqual (TBTS, One), LEqual (SBNR, TBUS)))
                        {
                            Return (One)
                        }
                        Else
                        {
                            Return (HPCE)
                        }
                    }
                }

With only this change made to my DSDT (no USBC SSDT) I can boot the system without a usb device in the TB/USBC combo port and the PCI express helper icon is in the menu (even though no usb device plugged in), if i plug in a USB device it works fine until i eject it .... without this patch the only way the TB/USBC port could be used was to boot with a device plugged in.

So this was a step forward ... but the port can only be used once

As Rehabman pointed out there where no AHCI names for the RP05 device tree ... by using the examples he provided I've now got PCI device RP05 now looking something like it should, i changed the Device names to the same as the example IO Reg @jhax01 sent me.

View attachment 276250
This is my SSDT Code :-

Code:
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20161117-64(RM)
* Copyright (c) 2000 - 2016 Intel Corporation
*
* Disassembling to non-symbolic legacy ASL operators
*
* Disassembly of iASL9oGNWl.aml, Sat Sep  2 12:12:34 2017
*
* Original Table Header:
*     Signature        "SSDT"
*     Length           0x000002B3 (691)
*     Revision         0x02
*     Checksum         0x36
*     OEM ID           "hack"
*     OEM Table ID     "TYPC"
*     OEM Revision     0x00000000 (0)
*     Compiler ID      "INTL"
*     Compiler Version 0x20161117 (538317079)
*/
DefinitionBlock ("", "SSDT", 2, "hack", "TYPC", 0x00000000)
{
    External (_SB_.PCI0.RP05.PXSX, DeviceObj)    // (from opcode)

    Scope (_SB.PCI0.RP05.PXSX)
    {
        Device (EP00)
        {
            Name (_ADR, Zero)  // _ADR: Address
        }

        Device (EP01)
        {
            Name (_ADR, 0x00010000)  // _ADR: Address
        }

        Device (EP02)
        {
            Name (_ADR, 0x00020000)  // _ADR: Address
        }
    }

    Scope (_SB.PCI0.RP05.PXSX.EP02)
    {
        Device (TXHC)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
            {
                0x6D,
                Zero
            })

            Device (RHUB)
            {
                Name (_ADR, Zero)  // _ADR: Address
                Device (HS01)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (One, 0x14))
                    }
                }

                Device (HS02)
                {
                    Name (_ADR, 0x02)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (Zero, 0x15))
                    }
                }

                Device (SS01)
                {
                    Name (_ADR, 0x03)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (One, 0x14))
                    }
                }

                Device (SS02)
                {
                    Name (_ADR, 0x04)  // _ADR: Address
                    Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
                    {
                        Return (GUPC (One))
                    }

                    Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
                    {
                        Return (TPLD (Zero, 0x15))
                    }
                }

                Method (GPLD, 2, Serialized)
                {
                    Name (PCKG, Package (0x01)
                    {
                        Buffer (0x10) {}
                    })
                    CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                    Store (One, REV)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
                    Store (Arg0, VISI)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x57, 0x08, GPOS)
                    Store (Arg1, GPOS)
                    Return (PCKG)
                }

                Method (TPLD, 2, Serialized)
                {
                    Name (PCKG, Package (0x01)
                    {
                        Buffer (0x10) {}
                    })
                    CreateField (DerefOf (Index (PCKG, Zero)), Zero, 0x07, REV)
                    Store (One, REV)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x40, One, VISI)
                    Store (Arg0, VISI)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x57, 0x08, GPOS)
                    Store (Arg1, GPOS)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x4A, 0x04, SHAP)
                    Store (One, SHAP)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x20, 0x10, WID)
                    Store (0x08, WID)
                    CreateField (DerefOf (Index (PCKG, Zero)), 0x30, 0x10, HGT)
                    Store (0x03, HGT)
                    Return (PCKG)
                }

                Method (GUPC, 1, Serialized)
                {
                    Name (PCKG, Package (0x04)
                    {
                        Zero,
                        0xFF,
                        Zero,
                        Zero
                    })
                    Store (Arg0, Index (PCKG, Zero))
                    Return (PCKG)
                }

                Method (TUPC, 1, Serialized)
                {
                    Name (PCKG, Package (0x04)
                    {
                        One,
                        Zero,
                        Zero,
                        Zero
                    })
                    Store (Arg0, Index (PCKG, One))
                    Return (PCKG)
                }
            }
        }
    }
}

Although my SSDT works and the tree now has proper AHCI names it does not help to solve the hot swap issue, once (a working) USB device is ejected the TB/USBC combo port is unusable but the PCI Express helper icon stays in the menu .. if i select 'Power off Card' the icon disappears .. but still the port still remains inactive ??

The RHUB Methods GPLD, GUPC, TPLD, TUPC i copied from my DSDT as the GUPC method in jhax01 example had two parameters passed where as the one in my DSDT only excepts one, i modified the calls to GUPC for the SSXX & HSXX accordingly, i know this is not optimal i did try a version with those methods externalised like i explained in post #34 but i lost the AHCI devices , probably doing it wrong maybe something to do with the Scope method ... so i went back to the above.

Not sure if thats the cause of the issue or not ?

In the DSDT RHUB Device there seems to be some power states defined :-

Code:
Method (_PS0, 0, Serialized)  // _PS0: Power State 0
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS0X))
                    {
                        PS0X ()
                    }
                }

                Method (_PS2, 0, Serialized)  // _PS2: Power State 2
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS2X))
                    {
                        PS2X ()
                    }
                }

                Method (_PS3, 0, Serialized)  // _PS3: Power State 3
                {
                    If (LEqual (DVID, 0xFFFF))
                    {
                        Return (Zero)
                    }

                    If (CondRefOf (\_SB.PCI0.XHC.RHUB.PS3X))
                    {
                        PS3X ()
                    }
                }
I wonder if these (or something similar for the RP05 RHUB device) could be the missing part of the puzzle ? ... i'm not sure how i would go about adding these to my SSDT as they reference pointers in the DSDT .... i think these could be important ...?

Anther issue is that the whole device tree disappears after a sleep ... so i tried adding a _PWR method to the TXHC device like in the linked example but it does not seem to work ... maybe related to above power states ?

Have pretty much exhausted my SSDT/DSDT experience so need a few more pointers on where to go from here ..

@RehabMan ... do you think i need to add USB Power Properties (Sierra Method) ?... My clover config.plist has the Inject USB options enabled but not sure if this would work in this case ... Latest IO REG dump attached.

My DSDT Has a EC Device but the _STA Returns 0

Code:
Scope (_SB.PCI0.LPCB)
    {
        Device (H_EC)
        {
            Name (_HID, EisaId ("PNP0C09"))  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Store (0x03, ^^^IGPU.CLID)
                Return (Zero)
            }

            Name (B1CC, Zero)
            Name (B1ST, Zero)
            Name (B2CC, Zero)
            Name (B2ST, Zero)
            Name (CFAN, Zero)
            Name (CMDR, Zero)
            Name (DOCK, Zero)

No trace of AppleBusPowerControllerUSB in my io reg .... not sure if this is critical or just ensure correct current on USB Ports, have not had any issues using USB devices other than the hot swap issues on the TB/USBC combo port.

Any more suggestions or thoughts ?

Cheers
Jay


This isn't a solution, but possibly a work around depending on your device configuration. If I select 'power off card' in the menu, my port will be dead until a reboot as well. I have since found that if I plug my charger in briefly, the port becomes available again -- of course, this depends on whether or not your device charges through the TB3 port.

The normal behavior for me is that if I leave my adapter plugged in, I can swap any number of times with different USB devices and the express card icon stays put. If I remove the USB C adapter the express card icon disappears after a couple seconds and will reappear if I plug in another device.

Are you hotpatching and are you renaming DSMs? I'm fully hotpatched on my device and leaving the oem DSMs in, meaning no DSM to XDSM rename. I wonder if your device is having difficulty because it's missing a DSM it needs?
 
Are you hotpatching and are you renaming DSMs? I'm fully hotpatched on my device and leaving the oem DSMs in, meaning no DSM to XDSM rename. I wonder if your device is having difficulty because it's missing a DSM it needs?

Just a note for recommended strategy if you need _DSM->XDSM rename (hotpatch scenario), but want to preserve certain _DSM methods.... create an SSDT that provides the _DSM methods (at the appropriate path) that simply delegate to XDSM (that was renamed due to hotpatch).
 
You should check your UsbConnector values in ioreg to see if they make sense for the physical ports.

I checked ... they had a value of FF (both SS and HS)... and would only recognise a USB 2 Device in OSX, the only way it would see my 3.1 SSD was if i booted with it connected but still had a port type of FF. I took anther look at Jhax01's IO reg and he had vales of 09 for both SS and HS .. so i modified the GUPC method to the same as his (2 values) and the calls from the USB device declarations and now they have a value of 09 ..

It now recognises both USB1/2 and 3.1 device in OSX so no need for the 3.1 device to be plugged in at boot.

I really think we need a way to keep the TB controller on the PCIe bus at all times, like on a real Mac.(at startup, after ejecting all devices, and after sleep). There is probably a setting/register for this somewhere within the chipset that we can set in an _INI method..

I agree, after i eject the 3.1 SSD and reconnect it .. the drive does not seem to have any power (LED off) no device found, pretty sure if we could keep the TB Controller powered up it would work ok.

Jay
 
Status
Not open for further replies.
Back
Top