Jump to content

Patched AppleUSBXHCI from OS 10.8.2

USB 3 AppleUSBXHCI

  • Please log in to reply
135 replies to this topic

#61
Zenith432

Zenith432

    InsanelyMac Sage

  • Developers
  • 468 posts
  • Gender:Male
newnekton1: my point was that AppleACPIPlatformExpert is not broken and doesn't need patching.

bebop68: Those are interesting results (with the asmedia and fl1000), which honestly - I cannot explain. According to the linux driver, there are a couple of classes of chips on which it always uses reset-on-resume - Etron xHC chip for the Asrock P67 MB, and all VIA xHC chips. I don't have the datasheet for these chips, but I assume there's a reason they added this quirk to always reset-on-resume with them. For all other xHC chips, it tries bonafide suspend/resume, and only if that fails does it reset the chip and reenumerate USB devices.

Apple's driver agrees to work for Intel Panther point and all FL chips, so I'm guessing those are what they tested with. The Intel chip is the only one which is integrated into the south-bridge and connected directly to the root complex. All others have at least one PCI-bridge separating them from the root-complex, and all intervening bridges must be properly configured for PME-routing in order for suspend/resume to work. Apple's software divides the configuration of PCI bridges between 1) IOPCIFamily, 2) AppleACPIPlatformExpert and 3) code executed from DSDT. So there are lots of places where things can go wrong :worried_anim:

#62
fau7i

fau7i

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 111 posts
  • Gender:Male
  • Location:Malaysia

According to the linux driver, there are a couple of classes of chips on which it always uses reset-on-resume - Etron xHC chip for the Asrock P67 MB, and all VIA xHC chips.

Hi Zenith432, it's me again.

I would believe this as I couldn't solve the disk ejection error with Etron chip in my Z77 Extreme6 nor auto reconnection. BTW, the 1st patch enables this chip.

Apple's driver agrees to work for Intel Panther point and all FL chips, so I'm guessing those are what they tested with. The Intel chip is the only one which is integrated into the south-bridge and connected directly to the root complex. All others have at least one PCI-bridge separating them from the root-complex, and all intervening bridges must be properly configured for PME-routing in order for suspend/resume to work. Apple's software divides the configuration of PCI bridges between 1) IOPCIFamily, 2) AppleACPIPlatformExpert and 3) code executed from DSDT. So there are lots of places where things can go wrong :worried_anim:

Do you know why Intel chip doesn't have 2.0 backward compatibility? Yes, it works natively (Z77 Extreme6 has Intel and Etron chips) but can't detect 2.0 drives nor charge my iPhone. Looks like it stop being connected after kernelcache loaded.

Thanks

#63
rob1980

rob1980

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 175 posts
Thanks for the time and effort put into this, what a massive improvement for me.

On my 4530s USB3.0 worked, but not properly. (PXHCD)

Unplugging a mouse no longer causes a panic, and devices like my midi controller that never worked on the USB3.0 port now work.

after sleep, I have the, not removed properly warning on USB drives, but it auto mounts again.

Many thanks!

Rob

#64
polkaholga

polkaholga

    InsanelyMac Geek

  • Donators
  • 151 posts
  • Gender:Male
  • Location:Otherland
@ Zenith432
Thank you so much for your hard work on this and great explanation about how things are connected on the USB side !
Big shout out too for shiecldk for sharing his experience and links to Mieze !
I don't have any USB3 device to test speed but at least the ports are working properly and no error messages / sleep problems
anymore !
:thumbsup_anim:

#65
dwmc

dwmc

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
Thanks much for the work Zenith432! And thanks shiecldk for the clover config stuff!

Appears to be working on the EJ168 ports on a GA-Z68X-UDH3-B3 (both front and rear). I'm using clover to perform the patches. I don't have any USB 3.0 devices handy to plug into the hackintosh, but my iPhone syncs on all ports and sleep/wake works O.K. (though my iPhone resyncs each time due to the unload/load).

#66
pokenguyen

pokenguyen

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 473 posts
  • Gender:Male
If I plug the mouse into USB 3.0 port then sleep/wake, it will cause a KP in IOHIDFamily kext. I have to unplug the mouse before waking.

#67
bebop68

bebop68

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
I was wondering if there's a way to force the cards to appear 'builtin' on a real mac and if its relevant to the sleep/resume issue? I tried with a nec 720202 (I think the 'a' low power version) and it dumped the drives at sleep, and wouldn't remount them afterwards.

#68
Zenith432

Zenith432

    InsanelyMac Sage

  • Developers
  • 468 posts
  • Gender:Male

I was wondering if there's a way to force the cards to appear 'builtin' on a real mac and if its relevant to the sleep/resume issue? I tried with a nec 720202 (I think the 'a' low power version) and it dumped the drives at sleep, and wouldn't remount them afterwards.

Make the patch at 10056 and revert the patch at 10014. It's supposed to do that. Run the "ioreg" command from post #8 and check if it says "Card Type" Built-In or PCI.

#69
bebop68

bebop68

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
Thanks - I'm going to double check my patches but this is what I get:


+-o AppleUSBXHCI <class AppleUSBXHCI, id 0x10000022a, registered, matched, act$
| {
| "IOClass" = "AppleUSBXHCI"
| "CFBundleIdentifier" = "com.apple.driver.AppleUSBXHCI"
| "IOProviderClass" = "IOPCIDevice"
| "Card Type" = "PCI"
| "IOPCIClassMatch" = "0x0c033000"
| "IOUserClientClass" = "IOUSBControllerUserClient"
| "IOPowerManagement" = {"ChildrenPowerState"=0x3,"DevicePowerState"=0x3,"C$
| "IOProbeScore" = 0x0
| "IOPCITunnelCompatible" = Yes
| "this" = 0xffffff81c48e2000
| "IOMatchCategory" = "IODefaultMatchCategory"
| "ISTKeepAway" = 0x1
| }
|
+-o XHCI Root Hub SS Simulation@0 <class IOUSBRootHubDevice, id 0x100000267,$
| +-o AppleUSBHub <class AppleUSBHub, id 0x100000269, registered, matched, a$
| +-o IOUSBInterface@0 <class IOUSBInterface, id 0x10000026b, !registered, !$
+-o XHCI Root Hub USB 2.0 Simulation@0 <class IOUSBRootHubDevice, id 0x10000$
+-o AppleUSBHub <class AppleUSBHub, id 0x10000026e, registered, matched, a$
+-o IOUSBInterface@0 <class IOUSBInterface, id 0x100000270, !registered, !$


Maybe this is why it doesn't resume from sleep. This is with an fl1000 card. If the patches are correct is there anything else I can do to force 'built in'? I'm guessing something about how apple handles expresscard slots forces 'pci'.

Update - the patches are correct.

Update 2 - with nex 720202 card it registers as 'built in' but that card doesn't resume after sleep, and refuses to mount a drive after sleep also. weird.

Edited by bebop68, 07 March 2013 - 04:45 AM.


#70
Zenith432

Zenith432

    InsanelyMac Sage

  • Developers
  • 468 posts
  • Gender:Male

Maybe this is why it doesn't resume from sleep. This is with an fl1000 card. If the patches are correct is there anything else I can do to force 'built in'? I'm guessing something about how apple handles expresscard slots forces 'pci'.

Update - the patches are correct.

That means the chip reports that it doesn't support PME, so sleep can't be done. It will be reset during sleep and devices reenumerated.

Update 2 - with nex 720202 card it registers as 'built in' but that card doesn't resume after sleep, and refuses to mount a drive after sleep also. weird.

That means the chip reports itself as supporting PME, and sleep is done. But after resume, it reports an error, because during sleep it lost all electric power. AppleUSBXHCI leaves it in an unusable state.

#71
DZLK

DZLK

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts
Zenith432

Hello.
Please!
Can you add 32 bit support for i386?
Because native AppleUSBXHCI.kext has support both x86_64 and i386, when patched has only x86_64 and i can't use it with Core Duo CPU, non x86_64, only i386.

Thank you and check my solution for NEC USB 3.0 Cards, may be it help you in future.

#72
X-TRiAL

X-TRiAL

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 157 posts
  • Gender:Male
  • Location:UK
Is this an alternative for the PXHCD.kext? or is that an essential kext?

#73
lollo78

lollo78

    InsanelyMac Protégé

  • Members
  • Pip
  • 22 posts
Hi zenith, it woks for me (thanks!) on GA-P55A-UD4
but If I put OSX in Stop (sleep), at resume USB3 device is disconnected (an error message appear).
maybe a DSDT issue like yours?
Could you help me to edit my DSDT (I have the _PTS Method) to have a full working USB3?
My DSDT here: http://www.mediafire...o2s4x9it4980ssv
Thank you a lot!

#74
X-TRiAL

X-TRiAL

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 157 posts
  • Gender:Male
  • Location:UK
Thank you it worked for me. It enabled my USB 3.0 port, I can use it with standard USB 2.0 devices however not yet tried with a USB 3.0 device.

When a device is inserted and I sleep my machine, the system does not wake.

Thanks

#75
bebop68

bebop68

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
I've tried with the nec 720200a and got an overvolt warning which shut down the driver. I tried with an fl1009 card - like the asmedia it wouldn't hot swap. If inserted before bootup the vanilla drivers would load it, and mount drives, but they would get disconnected with sleep. The same happens with the patched driver! ioreg reports the card as 'pci' not 'built in'. So far the only card that reports as 'built in' is a nec 720202 but it still wouldn't resume after sleep.

I'm going to look at the 10.8.3 binary and see if the patches are applicable.

Update: It looks very different to me.

#76
Zenith432

Zenith432

    InsanelyMac Sage

  • Developers
  • 468 posts
  • Gender:Male

I'm going to look at the 10.8.3 binary and see if the patches are applicable. Update: It looks very different to me.

Here.
1413c1413
< 0005840: 0200 0048 85c0 7526 488b bbe8 0100 0048 ...H..u&H......H
---
> 0005840: 0200 0048 85c0 eb26 488b bbe8 0100 0048 ...H...&H......H
3686c3686
< 000e650: 755b 498b 0748 8d35 d082 0000 4c89 ffff u[I..H.5....L...
---
> 000e650: eb5b 498b 0748 8d35 d082 0000 4c89 ffff .[I..H.5....L...
3703c3703
< 000e760: bdc7 0200 e066 3d00 010f 8255 0100 0049 .....f=....U...I
---
> 000e760: bdc7 0200 e066 3d00 000f 8255 0100 0049 .....f=....U...I
4099c4099
< 0010020: ffff fd89 0181 4908 0000 4000 4181 e4ff ......I...@.A...
---
> 0010020: ffff fd89 0181 4908 0000 0000 4181 e4ff ......I.....A...
4347c4347
< 0010fa0: 0800 0040 0080 bd67 ffff ff00 4c8b bd50 ...@...g....L..P
---
> 0010fa0: 0800 0000 0080 bd67 ffff ff00 4c8b bd50 .......g....L..P
4393c4393
< 0011280: 0000 0041 c746 0800 0040 0041 8b46 0c83 ...A.F...@.A.F..
---
> 0011280: 0000 0041 c746 0800 0000 0041 8b46 0c83 ...A.F.....A.F..
  • 5846 - formerly at 10056
  • e650 - formerly at 5520
  • e768 - formerly at 5624
  • 1002a, 10fa3, 11289 - formerly 6d65, 7ceb, 7fd1
I did not apply the patch formerly at 10014 (that makes it always use reset-on-resume), but if you want that one, change the byte at 5804 from 1 to 0.

Edit: Oddly, in 10.8.3, AppleUSBXHCI agrees to load on all Asmedia chips without "AllowAnyXHCI"/patch-at-e650, even though ASM 1042 doesn't work with it... So did Apple test asmedia chips or not???
Correction: It won't run on the ASM 1042, because that chip reports itself as v0.96 - which is blocked. Maybe they tested it with the newer asmedia 105x chip.

Edited by Zenith432, 21 March 2013 - 03:27 PM.


#77
tranduyquang

tranduyquang

    InsanelyMac Protégé

  • Members
  • PipPip
  • 56 posts
Thank for your kext. Which once would you recommend to use between the kext from this topic and Generic kext from here ? What discrepancy of them?

#78
todesto

todesto

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 160 posts
  • Gender:Male
  • Location:Whttier, CA
  • Interests:golf
    computer
    hacking
    movie
    Deep Purple, Led Zeppelin, Police, Queen, St...
Thank you. This works on Z68AP-D3 Etron EJ128 USB 3.0 port. It was mentioned in earlier post and I can confirm that.
However I notice everthing woke and works after sleep, but when I put the system to sleep second time and woke it up, it seemed it was waking up then it hung at deathe of spinning beach ball, however the mouse is working...... It wasn't doing that with 10.8.2 and didn't have this kext. had PXHCD.

#79
marcelol

marcelol

    InsanelyMac Protégé

  • Members
  • Pip
  • 48 posts
Has anyone performed any necessary patch for the releases 10.8.3 ?

#80
bebop68

bebop68

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
Yes, read post 76





Also tagged with one or more of these keywords: USB 3, AppleUSBXHCI


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy