InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   Various DSDT mods. (http://infinitemac.com/showthread.php?t=1960)

richarda 03-18-2010 03:34 PM

Hello,

Thanks for the info. Not sure I was clear enough tough. I'm having the problem with the SD card (I believe it's using an internal USB port) and the machine is an eeePC 901.
I need help on this one.....please.

uman 03-19-2010 04:24 PM

Quote:

Originally Posted by richarda (Post 46383)
Hello,

Thanks for the info. Not sure I was clear enough tough. I'm having the problem with the SD card (I believe it's using an internal USB port) and the machine is an eeePC 901.
I need help on this one.....please.

My bad. I'm so used to SD cards not working, that I assumed you meant SSD.

You could try the following:

1. Determine what USB slot your SD card is occupying. Easiest is to highlight he drive in disk utility and right-click Information. You should see something like: IODeviceTree:/PCI0@0/USB7@1D,7. That tells me that it's using USB7.

2. Edit your DSDT to replace the _PRW for the indicated USB slot with:
Code:

            Device (USB7)
            {
                ...
            // package (argnum) {GPEbit, Wakelevel, PowerResource}
            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
                })

where I have <xx> above, keep your DSDT's existing value, as that's the handler in the GPE for USB7. What I've highlighted in red is the change. Your existing DSDT likely has 0x03, which is effectively powered off.

What the 0x01 does is says that the drive still needs power. That *might* be enough to keep it from being ejected. But it might also prevent the computer from sleeping.

Take a look at the ACPI spec (4.0 rev) Chapter 7.2 for some of the things you can do with power management.

saul1d 03-20-2010 01:48 AM

hey guys ive been lurking around on this thread for a week or two now, and i'm more interested in getting my laptop fully working. ive been running osx for about a year now and i'm pretty familiar with everything except DSDT.

basically what i'm trying to get working:

- GMA X3100: was working with leo, but with 10.6.2 i lost the ability to make the
screen turn off.(although i still have QE/CI)
- Backlight: has never worked, "invalid firmware max backlight" problem. i was
hoping DSDT would be able to fix this
- Sleep: although i'm not too worried about it, it would be nice.


I have a Gateway M6841. I don't think it's a too popular system to be using for a hackintosh, so there's not much help that i've found in the forums.

here is my patched DSDT. its patched for sleep, backlight, and gmax3100 but it hasnt changed any of the problems. thanks to anyone that can help or at least point me in the right direction, i do have programming experience if it helps.

richarda 03-20-2010 05:44 PM

Quote:

Originally Posted by uman (Post 46422)
My bad. I'm so used to SD cards not working, that I assumed you meant SSD.

You could try the following:

1. Determine what USB slot your SD card is occupying. Easiest is to highlight he drive in disk utility and right-click Information. You should see something like: IODeviceTree:/PCI0@0/USB7@1D,7. That tells me that it's using USB7.

2. Edit your DSDT to replace the _PRW for the indicated USB slot with:
Code:

            Device (USB7)
            {
                ...
            // package (argnum) {GPEbit, Wakelevel, PowerResource}
            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
                })

where I have <xx> above, keep your DSDT's existing value, as that's the handler in the GPE for USB7. What I've highlighted in red is the change. Your existing DSDT likely has 0x03, which is effectively powered off.

What the 0x01 does is says that the drive still needs power. That *might* be enough to keep it from being ejected. But it might also prevent the computer from sleeping.

Take a look at the ACPI spec (4.0 rev) Chapter 7.2 for some of the things you can do with power management.

Hello,
Thanks a lot. In the disk utility I got: /PCI0@0/EUSB@1D,7
And in the DSDT file, at Device(EUSB) I don't have a lot of things. Just

{
Name (_ADR, 0x001D0007)
}

nothing else. Any idea what else I can add to make it working in that case ?

kizwan 03-20-2010 06:13 PM

Quote:

Originally Posted by richarda (Post 46459)
Hello,
Thanks a lot. In the disk utility I got: /PCI0@0/EUSB@1D,7
And in the DSDT file, at Device(EUSB) I don't have a lot of things. Just

{
Name (_ADR, 0x001D0007)
}

nothing else. Any idea what else I can add to make it working in that case ?

You're allowed to add what it don't have.

kizwan

richarda 03-20-2010 08:44 PM

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 ?

uman 03-21-2010 02:01 PM

Quote:

Originally Posted by richarda (Post 46464)
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.

uman 03-21-2010 02:03 PM

Oh, and if this doesn't work, there are bits you can set that essentially control power settings, ejectability, etc. But that is hugely dependent on your chipset. I have an ICH7, and most of that is the same in ICH9, and ICH10, but if you have an nvidia chipset, that's *totally* different.

richarda 03-21-2010 02:27 PM

OK, I'm 200% lost now. This is way too complex for me. I guess I have to find somebody litterate enough who solved the problem on the eee901 and just copy his settings.

Thanks anyway.

barnum 03-26-2010 01:56 PM

Code:

                Device (HUB1)                      // will become HUB2 for USB2
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

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

Hi,
Can You explain me what the "utility" of this part of the usb declaration"

In my dsdt, I doesn't have that.
Thank,
Barnum