View Single Post
 
Old 03-19-2010, 07:39 PM
walterav walterav is offline
Jaguar
 
Join Date: Aug 2009
Posts: 45
Quote:
Originally Posted by walterav View Post
I may post a list of all patches I used in the near future
This is just a summary of several dsdt fixes working for this board. I'm not the one who invented any of these patches, but I don't know the names of all contributors anymore... See it as a guide, and notice the //- or //+.

Code:
### several DSDT patches for optimizing p5k-e-wifi/ap bios 1202

###fix for adding fixes
Method (NPTS, 1, NotSerialized)
            {
            }

//+     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)
//+            }

Method (NWAK, 1, NotSerialized)
            {
            }

###shutdown fix

Device (SBRG)
{
    Name (_ADR, 0x001F0000)
    //+ OperationRegion (LPC0, PCI_Config, 0xA0, 0x54)
    //+ Field (LPC0, AnyAcc, NoLock, Preserve)
    //+ {
    //+        ,   10, 
    //+     XPME,   1, 
    //+             Offset (0x04), 
    //+     AG3E,   1, 
    //+             Offset (0x50), 
    //+     RCBA,   32
    //+ }

    Device (IELK)

Method (_PTS, 1, NotSerialized)
    {
        //+ If (LEqual (Arg0, 0x05))
        //+ {
        //+     Store (One, \_SB.PCI0.SBRG.AG3E)
        //+ }
        //+ Else
        //+ {
            Store (Arg0, DBG8)
            PTS (Arg0)
            Store (Zero, Index (WAKP, Zero))
            Store (Zero, Index (WAKP, One))
            If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
            {
                Sleep (0x0BB8)
            }

            Store (ASSB, WSSB)
            Store (AOTB, WOTB)
            Store (AAXB, WAXB)
            Store (Arg0, ASSB)
            Store (OSFL (), AOTB)
            Store (Zero, AAXB)
        //+ }
    }

### AppleIntelCPUPowerManagment.kext kernelpanic fix, hpet / rtc / tmr
#not that good for quadcores?

Device (PIC)
                {
                    Name (_HID, EisaId ("PNP0000"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0020,             // Range Minimum
                            0x0020,             // Range Maximum
                            0x00,               // Alignment
                            0x02,               // Length
                            )
                        IO (Decode16,
                            0x00A0,             // Range Minimum
                            0x00A0,             // Range Maximum
                            0x00,               // Alignment
                            0x02,               // Length
                            )
                        //- IRQNoFlags ()
                        //-     {2}
                    })

                
Device (TMR)
                {
                    Name (_HID, EisaId ("PNP0100"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0040,             // Range Minimum
                            0x0040,             // Range Maximum
                        //+-  0x01,               // Alignment
                            0x04,               // Length
                            )
                        //- IRQNoFlags ()
                        //-     {0}
            //+ IO (Decode16,
                        //+    0x0050,             // Range Minimum
                        //+    0x0050,             // Range Maximum
                        //+    0x01,               // Alignment
                        //+    0x04,               // Length
                        //+    )
                    })
                }

Device (RTC0)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0070,             // Range Minimum
                            0x0070,             // Range Maximum
                            0x00,               // Alignment
                            0x02,               // Length
                            )
                        //- IRQNoFlags ()
                        //-    {8}
                    })
                }

Device (HPET)
                {
                    Name (_HID, EisaId ("PNP0103"))
                    Name (CRS, ResourceTemplate ()
                    {
                        //+ IRQNoFlags ()
                        //+     {0}
                        //+ IRQNoFlags ()
                        //+     {8}
                        Memory32Fixed (ReadOnly,
                            0xFED00000,         // Address Base
                            0x00000400,         // Address Length
                            _Y09)
                    })

### internal SATA ports shown as internal Intel ESB2 sata ports

Device (SATA)
            {
                Name (_ADR, 0x001F0002)
                Name (^NATA, Package (0x01)
                {
                    0x001F0002
                })
                Name (\FZTF, Buffer (0x07)
                {
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF5
                })
                Name (REGF, One)
                //+ Method (_DSM, 4, NotSerialized)
                //+ {
                //+    Store (Package (0x02)
                //+         {
                //+             "device-id", 
                //+             Buffer (0x04)
                //+             {
                //+                 0x81, 0x26, 0x00, 0x00
                //+             }
                //+         }, Local0)
                //+     DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                //+     Return (Local0)
                //+ }

        Method (_REG, 2, NotSerialized)

### usb ports show as internal usbport for fixing sleep, a lot of work

Device (EUSB)
            {
                Name (_ADR, 0x001D0007)
                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0D, 0x04))
                }

                //+ 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 (USBE)
            {
                Name (_ADR, 0x001A0007)
                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x0D, 0x04))
                }

                //+ 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)
                //+ }
            }

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

          //+   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)
          //+   }

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

          //+   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)
          //+   }

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

          //+   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)
          //+   }

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

          //+   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)
          //+   }

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

          //+   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)
          //+   }

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

          //+   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)
          //+   }

### Network adapter will be shown as onboard fixes UUID/timemachine etc

Device (P0P9)
            {
                Name (_ADR, 0x001C0005)
                Method (_PRW, 0, NotSerialized)
                {
                    Return (GPRW (0x09, 0x04))
                }

                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR09)
                    }

                    Return (PR09)
                }

                //+ Device (GIGE)
                {
                    Name (_ADR, Zero)
                    OperationRegion (GPIO, SystemIO, 0x0800, 0x06)
                    Field (GPIO, ByteAcc, NoLock, Preserve)
                    {
                        GO01,   8, 
                        GO02,   8, 
                        GO03,   8, 
                        GO04,   8, 
                        GO05,   8, 
                        GP9,    1
                    }

                    Name (_PRW, Package (0x02)
                    {
                        0x09, 
                        0x03
                    })
                    Method (EWOL, 1, NotSerialized)
                    {
                        If (LEqual (Arg0, One))
                        {
                            Or (GP9, One, GP9)
                        }
                        Else
                        {
                            And (GP9, Zero, GP9)
                        }

                        If (LEqual (Arg0, GP9))
                        {
                            Return (Zero)
                        }
                        Else
                        {
                            Return (One)
                        }
                    }
                //+ }
            }

Device (GBEC)

### azalia/hdef AppleHDA compatible inject

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

    //+ Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x08)
                        {
                            "codec-id", 
                            Buffer (0x04)
                            {
                                0x9B, 0x82, 0x43, 0x10
                            }, 

                            "layout-id", 
                            Buffer (0x04)
                            {
                                0x0C, 0x00, 0x00, 0x00
                            }, 

                            "device-type", 
                            Buffer (0x17)
                            {
                                "Analog Devices AD1988B"
                            }, 

                            "PinConfigurations", 
                            Buffer (0x20)
                            {
                                /* 0000 */    0x30, 0x40, 0x21, 0x01, 0x10, 0x40, 0x11, 0x01, 
                                /* 0008 */    0x40, 0x90, 0xA1, 0x01, 0x50, 0x30, 0x81, 0x01, 
                                /* 0010 */    0x60, 0x10, 0x01, 0x01, 0x20, 0x90, 0xA1, 0x01, 
                                /* 0018 */    0xF0, 0x11, 0x45, 0x01, 0x70, 0x60, 0x01, 0x01
                            }
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }
            //+ }
        }

Scope (\_GPE)

### injecting ATI videocard with DSDT
#use Wormy/x1600 Megalodon/2600/3870 Motmot/4870
            Device (P0P2)
            {
                Name (_ADR, 0x00010000)
    //+    Device (GFX)
                {
                    Name (_ADR, Zero)
                    Name (_SUN, One)
                    Method (_DSM, 4, NotSerialized)
                    {
                        Store (Package (0x16)
                            {
                                "@0,compatible", 
                                Buffer (0x0E)
                                {
                                    "ATY,Megalodon"
                                }, 

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

                                "@0,display-connect-flags", 
                                Buffer (0x02)
                                {
                                    0x00, 0x04
                                }, 

                                "@0,name", 
                                Buffer (0x0E)
                                {
                                    "ATY,Display_A"
                                }, 

                                "@1,compatible", 
                                Buffer (0x0E)
                                {
                                    "ATY,Megalodon"
                                }, 

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

                                "@1,display-connect-flags", 
                                Buffer (0x02)
                                {
                                    0x00, 0x04
                                }, 

                                "@1,name", 
                                Buffer (0x0E)
                                {
                                    "ATY,Display_B"
                                }, 

                                "device_type", 
                                Buffer (0x14)
                                {
                                    "ATY,MegalodonParent"
                                }, 

                                "model", 
                                Buffer (0x19)
                                {
                                    "ATI Radeon HD2600 Series"
                                }, 

                                "rom-revision", 
                                Buffer (0x06)
                                {
                                    "3169a"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
    //+    }

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

                Method (_PRT, 0, NotSerialized)
                {
                    If (PICM)
                    {
                        Return (AR02)
                    }

                    Return (PR02)
                }
            }

### Snow Leopard extra sleep fix?
Return (WAKP)

//+    Return (Package (0x02)
    {
    Zero, 
    Zero
//+    })
Reply With Quote