Contribute
Register

USB-C Hotplug Questions

Status
Not open for further replies.

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
4,001
Motherboard
GB Z490 Vision G
CPU
i9 10850K OC @ 5.2 GHz
Graphics
Vega 64 LC + HD 630
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
Ok ...

@jhax01,

So i changed the _RMV method to Return 'One' and left everything else as is ...

This worked ... kind of .. in that i was able to boot OSX with no device plugged into the combo port, once in osx i plugged in USB C device and lo and behold it powered up and was usable .... Yippeee

But after i ejected the device and then replugged in the device it has no power so the port must have powered down after the removal .. i wonder if that down to the conditional if .. else .. will try simplifying the method to look like yours.

@RehabMan,

On Boot up with no device attached there is no XHC RP05 device !!! .... The attached zip archive contains three io reg dumps .

1 - Boot with no device attached
2 - With Device plugged in
3 - After Device Ejected

How do i go about solving the AHCI identity ....

Thanks guys ..
Cheers
Jay
 

Attachments

  • Archive.zip
    1.8 MB · Views: 91
Last edited:

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
4,001
Motherboard
GB Z490 Vision G
CPU
i9 10850K OC @ 5.2 GHz
Graphics
Vega 64 LC + HD 630
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
I tried simplifying the _RMV method down to basics ...

Code:
Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
                    {
                            Return (One)   
                    }

But it made no difference ... can only attache USB device once .... after eject no power on the port ...
However this is progress ... didn't work at all before unless booted with device attached ....

Jay
 

RehabMan

Moderator
Joined
May 2, 2012
Messages
183,805
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Ok ...

@jhax01,

So i changed the _RMV method to Return 'One' and left everything else as is ...

This worked ... kind of .. in that i was able to boot OSX with no device plugged into the combo port, once in osx i plugged in USB C device and lo and behold it powered up and was usable .... Yippeee

But after i ejected the device and then replugged in the device it has no power so the port must have powered down after the removal .. i wonder if that down to the conditional if .. else .. will try simplifying the method to look like yours.

@RehabMan,

On Boot up with no device attached there is no XHC RP05 device !!! .... The attached zip archive contains three io reg dumps .

1 - Boot with no device attached
2 - With Device plugged in
3 - After Device Ejected

How do i go about solving the AHCI identity ....

Thanks guys ..
Cheers
Jay

I'm not quite clear on what you're saying.

So are you saying that:
- booting with no device plugged in, no RP05.PXSX (even with patched _RMV)?
- after that, plugging in the device causes RP05.PXSX to appear?

I'll try testing later with my NUC7 but I'd like to know what to expect...
 

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
4,001
Motherboard
GB Z490 Vision G
CPU
i9 10850K OC @ 5.2 GHz
Graphics
Vega 64 LC + HD 630
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
I'm not quite clear on what you're saying.

So are you saying that:
- booting with no device plugged in, no RP05.PXSX (even with patched _RMV)?
- after that, plugging in the device causes RP05.PXSX to appear?

I'll try testing later with my NUC7 but I'd like to know what to expect...

Yes thats exactly what happens ..... see the io reg dumps in the archive ... if you look at the 1st there is no RP05 XHC but once plugged in it appears and device works (see 2nd io reg) .. but it only works once ???

Forgot to mention that i currently have USBInjectAll Kext load while debugging USB .. have the port limit patch in clover but disabled it as laptop has <15 ports ....

Cheers
Jay
 

RehabMan

Moderator
Joined
May 2, 2012
Messages
183,805
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Yes thats exactly what happens ..... see the io reg dumps in the archive ... if you look at the 1st there is no RP05 XHC but once plugged in it appears and device works (see 2nd io reg) .. but it only works once ???

Thanks for the clarification.

Forgot to mention that i currently have USBInjectAll Kext load while debugging USB .. have the port limit patch in clover but disabled it as laptop has <15 ports ....

Doesn't matter much for your TB experiments anyway. USBInjectAll.kext has no support for the USB ports on TB.
 

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
4,001
Motherboard
GB Z490 Vision G
CPU
i9 10850K OC @ 5.2 GHz
Graphics
Vega 64 LC + HD 630
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
Hummm

Am a bit confused now .... All the above test's done with Satechi USB C (3.1) external SSD enclosure ..

But if i do the same test with a USB 2 memory stick (connected via Apple Approved TypeA to TypeC adapter) port does not work at all ? .. but it does receive power (led on adapter on)

The other USB C port (non TB) works fine all the time ...

@RehabMan ... do i need to look at AHCI identities ? .. can you point me the right direction with one of your guides ?

Cheers
Jay
 
Joined
Dec 3, 2011
Messages
437
Motherboard
HP Elite X2
CPU
i5-7600U
Graphics
HD 620 2736 x 1834
Mac
  1. MacBook Pro
  2. Mac Pro
Classic Mac
  1. 128K
  2. 512K
Mobile Phone
  1. iOS
Hmmm...Ok, so maybe there's more to the puzzle.... I'm attaching my ioreg and DSDT output from patchmatic for reference. My TB3 port is on RP01 (the device is EP02) and you can see in the ioreg multiple connects/disconnects on both USB2 & USB3. Hopefully it will be as simple as adding some ACPI identities to your devices.



Edit*** - One thing I will add is that if you are using an adapter, some are finicky about which direction they are plugged in so you might try flipping it. I don't know if it's poor manufacturing or pin wear or whatever....
 

Attachments

  • Archive.zip
    994.4 KB · Views: 88

RehabMan

Moderator
Joined
May 2, 2012
Messages
183,805
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
... do i need to look at AHCI identities ? .. can you point me the right direction with one of your guides ?

ACPI (not AHCI) identities.
You can see clues in my NVMe spoof guide. Same concept.
Looking at a Mac (with similar hardware) ioreg and ACPI set will probably be useful.
 

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
4,001
Motherboard
GB Z490 Vision G
CPU
i9 10850K OC @ 5.2 GHz
Graphics
Vega 64 LC + HD 630
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
Hmmm...Ok, so maybe there's more to the puzzle.... I'm attaching my ioreg and DSDT output from patchmatic for reference. My TB3 port is on RP01 (the device is EP02) and you can see in the ioreg multiple connects/disconnects on both USB2 & USB3. Hopefully it will be as simple as adding some ACPI identities to your devices.

Edit*** - One thing I will add is that if you are using an adapter, some are finicky about which direction they are plugged in so you might try flipping it. I don't know if it's poor manufacturing or pin wear or whatever....

@jhax01,

Thanks for the examples ... very useful in understand what the io tree should look like .

ACPI (not AHCI) identities.
You can see clues in my NVMe spoof guide. Same concept.
Looking at a Mac (with similar hardware) ioreg and ACPI set will probably be useful.

@RehabMan,

Ok i now think i understand what your referring too ... this is a io reg dump of the port (after usb2 memory stick removed)

TXHC Rename.png


If i understand you correctly i need to inject device identities from the indicated position onwards ..

So pci8086,15bd@0 needs to be TXHC@0

Is that all i need to do or will i also need to inject device names so that the AppleUSBXXXXX entries below that become HSXX@00X00000, SSXX@00X00000 ... etc

Is this correct ? ...

Cheers
Jay
 

jaymonkey

Moderator
Joined
Aug 27, 2011
Messages
4,001
Motherboard
GB Z490 Vision G
CPU
i9 10850K OC @ 5.2 GHz
Graphics
Vega 64 LC + HD 630
Mac
  1. MacBook Air
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
Ok ... think i'm getting somewhere ...

In jhax01 DSDT there is code to create Device EP02 (TB device i think) and then the USB ports associated with it :-

Code:
  If (LAnd (LEqual (TBTS, One), LEqual (TBSE, One)))
    {
        Scope (_SB.PCI0.RP01.PXSX)
        {
            Method (_RMV, 0, NotSerialized)  // _RMV: Removal Status
            {
                Return (One)
            }

            Device (EP02)
            {
                Name (_ADR, 0x00020000)  // _ADR: Address
                Device (TXHC)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
                    {
                        Store (Package (0x02)
                            {
                                Zero,
                                Zero
                            }, Local0)
                        Store (0x6D, Index (Local0, Zero))
                        If (LEqual (USWE, One))
                        {
                            Store (0x03, Index (Local0, One))
                        }

                        Return (Local0)
                    }

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

                            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 (Zero, 0xFF))
                            }

                            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 (0xFF, 0x09))
                            }

                            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 (Zero, 0xFF))
                            }

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

            Method (_PS0, 0, Serialized)  // _PS0: Power State 0
            {
            }

            Method (_PS3, 0, Serialized)  // _PS3: Power State 3
            {
                Store (" Host router Upstream port _PS3", Debug)
                Acquire (OSUM, 0xFFFF)
                Store (MMTB (), Local0)
                \_GPE.SXST (Local0)
                Release (OSUM)
            }
        }

My DSDT has no such code .... which would account for why i do not have any AHCI identities associated with the combo TB/USB port .. I've also checked all the SSDT's and i cant find anything .... could it be in one of the dynamic SSDT's ?

So i assume i somehow need to create a SSDT that does the same.. i know i'll need to change the scope def at the top of the code to Scope (_SB.PCI0.RP05.PXSX) but i assume it will need a load of external defs in order for it to work ... waht would be your advice on how to implement this ...

Cheers
Jay
 
Status
Not open for further replies.
Top