Jump to content

How to get Intel 7 Series USB 3.0 fully working - Step by Step guide


giacomoleopardo
 Share

101 posts in this topic

Recommended Posts

GUIDE UPDATED! SEE AT THE BOTTOM OF THIS POST UPDATE #2 and #3!!!

 

Hello hackintoshers!

 

This thread will help you to enable USB 3.0 on 7 Series motherboards with Ivy Bridge CPUs. This editing work is based on forum member Mieze's job; she's the mind behind all of this stuff. It's important to note that is a work in progress, I personally tested it with full success on Gigabyte GA-Z77N-WiFi, Zotac Z77- ITX WiFi and Asrock Z77E-ITX, so hopefully most of Z77 and H77 boards can support this.

Due to the fact that on pre-7 series motherboards USB 3.0 was not always fully supported, this method allows Intel chipset USB 3.0 ports to work properly with any kind of device (3.0 and backward to 2.0 and 1.0)

Assuming that you have a Z77 or H77 board with Ivy Bridge processor (Sandy Bridge CPUs or older don't support USB 3.0, so this guide is not for you, sorry <--- Bad guess!) I guess you already have a dsdt to get HDMI Audio working properly. If yes, skip the step #1 and step # 2 and jump directly on step #3. If not, follow this guide from step #1.

 

Tools

 

All you need is:

- Internet access

- A program to extract and edit DSDT like DSDT Editor

- A working Mac or Hackintosh

- Coffee, cigarettes, time and patience: I did need all of them!

 

 

 

Step #1 - Getting DSDT patches

This first step allow you to get the patches in order to have a clean DSDT with HDMI Audio patch. Forum member Toleda has done a great job about this, generating just two patches.

- Go to toleda's repository and click on ib1-ami_efi_clean_compile.txt

- In the top right corner click on Raw command, the browser window will now show only text: that's the patch

- Save the windows as a file text in Desktop (generating ib1-ami_efi_clean_compile.txt)

- Go back to the previous repository page and select AMI-HD4000-7_Series, then you'll have two options:

  • ib2-hdmi_audio_ami_efi_hd4000-1.txt if you have a discrete graphic card
  • ib3-hdmi_audio_ami_efi_hd4000-3.txt if you have only Intel HD 4000 onboard graphic

​- Choose whatever you need and save a text file as previous explained for the first patch. Now on desktop you'll have two text files, and we're going to use with DSDT Editor (from now DE)

 

 

Step #2 - Extract, patch and compile DSDT for HDMI Audio

- Open DE and in Menu bar click on File/Extract DSDT, a fresh DSDT will be generated.

NOTE: If you already have a DSDT in System/Extra folder reboot the system typing at Chameleon-Chimera screen DSDT=Null then proceed extracting DSDT

- In DE Menu bar click on Patch/Open and choose the first text file you saved in Step 1 of this thread (ib1-ami_efi_clean_compile.txt)

- In the new window just appeared click on Apply, wait the end of the process (a few seconds) and Close

- In DE Menu bar click on IASL/Compile: a new window will appear reporting compiling results. It's possible that it will report some Warnings or Remarks, the important thing is that MUST BE 0 Errors! Warning or Remarks will disappear applying the next patch.

- Repeat patch procedure choosing ib3-hdmi_audio_ami_efi_hd4000-X.txt (Patch/Open/Apply/Close and IASL/Compile)

- Now, after compiling, compile window should report 0 Errors, 0 Warnings, 0 Remarks, XX Optimizations, so in DE Menu bar Click on IASL/Save AML as and name it DSDT.aml. You're ready to edit (manually, for now) DSDT in order to fix USB 3.0 backward port. Drink a cup of coffee, feed your cats, kiss your wife, smoke a cigarette and lock the door.

 

Step #3 - USB 3.0 fix

- Open DSDT just saved and find

Device (XHC)

 

- Select the entire block from Device (XHC) to Device (HDEF)

Device (XHC)
...............................
Device (HDEF)

 

and replace with this

Device (XHC1)
 {
	 Name (_ADR, 0x00140000)
	 OperationRegion (XPRT, PCI_Config, 0x74, 0x6C)
	 Field (XPRT, DWordAcc, NoLock, Preserve)
	 {
				 Offset (0x01),
		 PMEE, 1,
			 , 6,
		 PMES, 1,
				 Offset (0x5C),
		 PR2, 32,
		 PR2M, 32,
		 PR3, 32,
		 PR3M, 32
	 }

	 OperationRegion (XH1C, PCI_Config, 0xD0, 0x10)
	 Field (XH1C, ByteAcc, NoLock, Preserve)
	 {
		 PAHC, 1,
		 PBHC, 1,
		 PCHC, 1,
		 PDHC, 1,
				 Offset (0x08),
		 PASS, 1,
		 PBSS, 1,
		 PCSS, 1,
		 PDSS, 1
	 }

	 OperationRegion (XHC2, PCI_Config, 0x44, 0x04)
	 Field (XHC2, ByteAcc, NoLock, Preserve)
	 {
				 Offset (0x01),
		 MIAI, 2
	 }

	 Name (XRST, Zero)
	 Method (_INI, 0, NotSerialized)
	 {
		 If (OSDW ())
		 {
			 Store (Zero, MIAI)
		 }

		 If (LAnd (LGreaterEqual (OSYS, 0x07DC), LLess (OSYS, 0x2710)))
		 {
			 Store (One, PASS)
			 Store (One, PAHC)
			 Store (One, PBSS)
			 Store (One, PBHC)
			 Store (One, PCSS)
			 Store (One, PCHC)
			 Store (One, PDSS)
			 Store (One, PDHC)
		 }
	 }

	 Method (_S3D, 0, NotSerialized)
	 {
		 Return (0x02)
	 }

	 Method (_S4D, 0, NotSerialized)
	 {
		 Return (0x02)
	 }

	 Device (RHUB)
	 {
		 Name (_ADR, Zero)
		 Device (PRT1)
		 {
			 Name (_ADR, One)
			 Method (_UPC, 0, Serialized)
			 {
				 Name (UPCP, Package (0x04)
				 {
					 0xFF,
					 0x03,
					 Zero,
					 Zero
				 })
				 Return (UPCP)
			 }

			 Method (_PLD, 0, Serialized)
			 {
				 Name (PLDP, Package (0x01)
				 {
					 Buffer (0x10)
					 {
						 /* 0000 */ 0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
						 /* 0008 */ 0x69, 0x0C, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
					 }
				 })
				 Return (PLDP)
			 }

			 Name (MUXS, "EHCA")
		 }

		 Device (PRT2)
		 {
			 Name (_ADR, 0x02)
			 Method (_UPC, 0, Serialized)
			 {
				 Name (UPCP, Package (0x04)
				 {
					 0xFF,
					 0x03,
					 Zero,
					 Zero
				 })
				 Return (UPCP)
			 }

			 Method (_PLD, 0, Serialized)
			 {
				 Name (PLDP, Package (0x01)
				 {
					 Buffer (0x10)
					 {
						 /* 0000 */ 0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
						 /* 0008 */ 0x69, 0x0C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
					 }
				 })
				 Return (PLDP)
			 }

			 Name (MUXS, "EHCB")
		 }

		 Device (PRT3)
		 {
			 Name (_ADR, 0x03)
			 Method (_UPC, 0, Serialized)
			 {
				 Name (UPCP, Package (0x04)
				 {
					 0xFF,
					 0x03,
					 Zero,
					 Zero
				 })
				 Return (UPCP)
			 }

			 Method (_PLD, 0, Serialized)
			 {
				 Name (PLDP, Package (0x01)
				 {
					 Buffer (0x10)
					 {
						 /* 0000 */ 0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
						 /* 0008 */ 0x69, 0x0C, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00
					 }
				 })
				 Return (PLDP)
			 }

			 Name (MUXS, "EHCC")
		 }

		 Device (PRT4)
		 {
			 Name (_ADR, 0x04)
			 Method (_UPC, 0, Serialized)
			 {
				 Name (UPCP, Package (0x04)
				 {
					 0xFF,
					 0x03,
					 Zero,
					 Zero
				 })
				 Return (UPCP)
			 }

			 Method (_PLD, 0, Serialized)
			 {
				 Name (PLDP, Package (0x01)
				 {
					 Buffer (0x10)
					 {
						 /* 0000 */ 0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
						 /* 0008 */ 0x69, 0x0C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
					 }
				 })
				 Return (PLDP)
			 }

			 Name (MUXS, "EHCD")
		 }
	 }

	 Method (_PRW, 0, NotSerialized)
	 {
		 Return (GPRW (0x0D, 0x04))
	 }

	 Method (_DSM, 4, NotSerialized)
	 {
		 Store (Package (0x0B)
			 {
				 "AAPL,current-available",
				 0x0834,
				 "AAPL,current-extra",
				 0x0898,
				 "AAPL,current-extra-in-sleep",
				 0x0640,
				 "AAPL,max-port-current-in-sleep",
				 0x0834,
				 "AAPL,device-internal",
				 Zero,
				 Buffer (One)
				 {
					 0x00
				 }
			 }, Local0)
		 DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
		 Return (Local0)
	 }

	 Method (XHCA, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (One, PASS)
		 }

		 Store (One, PAHC)
	 }

	 Method (XHCB, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (One, PBSS)
		 }

		 Store (One, PBHC)
	 }

	 Method (XHCC, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (One, PCSS)
		 }

		 Store (One, PCHC)
	 }

	 Method (XHCD, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (One, PDSS)
		 }

		 Store (One, PDHC)
	 }

	 Method (EHCA, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (Zero, PASS)
		 }

		 Store (Zero, PAHC)
	 }

	 Method (EHCB, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (Zero, PBSS)
		 }

		 Store (Zero, PBHC)
	 }

	 Method (EHCC, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (Zero, PCSS)
		 }

		 Store (Zero, PCHC)
	 }

	 Method (EHCD, 0, NotSerialized)
	 {
		 If (LNot (OSDW ()))
		 {
			 Store (Zero, PDSS)
		 }

		 Store (Zero, PDHC)
	 }
 }

 Device (HDEF)

 

- Find

Name (_ADR, 0x001D0000)

 

under that you'll find

Device (HUBN)

 

here you have to look for the devices that don't have "Method (_DSM". In my case they are Device (PR11), Device (PR12), Device (PR13), Device (PR18), skipping Device (PR01). Those devices - without "Method (_DSM" - have to be modified adding Name (MUXS, "XHCA") to Device (PR11), Name (MUXS, "XHCB") to Device (PR12), Name (MUXS, "XHCC") to Device (PR13), Name (MUXS, "XHCD") to Device (PR18).

Here is the first case, that's the same for the other three

from

Device (PR11)
			 {
				 Name (_ADR, One)
				 Method (_UPC, 0, Serialized)
				 {
					 Name (UPCP, Package (0x04)
					 {
						 0xFF,
						 0xFF,
						 Zero,
						 Zero
					 })
					 Return (UPCP)
				 }

				 Method (_PLD, 0, Serialized)
				 {
					 Name (PLDP, Package (0x01)
					 {
						 Buffer (0x10)
						 {
							 /* 0000 */ 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
							 /* 0008 */ 0xE1, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
						 }
					 })
					 Return (PLDP)
				 }
			 }

 

into

Device (PR11)
			 {
				 Name (_ADR, One)
				 Method (_UPC, 0, Serialized)
				 {
					 Name (UPCP, Package (0x04)
					 {
						 0xFF,
						 0xFF,
						 Zero,
						 Zero
					 })
					 Return (UPCP)
				 }

				 Method (_PLD, 0, Serialized)
				 {
					 Name (PLDP, Package (0x01)
					 {
						 Buffer (0x10)
						 {
							 /* 0000 */ 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
							 /* 0008 */ 0xE1, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
						 }
					 })
					 Return (PLDP)
				 }

				 Name (MUXS, "XHCA")
			 }

 

-Find

Method (_OSC, 4, Serialized)

 

and replace the entire block from this

Method (_OSC, 4, Serialized)
	 {
		 Store (Arg3, Local0)
		 CreateDWordField (Local0, Zero, CDW1)
		 CreateDWordField (Local0, 0x04, CDW2)
		 CreateDWordField (Local0, 0x08, CDW3)
		 If (^XHC.CUID (Arg0))
		 {
			 Return (^XHC.POSC (Arg1, Arg2, Arg3))
		 }
		 Else
		 {
			 If (_OSI ("Windows 2012"))
			 {
				 If (LEqual (XCNT, Zero))
				 {
					 ^XHC.XSEL ()
					 Increment (XCNT)
				 }
			 }
		 }

		 If (LEqual (Arg0, GUID))
		 {
			 Store (CDW2, SUPP)
			 Store (CDW3, CTRL)
			 If (LEqual (NEXP, Zero))
			 {
				 And (CTRL, 0xFFFFFFF8, CTRL)
			 }

			 If (NEXP)
			 {
				 If (Not (And (CDW1, One)))
				 {
					 If (And (CTRL, One))
					 {
						 NHPG ()
					 }

					 If (And (CTRL, 0x04))
					 {
						 NPME ()
					 }
				 }
			 }

			 If (LNotEqual (Arg1, One))
			 {
				 Or (CDW1, 0x08, CDW1)
			 }

			 If (LNotEqual (CDW3, CTRL))
			 {
				 Or (CDW1, 0x10, CDW1)
			 }

			 Store (CTRL, CDW3)
			 Store (CTRL, OSCC)
			 Return (Local0)
		 }
		 Else
		 {
			 Or (CDW1, 0x04, CDW1)
			 Return (Local0)
		 }
	 }

	 Scope (\_SB.PCI0)

 

to this

Method (_OSC, 4, Serialized)
	 {
		 Store (Arg3, Local0)
		 CreateDWordField (Local0, Zero, CDW1)
		 CreateDWordField (Local0, 0x04, CDW2)
		 CreateDWordField (Local0, 0x08, CDW3)
		 Store (CDW2, SUPP)
		 Store (CDW3, CTRL)
		 If (LEqual (One, OSDW ()))
		 {
			 If (LAnd (LEqual (Arg0, GUID), NEXP))
			 {
				 If (Not (And (CDW1, One)))
				 {
					 If (And (CTRL, 0x02))
					 {
						 NHPG ()
					 }

					 If (And (CTRL, 0x04))
					 {
						 NPME ()
					 }
				 }

				 If (LNotEqual (Arg1, One))
				 {
					 Or (CDW1, 0x08, CDW1)
				 }

				 If (LNotEqual (CDW3, CTRL))
				 {
					 Or (CDW1, 0x10, CDW1)
				 }

				 Store (CTRL, CDW3)
				 Store (CTRL, OSCC)
				 Return (Local0)
			 }
			 Else
			 {
				 Or (CDW1, 0x04, CDW1)
				 Return (Local0)
			 }
		 }
		 Else
		 {
			 If (LEqual (Arg0, Buffer (0x10)
					 {
						 /* 0000 */ 0xA9, 0x12, 0x95, 0x7C, 0x05, 0x17, 0xB4, 0x4C,
						 /* 0008 */ 0xAF, 0x7D, 0x50, 0x6A, 0x24, 0x23, 0xAB, 0x71
					 }))
			 {
				 Store (One, ^XHC1.PASS)
				 Store (One, ^XHC1.PAHC)
				 Store (One, ^XHC1.PBSS)
				 Store (One, ^XHC1.PBHC)
				 Store (One, ^XHC1.PCSS)
				 Store (One, ^XHC1.PCHC)
				 Store (One, ^XHC1.PDSS)
				 Store (One, ^XHC1.PDHC)
			 }

			 Return (Local0)
		 }
	 }

	 Scope (\_SB.PCI0)

 

-Find this block

Scope (_SB.PCI0)
{
 Method (_INI, 0, NotSerialized)
 {
	 Store (0x07D0, OSYS)
	 If (CondRefOf (_OSI, Local0))
	 {
		 If (_OSI ("Windows 2001"))
		 {
			 Store (0x07D1, OSYS)
		 }

		 If (_OSI ("Windows 2001 SP1"))
		 {
			 Store (0x07D1, OSYS)
		 }

		 If (_OSI ("Windows 2001 SP2"))
		 {
			 Store (0x07D2, OSYS)
		 }

		 If (_OSI ("Windows 2001.1"))
		 {
			 Store (0x07D3, OSYS)
		 }

		 If (_OSI ("Windows 2006"))
		 {
			 Store (0x07D6, OSYS)
		 }

		 If (_OSI ("Windows 2009"))
		 {
			 Store (0x07D9, OSYS)
		 }

		 If (_OSI ("Windows 2012"))
		 {
			 Store (0x07DC, OSYS)
		 }
	 }
 }

 

add this

If (_OSI ("Darwin"))
		 {
			 Store (0x2710, OSYS)
		 }

 

and the result will be

Scope (_SB.PCI0)
{
 Method (_INI, 0, NotSerialized)
 {
	 Store (0x07D0, OSYS)
	 If (CondRefOf (_OSI, Local0))
	 {
		 If (_OSI ("Darwin"))
		 {
			 Store (0x2710, OSYS)
		 }

		 If (_OSI ("Windows 2001"))
		 {
			 Store (0x07D1, OSYS)
		 }

		 If (_OSI ("Windows 2001 SP1"))
		 {
			 Store (0x07D1, OSYS)
		 }

		 If (_OSI ("Windows 2001 SP2"))
		 {
			 Store (0x07D2, OSYS)
		 }

		 If (_OSI ("Windows 2001.1"))
		 {
			 Store (0x07D3, OSYS)
		 }

		 If (_OSI ("Windows 2006"))
		 {
			 Store (0x07D6, OSYS)
		 }

		 If (_OSI ("Windows 2009"))
		 {
			 Store (0x07D9, OSYS)
		 }

		 If (_OSI ("Windows 2012"))
		 {
			 Store (0x07DC, OSYS)
		 }
	 }
 }

 

Please note that the block above may result different from board to board: leave as it is DON'T COPY MY RESULT posted up here, just adding Darwin block is the important thing!

 

- At the end of DSDT add this block just before the last "}"

Method (OSDW, 0, NotSerialized)
{
 If (LEqual (OSYS, 0x2710))
 {
	 Return (One)
 }
 Else
 {
	 Return (Zero)
 }
}

 

this is the result

<<<<<<<DSDT stuff>>>>>>>
Store ("ib3-hdmi_audio_ami_efi_hd4000-3.txt_v1.0 dsdt edits, github.com/toleda", Debug)
Method (OSDW, 0, NotSerialized)
{
 If (LEqual (OSYS, 0x2710))
 {
	 Return (One)
 }
 Else
 {
	 Return (Zero)
 }
}
}

 

- Now the Compiler Summary windows should be clean (0 Errors, 0 Warning, 0 Remarks, XX Optimizations). Done.

- If not, maybe it's necessary to resolve some references to the XHC that could generate compile error (it's about XHC to be replaced with XHC1), it depends by the error message.

 

Your DSDT will make Intel USB 3.0 fully working

Please note that I'm not a DSDT or ACPI expert.

I take NO CREDITS for all this amazing work! I simply gathered infos from web and from Mieze.

Anyway, feel free to report success, errors, advices etc.

Mieze: you're the one! Thank you!

 

 

UPDATE April 15th, 2013

As stated by Mieze in post #24, some System Definitions don't work with USB 3.0 backwards.

So, if you're using Ivy Bridge cpu and 7 series motherboard (Z77, H77, B75 etc.) probably the best SysDef choice is MacMini 6,1 (i5 cpu) or 6,2 (i7 cpu, with the most pstates regarding Ivy Bridge Power Management). It also be pretty good iMac 13,1 (i5 cpu) iMac 13,2 (i7 cpu). Anyhow, any Ivi Bridge SysDef make usb 3.0 working properly with the editing above here.

You can also choose Sandy Bridge SysDef (it depends by your components, of course) MacMini 5,1 or Mac Pro 3,1. Cheers!

 

 

UPDATE 2 April 21st, 2013

Awsome news! (not so new, as a matter of fact)

Forum member Zenith432 has created a GenericUSBXHCI.kext that makes Intel Z77 usb hub controller working properly without all the editing work above reported. And more: GenericUSBXHCI.kext makes my ASMedia usb 3 controller working, as well.

  • Download "Binaries v.1.1.4" from his thread
  • Remove any kext installed to make (partially?) usb 3.0 working from System/Library/Extensions (in my case CalDigitUSBxHCI.kext and CalDigitFastIO.kext)
  • Install GenericUSBXHCI.kext with Kext Utility or whatever you like
  • Show hidden files typing in terminal window defaults write com.apple.finder AppleShowAllFiles TRUE then press enter and type killall Finder and press enter again
  • Paste xhcdump in /usr/local/bin
  • Repair permissions and rebuilt cache
  • Hide hidden files typing in terminal window defaults write com.apple.finder AppleShowAllFiles FALSE then press enter and type killall Finder and press enter again
  • Reboot

Here is my test with an external HDD USB 3.0 and flash drive 2.0. Asrock Z77E-ITX motherborad and Intel core i7 3770S

 

PART 1 - Mieze's DSDT patch + ASMedia kexts (CalDigitFastIO.kext and CalDigitUSBxHCI.kext) downloaded here

 

- HDD connected to Intel usb 3, recognized as Super Speed Bus up to 5 Gb/sec and stays connected after wake from sleep

- HDD connected to ASMedia usb 3, recognized as Super Speed Bus up to 480 Mb/sec and auto remounted after wake from sleep

- HDD connected to usb 2 recognized as High Speed Bus up to 480 Mb/sec and stays connected after wake from sleep

- Flash drive recognized properly everywhere, but in ASMedia usb 3 auto remounted after wake from sleep

 

 

PART 2 - No Mieze's DSDT patch, no ASMedia kexts, just GenericUSBXHCI.kext

 

- HDD connected to Intel usb 3, recognized as Super Speed Bus up to 5 Gb/sec and stays connected after wake from sleep

- HDD connected to ASMedia usb 3, recognized as Super Speed Bus up to 5 Gb/sec and auto remounted after wake from sleep

- HDD connected to usb 2 recognized as High Speed Bus up to 480 Mb/sec and stays connected after wake from sleep

- Flash drive recognized properly everywhere, but in ASMedia usb 3 auto remounted after wake from sleep

- "-gux_nosleep" kernel flag caused unmount remount in Intel usb3 without solving remount in ASMedia ports

- "-gux_nomsi" kernel flag doesn't affect Intel ports after wake from sleep, but doesn't solve unmount on ASMedia ports.

 

Conclusion

Regarding ASMedia USB 3.0 Controller, GenericUSBXHCI.kext works better than CalDigitFastIO.kext + CalDigitUSBxHCI.kext

Regarding Intel Z77 USB 3.0 Controller, GenericUSBXHCI.kext does the same job as Mieze's DSDT patches

 

Using DSDT with Mieze's patch doesn't affect GenericUSBXHCI.kext job. Not necessary, I know, but for the sake of curiosity...

 

UPDATE 3 April 22nd, 2013

Tested on Gigabyte Z77N-ITX WiFi + Intel i7 3770K and on Zotac Z77-ITX WiFi + Intel i7 3770T

 

Since these motherboards have only Intel Controller I couln't say these results are for all mobos.

  • On Zotac everything went well: tested both methods DSDT patch and just GenericUSBXHCI.kext. Also wake from sleep doesn't affect hdd or flash drive connection. So I decided to keep DSDT editing, I prefer not to add extra kexts, but it's definetly the same result.
  • On Gigabyte I had some issues. Basically every device is properly recognized, but with both methods they're disconnected after wake from sleep. This happens in every usb port: 2.0 and 3.0 as well. Furthermore GenericUSBXHCI.kext method seems to compromise my apple usb keyboard hub until I unplug the device connected and remounted after sleep (hdd or flash drive). That doesn't happen when applying DSDT patch. So in this case DSDT patch has my +1. I can't really say why it happens, maybe something in Gigabyte Uefi Bios has to be set in another way, or maybe some other dsdt string to be changed...really don't know.

Carbo178 reported best results with DSDT patch method on his ASUS mobo (i.e. no sleep issues), what about you, guys?

I think that our community needs testers. So come on, report results!

Unfortunately this is my last day with Gigabyte Z77N-ITX WiFi. So my tests stop here. Until some other friend or relative will ask me to build him/her a hack! Ah ah!

Cheers

g.

Edited by giacomoleopardo
  • Like 10
Link to comment
Share on other sites

Sandy Bridge CPUs or older don't support USB 3.0

 

Odd statement you are making here. I have a 7 series motherboard with a Sandybridge processor and USB3.0 has been working oob without any modifications. The only thing I noticed is that the speed of USB3 dropped from 150 Kb/s to 70 Kb/s from 10.8.2 onwards, but rolling back to 10.8.0 IOUSBFamily & IOUSBMassStorageClass kexts sort that out. Otherwise... 100% functional.

 

So I am not sure why you claim that 7 series USB3 requires anything else but a fix for the latest versions of IOUSBFamily. I also don't see how the CPU type (Sandybridge / Ivy Bridge) matters, since the processor has no bearing on whether or not Intel 7 series chipset are recognized or not. All Intel 7 SEries Chipsets have been recognized (USB 3.0 included) since 10.8.0, but only correctly identified in 10.8.3. Al have been 100% functional - SandyBridge / IvyBridge.

 

Attached are screenshots from my 7 Series B75M motherboard with ... tadaaaa! a Sandy Bridge CPU. It has an Intel USB chipset. No extra kexts installed, no modifications or anything Just a roll-back to of 2x 10.8.0 kexts. That's all. Roll-backs don't count - they are still stock Apple kexts.

 

Just to taunt you even more. I have an old G31m socket 775 setup I use as a dedicated machine for downloads etc. It has an Intel Core2Duo CPU with a cheap no-name brand USB3.0 adaptor which runs on the stock ML AppleUSBXHCI kext too. Natively detected...

 

EDIT: I never realized my usb3 ports do not recognize usb2 devices.

post-399780-0-88648700-1365971713_thumb.jpg

Edited by subxero
Link to comment
Share on other sites

Thanks to Mieze first of all for the idea and to giacomoleopardo for taking the time to explain it in detail.

For me this modification enabled backwards compatibility for USB3 ports which was not working before.

 

I would like to propose a small optimization which includes removing unnecessary conditions.

 

A Mac's DSDT contains the OSDW() method which determines if the current OS is OS X (Darwin) or not. As we want to use Apple's way of handling USB, we only need to keep the code which is executed if OSDW() is true and delete the rest of the confition. This will shorten several methods and eliminate the need for the OSDW() method to be created at all.

 

Example with Method XHCA:

 

 

Method (XHCA, 0, NotSerialized)
{
   If (LNot (OSDW ()))
   {
       Store (One, PASS)
   }

   Store (One, PAHC)
}

.. will turn into:


Method (XHCA, 0, NotSerialized)
{
   Store (One, PAHC)
}

 

 

 

Another thing is that a PC's DSDT is not adjusted for use with OS X. Throughout the DSDT you can find several places where the OSYS variable is checked to determine the OS that is being run, mostly for different Windows versions. According to the value, a different code path is chosen. Setting OSYS to 0x2710 will render these code paths unusable because there is simply no special condition for this value.

 

I also noticed that the code for devices EHC1, EHC2 and XHC is identical for Z77 boards, at least for the ones I had a look at - including Asus, ASRock and MSI.

 

Here is the result I came up with for these three devices:

 

 

Device (EHC1)
{
   Name (_ADR, 0x001D0000)  // _ADR: Address
   Method (_S3D, 0, NotSerialized)  // _S3D: S3 Device State
   {
       Return (0x02)
   }

   Method (_S4D, 0, NotSerialized)  // _S4D: S4 Device State
   {
       Return (0x02)
   }

   Method (XHCA, 0, NotSerialized)
   {
       Store (One, ^^XHC1.PAHC)
   }

   Method (XHCB, 0, NotSerialized)
   {
       Store (One, ^^XHC1.PBHC)
   }

   Method (XHCC, 0, NotSerialized)
   {
       Store (One, ^^XHC1.PCHC)
   }

   Method (XHCD, 0, NotSerialized)
   {
       Store (One, ^^XHC1.PDHC)
   }

   Method (EHCA, 0, NotSerialized)
   {
       Store (Zero, ^^XHC1.PAHC)
   }

   Method (EHCB, 0, NotSerialized)
   {
       Store (Zero, ^^XHC1.PBHC)
   }

   Method (EHCC, 0, NotSerialized)
   {
       Store (Zero, ^^XHC1.PCHC)
   }

   Method (EHCD, 0, NotSerialized)
   {
       Store (Zero, ^^XHC1.PDHC)
   }

   Device (RHUB)
   {
       Name (_ADR, Zero)  // _ADR: Address
       Device (PRT1)
       {
           Name (_ADR, One)  // _ADR: Address
           Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
           {
               Name (UPCA, Package (0x04)
               {
                   0xFF, 
                   Zero, 
                   Zero, 
                   Zero
               })
               Return (UPCA)
           }

           Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
           {
               Name (PLDP, Package (0x01)
               {
                   Buffer (0x10)
                   {
                       /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                       /* 0008 */   0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                   }
               })
               Return (PLDP)
           }

           Device (PRT1)
           {
               Name (_ADR, One)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Name (MUXS, "XHCA")
           }

           Device (PRT2)
           {
               Name (_ADR, 0x02)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Name (MUXS, "XHCB")
           }

           Device (PRT3)
           {
               Name (_ADR, 0x03)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Name (MUXS, "XHCC")
           }

           Device (PRT4)
           {
               Name (_ADR, 0x04)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Alias (SBV1, SDGV)
               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
               {
                   If (LEqual (Arg0, Buffer (0x10)
                           {
                               /* 0000 */   0x8F, 0x70, 0xFC, 0xA5, 0x75, 0x87, 0xA6, 0x4B,
                               /* 0008 */   0xBD, 0x0C, 0xBA, 0x90, 0xA1, 0xEC, 0x72, 0xF8
                           }))
                   {
                       Name (T_0, Zero)
                       Store (ToInteger (Arg2), T_0)
                       If (LEqual (T_0, Zero))
                       {
                           If (LEqual (Arg1, One))
                           {
                               Return (Buffer (One)
                               {
                                    0x07
                               })
                           }
                           Else
                           {
                               Return (Buffer (One)
                               {
                                    0x00
                               })
                           }
                       }
                       Else
                       {
                           If (LEqual (T_0, One))
                           {
                               If (LEqual (SDGV, 0xFF))
                               {
                                   Return (Zero)
                               }
                               Else
                               {
                                   Return (One)
                               }
                           }
                           Else
                           {
                               If (LEqual (T_0, 0x02))
                               {
                                   Return (SDGV)
                               }
                           }
                       }
                   }

                   Return (Zero)
               }
           }

           Device (PRT5)
           {
               Name (_ADR, 0x05)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xB1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Alias (SBV2, SDGV)
               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
               {
                   If (LEqual (Arg0, Buffer (0x10)
                           {
                               /* 0000 */   0x8F, 0x70, 0xFC, 0xA5, 0x75, 0x87, 0xA6, 0x4B,
                               /* 0008 */   0xBD, 0x0C, 0xBA, 0x90, 0xA1, 0xEC, 0x72, 0xF8
                           }))
                   {
                       Name (T_0, Zero)
                       Store (ToInteger (Arg2), T_0)
                       If (LEqual (T_0, Zero))
                       {
                           If (LEqual (Arg1, One))
                           {
                               Return (Buffer (One)
                               {
                                    0x07
                               })
                           }
                           Else
                           {
                               Return (Buffer (One)
                               {
                                    0x00
                               })
                           }
                       }
                       Else
                       {
                           If (LEqual (T_0, One))
                           {
                               If (LEqual (SDGV, 0xFF))
                               {
                                   Return (Zero)
                               }
                               Else
                               {
                                   Return (One)
                               }
                           }
                           Else
                           {
                               If (LEqual (T_0, 0x02))
                               {
                                   Return (SDGV)
                               }
                           }
                       }
                   }

                   Return (Zero)
               }
           }

           Device (PRT6)
           {
               Name (_ADR, 0x06)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xB1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Alias (SBV1, SDGV)
               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
               {
                   If (LEqual (Arg0, Buffer (0x10)
                           {
                               /* 0000 */   0x8F, 0x70, 0xFC, 0xA5, 0x75, 0x87, 0xA6, 0x4B,
                               /* 0008 */   0xBD, 0x0C, 0xBA, 0x90, 0xA1, 0xEC, 0x72, 0xF8
                           }))
                   {
                       Name (T_0, Zero)
                       Store (ToInteger (Arg2), T_0)
                       If (LEqual (T_0, Zero))
                       {
                           If (LEqual (Arg1, One))
                           {
                               Return (Buffer (One)
                               {
                                    0x07
                               })
                           }
                           Else
                           {
                               Return (Buffer (One)
                               {
                                    0x00
                               })
                           }
                       }
                       Else
                       {
                           If (LEqual (T_0, One))
                           {
                               If (LEqual (SDGV, 0xFF))
                               {
                                   Return (Zero)
                               }
                               Else
                               {
                                   Return (One)
                               }
                           }
                           Else
                           {
                               If (LEqual (T_0, 0x02))
                               {
                                   Return (SDGV)
                               }
                           }
                       }
                   }

                   Return (Zero)
               }
           }

           Device (PRT7)
           {
               Name (_ADR, 0x07)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xB1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Alias (SBV2, SDGV)
               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
               {
                   If (LEqual (Arg0, Buffer (0x10)
                           {
                               /* 0000 */   0x8F, 0x70, 0xFC, 0xA5, 0x75, 0x87, 0xA6, 0x4B,
                               /* 0008 */   0xBD, 0x0C, 0xBA, 0x90, 0xA1, 0xEC, 0x72, 0xF8
                           }))
                   {
                       Name (T_0, Zero)
                       Store (ToInteger (Arg2), T_0)
                       If (LEqual (T_0, Zero))
                       {
                           If (LEqual (Arg1, One))
                           {
                               Return (Buffer (One)
                               {
                                    0x07
                               })
                           }
                           Else
                           {
                               Return (Buffer (One)
                               {
                                    0x00
                               })
                           }
                       }
                       Else
                       {
                           If (LEqual (T_0, One))
                           {
                               If (LEqual (SDGV, 0xFF))
                               {
                                   Return (Zero)
                               }
                               Else
                               {
                                   Return (One)
                               }
                           }
                           Else
                           {
                               If (LEqual (T_0, 0x02))
                               {
                                   Return (SDGV)
                               }
                           }
                       }
                   }

                   Return (Zero)
               }
           }

           Device (PRT8)
           {
               Name (_ADR, 0x08)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xB1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Name (MUXS, "XHCD")
           }
       }
   }

   Method (MBSD, 0, NotSerialized)
   {
       Return (One)
   }

   Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
   {
       Return (GPRW (0x0D, 0x04))
   }

   Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
   {
       Store (Package (0x0B)
           {
               "AAPL,current-available", 
               0x0834, 
               "AAPL,current-extra", 
               0x0A8C, 
               "AAPL,current-extra-in-sleep", 
               0x0A8C, 
               "AAPL,max-port-current-in-sleep", 
               0x0834, 
               "AAPL,device-internal", 
               0x02, 
               Buffer (One)
               {
                    0x00
               }
           }, Local0)
       DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
       Return (Local0)
   }

   Method (XHCN, 0, NotSerialized)
   {
       Return (One)
   }
}

Device (EHC2)
{
   Name (_ADR, 0x001A0000)  // _ADR: Address
   Method (_S3D, 0, NotSerialized)  // _S3D: S3 Device State
   {
       Return (0x02)
   }

   Method (_S4D, 0, NotSerialized)  // _S4D: S4 Device State
   {
       Return (0x02)
   }

   Device (RHUB)
   {
       Name (_ADR, Zero)  // _ADR: Address
       Device (PRT1)
       {
           Name (_ADR, One)  // _ADR: Address
           Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
           {
               Name (UPCA, Package (0x04)
               {
                   0xFF, 
                   Zero, 
                   Zero, 
                   Zero
               })
               Return (UPCA)
           }

           Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
           {
               Name (PLDP, Package (0x01)
               {
                   Buffer (0x10)
                   {
                       /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                       /* 0008 */   0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                   }
               })
               Return (PLDP)
           }

           Device (PRT1)
           {
               Name (_ADR, One)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }
           }

           Device (PRT2)
           {
               Name (_ADR, 0x02)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Alias (SBV1, SDGV)
               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
               {
                   If (LEqual (Arg0, Buffer (0x10)
                           {
                               /* 0000 */   0x8F, 0x70, 0xFC, 0xA5, 0x75, 0x87, 0xA6, 0x4B,
                               /* 0008 */   0xBD, 0x0C, 0xBA, 0x90, 0xA1, 0xEC, 0x72, 0xF8
                           }))
                   {
                       Name (T_0, Zero)
                       Store (ToInteger (Arg2), T_0)
                       If (LEqual (T_0, Zero))
                       {
                           If (LEqual (Arg1, One))
                           {
                               Return (Buffer (One)
                               {
                                    0x07
                               })
                           }
                           Else
                           {
                               Return (Buffer (One)
                               {
                                    0x00
                               })
                           }
                       }
                       Else
                       {
                           If (LEqual (T_0, One))
                           {
                               If (LEqual (SDGV, 0xFF))
                               {
                                   Return (Zero)
                               }
                               Else
                               {
                                   Return (One)
                               }
                           }
                           Else
                           {
                               If (LEqual (T_0, 0x02))
                               {
                                   Return (SDGV)
                               }
                           }
                       }
                   }

                   Return (Zero)
               }
           }

           Device (PRT3)
           {
               Name (_ADR, 0x03)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }

               Alias (SBV2, SDGV)
               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
               {
                   If (LEqual (Arg0, Buffer (0x10)
                           {
                               /* 0000 */   0x8F, 0x70, 0xFC, 0xA5, 0x75, 0x87, 0xA6, 0x4B,
                               /* 0008 */   0xBD, 0x0C, 0xBA, 0x90, 0xA1, 0xEC, 0x72, 0xF8
                           }))
                   {
                       Name (T_0, Zero)
                       Store (ToInteger (Arg2), T_0)
                       If (LEqual (T_0, Zero))
                       {
                           If (LEqual (Arg1, One))
                           {
                               Return (Buffer (One)
                               {
                                    0x07
                               })
                           }
                           Else
                           {
                               Return (Buffer (One)
                               {
                                    0x00
                               })
                           }
                       }
                       Else
                       {
                           If (LEqual (T_0, One))
                           {
                               If (LEqual (SDGV, 0xFF))
                               {
                                   Return (Zero)
                               }
                               Else
                               {
                                   Return (One)
                               }
                           }
                           Else
                           {
                               If (LEqual (T_0, 0x02))
                               {
                                   Return (SDGV)
                               }
                           }
                       }
                   }

                   Return (Zero)
               }
           }

           Device (PRT4)
           {
               Name (_ADR, 0x04)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xE1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }
           }

           Device (PRT5)
           {
               Name (_ADR, 0x05)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xB1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }
           }

           Device (PRT6)
           {
               Name (_ADR, 0x06)  // _ADR: Address
               Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
               {
                   Name (UPCP, Package (0x04)
                   {
                       0xFF, 
                       0xFF, 
                       Zero, 
                       Zero
                   })
                   Return (UPCP)
               }

               Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
               {
                   Name (PLDP, Package (0x01)
                   {
                       Buffer (0x10)
                       {
                           /* 0000 */   0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                           /* 0008 */   0xB1, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }
                   })
                   Return (PLDP)
               }
           }
       }
   }

   Method (MBSD, 0, NotSerialized)
   {
       Return (One)
   }

   Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
   {
       Return (GPRW (0x0D, 0x04))
   }

   Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
   {
       Store (Package (0x0B)
           {
               "AAPL,current-available", 
               0x0834, 
               "AAPL,current-extra", 
               0x0A8C, 
               "AAPL,current-extra-in-sleep", 
               0x0A8C, 
               "AAPL,max-port-current-in-sleep", 
               0x0834, 
               "AAPL,device-internal", 
               0x02, 
               Buffer (One)
               {
                    0x00
               }
           }, Local0)
       DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
       Return (Local0)
   }

   Method (XHCN, 0, NotSerialized)
   {
       Return (One)
   }
}

Device (XHC1)
{
   Name (_ADR, 0x00140000)  // _ADR: Address
   OperationRegion (XPRT, PCI_Config, 0x74, 0x6C)
   Field (XPRT, DWordAcc, NoLock, Preserve)
   {
       Offset (0x01), 
       PMEE,   1, 
           ,   6, 
       PMES,   1, 
       Offset (0x5C)
   }

   OperationRegion (XH1C, PCI_Config, 0xD0, 0x10)
   Field (XH1C, ByteAcc, NoLock, Preserve)
   {
       PAHC,   1, 
       PBHC,   1, 
       PCHC,   1, 
       PDHC,   1, 
       Offset (0x08)
   }

   OperationRegion (XHC2, PCI_Config, 0x44, 0x04)
   Field (XHC2, ByteAcc, NoLock, Preserve)
   {
       Offset (0x01), 
       MIAI,   2
   }

   Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
   {
       Return (GPRW (0x0D, 0x04))
   }

   Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
   {
       Store (Package (0x0B)
           {
               "AAPL,current-available", 
               0x0834, 
               "AAPL,current-extra", 
               0x0A8C, 
               "AAPL,current-extra-in-sleep", 
               0x0A8C, 
               "AAPL,max-port-current-in-sleep", 
               0x0834, 
               "AAPL,device-internal", 
               Zero, 
               Buffer (One)
               {
                    0x00
               }
           }, Local0)
       DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
       Return (Local0)
   }

   Method (XHCA, 0, NotSerialized)
   {
       Store (One, PAHC)
   }

   Method (XHCB, 0, NotSerialized)
   {
       Store (One, PBHC)
   }

   Method (XHCC, 0, NotSerialized)
   {
       Store (One, PCHC)
   }

   Method (XHCD, 0, NotSerialized)
   {
       Store (One, PDHC)
   }

   Method (EHCA, 0, NotSerialized)
   {
       Store (Zero, PAHC)
   }

   Method (EHCB, 0, NotSerialized)
   {
       Store (Zero, PBHC)
   }

   Method (EHCC, 0, NotSerialized)
   {
       Store (Zero, PCHC)
   }

   Method (EHCD, 0, NotSerialized)
   {
       Store (Zero, PDHC)
   }

   Method (_INI, 0, NotSerialized)  // _INI: Initialize
   {
       Store (Zero, MIAI)
   }

   Device (RHUB)
   {
       Name (_ADR, Zero)  // _ADR: Address
       Device (PRT1)
       {
           Name (_ADR, One)  // _ADR: Address
           Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
           {
               Name (UPCP, Package (0x04)
               {
                   0xFF, 
                   0x03, 
                   Zero, 
                   Zero
               })
               Return (UPCP)
           }

           Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
           {
               Name (PLDP, Package (0x01)
               {
                   Buffer (0x10)
                   {
                       /* 0000 */   0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
                       /* 0008 */   0x69, 0x0C, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
                   }
               })
               Return (PLDP)
           }

           Name (MUXS, "EHCA")
       }

       Device (PRT2)
       {
           Name (_ADR, 0x02)  // _ADR: Address
           Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
           {
               Name (UPCP, Package (0x04)
               {
                   0xFF, 
                   0x03, 
                   Zero, 
                   Zero
               })
               Return (UPCP)
           }

           Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
           {
               Name (PLDP, Package (0x01)
               {
                   Buffer (0x10)
                   {
                       /* 0000 */   0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
                       /* 0008 */   0x69, 0x0C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
                   }
               })
               Return (PLDP)
           }

           Name (MUXS, "EHCB")
       }

       Device (PRT3)
       {
           Name (_ADR, 0x03)  // _ADR: Address
           Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
           {
               Name (UPCP, Package (0x04)
               {
                   0xFF, 
                   0x03, 
                   Zero, 
                   Zero
               })
               Return (UPCP)
           }

           Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
           {
               Name (PLDP, Package (0x01)
               {
                   Buffer (0x10)
                   {
                       /* 0000 */   0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
                       /* 0008 */   0x69, 0x0C, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00
                   }
               })
               Return (PLDP)
           }

           Name (MUXS, "EHCC")
       }

       Device (PRT4)
       {
           Name (_ADR, 0x04)  // _ADR: Address
           Method (_UPC, 0, Serialized)  // _UPC: USB Port Capabilities
           {
               Name (UPCP, Package (0x04)
               {
                   0xFF, 
                   0x03, 
                   Zero, 
                   Zero
               })
               Return (UPCP)
           }

           Method (_PLD, 0, Serialized)  // _PLD: Physical Location of Device
           {
               Name (PLDP, Package (0x01)
               {
                   Buffer (0x10)
                   {
                       /* 0000 */   0x01, 0xC6, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
                       /* 0008 */   0x69, 0x0C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
                   }
               })
               Return (PLDP)
           }

           Name (MUXS, "EHCD")
       }
   }

   Method (MBSD, 0, NotSerialized)
   {
       Return (One)
   }
}

 

 

Edited by k3nny
  • Like 1
Link to comment
Share on other sites

Thanks to Mieze first of all for the idea and to giacomoleopardo for taking the time to explain it in detail.

For me this modification enabled backwards compatibility for USB3 ports which was not working before.

 

I would like to propose a small optimization which includes removing unnecessary conditions. I also believe you should not set OSYS to 0x2710 as it will render some code unusable which is otherwise accessed when OSYS is 0x07D0 or similar.

 

With that in mind, we just need to use the code inside OSDW() and delete the rest of the confition. This will shorten the EHC# and XHC# methods and eliminate the need for the OSDW() method to be created at all.

 

I also noticed that the code for devices EHC1, EHC2 and XHC is identical for Z77 boards, at least for the ones I had a look at - including Asus, ASRock and MSI.

 

Here is the result I came up with for these three devices:

 

Hi k3nny, thanks for reply!

I wrote this thread to reach common and non-expert users (as I am!). Your optimization seems to be interesting, but I'm asking you to explain better why and what you did this, I know sometimes that could be a hard request, and also pretty annoying, but that's the spirit of this community, and I'm shure a lot of people can benefit from this thread.

TIA

g.

  • Like 1
Link to comment
Share on other sites

Hi, Giacomo!

 

First, great job and thank you for assembling this tutorial!

 

Second, i tried to follow your steps to no avail. The reason is my DSDT (already patched for Intel HD4000 HDMI audio and two extra GPUs) simply doesn't have the blocks and lines that must be found and replaced, despite some of the devices referred (such as XHC@14) do appear in the IOReg tree, under PCI0. H77 user here, so i wonder if your guide is not better suited for Z77 motherboards.

 

On the other hand, DSDT Editor refuses to even compile the DSDT if i add manually the patches i can (not as outputting errors, but doing nothing), so i'll double check if my DSDT Editor wasn't broken by 10.8.3 somehow. Hope i can find something, because this seems to open a possibility to get backwards compatibility for my USB 3.0 ports (USB 3.0 are properly recognized and work as should) without resorting to a non-vanilla kext.

 

All the best!

Link to comment
Share on other sites

Hi, Giacomo!

 

First, great job and thank you for assembling this tutorial!

 

Second, i tried to follow your steps to no avail. The reason is my DSDT (already patched for Intel HD4000 HDMI audio and two extra GPUs) simply doesn't have the blocks and lines that must be found and replaced, despite some of the devices referred (such as XHC@14) do appear in the IOReg tree, under PCI0. H77 user here, so i wonder if your guide is not better suited for Z77 motherboards.

 

On the other hand, DSDT Editor refuses to even compile the DSDT if i add manually the patches i can (not as outputting errors, but doing nothing), so i'll double check if my DSDT Editor wasn't broken by 10.8.3 somehow. Hope i can find something, because this seems to open a possibility to get backwards compatibility for my USB 3.0 ports (USB 3.0 are properly recognized and work as should) without resorting to a non-vanilla kext.

 

All the best!

 

Hi theconnactic,

to be honest I've never tried this method on H77 chipset. Help me to help you: are you talking about iHACK Workstation that I see in your signature? If not, please post your config and anyhow also post your ioreg, DSDT that you're using and a virgin DSDT (I guess you know how to extract ;-)). It would be helpful know "the story" of your DSDT, I mean: what patches did you apply?

  • Like 1
Link to comment
Share on other sites

Hi, Giacomo!

 

Yes, the iHack workstation. :) Will do. Give me only a couple of minutes to assemble and upload all this.

 

All the best!

 

P.S.: I applied the patches recommended by Rampage and Toleda here: http://www.insanelym...-the-same-time/ and patches for HD4000 HDMI audio for Mountain Lion (also by Toleda, but i won't link Voldemort's castle here, hehe).

 

Here's my current DSDT: DSDT.aml.zip

 

And a IOReg: local.ioreg.zip

 

My motherboard, as stated in the signature, is a Gigabyte H77-DS3H, which has two USB 2.0 ports (front) and 4 USB 2.0 and 2 USB 3.0 (back).

 

All the best!

Link to comment
Share on other sites

Well well well, i had to boot in Windows7 to extract my virgin DSDT, since Snow Leopard was sharing the config.plist of Mountain Lion for some reason that i have no patience to figure out right now. I just found out that the DSDT extracted from Windows has some differences to the one i first extracted on OSX (or, perhaps, DSDT Editor is not working quite well under 10.8.3 - who knows?). Take a look, how odd:

 

 

DSDT.zip

 

All the best!

Link to comment
Share on other sites

Theconnactic, try this:

DSDT virgin compiled as above stated plus a little modification for long sleep (I saw in your thread you have troubles)

If it works (everything, not just usb 3.0 backwards) we'll discuss about it, so that everybody can see, if you don't mind

 

EDIT: Try this dsdt with original 10.8.3 AppleACPIPlatform.kext, not the rollback one! If you don't have it anymore, I'll attach.

DSDT.aml.zip

  • Like 1
Link to comment
Share on other sites

I thought I would give this a shot to get my USB2 devices to be recognized when plugged into a USB3 port, but it does not work for me. I have attached my DSDT which I compiled and patched for Audio and Graphics. I tried Toleda's patch for HDMI, but DSDTEditor hangs everytime I click on patch. At5 this point, HDMI for my ASUS 6850 is not working. I used the edits as above and received no compile errors, just a warning. Please could you look at what I have compiled and let me know if I have missed something?

DSDT.aml.zip

Link to comment
Share on other sites

UPDATE: just tested it, no loss of previous functionalities i already had: connected my DVI monitor in all cards, all working. HDMI audio and internal audio still there. USB 3.0 ports showing up like before, and working with USB 3.0 devices, and with USB mouse and keyboard like before. Didn't test sleep yet (will do), but tested compatibility of the USB ports with USB 2.0 storage devices: unfortunately still the same, they don't work at all.

 

Here's another IOReg. I noticed now that a "USB 2.0 simulator" appears under the XHC tree: local.ioreg.zip

 

All the best!

 

UPDATE 2: just tested sleep, indeed your DSDT solved the slow wake issue (sometimes 5+ minutes to wake), so thank you very much for that!

  • Like 1
Link to comment
Share on other sites

I thought I would give this a shot to get my USB2 devices to be recognized when plugged into a USB3 port, but it does not work for me. I have attached my DSDT which I compiled and patched for Audio and Graphics. I tried Toleda's patch for HDMI, but DSDTEditor hangs everytime I click on patch. At5 this point, HDMI for my ASUS 6850 is not working. I used the edits as above and received no compile errors, just a warning. Please could you look at what I have compiled and let me know if I have missed something?

Hi Subxero, please post a virgin DSDT.aml of your system, a copy of your ioreg and the specs of your system. Since I'm not a dsdt guru, my contribute could be just compiling from scratch a virgin dsdt.

Link to comment
Share on other sites

Reporting from a Mieze's e-mail:

 

It's definitely not the chipset that is causing the trouble. The patch is compatible with all 7 series chipsets and has been verified to work on a number of mainboards from Asus, Asrock, MSI and Intel but I don't remember anyone who tried it with a Gigabyte board. As far as I know Gigabyte's BIOS has some USB 3.0 related settings. Maybe playing with those might help because I can't rule out that there is any interference between the BIOS and OS X with regard to the XHCI controller?

Second, mrengles found out that the patch doesn't work with system definition iMac12,1 and iMac12,2 while Macmini5,1, Macpro3,1 and all the system definitions of Ivy Bridge Macs are fine. I would recommend to add this information to the tutorial.

 

So, guys, let's double check BIOS settings and SysDef!

Please report results!

Thanks to everybody!

  • Like 1
Link to comment
Share on other sites

Reporting from a Mieze's e-mail:

 

It's definitely not the chipset that is causing the trouble. The patch is compatible with all 7 series chipsets and has been verified to work on a number of mainboards from Asus, Asrock, MSI and Intel but I don't remember anyone who tried it with a Gigabyte board. As far as I know Gigabyte's BIOS has some USB 3.0 related settings. Maybe playing with those might help because I can't rule out that there is any interference between the BIOS and OS X with regard to the XHCI controller?[/size]

Second, mrengles found out that the patch doesn't work with system definition iMac12,1 and iMac12,2 while Macmini5,1, Macpro3,1 and all the system definitions of Ivy Bridge Macs are fine. I would recommend to add this information to the tutorial.

 

So, guys, let's double check BIOS settings and SysDef!

Please report results!

Thanks to everybody!

 

I will try what is mentioned here since I have a Gigabyte B75M D3P m/board and am using 12,2 SMBios. Attaching my Virgin DSDT & IOReg anyway.

Archive.zip

Link to comment
Share on other sites

 Share

×
×
  • Create New...