Help - Search - Members - Calendar
Full Version: DSDT: trick retail drivers by changing "device-id" (e.g USB)
InsanelyMac Forum > OSx86 Project > Tutorials (The Genius Bar)
Pages: 1, 2, 3, 4, 5, 6
zhell
Patch DSDT to Enable Apple Drivers for non-Apple Hardware

Some KEXTs use the "device-id" of devices attached to the PCI bus to decide (i) whether to start and (ii) to tweak their behavior depending on the specific device.
This allows some but far from all KEXTs to be tricked into believing that you have hardware that is used by Apple and thus enjoying support from Apple's drivers.

In this tutorial, I will show how to get boards with USB from the Intel ICH9/-R chip (Intel P35 chipset) to sleep properly by leading the USB KEXTs into believing that it is actually an ICH10-R, which is used in the MacPro4,1. [bThis fix requires Mac OS X 10.5.7.[/b]
Note: Automatic sleep after an idle period is not enabled by this fix. This problem is not necessarily even related to USB but might be caused by your DVD drive.

If your computer goes to sleep properly (i.e. all disks and fans completely switched off) but has trouble waking up, this fix may unfortunately not help.

If you have Mac OS X 10.5.5 or earlier, the fix won't change anything. Using it with Mac OS X 10.5.6 is not recommended.
If your computer has an ICH9/-R and can only sleep with slice's USB kexts, this fix should allow you to get sleep with the stock USB drivers from 10.5.7.
What the fix does is it lets the USB kext "recognize" the UHCI devices and enables the proper work-arounds for their quirks (see the "Errata" property of "AppleUSBUHCI" devices in IORegistryExplorer: if it is 0x0, the driver has probably not recognized the device).
To understand what is going on, you may want to install the USB Debug Kit from Apple. Using the supplied KEXTs, you will see at boot that the device is not supported and therefore power manangement is turned off. This results in the well-known behavior of the computer going to sleep only half-way and then requiring a hard reset to get back to life.

Thanks to CycloneFr and THe KiNG for beta testing!

Note: You are using this at your own risk. Tricking drivers into believing the hardware is something it isn't may seriously damage your computer.
The fix itself is quite simple for DSDT standards. However, I assume you are fairly experienced modding the DSDT. Otherwise, you should get your feet wet with some other tutorial.
Using the widely-used patch method "DTGP", we will add a property "device-id" to the UHCI devices in the DSDT. This property will be chosen to match that of the corresponding devices of the ICH10-R used in MacPro4,1.

Note: Do not set the model of your machine to MacPro4,1, as this will cause a kernel panic with 10.5.7. Just set it to MacPro3,1 or leave it at whatever you have used before.

Method DTGP
Ensure you have method DTGP defined somewhere in your DSDT.dsl. You might want to use the DSDT patcher to insert this method by applying one of its many fixes. This tutorial does not cover this. The end result is that you need to have the following code in the right place:
CODE

Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}

If (LEqual (Arg2, One))
{
Return (One)
}
}
}

Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}

Once you are done with this step and your DSDT.dsl still compiles without errors and warnings (or at least not more than before you touched it), you may proceed identifying the devices we will patch.

Identifying Your UHCI Devices
The UHCI devices may be called anything. However, we can identify them based on their addresses, which are given by the line that begins with "Name (_ADR, 0x...). My second UHCI device, called "UHC2", begins like this:
CODE
      Device (UHC2)
      {
        Name (_ADR, 0x001D0001)
      ...

From this value "0x001D0001", you may strip leading zeroes of every block of four figures and obtain "1D,1", which then corresponds to the addresses shown in IORegistryExplorer to the right of the "@" sign, such as "UHC2@1D,1". (IORegistryExplorer is part of XCode Tools, download from developer.apple.com). Limit the view by searching for "UHCI" and you should see something like this:
Click to view attachment

This way, you should be able to spot the six UHCI devices. Note that there may be more devices in the DSDT that look like UHCI devices (often there are seven), but only six are shown in IORegistryExplorer. Those are the ones we are going to patch.

The corresponding lines from "lspci" are:
CODE
00:1d.0 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family)
  USB UHCI Controller #1 [8086:2934] (rev 03)
00:1d.1 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family)
  USB UHCI Controller #2 [8086:2935] (rev 03)
00:1d.2 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family)
  USB UHCI Controller #3 [8086:2936] (rev 03)
00:1a.0 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family)
  USB UHCI Controller #4 [8086:2937] (rev 03)
00:1a.1 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family)
  USB UHCI Controller #5 [8086:2938] (rev 03)
00:1a.2 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family)
  USB UHCI Controller #6 [8086:2939] (rev 03)

In the second pair of brackets, you can see the PCI vendor id (8086 for Intel) and the device-id (2934..2939).
For the ICH9/-R, devices UHCI 1...UHCI 6 have the following addresses and device IDs:
CODE
UHCI 1: 1D    2934
UHCI 2: 1D,1  2935
UHCI 3: 1D,2  2936
UHCI 4: 1A    2937
UHCI 5: 1A,1  2938
UHCI 6: 1A,2  2939

Do not change the names of your devices as the DSDT won't compile anymore if you do.
Only proceed to patching if the addresses of all six UHCI devices match exactly.

Patching the "device-id" of the UHCI Devices
Now, we just add a call to the DTGP method by inserting a few lines of code into every single one of the 6 UHCI devices. The arguments we pass are "device-id", which is the property we want to patch, and then a four-byte buffer that contains the value to assign to the "device-id" property. These buffers are written "back-wards", i.e. the device-id for the UHC2 device of the ICH10-R, which is "3a35", is written as "0x35, 0x3A, 0x00, 0x00"
The code to add to the UHC2 device is:
CODE

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x35, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

The device-ids for the six UHCI devices on the ICH10-R are:
CODE
UHCI 1: 1D    3a34
UHCI 2: 1D,1  3a35
UHCI 3: 1D,2  3a36
UHCI 4: 1A    3a37
UHCI 5: 1A,1  3a38
UHCI 6: 1A,2  3a39

The end result of the UHCI devices should look as follows:
CODE

Device (UHC1)
{
Name (_ADR, 0x001D0000)
[...]

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x34, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (UHC2)
{
Name (_ADR, 0x001D0001)
[...]

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x35, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (UHC3)
{
Name (_ADR, 0x001D0002)
[...]

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x36, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (UHC4)
{
Name (_ADR, 0x001A0000)
[...]

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x37, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (UHC5)
{
Name (_ADR, 0x001A0001)
[...]

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x38, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (UHC6)
{
Name (_ADR, 0x001A0002)
[...]

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x39, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Have fun patching.

Verifying the Reliability of Sleep
You need to be aware that if your machine has never slept before, you may encounter surprises when using sleep now that it works. In order to be able to attribute any issues you may experience to sleep, I strongly recommend a thorough burn-in procedure.

First, unplug all USB devices that you do not need, in particular any storage devices.
Then, in all the applications you typically use, open a few documents and leave them open.

Now put the machine to sleep at least a hundred times and wake it up afterwards.

This sounds like a big hassle, but if you have a second computer that is capable of doing all the work, it's not that bad. Using the PHP script below allows you to remotely sleep and wake up your machine any number of times without human intervention.
Click to view attachment

You need to edit the variables "$target", "$hwaddr" and "$login". Run the script with one argument, e.g.
CODE
/path/to/sleep-wake.php 100
will sleep and wake up your machine 100 times.
Note that for wake-up to work, UDP port 9 must be open. For sleep to work, SSH needs to be enabled and you need a public key installed on the target in order to allow automatic login. How to achieve this is outside the scope of this tutorial.
kizwan
Very interesting. smile.gif Do you know any other Intel chipset that supported by (10.5.7) vanilla kext? I have ICH7 chipset, maybe I can try this trick to get sleep working.

kizwan
zhell
QUOTE (kizwan @ May 26 2009, 05:33 PM) *
Very interesting. smile.gif Do you know any other Intel chipset that supported by (10.5.7) vanilla kext? I have ICH7 chipset, maybe I can try this trick to get sleep working.

Thanks for your interest.
Are you sure the problem of your board is related to USB? ICH7 is supported by Apple's drivers. It could be that your chip has different device-ids, though. To check this, just verify that the "Errata" value is 0x0 in IORegistryExplorer, which indicates that the chip was not recognized.
The device-ids that Apple uses for ICH7 are 27C8-27CC. For ICH8, the device-ids are 2830-2835.
Master Chief
Okay... so first we had a patched kext (IOUSBFamily.kext) and now this. Seems like time for EFI strings and a plist only kext. I mean two out of four is better than nothing, but not everyone want to use this – especially for people new to DSTD compiling. Nice work BTW wink.gif

Oh, and what about reboot and shutdown? Do they also work?

Have you tried to set the "Card Type" to "Built-in" and "Errata" to say 0xe800? I mean instead of changing the device id's...
BlackCH
Looks good!
I tryed it on a P5K-VM (ICH9). It goes to sleep but it wakes up right after and then USB keyboard/mouse must be re-pluged to be working again.... 10.5.7 stock kernel/stock USB kexts
Master Chief
QUOTE (BlackCH @ May 26 2009, 07:42 PM) *
Looks good!
I tryed it on a P5K-VM (ICH9). It goes to sleep but it wakes up right after and then USB keyboard/mouse must be re-pluged to be working again.... 10.5.7 stock kernel/stock USB kexts

Interesting, I mean I usually have to repair my permissions when that happens.

p.s. I am working on a new EFI string, and I'm almost done (will finish this after the coffee break).
zhell
QUOTE (Master Chief @ May 26 2009, 06:46 PM) *
Okay... so first we had a patched kext (IOUSBFamily.kext) and now this.

Yes; patched KEXTs do not seem to work for Intel boards (kernel panic or no change to vanilla).
QUOTE
Seems like time for EFI strings and a plist only kext.

EFI strings should work, but plist-only KEXT cannot help here because the device-ids are hard-coded in the source code of IOUSFamily.kext
QUOTE
I mean two out of four is better than nothing, but not everyone want to use this – especially for people new to DSTD compiling.

That's for sure. People should post their fixed DSDT.aml files here :-)

QUOTE
Nice work BTW wink.gif

Oh, and what about reboot and shutdown? Do they also work?

With the DP35DP, this has always worked thanks to OpenHaltRestart.kext.
QUOTE
Have you tried to set the "Card Type" to "Built-in" and "Errata" to say 0xe800? I mean instead of changing the device id's...

No, I have not tried this. But from the source code, it looks like it would not work. What slice does is: he copies the code that matches on the ICH8 device-ids and replaces the device-id with that of ICH9 (among a few other things, like getting the code to actually compile).
Hence, I would say setting these properties would rather not have an effect.
downlord
Looks very promising. Will have a try ASA I upgrade to 10.5.7
Sleep never worked here but shutdown/restart works 100% with openhalrestart or superhai's voodoopower.
Thanks for your work and the good explanation of the phenomenon.
zhell
QUOTE (BlackCH @ May 26 2009, 07:42 PM) *
Looks good!
I tryed it on a P5K-VM (ICH9). It goes to sleep but it wakes up right after and then USB keyboard/mouse must be re-pluged to be working again.... 10.5.7 stock kernel/stock USB kexts
Hmm, this "immediate restart thing" is well known behavior for some boards; I have never experienced this myself, though.
Could be that it is fixed by enabling "Restart automatically after power failure". This option should be present in the "Energy Saver" preferences pane. Otherwise, "man pmset" should help as well.
coconup
indeed I solved every sleep issue related to usb by brutally deleting all the usb devices in my dsdt. now they are recognized as 'external slot' instead of 'built in' but everything works including sleep smile.gif
kulos
Hi

Tried your method on my GA-EP35-DS4. It didn't solve my problem, which is failure to enter automatic sleep ("manual sleep" works fine even without your DSDT fix)

I reinstalled OSX before upgrading to 10.5.7. The old 10.5.6 install went into automatic sleep without issues. After installation of 10.5.7 it never worked again. Any clue??

I get these messages when starting up:
USBF: 0.348 AppleUSBOHCI[0x61d5000]::CheckSleepCapability - controller will be unloaded across sleep
USBF: 0.348 AppleUSBOHCI[0x61e0800]::CheckSleepCapability - controller will be unloaded across sleep

Only USB devices are a Logitech G5 laser mouse and a cheap USB logitech keyboard (both same as before 10.5.7)


Setup:
Install by boot-132 from retail DVD.

Chameleon 2RC1 (into EFI partition)

/Extra/ (EFI partition)
boot.plist (EFI string for 8800GTX)
smbios.plist
DSDT.aml
mkext
(AppleDecrypt.kext
Disabler.kext
AHCIPortInjector.kext
IOAHCIBlockStorageInjector.kext
ATAPortInjector.kext
OpenHaltRestart.kext)


/S/L/E/
R1000.kext
AppleHDA.kext patched

Some help/thoughts/ideas would be highly appreciated!

kulos
Master Chief
QUOTE (zhell @ May 26 2009, 08:54 PM) *
...EFI strings should work, but plist-only KEXT cannot help here because the device-ids are hard-coded in the source code of IOUSFamily.kext


I already have it working – seems like we all (you, slice me and that other guys, what's his name pcb355?) are all working on the same thing
Master Chief
QUOTE (kulos @ May 27 2009, 02:35 AM) *
Hi

Tried your method on my GA-EP35-DS4. It didn't solve my problem, which is failure to enter automatic sleep ("manual sleep" works fine even without your DSDT fix)

I reinstalled OSX before upgrading to 10.5.7. The old 10.5.6 install went into automatic sleep without issues. After installation of 10.5.7 it never worked again. Any clue??


Same here (no auto sleep) – there appears to be some sort of activity on my DVD drive, every 40 seconds or so, and that after it should sleep!

Edit: I just noticed that inserting a DVD makes automatic sleep work – let's go do some hunting.
sama7896
Any chance this can be applied to a atheros 5006 wifi card?
I can't try because i don't have (any) experience on tweaking dsdt
kulos
QUOTE (Master Chief @ May 27 2009, 03:32 AM) *
Same here (no auto sleep) – there appears to be some sort of activity on my DVD drive, every 40 seconds or so, and that after it should sleep!


Have the same experience!
zhell
QUOTE (coconup @ May 26 2009, 10:26 PM) *
indeed I solved every sleep issue related to usb by brutally deleting all the usb devices in my dsdt. now they are recognized as 'external slot' instead of 'built in' but everything works including sleep smile.gif

Wow, that's an interesting approach. Great to hear it works for you. Congratulations on your out-of-the-box thinking smile.gif
Aranius
Could hthis possibly be working with ICH9M Chipsets by Notebooks?

Another thing: I need an plist-only kext for my Yukon2 Ethernet, can this be solved in the dsdt too?

Thanks in advance,
Aranius
zhell
QUOTE (Aranius @ May 27 2009, 10:53 AM) *
Could hthis possibly be working with ICH9M Chipsets by Notebooks?

Another thing: I need an plist-only kext for my Yukon2 Ethernet, can this be solved in the dsdt too?

It could work with ICH9M, but you would need to find out the addresses of the UHCI devices on your own. Further, there would no longer be a 1:1 correspondence to the ICH10-R devices because ICH9M likely has fewer UHCI devices than ICH9/-R.

Regarding the Yukon2 driver, I have no experience. You could certainly give it a try and report about it here. I'm sure other users of the plist-only kext would be interested to know.
BlackCH
QUOTE (Aranius @ May 27 2009, 09:53 AM) *
Another thing: I need an plist-only kext for my Yukon2 Ethernet, can this be solved in the dsdt too?


I've tried inserting the ID from the yukon 8055 (to fake my 8056) on my DSDT but even though DPCIManager is reading it OK, in the Network prefpane the device is recognized as a Serial Port device (modem) instead of ethernet adapter, and it does not work. But maybe is possible to get it working with more tweaking
zhell
QUOTE (BlackCH @ May 27 2009, 04:06 PM) *
I've tried inserting the ID from the yukon 8055 (to fake my 8056) on my DSDT but even though DPCIManager is reading it OK, in the Network prefpane the device is recognized as a Serial Port device (modem) instead of ethernet adapter, and it does not work. But maybe is possible to get it working with more tweaking

Thanks for reporting. This seems rather strange to me. What do you see in IORegistryExplorer as compared to when you use the plist-only KEXT?

However, changing device-ids in DSDT does not keep the driver from asking the device itself for its device-id via the PCIE bus.
BlackCH
With the modded plist (inserted 8056 id):
Click to view attachment

With the DSDT:
Click to view attachment

As you can see in the last shot there is no kext attached to the device. This time I also removed the 8056 ID from the plist and the device wasnt seen at all on the Network prefpane.
Master Chief
I seem to be using the same network adapter (built-in) but without the "AAPL,slot-name", "acpi-device" and "acpi-path" properties showing up in the IORegistryExplorer, and thus now I wonder what you did to get these?!? Are these part of your modified Info.plist?
CPT_MAC
Hi,
same problem no automatic sleep. But since I used slice's kext systems does wake up by USB keyboard. Good improvement!

I am not an expert, but during boot in -v mode I can see a lot of, missing... not found...can't read....and so on

In my case, the CPU Intel 7200 is not recogniced correct the ram speed not correct as well.

Modelname: Mac Serialnumber: SOMESRLNMBR

Something like Intel cpupowermanagment...... not found. If it helps, I can take pictures during boot and post.

One more thing, my timemachine was not working. After installing IOnetworking fix, time machine works for backup, but when I open the backup by the timemachine icon in dock, one screen goes black and on the main screen I have two open windows in finder showing the desktop.

Also my logitch quickcam 4000pro does not work. It worked before on other hackintosh. Anyhow for testing I disconnected all USB devices except the wireless USB Keyboard.

just some thoughts
BlackCH
QUOTE (Master Chief @ May 27 2009, 06:45 PM) *
I seem to be using the same network adapter (built-in) but without the "AAPL,slot-name", "acpi-device" and "acpi-path" properties showing up in the IORegistryExplorer, and thus now I wonder what you did to get these?!? Are these part of your modified Info.plist?


Those parameters are injected via custom DSDT table. Also all devices names has been modified to match a macpro DSDT.
Furthermore I have injected the necessary data for my 7600GT to work OOTB without NVkush, NVInject, or any other extra kext.
DSDT has a lot of posibilities

Nevertheless device ID injection for this network adapter (or any) doesnt seem to work.
kizwan
QUOTE (zhell @ May 27 2009, 12:19 AM) *
Thanks for your interest.
Are you sure the problem of your board is related to USB? ICH7 is supported by Apple's drivers. It could be that your chip has different device-ids, though. To check this, just verify that the "Errata" value is 0x0 in IORegistryExplorer, which indicates that the chip was not recognized.
The device-ids that Apple uses for ICH7 are 27C8-27CC. For ICH8, the device-ids are 2830-2835.

You're right, my ICH7 was supported; device-ids 27C8-27CB (UHCI - Errata 0xe800) & 27CC (EHCI - Errata 0x5800). It only able to hibernate (mode 5) not sleep because USB will cause it to wake immediately.

There is one USB device not listed or recognized in OS X. Attached to it is built-in bluetooth device & I unable to turn it on since the button handle it not functioning in OS X.

kizwan
rx782p
Unfortunately the issue of my USB was not able to be settle by this method.
but it was useful about an SATA device.

8086:3a02 82801JD/DO (ICH10 Family) SATA AHCI Controller (My borad)
8086:3a22 82801JI (ICH10 Family) SATA AHCI Controller (Machintosh)

CODE
        Device (SAT0)
            {
                Name (_ADR, 0x001F0002)
                ....


                 Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x02)
                        {
                            "device-id",
                            Buffer (0x04)
                            {
                                0x22, 0x3A, 0x00, 0x00
                            }
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                Return (Local0)
                }
            }

No Modified DSDT
Click to view attachment

Modified DSDT(Device ID)
Click to view attachment
Click to view attachment

Yes! I am not necessary with LegacyAppleAHCIPort.kext after adding device ID to DSDT.

Thanks zhell, it's a nice trick.
Sorry for my poor English.
zhell
QUOTE (rx782p @ May 28 2009, 08:28 AM) *
Unfortunately the issue of my USB was not able to be settle by this method.
but it was useful about an SATA device.

Great to hear that you put it to good use! And thanks for sharing your method.
I have tried to "sell" my ICH9-R as an ICH10 with 10.5.6, but it did not work, so I still needed the legacy AHCI kext. I will give it another try with 10.5.7.

What is the issue with your USB? Is it sleep-related, or something else?
Master Chief
QUOTE (BlackCH @ May 27 2009, 09:54 PM) *
Those parameters are injected via custom DSDT table. Also all devices names has been modified to match a macpro DSDT.

Right. I should have know that, being a MacPro user myself (see sig).
QUOTE (BlackCH @ May 27 2009, 09:54 PM) *
Furthermore I have injected the necessary data for my 7600GT to work OOTB without NVkush, NVInject, or any other extra kext. DSDT has a lot of posibilities

Cool. I however used EFI Studio to inject my 8600GT data – it was just a click on a button. I do wonder how / what you've done to get that working – it might be available via search, but I haven't checked it yet.

BTW: We might need DSDT patching to get Snow Leopard (10.6.0) going, and thus I re-generated my dsdt.aml yesterday evening, after reading this. I'll start researching DSDT in combination with OS X later today – I already use it for my good old notebook running Ubuntu. Thanks wink.gif

QUOTE (zhell @ May 28 2009, 09:24 AM) *
I have tried to "sell" my ICH9-R as an ICH10 with 10.5.6, but it did not work, so I still needed the legacy AHCI kext. I will give it another try with 10.5.7.

I might be wrong (haven't checked) but wasn't ICH10 support added in 10.5.7? Nah, I just checked (diff) and it was there already in IOUSBFamily-327.4.0
zhell
QUOTE (Master Chief @ May 28 2009, 09:45 AM) *
Right. I should have know that, being a MacPro user myself (see sig).

Cool. I however used EFI Studio to inject my 8600GT data – it was just a click on a button. I do wonder how /what you've done to get that working – it might be available via search, but I haven't checked it yet.

BTW: We might need DSDT patching to get Snow Leopard (10.6.0) going, and thus I re-generated my dsdt.aml yesterday evening, after reading this. I'll start researching DSDT in combination with OS X later today – I already use it for my good old notebook running Ubuntu. Thanks wink.gif


I might be wrong (haven't checked) but wasn't ICH10 support added in 10.5.7?

Slightly off-topic, but here's the entry I use for my 8600 GT/512MB.
CODE

Device (GFX0)
{
Name (_ADR, Zero)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x18)
{
"@0,compatible",
Buffer (0x0B)
{
"NVDA,NVMac"
},

"@0,device_type",
Buffer (0x08)
{
"display"
},

"@0,name",
Buffer (0x0F)
{
"NVDA,Display-A"
},

"@1,compatible",
Buffer (0x0B)
{
"NVDA,NVMac"
},

"@1,device_type",
Buffer (0x08)
{
"display"
},

"@1,name",
Buffer (0x0F)
{
"NVDA,Display-B"
},

"NVCAP",
Buffer (0x18)
{
/* 0000 */ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
/* 0008 */ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
/* 0010 */ 0x00, 0x00, 0x00, 0x00
},

"NVPM",
Buffer (0x1C)
{
/* 0000 */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 0018 */ 0x00, 0x00, 0x00, 0x00
},

"VRAM,totalsize",
Buffer (0x04)
{
0x00, 0x00, 0x00, 0x20
},

"device_type",
Buffer (0x0C)
{
"NVDA,Parent"
},

"model",
Buffer (0x17)
{
"nVidia GeForce 8600 GT"
},

"rom-revision",
Buffer (0x25)
{
"nVidia GeForce 8600 GT OpenGL Engine"
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
kizwan
Hi zhell,

Sorry, another slightly off-topic. I have to put dsdt code for GeForce Go 7300 in VGA procedure/function instead GFX0 because it is what stated in IORegistryExplorer when I use injector (NVinject.kext). Where did you get the value for "NVPM"? Was it for power management? If it is possible I want to eliminate problem where display failed to wake up after display goes to sleep.

kizwan
zhell
QUOTE (kizwan @ May 28 2009, 12:14 PM) *
Sorry, another slightly off-topic. I have to put dsdt code for GeForce Go 7300 in VGA procedure/function instead GFX0 because it is what stated in IORegistryExplorer when I use injector (NVinject.kext). Where did you get the value for "NVPM"? Was it for power management? If it is possible I want to eliminate problem where display failed to wake up after display goes to sleep.

I'm sorry but I'm unable to answer to this question as I have just copy-pasted the entry for my card from someone else's DSDT. I think you should be able to find some help or maybe even the DSDT entry for your card. What needs to be inserted is more or less what EFIStudio produces, just in the language of DSDT.

Here's a DSDT containing an entry for the 7300 including NVPM., although the NVPM part looks funny
Master Chief
QUOTE (zhell @ May 28 2009, 10:00 AM) *
Slightly off-topic, but here's the entry I use for my 8600 GT/512MB.
CODE
<snip/>

Thank you very much – the data looks very similar, if not the same to my EFI string data. Which is perfect for me.

And the vanilla DSDT appears to work: AppleIntelCPUPowerManagement: initialization complete (disabler.kext has been removed).

Well, almost – the following lines showed up in /var/log/system.log:
CODE
ACPI_SMC_PlatformPlugin::pushCPU_CSTData - _CST evaluation failed
ACPI_SMC_PlatformPlugin::registerLPCDriver - WARNING - LPC device initialization failed: C-state power management not initialized

I do have a Intel SpeedStep enabled CPU so I guess I need to do some patching now – I have however no idea what/how at the moment. Wasn't this something in Scope(_PR)?
kidalive
Hi, Zhell. Here is the my problem with sleep. I got a ICH8H MB which is recognized without any patch. Every time when I put my computer yo sleep it does sleep for a while but soon waked up. I checked the system log found this.
CODE
May 28 19:33:51 austin kernel[0]: image 447063040, uncompressed 965120000 (235625), compressed 442956576 (45%), sum1 affdc5cd, sum2 ad0a6fd0
May 28 19:33:51 austin kernel[0]: hibernate_write_image done(0)
May 28 19:33:51 austin kernel[0]: sleep
May 28 19:33:51 austin kernel[0]: Wake reason = HDEF EHC1 EHC2
May 28 19:33:51 austin kernel[0]: System Wake
May 28 19:33:51 austin kernel[0]: USB (EHCI):Port 3 on bus 0xfd connected or disconnected: portSC(0x301803)
May 28 19:33:53 austin kernel[0]: smb_iod_re


And I noticed the bus 0xfd is my wireless card which is Realtek 8187l.

I don`t quite understand the DSDT modification and I got hooked up with the generated DSDT.aml stuff. So I upload my ORIGIN DSDT dumped from IOREG and I hope you can help me out.
And I uploaded my WORKING LegacyHda KEXT can u help me inject it into the DSDT? Thanks in advance.
atka
First which sleep problem does this fix? Mine just hangs when it goes to sleep and sits there is this the one? Secondly can the same be done for EHCI I looked through the plist of EHCI and can't seem to detirmine a valid device id.
zhell
QUOTE (atka @ May 28 2009, 01:21 PM) *
First which sleep problem does this fix? Mine just hangs when it goes to sleep and sits there is this the one? Secondly can the same be done for EHCI I looked through the plist of EHCI and can't seem to detirmine a valid device id.

As stated in the very first post, this fixes "the well-known behavior of the computer going to sleep only half-way and then requiring a hard reset to get back to life".

EHCI devices could be treated the same, but so far I have not come across an ICH9 board where this was required.
Master Chief
zhell, you want us to add this:
CODE

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x35, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

to each USB device, but why not add/call a new method with these specific bits of the patch:
CODE
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x35, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)

Which in my case is replicated six times (with another 6 ports waiting to be patched).
zhell
QUOTE (Master Chief @ May 28 2009, 01:49 PM) *
zhell, you want us to add this:
...
to each USB device, but why not add/call a new method with these specific bits of the patch:
...
Which in my case is replicated six times (with another 6 ports waiting to be patched).

The device-id is different for each of the six (3a34-3a39).
Also, you should only have six UHCI device entries (each offers two ports), or do you have 24 USB ports?
rx782p
@zhell
My problem is EHCI Host Controller, does not work.
UHCI seem fixed by your method.

@Master Chief
I cheaked EFI strings once again.
I am using Vanilla IOUSBFamiry.kext and delete DSDT.
and the result was the same.

Click to view attachment
Click to view attachment
Click to view attachment
BlackCH
QUOTE (kizwan @ May 28 2009, 11:14 AM) *
Sorry, another slightly off-topic. I have to put dsdt code for GeForce Go 7300 in VGA procedure/function instead GFX0 because it is what stated in IORegistryExplorer when I use injector (NVinject.kext).


You can change the name of the function if you like; you need to scan the DSDT table in case that you need to raplece the name more than once.
zhell
QUOTE (rx782p @ May 28 2009, 02:06 PM) *
@zhell
My problem is EHCI Host Controller, does not work.
UHCI seem fixed by your method.

Try this for EHCI 1 and EHCI 2:
CODE

Device (EHC1)
{
Name (_ADR, 0x001D0007)
...
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x3a, 0x3a, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (EHC2)
{
Name (_ADR, 0x001A0007)
...
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x3c, 0x3a, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
rx782p
QUOTE (zhell @ May 28 2009, 10:28 PM) *
Try this for EHCI 1 and EHCI 2:
CODE

Device (EHC1)
{
Name (_ADR, 0x001D0007)
...
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x3a, 0x3a, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}

Device (EHC2)
{
Name (_ADR, 0x001A0007)
...
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x3c, 0x3a, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}


I already tried the method.
ECHI did not work.

Anyway, thank for suggestion.
it's promising for A board having the device which resembled Macintosh.
Bart86
We have found that having a disk in the DVD drive allows auto-sleep to work. This is on EP45-UD3P with 10.5.7 retail and no DSDT patching. Not sure what that implies or where to start looking for a proper fix but it's a start.
zhell
QUOTE (rx782p @ May 28 2009, 04:20 PM) *
I already tried the method.
ECHI did not work.

Anyway, thank for suggestion.
it's promising for A board having the device which resembled Macintosh.

Well, it's only supposed to work for ICH9/-R. Do you have such a south bridge?


QUOTE (Bart86 @ May 28 2009, 04:24 PM) *
We have found that having a disk in the DVD drive allows auto-sleep to work. This is on EP45-UD3P with 10.5.7 retail and no DSDT patching. Not sure what that implies or where to start looking for a proper fix but it's a start.

Thanks a lot, Bart86. Indeed, with my DP35DP, auto sleep never worked with 10.5.7, until just now when I put a DVD into the drive :-)
Edit: Found out replacing the DVD drive solves the problem
I don't know why this makes a difference, but it's definitely good to know. My board still needs the DSDT fix though, that's for sure because without the fix, it does not even sleep when forced.
ontoid
Great!!!
It works for me.
Cheating USB and ACPI as well.
Also GFX card and Audio is loaded via dsdt.aml
What can i say... dsdt patching have incredible possibilities, on my mobo i need only appledecrypt and 3 legacy kext's
(block storage and audio)

Thank U
Click to view attachment
zhell
QUOTE (ontoid @ May 28 2009, 10:49 PM) *
Great!!!
It works for me.
Cheating USB and ACPI as well.
Also GFX card and Audio is loaded via dsdt.aml
What can i say... dsdt patching have incredible possibilities, on my mobo i need only appledecrypt and 3 legacy kext's
(block storage and audio)


Thanks for the feedback, I agree, DSDT is a lot of fun... once you get your job done with it. The process can be painful, though, but it's worth it.

Enjoy! smile.gif
BlackCH
I confirm it works to fake ICH9 SATA (with ICH10 id):
Click to view attachment
Click to view attachment
So no more LegacyAppleAHCIPort.kext (I assume IDE mode wont work without LegacyAppleIntelPXIIATA.kext, still need to test)

Pitty changing USB ids (UHCI/EHCI) didnt fix sleep

EDIT:
In IDE mode this mod cause a KP at boot related with the stock AppleAHCIPort.kext
atka
Thanks for the info it didn't fix sleep for me though but it is fun to mess with the DSDT. I managed to get the ICH9 to report as ICH10 but does anybody know how to tell the OS that the drives are internal and not external?
SMF
I'm interested in the ICH10 fix (I have a Gigabyte P35-DQ6 with ICH9R) but would appreciate someone posting the exact section from their DSDT to help me understand ... as for USB and EHCI mine seems to be working - here's what I have from my DSDT for USB. This comes from using fassl's script and is not modified by me.

CODE
Device (USB0)
{
Name (_ADR, 0x001D0000)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x03,
0x03
})
}

Device (USB1)
{
Name (_ADR, 0x001D0001)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x04,
0x03
})
}

Device (USB2)
{
Name (_ADR, 0x001D0002)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0C,
0x03
})
}

Device (USB3)
{
Name (_ADR, 0x001D0003)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0E,
0x03
})
}

Device (US31)
{
Name (_ADR, 0x001A0000)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0E,
0x03
})
}

Device (USB4)
{
Name (_ADR, 0x001A0001)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x05,
0x03
})
}

Device (USB5)
{
Name (_ADR, 0x001A0002)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x20,
0x03
})
}

Device (USBE)
{
Name (_ADR, 0x001D0007)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0D,
0x03
})
}

Device (USE2)
{
Name (_ADR, 0x001A0007)
Method (_S3D, 0, NotSerialized)
{
If (LEqual (OSFL, 0x02))
{
Return (0x02)
}

Return (0x03)
}

Name (_PRW, Package (0x02)
{
0x0D,
0x03
})
}


Here's what my System Profiler shows -
atka
Well for ICH10 I post this at the end of my Device (Sata) section
CODE
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x02)
{
"device-id",
Buffer (0x04)
{
0x22, 0x3A, 0x00, 0x00
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}


I am not sure what yours would be called but my physical address was 1f0002 if you look in IOreg you'll find your address it might be the same.
mitch_de
Here is my part of USB dsdt for an GA-EP35 DS3 (ICH9 nonraid)
It has 29xx(hex) ICH pci dev id´s.
Also be carefull with that US31 device which is in the middle between that USB devices. Its NOT! an USB or EHCI device, let it stay as it is.

I would NOT change orig. device names (USB0 to UHCI1 for examle), because if you do that you have also more work to change all occurences of that in the dsl.

So (for less work) let them as they are and only add that device id stuff (that new method) to each of them. (For my knowledge wink.gif )
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.