View Single Post
 
Old 03-21-2010, 02:01 PM
uman uman is offline
Panther
 
Join Date: May 2009
Location: USA
Posts: 103
Quote:
Originally Posted by richarda View Post
Allright, I got that but in this case I guess I have to pute something like

Name(_PRW, Package()
{
<xx>, // Bit number in GPEx_EN to enable USB resume
0x01 // Reference to lowest sleeping state which can be
// entered while still providing wake functionality
// no relative power resource specified
})

But how to determine the <xx> value then ?
That's the problem then. You really need to have some of the resources specified for your USB (UHCI) and EHCI ports. Since you don't have anything, you can add the GPE handlers, and things should work. The best way to proceed, is to first identify which Mac model your machine is closest to, and then take the requisite parts, carefully excising out the problematic parts.

For my hack, I looked at the list of mac models on wikipedia, and then chose MacBook 2,1 as the closest. I then edited my smbios.plist to reflect those values. I then compared my DSDT to the MacBook 2,1 DSDT and ioreg, and found they were surprisingly close. I've included below, some pieces for you to try from a MacBook 2,1 DSDT:

Code:
    Scope (\_GPE)
    {
...
        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB1, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L04, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB2, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }
...
        Method (_L0C, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB3, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L0D, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB7, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L0E, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB4, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }
...
Note the parts in red. If you already have level handlers in your GPE scope that use these numbers (so say you already have _L03), you will have to change them, and change the part in the USB1 declaration for, say, _L03. Don't put really large numbers, because there's a part in the DSDT that says the handlers go only up to 0xXX (I've forgotten where that is). Just make sure you use unused numbers. For example, in my DSDT I added one for _L11 for my firewire.

Code:
            Device (USB1)
            {
                Name (_ADR, 0x001D0000)  // keep your existing ADDR lines!!!
                Device (HUB1)                       // will become HUB2 for USB2
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

                OperationRegion (U1CS, PCI_Config, 0xC4, 0x04)
                Field (U1CS, DWordAcc, NoLock, Preserve)
                {
                    U1EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x03,     // must match number you use in _Lxx handler
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U1EN)
                    }
                    Else
                    {
                        Store (0x00, U1EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)  // note: I don't have these
                {
                    Return (0x03)
                }

                Method (_S4D, 0, NotSerialized) // note: I don't have these
                {
                    Return (0x03)
                }
            }
The parts in red will change to match each USB port, so U1CS, U1EN becomes U2CS and U2EN for USB2, along with changing HUB1 to HUB2. I don't have the _S3D and _S4D methods in my DSDT and from reading the spec, I don't think they are needed.

So USB2, looks like:

Code:
            Device (USB2)
            {
                Name (_ADR, 0x001D0001)
                Device (HUB2)
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

                OperationRegion (U2CS, PCI_Config, 0xC4, 0x04)
                Field (U2CS, DWordAcc, NoLock, Preserve)
                {
                    U2EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x04,      // A different _L04 is a different _LXX handler than USB1!
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U2EN)
                    }
                    Else
                    {
                        Store (0x00, U2EN)
                    }
                }

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

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x03)
                }
            }
Do the same edits for USB3 and USB4 (if you have USB4) and even USB5, and USB6 if you have a desktop with lots of USB ports (although I suspect you will need another EHCI hub there, but I don't know).

USB7 is quite different:
Code:
            Device (USB7)
            {
                Name (_ADR, 0x001D0007)
                Device (HUB7)
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }

                    Device (PRT3)
                    {
                        Name (_ADR, 0x03)
                    }

                    Device (PRT4)
                    {
                        Name (_ADR, 0x04)
                    }

                    Device (PRT5)
                    {
                        Name (_ADR, 0x05)
                    }

                    Device (PRT6)
                    {
                        Name (_ADR, 0x06)
                    }

                    Device (PRT7)
                    {
                        Name (_ADR, 0x07)
                    }

                    Device (PRT8)
                    {
                        Name (_ADR, 0x08)
                    }
                }

                Name (_PRW, Package (0x02)
                {
                    0x0D,     // yet another different handler
                    0x03      // I suggested you change this to 0x1
                })
                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x03)
                }

                  Method (_S4D, 0, NotSerialized)
                {
                    Return (0x03)
                }
            }
Remove the parts in yellow for the USB7, since they don't match the change from 0x03 -> 0x01. Plus I suspect they really aren't needed.

--
MacBook Pro - have allergy to nickel in the aluminum casing. So my kid gets an expensive toy!

Gateway MX 8738 - Retail, vanilla Snow Leopard 10.6.2 (thanks kizwan!) with Chameleon RC4, modified DSDT. Upgraded to Core 2 CPU (easy to do). Upgraded to 640GB drive. Everything but SD card working. Minor niggles. GMA950 with QE/CI and *no* artifacts.

iMac (luxo/lamp) G4 with Tiger.
Reply With Quote