Help - Search - Members - Calendar
Full Version: Some useful DSDT patches
Project OS X Forums > Snow Leopard Guides & Tutorials > DSDT Patching
Slice
First of all thanks Fassl for DSDT patcher.
Now I have dsdt.dsl and can edit it to change functionality of my hackintosh.
1. Patch by vaag to exclude sleep trick for IntelX3100. I confirm, it works. We need to delete CRT device here
CODE
            Device (GFX0)
            {
                Name (_ADR, 0x00020000)
                Method (_DOS, 1, NotSerialized)
                {
                    Store (Arg0, MIS4)
                    SMI (0x9E, MIS4)
                }

                Method (_DOD, 0, NotSerialized)
                {
                    Return (Package (0x04)
                    {
                        0x00010100,
                        0x00010200,
                        0x00010400,
                        0x00010300
                    })
                }
/*Device (CRT)*/
                Device (LCD)
                {

2. Make display dim when working from battery:
Delete IRQ from TMR device
CODE
                Device (TIMR)
                {
                    Name (_HID, EisaId ("PNP0100"))
      /*                  IRQNoFlags ()
                            {2}    */

and add it to IPIC
CODE
                Device (IPIC)
                {
                    Name (_HID, EisaId ("PNP0000"))
                    Name (CRS, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0020,             // Range Minimum
                            0x0020,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x04D0,             // Range Minimum
                            0x04D0,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                        IRQNoFlags ()
                            {2}


3. WiFi waking from sleep
CODE
       Method (_L09, 0, NotSerialized)
        {
            Store (SMI (0xC6, Zero), Local0)
            If (And (Local0, One))
            {
                Store (One, \_SB.PCI0.RP01.PSP1)
                Notify (\_SB.PCI0.RP01.PXS1, 0x02)  // this is my LAN
            }

            If (And (Local0, 0x04))
            {
                Notify (\_SB.PCI0.RP05.PXS5, 0x02) // change to RP02.PXS2 which is my WiFi.
            }
        }

4. Switch on support for AC adapter
CODE
       Device (ADP1)
        {
            Name (_HID, "ACPI0003")
            Name (_PRW, Package (0x02)  // add this
            {
                0x18,
                0x03
            })

and now I see
QUOTE
| | |
| | +-o AppleACPIACAdapter <class AppleACPIACAdapter, !registered, !matched, active, busy 0, retain 4>
in my ioreg.
5. PCI card information
CODE
            Device (RP02)
            {
                Name (_ADR, 0x001C0001)  // last two digits is a number of the bridge
                Device (ARPT)
                {
                    Name (_ADR, Zero)
                    Name (_SUN, 0x01)    // add this object with the same value as PCI bridge
                      Method (_DSM, 4, NotSerialized)   // add this method
                    {
                        Store (Package (0x04)
                        {
                            "model",
                            Buffer ()
                            {
                                "Dell Wireless 1395"
                            },

                            "built-in",
                            Buffer ()
                            {
                                0x00
                            }

                        }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))   // define the method at the top
                        Return (Local0)
                    }

Now I see
Click to view attachment
6. DSDT patch for USB to use native driver.
CODE
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x0f)
                        {
                            "device-id",
                            Buffer (0x04)
                            {
                                0x34, 0x3A, 0x00, 0x00  //the values below
                            },
                            "AAPL,clock-id",   // property needed for sleep support
                            Buffer (One)
                            {
                                0x0a  
                            },

                                "built-in",
                                Buffer ()
                                {
                                        0x00
                                },

                              "device_type",   //not sure it is useful
                              Buffer (0x05)
                              {
                                  "EHCI"
                              },

                            
                            "AAPL,current-available",
                            0x04B0,
                            "AAPL,current-extra",
                            0x02BC,
                            "AAPL,current-in-sleep",  // to solve a problem with sleep when stick is inserted
                            0x03E8,

                            Buffer (0x01)
                            {
                                0x00
                            }
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }

DeviceIDs
Intel
USB1 - 0x2830
USB2 - 0x2831
USB3 - 0x2832
USB4 - 0x2834
USB5 - 0x2835
EHC1 - 0x2836
EHC2 - 0x283a
nForce
USB1 - 0x0aa5
USB2 - 0x0aa7
EHC1 - 0x0aa6
EHC2 - 0x0aa9
Slice
What Operating System emulates by your DSDT?
CODE
    Name (W98S, "Microsoft Windows")
    Name (NT5S, "Microsoft Windows NT")
    Name (WINM, "Microsoft WindowsME: Millennium Edition")
    Name (WXP, "Windows 2001")
    Name (WLG, "Windows 2006")
    Name (LNX, "Linux")

We can change it here ( changes from 23.01.2012 - we must emulate WindowsXP!)
CODE
    Method (OSID, 0, NotSerialized)
    {
        Store (0x10, MIS3)
/*        If (LEqual (MIS3, Zero))
        {
            Store (0x10, MIS3)
            If (CondRefOf (\_OSI, Local0))
            {
                If (_OSI (WXP))
                {
                    Store (0x10, MIS3)
                }

                If (_OSI (WLG))
                {
                    Store (0x20, MIS3)
                }

                If (_OSI (LNX))
                {
                    Store (0x40, MIS3)
                }
            }
            Else
            {
                If (STRE (_OS, W98S))
                {
                    Store (0x02, MIS3)
                }

                If (STRE (_OS, NT5S))
                {
                    Store (0x08, MIS3)
                }

                If (STRE (_OS, WINM))
                {
                    Store (0x04, MIS3)
                }
            }
        }  */

        Return (MIS3)
    }

But I don't know what is better.
For example
CODE
        If (LGreaterEqual (OSID (), 0x20))
        {
            If (And (Local0, 0x04))
            {
                Notify (\_SB.PCI0.GFX0.LCD, 0x86)
            }

            If (And (Local0, 0x02))
            {
                Notify (\_SB.PCI0.GFX0.LCD, 0x87)
            }
        }
Slice
In the example above we see that waking method depends on Operating System
If (LGreaterEqual (OSID (), 0x20)) - this is for Windows Vista and Linux only
{
If (And (Local0, 0x04))
{
Notify (\_SB.PCI0.GFX0.LCD, 0x86) - wake up set LCD with code 86
}

If (And (Local0, 0x02))
{
Notify (\_SB.PCI0.GFX0.LCD, 0x87) - wake up set LCD with code 87
}
}
0x80 is a sleep. 0x06 or 0x07 is a brightness I think.
18seven
QUOTE (Slice)
0x80 is a wake up. 0x06 or 0x07 is a brightness I think.

Value Description

0x85 Cycle Brightness. Used to notify OSPM that the output device brightness should be increased by
one level. Used to notify OSPM that the user pressed a button or key that is associated with cycling
brightness. A useful response by OSPM would be to increase output device brightness by one or
more levels. (Levels are defined in _BCL.) If the brightness level is currently at the maximum
value, it should be set to the minimum level.

0x86 Increase Brightness. Used to notify OSPM that the output device brightness should be increased
by one or more levels as defined by the _BCL object. Used to notify OSPM that the user pressed a
button or key that is associated with increasing brightness. If the brightness level is currently at the
maximum value, OSPM may should ignore the notification.

0x87 Decrease Brightness. Used to notify OSPM that the output device brightness should be decreased
by one or more levels as defined by the _BCL object. Used to notify OSPM that the user pressed a
button or key that is associated with decreasing device brightness. If the brightness level is
currently at the minimum value, OSPM may should ignore the notification.

0x88 Zero Brightness. Used to notify OSPM that the output device brightness should be zeroed,
effectively turning off any lighting that is associated with the device. Used to notify OSPM that the
user pressed a button or key associated with zeroing device brightness. This is not to be confused
with putting the device in a D3 state. While the brightness may be decreased to zero, the device
may still be displaying, using only ambient light.

0x89 Display Device Off. Used to notify OSPM that the device should be put in an off state, one that is
not active or visible to the user, usually D3, but possibly D1 or D2. Used to notify OSPM that the
user pressed a low power button or key associated with putting the device in an off state. There is
no need for a corresponding “device on” notification, for two reasons. First, OSPM may choose to
toggle device state when this event is pressed multiple times. Second, OSPM may (and probably
will) choose to turn the monitor on whenever the user types on the keyboard, moves the mouse, or
otherwise indicates that he or she is attempting to interact with the machine.
Slice
Thank you 18seven!
Where did you find these description?

I am wrong 0x80 is Put To Sleep, 0x02 is Wake
Edited posts...
18seven
QUOTE (Slice)
Where did you find these description?

NP, ACPI specs appendix B.
Slice
QUOTE (18seven @ Aug 19 2009, 11:41 AM) *
NP, ACPI specs appendix B.

Thanks! I have this manual, but 631 pages...

18seven
lol, yes its epic. However, I find it pleasant to read... I think that means I should go get a drink.
drmash
thanks Slice, great stuff! Please post your orig/mod sections(dell laptop) DSDT patch for USB to use native driver.
Slice
My latest working DSDT.dsl (12.09.2009) for Dell Inspiron 1525
Click to view attachment
drmash
clock-id maybe different for two ehci & ehc2 divece's?
CODE
                            "AAPL,clock-id",
                             Buffer (One)
                             {
                                 0x0a  
                             },
Slice
QUOTE (drmash @ Sep 12 2009, 03:22 PM) *
clock-id maybe different for two ehci & ehc2 divece's?
CODE
                            "AAPL,clock-id",
                             Buffer (One)
                             {
                                 0x0a  
                             },

Yes. Sorry it's my mistake.
The dsdt is not ultimate I hope to make sleep/wake working with AC adapter attached.
fingerr
Hi all,

I'm trying to enable sleep on my system (Asus U30JC) and I've tried a lot of solutions provided on forums, but I can't get it working.

Attached is my DSDT.aml. Can someone have a look and help me with it?

Thanks in advance and best regards,
fingerr
ytrox
PCI card information mod works for ethernet controllers but with this method I can't connect to internet (I use a pci ethernet card RTL8139)

EDIT: OK, evrything works fine
Slice
One news here.
I had a problem with Lion that can't sleep while in Snow all is OK.
I found that Lion is more critical to DSDT mistakes.
TRICK #4 from topic appears to be a final solution to have good working sleep/wake.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.