Help - Search - Members - Calendar
Full Version: Ehci Ownership Fix
Project OS X Forums > Snow Leopard Guides & Tutorials > DSDT Patching
THe KiNG
This feature is already present in Chameleon and derivates, however I decided to fix it in DSDT b/c on some variants/implementations it dosen't allow me to boot from a USB flash stick.
So here we go, thanks to iNDi who translated the original code for me, I was able to fix it in DSDT:
Test machine - ASUS M50SV ICH8-M notebook.
Docs used - Intel ICH8 IO Controller HUB, 15.1.26 LEG_EXT_CAP�USB EHCI Legacy Support Extended Capability Register (USB EHCI�D29:F7, D26:F7), page 597.

On each EHC1 and EHC2 add this code, or complete it if is already:

CODE
OperationRegion (EOWN, PCI_Config, 0x68, 0x04) // LEG_EXT_CAP�USB EHCI Legacy Support Extended
Field (EOWN, ByteAcc, NoLock, Preserve)
{
, 16,
HCBO, 1, // HC BIOS Owned Semaphore
, 7,
HCOO, 1, // HC OS Owned Semaphore
}


Now in our good PINI method(I explained in other topics/hacks how/where):

CODE
Method (PINI, 0, NotSerialized) // For PCI0/Wake INI
{
Store (Zero, \_SB.PCI0.EHC1.HCBO)
Store (One, \_SB.PCI0.EHC1.HCOO)
Store (Zero, \_SB.PCI0.EHC2.HCBO)
Store (One, \_SB.PCI0.EHC2.HCOO)
// ................. // If you have more stuff to add
}


Do not forget the call of PINI in _WAK method and on PCI0 _INI method!
CODE
Method (_WAK, 1, NotSerialized)
{
PINI ()
// ....... // Rest of your stuff from _WAK method
}


CODE
Device (PCI0)
{
Method (_INI, 0, NotSerialized)
{
PINI ()
}

// ....... //
}


Enjoy!

L.E. Fixed the code to write only on required bits...
Slice
So, the last reason to remake IOUSBFamily is out. All fixes done by DSDT.
rob3r7o
Thank You!!!!!!!!!

rolleyes.gif laugh.gif rolleyes.gif

Bye bye USBF error!!!!!

Great Work



My PC: ASUS M51sn ICH8-M notebook
18seven
Fixed my ICH10R shutdown issue. Using the configuration space is a much better method than others (like the hackie device specific method, yuck) thanks.
гык-sse2
For ICH10 not 15 but 16 worked.
Slice
Thanks to SunKi!
http://www.applelife.ru/topic/21865-п...post__p__204697
THe KiNG
QUOTE (гык-sse2 @ Aug 20 2010, 01:40 PM) *
For ICH10 not 15 but 16 worked.



QUOTE (Slice @ Aug 20 2010, 02:18 PM) *

Yes, my mistake when I updated the code...
Thanks for notice the bug smile.gif

Always check the datasheet...
BTW for MCP79 users the offset address is 0x0A
18seven
QUOTE (THe KiNG @ Aug 21 2010, 03:07 AM) *
Always check the datasheet...


Agreed, despite the fact I have a totally different config space setup than this guide, I still would have never realized ICH8 and ICH10 were identical because I always read the docs for my hardware to implement the idea presented for my needs/understanding, however, glad it is sorted and would have posted had I seen the error.

thx againTHe KiNG for all the cs info you have posted. I may contribute something useful in return sometime...
Slice
Hmmm. I read orByte post and found something new
QUOTE
Briefly, while Apple implements
CODE
#define EHCI_USBLEGSUP_BIOS    (1 << 16)    /* BIOS semaphore */
#define EHCI_USBLEGSUP_OS    (1 << 24)    /* OS semaphore */,

they do not IMPLEMENT

CODE
#define EHCI_USBLEGCTLSTS    4        /* legacy control/status */
#define EHCI_USBLEGCTLSTS_SOOE    (1 << 13)    /* SMI on ownership change */,

which is actually a critical part of the management state machine (consequently on restart/reset BIOS reclaims but OS does not let go - so when you restart - no one gets it in the end). Well, in an unquirky world it would be taken care of by the BIOS, but hey! You know how it goes...

Resetting the OS owned bit, generates the SMI event which then sorts out the rest of the registers properly after restart/reset. We need to do this check prior to writing an OS owned bit.

So... the trick in the topic is not full solution.
THe KiNG
QUOTE (Slice @ Aug 27 2010, 09:57 AM) *
Hmmm. I read orByte post and found something new

So... the trick in the topic is not full solution.

Yes it is, if you have EHCI devices right configured in DSDT.
Sleep/Wake/Restart/Shutdown works with no problem on 2 borked systems.
For me worked even on "evil" MCP79 after I found out the it has a diff offset(thanks to Signal64 and his debug booter)
Anyway a fixed driver would do a better job(if is done proper) especial if it can fix the eject after sleep bug on MCP79...
Still investigating that with no luck so far...
Slice
Moreover, I see AppleUSBEHCI.kext set ownership bits in the same way as this DSDT patch ohmy.gif
CODE
_device->configWrite32(eecp, data | kEHCI_USBLEGSUP_OSOwned);

The problem is more deeper that simply set the bit.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.