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)

The Edge3000 08-11-2009 10:03 PM

Quote:

Originally Posted by sk1nhd33t (Post 30675)
hmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it :(

Uncheck "Allow power button to put the computer to sleep" in energy saver =P.

Gurruwiwi 08-17-2009 02:00 PM

Hi guys,

I dont mean to hijack the thread, but what beeter place for 2 quick DSDT questions for people who actually seem to know what they are talking about !!
No one has been able to answer me, well... because no one seems to actually KNOW what they are saying... Please please help!
DSDT is the voodoo of computers for to me loool...
Ok, I've got 2 Acer laptops and 1 Asus laptop. Just for reference. All had OSx, 10.4 to 10.5, many distros, my latest and greatest in my sig.

How on earth do I know if DSDT is doing something or not ?

iAtkos v7 Chameleon 2 RC1 (now RC2) and fassls DSDT script checked. DSDT.aml
is in root, but I tried in Extra folder and felt absolutely no difference.
On first boot I press power, poweroff window comes up (native install) My multimedia controller on my keyboard controls volume and front row funtions!! (photos in link in signature) - Video card not detected (but with strings + 2 kext native HD res QE etc)
Out of the box, FN and up down increases/decreases screen brightness. Other fn work, very few dont.
. Audio works OTB, clicks pops etc, no internal or external mic. VoodooHDA is the same,
Ehternet with kext only... didnt try stringing it because I got it to work
So how do I know if DSDT is working? if I remove it I am almost certain my laptop will respond the same.

My previous laptops, NONE used DSDT, I pressed power button, they worked fine! Brightness and other stuff too... etc etc
and I am scared because I read sometimes
"Patch DSDT at you own risk!! !
as in flashing the bios or something... can I bick my laptop with DSDT !??! When can DSDT be dangerous?

I want to try decompiling and fixing my dsdt for Snow... but I dont even know if

1) I actually need it
2) If it is working or not
3) it is dangerous, or when is it dangerous?

ok, three questions :)

thanks in advance"

kizwan 08-17-2009 07:01 PM

Quote:

Originally Posted by Gurruwiwi (Post 31282)
1) I actually need it
2) If it is working or not
3) it is dangerous, or when is it dangerous?
................

1) You don't need it unless you need it. If everything is working properly, so you don't need it. DSDT override just for PC that have problem with CPU alias (only can use one core), sound, graphic card, power management & etc.
2) It is working.
3) No hard evidence that it is dangerous. DSDT override can be applied by 2 ways; i) by using dsdt.aml file. ii) by flashing it to ROM permanently. Of course the second one is dangerous if you do it wrongly.

kizwan

Gurruwiwi 08-17-2009 09:47 PM

thanks for the reply

Ah, ok, you can actually flash a BIOS to mimic hardware change... ouch! no thanks.

The thing is kizwan, if I remove the DSDT.aml file, my system boots (Leo) and behaves the same! Which is really weird since I have perfect use of my multimedia pad (volume, next song, ff, rw, mute, hold and, believe it or not, and, the "enter" button works the same as Enter key, the arrows next to it like cursor, and the envolving white lines "tabs" stuffs depending on program, firefox, openoffice, folders, etc...) and 75% of bios FN keys etc.

For instance, my webcam, out of the box, reads in profile as "Acer Crystal Eye Webcam" - 100% opertional including ichat, ibooth, etc, which is know to crash with some "working" webcams - this withou dsdt or patching or stringing

That is why I say I have no idea, following logic from what I read, how the DSDT WORKS to help boot or not. even if its not present this laptop boots Leo like if it had.

Now I do have dual boot with dsdt present on both sides, but I guarantee you with single boot I had this behaviour

EnzoFX 09-03-2009 05:17 AM

So the powerbutton fix, will make my power button do either sleep or shutdown/logout/resatart prompt? It depends on the setting in System Prefs is what you guys are saying? (Once enabled through dsdt)

My power button currently does nothing! =P

kizwan 09-03-2009 06:06 AM

Quote:

Originally Posted by EnzoFX (Post 33345)
So the powerbutton fix, will make my power button do either sleep or shutdown/logout/resatart prompt? It depends on the setting in System Prefs is what you guys are saying? (Once enabled through dsdt)

My power button currently does nothing! =P

For a working power button in Mac OS X, a dialog box will appear if you press the power button. In this dialog box, you have a choice either you want to sleep, restart or shutdown (you will see all of the 3 choices).

If your power button does nothing, it means it have not yet enabled in DSDT (most machine has this enabled by default). If you have tried to enabled it in DSDT, maybe the code is wrong. Try to check it again.

kizwan

EnzoFX 09-03-2009 06:40 AM

I have not tried, but I will.

I was just wondering if what it did (Once working) depended on the setting in Sys Prefs. I.e. whether it just sleeps, or if it gives you the shutdown/etc options.

kizwan 09-03-2009 06:50 AM

Quote:

Originally Posted by EnzoFX (Post 33347)
I have not tried, but I will.

I was just wondering if what it did (Once working) depended on the setting in Sys Prefs. I.e. whether it just sleeps, or if it gives you the shutdown/etc options.

Once it working it will always shows you the options, either sleep, shutdown or restart. There is no setting in System Preferences for power button.

kizwan

The Edge3000 09-07-2009 08:16 AM

I applied the power button fix. However, It only seems to work when I check the box to allow it to sleep the computer. Other than that, it does nothing - no menu or anything.

Common_Sense 09-08-2009 09:21 PM

I applied the power button fix but it doesn't work, when I press it my computer will enter sleep mode without displaying any message just like it did before I applied the fix, I have a gigabyte EP45-DS3LR, anyone knows whats wrong?, this is how the DSDT looks like:

Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C")) --> Name (_CID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

gnychis 09-25-2009 03:41 AM

1 Attachment(s)
hi all... I have a Thinkpad X300, that whenever I put to sleep, I see the wireless light blink, and the the laptop wakes up. It seems as though the wireless card is waking the system after a second or two every time I sleep it.

Does anyone have any recommendations for this in terms of the DSDT? I've attached mine if it helps.

msingh 10-05-2009 05:37 AM

DSDT advice needed
 
1 Attachment(s)
Hello,

My system is a Dell D830.

After a lot of tinkering around, I managed to install Snow Leopard on it. Please see my guide.

I did a few DSDT mods to get some basic fixes.

Now, the system sleeps (S3 suspend to ram) but does not deep sleep (S5 suspend to disk), shutdown or reboot. I am using OpenHaltRestart.kext and SleepEnabler.kext. The latter made it possible to even suspend.

I am including my dsdt.dsl (which includes my fixes, by the way).

I see tantalizing references to the sleep button, SBTN, etc., but I have not found any systematic documentation for the code (btw. I am comfortable with coding as I do plenty of numerical coding in my work).

Can anyone take a look and let me know what I need to do to fix my poweroff and hibernate problem ?

The DSDT repository does not contain a fixed DSDT for my laptop.

PS: Microsoft's ASL compiler should be outlawed.

2nerd4u 10-20-2009 04:07 PM

Quote:

Originally Posted by sk1nhd33t (Post 30675)
Quote:

Originally Posted by pentiumpc (Post 21188)
change _HID to _CID

Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C"))
Name (_UID, 0xAA)
Name (_STA, 0x0B)
}


This one I got it off some site, cannot remember where. (credit goes to him/her)
This will activate your power button to bring up the shutdown menu.

http://www.infinitemac.com/attachmen...1&d=1232342192

hmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it :(

mine will shut down instantly :D
edit: well actually it just goes to sleep mode verry fast^^ too bad my system wont wake from sleep...

Sweaty 12-21-2009 01:26 PM

DSDT shutdown patch
 
1 Attachment(s)
With this and new restart patch chameleon booter from Duvel (strong beer that) I have only fakesmc as an added kext, although I'm about to reinstall voodoohda so I can hopefully have two soundcards working.. anyway this is mm67's work I just found it a pain to find the detail on insane so posting it here.. Thanks to all who put together these fixes. Need to add the two operation region bits and change your method PTS

Code:

    OperationRegion (DEBG, SystemIO, 0x80, One)
    Field (DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,  8
    }

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,  4,
        SLPE,  1,
                Offset (0x08),
        GPSE,  16,
        GPSS,  16,
                Offset (0x12),
            ,  1,
        SWGC,  1
    }

    Method (_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
        Store (Local0, DBG1)
        Store (Zero, \_SB.PCI0.LPCB.AG3E)
        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }
    }

also your LPCB has to be like so

Code:

            Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
                Field (LPC0, ByteAcc, NoLock, Preserve)
                {
                    AG3E,  1
                }

I suppose add device ID if you need it, I'm on ICH10 so don't.

Also attaching blackosx's duvel+rekursor version of RC4 here, replace your chameleon boot file with the one from here and add these to boot.plist to get unique UUID and restart fix:
Code:

    <key>DeviceID</key>
    <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>

    <key>RestartFix</key>
    <string>YES</string>


mm67 12-21-2009 02:24 PM

Quote:

Originally Posted by Sweaty (Post 41562)
With this and new restart patch chameleon booter from Duvel (strong beer that) I have only fakesmc as an added kext, although I'm about to reinstall voodoohda so I can hopefully have two soundcards working.. anyway this is mm67's work I just found it a pain to find the detail on insane so posting it here.. Thanks to all who put together these fixes. Need to add the two operation region bits and change your method PTS

Code:

    OperationRegion (DEBG, SystemIO, 0x80, One)
    Field (DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,  8
    }

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,  4,
        SLPE,  1,
                Offset (0x08),
        GPSE,  16,
        GPSS,  16,
                Offset (0x12),
            ,  1,
        SWGC,  1
    }

    Method (_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
        Store (Local0, DBG1)
        Store (Zero, \_SB.PCI0.LPCB.AG3E)
        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }
    }


It's only this :
Code:

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,  4,
        SLPE,  1,

and this:
Code:

        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }

that make the shutdown work, rest of the code is Gigabyte specific. This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)

Sweaty 12-21-2009 03:43 PM

Ok cheers mate, had to add the other bits on my board (asus p5ql/epu) to get it to compile, I'll try the simpler way later.. At least it did work the way I bodged it :)

EDIT: OK fixed code as you suggested I needed to use 0x830, also got rid of unnecessary bits, sometimes I needed to turn PSU off with 0x430 (before I could restart, shutdown was complete), that seems fixed now. Thanks a lot.

adityaxavier 01-09-2010 08:36 AM

Hi Guys,

Im in a fix.. Everywhere there is a DSDT Fix for getting the USB port to be displayed as Built-in but i need the opposite..
USB - 3 shows as built-in, but it has bluetooth. hence on sleep i loose bluetooth.. if i remove the entry altogether, i have it as external but my sleep fails..

Any help would be greatly appreciated.
Am having Lenovo T60p. with ICH7-M chipset.

Thanks,
Xavier

ping99 01-18-2010 02:42 PM

Shutdown & Restart with sleep fix-Thanks to Sweaty & mm67
 
Many thanks to Sweaty and mm67. You are really nice. This resolve the problem I thought it would never be resloved.

I just made a small change to Method (_PTS, 1, NotSerialized) in order to resolve sleep issue on my notebook CQ60-202TX. Now let me put all together step by step as a guide. This might help newbie.

1 Add OperationRegion below before Method (_PTS, 1, NotSerialized)
OperationRegion (DEBG, SystemIO, 0x80, One)
Field (DEBG, ByteAcc, NoLock, Preserve)
{
DBG1, 8
}

OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
Field (PMRS, ByteAcc, NoLock, Preserve)
{
, 4,
SLPE, 1,
Offset (0x08),
GPSE, 16,
GPSS, 16,
Offset (0x12),
, 1,
SWGC, 1
}

2 Check Device (LPC) if there is a similar Operation Region "LPC" like below. If you don't have LPC device, just search Name (_ADR, 0x001F0000), sometimes the device name is different.
Device (LPC)
{
Name (_ADR, 0x001F0000)
OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
Field (LPC0, ByteAcc, NoLock, Preserve)
{
AG3E, 1
}
If there is no OperationRegion LPC, please add code above. In my dsdt's OperationRegion LPC0, there is an EXPE instead of AG3E. So I did not modify it, but had to change a bit in Method (_PTS, 1, NotSerialized) . See mine below:
OperationRegion (LPC0, PCI_Config, 0x40, 0xC0)
Field (LPC0, AnyAcc, NoLock, Preserve)
{
Offset (0x60),
, 10,
EXPE, 1
}

3 Add code below in Method (_PTS, 1, NotSerialized) like this
Method (_PTS, 1, NotSerialized)
{
Or (Arg0, 0xF0, Local0)
Store (Local0, DBG1)
Store (Zero, \_SB.PCI0.LPC.EXPE) //Please change to \_SB.PCI0.LPC.AG3E if you don't have the EXPE, but add AG3E.
If (LEqual (Arg0, 0x05))
{
Store (Zero, SLPE)
Sleep(0x10)
}
Else
{
//**Original Code, this resolved my sleep issue.
}
}

//This is written by mm67. You are really nice.
This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)

4 Add these in your com.apple.Boot.plist and then put "boot_RC4_Duvelv2.1_Rekursor" under your boot partition.
<key>DeviceID</key>
<string>******XX-***X-***X-***X-************</string>
<key>RestartFix</key>
<string>YES</string>

Now you can remove OpenHaltRestart.kext and PlatformUUID.kext or other similar kexts.

pocenk 01-29-2010 10:05 AM

does anyone have dsdt for EP45-DS5? i'm trying to patch myself and always failed

please help

Nameci 01-31-2010 02:11 AM

1 Attachment(s)
Quote:

Originally Posted by pentiumpc (Post 21190)
Most portable system don't sleep on closing the LID, I tried to find a DSDT fix for it but cannot find it. (google is my best friend.) so I wrote 1 to fix my own.

If you have a better or alternative method, please let me know. Thanks.

Device (LID0)
{
Name (_HID, EisaId ("PNP0C0D")) //LID detection
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0B,
0x04
})
}
Name (LIDS, One)
Method (_LID, 0, NotSerialized)
{
Store (^^PCI0.SBRG.EC0.SF13, LIDS) //LID register
XOr (LIDS, One, Local0)
IF (Local0) //if LID is closed
{
Notify (SLPB, 0x80) //Set system to sleep
}
Return (LIDS)
}


LID device should be easy to find, just need to add a line to notify the system to sleep.

On most system, (I think) depends on the OS to set the system to sleep bit OS X don't understand the notification sent by the LID device, so I did it in the hardware instead.

Noob here.

Never did work on my dsdt, I have errors after compiling on which it cannot find the registers. After much of googling, I have edited one value on my dsdt, on the LID0, instead of 0x03 I have made it to 0x04. I have sleep on lid close now, but I still don't have wake on lid open or wake on keyboard press after sleep via Fn+F1.

Here is my DSDT.dsl if somebody care to point me to the right direction.

Thanks in advance.

Nameci 01-31-2010 11:18 PM

I have repatched the dsdt once again with a fresh one. I delete all dsdt and did the patching once again, i still have sleep on lid close, Fn+F1, on the power button. I can wake thru power button with no problems, I can wake buy plugging or unplugging a usb device. But no wake on lid open or keyboard.

With this dsdt, clamshelldisplay.kext is not necessary anymore, so I have removed this kext.

Btw I have modded my dsdt on LID as almost the same on earlier post by pentiumpc.

Any ideas on how to enabel wake on lid open?

uman 03-04-2010 03:17 PM

What you need to find is the method that is called upon a lid switch event, which means it is under EC0, the embedded controller device. On a MacBook, it's typically _Q20, which looks like this:

Code:

                    Method (_Q20, 0, NotSerialized)
                    {
                        Store (LSTE, LIDS)
                        Notify (\_SB.LID0, 0x80)
                    }

On my Gateway, it's _Q8A:
Code:

                    Method (_Q8A, 0, NotSerialized)
                    {
                        If (LIDE)
                        {
                            Store ("_Q8A : LID Switch Event", Debug)
                            Store (0x01, LIDE)
                            If (IGDS)
                            {
                                Store (0x90, SMIF)
                                Store (0x00, TRP0)
                            }

                            Notify (\_SB.LID0, 0x80)
                        }

on many other notebooks, it's _Q09. So you'll need to find where it is, and add the appropriate Notify call, to inform the OS that the laptop should be woken up. (I've modified my DSDT to use LID0, to better match the MacBook DSDT).

kizwan 03-11-2010 02:28 PM

Enabled bluetooth on Acer Aspire 9420
 
Hi uman,

Do you remember, not a long time a go, I'm pursuing to enable bluetooth in Mac OS X? I'm still unable to get the bluetooth button working but I'm able to make the bluetooth device working via DSDT hacking. I'm still however unable to trigger the bluetooth ON/OFF button. I even trying to re-map the bluetooth ON/OFF button to another button (Fn+..) but unsuccessful. Therefore, I modify System Wake (_WAK) to enable bluetooth. This is for temporary solution. When hot booting the computer, it need to be put to sleep one time only & waking up the computer will turning ON the bluetooth device. To make it working cleanly, I modify both System Wake (_WAK) and Prepare to Sleep (_PTS). In the process, I also fixed the wireless device won't turn ON after waking from sleep.

_WAK code:-
Code:

    Method (_WAK, 1, NotSerialized)
    {
        Store (Arg0, P80H)
        If (LEqual (Arg0, 0x03))
        {
            Store (CIRT, \_SB.PCI0.LPCB.EC0.CIRE)
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            Store (EEPM, \_SB.PCI0.LPCB.EC0.WEPM)
            Store (CAST, \_SB.PCI0.LPCB.EC0.CAME)
            Store (WLPW, \_SB.PCI0.LPCB.EC0.WLEN)
            Store (BTPW, \_SB.PCI0.LPCB.EC0.BTEN)
            Store (WLLE, \_SB.PCI0.LPCB.EC0.WLLD)
            Store (BTLE, \_SB.PCI0.LPCB.EC0.BTLD)
        }

        Store (0x00, \_SB.PCI0.LPCB.EC0.MUTE)
        Store (0x00, \_SB.PCI0.LPCB.EC0.KTAF)
        Store (0x01, \_SB.PCI0.LPCB.EC0.KTEE)
        // start
        // Add support for Wireless & Bluetooth devices (power & LED).
        // Turned ON Wireless & Bluetooth devices after resume from Sleep.
        Store (0x01, \_SB.PCI0.LPCB.EC0.WLEN)
        Store (0x01, \_SB.PCI0.LPCB.EC0.WLLD)
        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
        // end
..................

_PTS code:-
- Preventing the wireless device from turn OFF before goes to sleep. Therefore, the wireless device can be turn ON after waking from sleep.
Code:

    Method (_PTS, 1, NotSerialized)
    {
        Store (Arg0, P80H)
        Store (0x01, \_SB.PCI0.LPCB.EC0.MUTE)
        If (LEqual (Arg0, 0x03))
        {
            Store (\_SB.PCI0.LPCB.EC0.CIRE, CIRT)
        }

        If (LEqual (Arg0, 0x04))
        {
            Store (0x01, \_SB.PCI0.LPCB.EC0.BLNK)
            Store (0x00, \_SB.PCI0.LPCB.EC0.CIRE)
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            Store (\_SB.PCI0.LPCB.EC0.WEPM, EEPM)
            Store (\_SB.PCI0.LPCB.EC0.CAME, CAST)
            Store (\_SB.PCI0.LPCB.EC0.WLEN, WLPW)
            Store (\_SB.PCI0.LPCB.EC0.BTEN, BTPW)
            Store (\_SB.PCI0.LPCB.EC0.WLLD, WLLE)
            Store (\_SB.PCI0.LPCB.EC0.BTLD, BTLE)
        }

        Store (0x00, \_SB.PCI0.LPCB.EC0.CAME)
        Store (0x00, \_SB.PCI0.LPCB.EC0.CIRE)
        // Preventing Wireless device from turning OFF when system going to Sleep.
        // Store (0x00, \_SB.PCI0.LPCB.EC0.WLEN)
        // start
        // Add support for Wireless (LED) & Bluetooth (power & LED) devices.
        // Turned OFF Wireless (LED) & Bluetooth (power & LED) devices before going to Sleep.
        Store (0x00, \_SB.PCI0.LPCB.EC0.WLLD)
        Store (0x00, \_SB.PCI0.LPCB.EC0.BTEN)
        Store (0x00, \_SB.PCI0.LPCB.EC0.BTLD)
        // end
        If (LEqual (Arg0, 0x05))
        {
            PHSR (0x28, 0x00)
        }
    }

Applying this fix causing the computer unable to sleep anymore because USB4 device (where the bluetooth device attached to) causing the system wake immediately. I remember that according to ACPI Specification revision 4 documentation; in addition to the _PRW control method, _PSW control method can be used to enable or disable the device’s ability to wake a sleeping system.
Quote:

Arguments: (1) Arg0 – An Integer containing a wake capability control
0 – Disable the device’s wake capabilities
1 – Enable the device’s wake capabilities
By looking at USB4 device in DSDT, there is _PSW entry that can be manipulate. This is the entry for USB4 device in DSDT after modifying the argument (set to 0):-
Code:

            Device (USB4)
            {
                Name (_ADR, 0x001D0003)
                OperationRegion (U4CS, PCI_Config, 0xC4, 0x04)
                Field (U4CS, DWordAcc, NoLock, Preserve)
                {
                    U4EN,  2
                }

                Name (_PRW, Package (0x02)
                {
                    0x0E,
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

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

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

The last FIX enable the computer to sleep again.

kizwan

uman 03-12-2010 02:11 AM

Nice work! Too bad I don't have bluetooth!

I've come to the conclusion that getting access to keyboard events is impossible in DSDT. I think you have three choices: construct an AMW0 device kext to bind to the AMW0 (which I presume is in your DSDT). This would be a challenge, but might allow you to be straight retail. Two, hack at ApplePS2Keyboard (if PS2) or something else if USB. Or three, do the same with VoodooPS2 (again if PS2).

If you have USB, your job may be easier, since you might be able to do it outside kernel space.

kizwan 03-12-2010 04:51 PM

Battery indicator
 
Hi uman,

I'm successfully compiled AMW0.kext for SL but got kernel panic while initializing some MethodTerm at boot. Since AMW0.kext project is not finished, I think I'm going to try ACPI4ASUS.kext instead. If ACPI4ASUS.kext developed to works with AMW0 v2 interface (AMW0 and WMID), it should works with other laptop model too.

I'm trying to enable battery icon by patching DSDT. It is being done by adjusting ADP1 & BAT0 code according to DSDT from MBP4,1. Not successful yet, but the battery indicator did show up. It said battery is not detected & current power source is power adapter. Do you think it is possible to make it working by just patching the DSDT?

EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one.
Code:

                    Method (_Q3F, 0, NotSerialized)
                    {
                        // start
                        // auto turn ON Bluetooth device during computer startup
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
                        // end
                        HKEY (0x3F)
                    }

kizwan

breakky 03-13-2010 04:31 AM

Hello to all,

Can you somebody help me to enable my audio on Snow Leopard?My audio chip is Realtek ALC662:
I make a codec dump:You can download and see it.

http://hotfile.com/dl/32500771/8b28f...p.txt.rar.html


I want to fix my audio in DSDT, so I read your tutorial and convert the Default pinconfig on each "[JACK]" device:

Mic (colour:Pink) 01a19830 ---> reversed 3098a101

Mic which is not a jack 99a3093f ---> 3f09a399


HP - 0121401f ---> 1f402101


SPDIF -01441120 ---> 20114401


This is my audio configuration on my laptop.


Thanks in advance!

I don't know how to generate values which I haveto enter in my DSDT.This is my DSDT (HDEF):

Code:

Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                OperationRegion (HDAR, PCI_Config, 0x4C, 0x10)
                Field (HDAR, WordAcc, NoLock, Preserve)
                {
                    DCKA,  1,
                            Offset (0x01),
                    DCKM,  1,
                        ,  6,
                    DCKS,  1,
                            Offset (0x08),
                        ,  15,
                    PMES,  1
                }

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


breakky 03-13-2010 09:40 AM

Quote:

Originally Posted by kizwan (Post 46170)


EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one.
Code:

                    Method (_Q3F, 0, NotSerialized)
                    {
                        // start
                        // auto turn ON Bluetooth device during computer startup
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
                        // end
                        HKEY (0x3F)
                    }

kizwan


Where you put this code?

I searched in my DSDT for
Code:

Method (_Q3F, 0, NotSerialized)
, But didn't find it.I have a laptop with Bluetooth, where to put this code?

uman 03-13-2010 01:21 PM

Quote:

Originally Posted by kizwan (Post 46170)
Hi uman,

I'm successfully compiled AMW0.kext for SL but got kernel panic while initializing some MethodTerm at boot. Since AMW0.kext project is not finished, I think I'm going to try ACPI4ASUS.kext instead. If ACPI4ASUS.kext developed to works with AMW0 v2 interface (AMW0 and WMID), it should works with other laptop model too.

So does Asus use AMW0, or do you need to add that code from AMW0. A WMID kext would be useful as many PC vendors use that interface. uninc's DSDT was hideously intertwined with WMID.

Quote:

I'm trying to enable battery icon by patching DSDT. It is being done by adjusting ADP1 & BAT0 code according to DSDT from MBP4,1. Not successful yet, but the battery indicator did show up. It said battery is not detected & current power source is power adapter. Do you think it is possible to make it working by just patching the DSDT?
I'm not sure, but given that the ACPI 4.0 spec devotes pages and pages to battery and power issues, I think it is at least possible. I also intend to try to solve this (but it's a lower priority for me because my laptop battery is toast anyway). I tried VoodooBattery, which worked great (it told me my battery was toast, lol), but then it kernel panic'ed HARD and I had to repair my disk, so I won't be using that again.

Quote:

EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one.
Code:

                    Method (_Q3F, 0, NotSerialized)
                    {
                        // start
                        // auto turn ON Bluetooth device during computer startup
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
                        // end
                        HKEY (0x3F)
                    }

kizwan
I still don't understand how query methods are executed, nor how they are bound to some device. ACPI says:
Quote:

"For an embedded controller event, OSPM will queue the control method of the name _QXX, where XX is the hex format of the query code. Notice that each embedded controller device can have query event control methods. Similarly, for an SMBus driver, if no driver registers for SMBus alarms, the SMBus driver will queue control methods to handle these. Methods must be placed under the SMBus device with the name _QXX where XX is the hex format of the SMBus address of the device sending the alarm."
And then they discuss it more with a completely unhelpful example. Oh wait, the acpi implementers guide is more helpful:

Quote:

What’s the trap? Using decimal instead of hexadecimal numbers in _Lxx, _Exx, and _Qxx names in your ASL code. When the number (xx) in the _Lxx, _Exx, or _Qxx event handler object name in the ASL code does not match the number of the bit in the GPE register block (or match the number of the embedded controller query number in the case of _Qxx), then the OS loses events. For more information about the relationship of event handler object names and bits on the GPE register block, see section 5.6.2.2.

Tip: The xx in the event handler name is a hexadecimal number that corresponds to the GPE register bit or EC query number the event is tied to. For example, the level-triggered event tied to bit 11 of the GPEx register block must be named _L0B, not _L11.
DSDT is fun ;) but time consuming!

uman 03-13-2010 01:26 PM

Quote:

Originally Posted by breakky (Post 46201)
Where you put this code?

I searched in my DSDT for
Code:

Method (_Q3F, 0, NotSerialized)
, But didn't find it.I have a laptop with Bluetooth, where to put this code?

Each laptop model is going to be different. That's why you have to be prepared to do some work to get DSDT going. You will first need to determine what symbols, events, and queries correspond to your bluetooth device. Then kizwan's code can act as a guide.

kizwan 03-13-2010 01:32 PM

Quote:

Originally Posted by breakky (Post 46201)
Where you put this code?

I searched in my DSDT for
Code:

Method (_Q3F, 0, NotSerialized)
, But didn't find it.I have a laptop with Bluetooth, where to put this code?

It is hardware & BIOS specific. You may have different query method. I'm afraid, you need to try & error every query method in your DSDT.

EDIT: You may want to follow uman suggestion (next post) to get your audio working. It is much easier.
As for your sound, you need to do a lot of work to get your sound working. You already have HDEF entry in DSDT, so you just missing legacy/patched kext. You need to put your ConfigData & Pin Config in legacy/patched kext. Use this legacy kext as a template:-
http://www.mediafire.com/?vkzyzmtzozo
If you like to put ConfigData & PinConfigurations in DSDT, this is how HDEF entry will look like (between "// start" & "// end"):-
Code:

            Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                Name (HDWA, 0x00)
                Name (_PRW, Package (0x02)
                {
                    0x05,
                    0x03
                })
                Method (_PS0, 0, Serialized)
                {
                    If (LEqual (HDWA, 0x00))
                    {
                        Store (0x01, HDWA)
                        HKEY (0x8F)
                    }
                }

                Method (_PS3, 0, Serialized)
                {
                    Store (0x00, HDWA)
                }
                // start - required code
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x0C)
                    {
                        "built-in",
                        Buffer (One)
                        {
                            0x00
                        },

                        "codec-id",
                        Buffer (0x04)
                        {
                            0x83, 0x08, 0xEC, 0x10
                        },

                        "ConfigData",
                        Buffer (0x40)
                        {
                            /* 0000 */    0x01, 0x47, 0x1C, 0x30, 0x01, 0x47, 0x1D, 0x11,
                            /* 0008 */    0x01, 0x47, 0x1E, 0x0B, 0x01, 0x47, 0x1F, 0x01,
                            /* 0010 */    0x01, 0x87, 0x1C, 0x10, 0x01, 0x87, 0x1D, 0x01,
                            /* 0018 */    0x01, 0x87, 0x1E, 0xA0, 0x01, 0x87, 0x1F, 0x90,
                            /* 0020 */    0x01, 0xA7, 0x1C, 0x20, 0x01, 0xA7, 0x1D, 0x31,
                            /* 0028 */    0x01, 0xA7, 0x1E, 0x81, 0x01, 0xA7, 0x1F, 0x01,
                            /* 0030 */    0x01, 0xE7, 0x1C, 0x40, 0x01, 0xE7, 0x1D, 0xE1,
                            /* 0038 */    0x01, 0xE7, 0x1E, 0x45, 0x01, 0xE7, 0x1F, 0x01
                        },

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

                        "device-type",
                        Buffer (0x11)
                        {
                            "Mobile ALC883 S/T"
                        },

                        "PinConfigurations",
                        Buffer (0x10)
                        {
                            /* 0000 */    0x30, 0x11, 0x0B, 0x01, 0x10, 0x91, 0xAB, 0x01,
                            /* 0008 */    0x20, 0x31, 0x81, 0x01, 0x40, 0xE1, 0x45, 0x01
                        }
                    }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }
                // end - required code
            }

I'll try to construct ConfigData & PinConfigurations for you but I can't promise.

kizwan

uman 03-13-2010 01:33 PM

Are you planning to use VoodooHDA, or AppleHDA? If Voodoo, first rename all references to HDEF to ALC6 (or whatever turns you on :)) Doing so will prevent AppleHDA from loading and matching your HDA device. If AppleHDA is loaded, then VoodooHDA doesn't load.

Next, and this is common for both Apple and Voodoo. Add this to your HDEF or ALC6 device:
Quote:

Method (_DSM, 4, NotSerialized)
{
Store (Package (0x04)
{
"layout-id",
Buffer (0x04)
{
0x0C, 0x00, 0x00, 0x00
},

"PinConfigurations",
Buffer (Zero) {}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
You can then add your pin configs in there or in the plist depending on how you want to get sound going. See the great guide on infinitemac, or the one on projectosx.

Search my posts and look for my question on pinconfigs to find the links. I'm still trying to find out how to get my pinconfigs without Windows, since I don't run that anymore!

barnum 03-13-2010 02:14 PM

Hi kizman,

Quote:

Originally Posted by kizwan (Post 46132)
By looking at USB4 device in DSDT, there is _PSW entry that can be manipulate. This is the entry for USB4 device in DSDT after modifying the argument (set to 0):-
Code:

            Device (USB4)
            {
                Name (_ADR, 0x001D0003)
                OperationRegion (U4CS, PCI_Config, 0xC4, 0x04)
                Field (U4CS, DWordAcc, NoLock, Preserve)
                {
                    U4EN,  2
                }

                Name (_PRW, Package (0x02)
                {
                    0x0E,
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

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

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

The last FIX enable the computer to sleep again.

kizwan

can you tell me what modification should I apply to this code to disable sleep for a device in usb2 ?

regards,
Vincent

kizwan 03-13-2010 02:24 PM

Quote:

Originally Posted by uman (Post 46202)
So does Asus use AMW0, or do you need to add that code from AMW0. A WMID kext would be useful as many PC vendors use that interface. uninc's DSDT was hideously intertwined with WMID.

Looks like I still need to go through WMI and ACPI documentation to have better understanding. ;) Then I can make this successful.
Quote:

Originally Posted by uman (Post 46202)
I'm not sure, but given that the ACPI 4.0 spec devotes pages and pages to battery and power issues, I think it is at least possible. I also intend to try to solve this (but it's a lower priority for me because my laptop battery is toast anyway). I tried VoodooBattery, which worked great (it told me my battery was toast, lol), but then it kernel panic'ed HARD and I had to repair my disk, so I won't be using that again.

Yeah, it's a low priority for me too. Just playing around.

I guess to make it working, maybe need to determine which query method it use. I said that because I found that there are query method that called ADP1 & BAT0 device. Just don't know what it do & what it contribute to battery detection.
Quote:

Originally Posted by uman (Post 46202)
I still don't understand how query methods are executed, nor how they are bound to some device. ACPI says: And then they discuss it more with a completely unhelpful example. Oh wait, the acpi implementers guide is more helpful:

I'm going to grab the acpi implementers guide.
Quote:

Originally Posted by uman (Post 46202)
DSDT is fun ;) but time consuming!

I agree. :)

kizwan 03-13-2010 02:32 PM

Quote:

Originally Posted by barnum (Post 46209)
Hi kizman,
.....................
can you tell me what modification should I apply to this code to disable sleep for a device in usb2 ?
..................

Do you mean you want to disable USB2 capability to wake a sleeping system, don't you? If in "Device (USB2)" entry it have _PSW (Power State Wake) method, you will need to change it according to my modification.
Code:

                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

Refer to arguments for _PSW:
Quote:

Arguments: (1)
Arg0 – An Integer containing a wake capability control
0 – Disable the device’s wake capabilities
1 – Enable the device’s wake capabilities
That is why I change both condition to execute the same thing. So that it always execute the same "Store" operation as if it is Arg0=0.



kizwan

breakky 03-13-2010 02:55 PM

Quote:

Originally Posted by uman (Post 46205)
Are you planning to use VoodooHDA, or AppleHDA? If Voodoo, first rename all references to HDEF to ALC6 (or whatever turns you on :)) Doing so will prevent AppleHDA from loading and matching your HDA device. If AppleHDA is loaded, then VoodooHDA doesn't load.

Next, and this is common for both Apple and Voodoo. Add this to your HDEF or ALC6 device:
You can then add your pin configs in there or in the plist depending on how you want to get sound going. See the great guide on infinitemac, or the one on projectosx.

Search my posts and look for my question on pinconfigs to find the links. I'm still trying to find out how to get my pinconfigs without Windows, since I don't run that anymore!


I planed to use AppleHDA with DSDT.aml fix.This is my original DSDT.aml

http://hotfile.com/dl/32576445/45eb3...T.dsl.zip.html


By the way I use AsereBLN booter 1.1.9.

kizwan 03-13-2010 07:56 PM

Quote:

Originally Posted by breakky (Post 46213)
I planed to use AppleHDA with DSDT.aml fix.This is my original DSDT.aml

Try this legacy kext for ALC662 (Snow Leopard):-
http://www.mediafire.com/?kmnykkqmy5m

Make sure AppleHDA.kext in /System/Library/Extensions/ folder is original kext. Remember to put _DSM method in Device (HDEF) (please refer to uman's post #81).

You also need to put DTGP code in DSDT. Put it afterMethod (_WAK) function.
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)
    }

kizwan

breakky 03-14-2010 03:59 AM

When I try to compile my dsdt.dsl I get one error:

Code:

4644: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error    4067 -    ^ Object is not accessible from this scope (DTGP)


Nevermind I found where is the error and fix it!

kizwan 03-14-2010 07:23 AM

Quote:

Originally Posted by breakky (Post 46239)
When I try to compile my dsdt.dsl I get one error:

Code:

4644: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error    4067 -    ^ Object is not accessible from this scope (DTGP)


Nevermind I found where is the error and fix it!

How about the sound? Is it working?

richarda 03-16-2010 04:39 PM

Hello all,

This thread has been very useful for me. I now just miss one last step to have the "perfect" install.
I'm running Snow Leopard on an ASUS eeePC 901 from the SD card. It's a bit slow but this is OK.

My problem: whenever I go to sleep and wake-up from sleep, I guess the SD card (my "boot drive") gets brutally ejected and.....well, it's bad.

My question: is there any DSDT mod that would allow my SD card to stay mounted (powered maybe) during all the cycle wake-sleep-wake ?

I found a lot of approaching stuff on the thread but nothing exactly like that. this would make may day.

Any idea anyone ?

Thanks, Richard.

uman 03-18-2010 04:58 AM

Quote:

Originally Posted by richarda (Post 46325)
Hello all,

This thread has been very useful for me. I now just miss one last step to have the "perfect" install.
I'm running Snow Leopard on an ASUS eeePC 901 from the SD card. It's a bit slow but this is OK.

My problem: whenever I go to sleep and wake-up from sleep, I guess the SD card (my "boot drive") gets brutally ejected and.....well, it's bad.

My question: is there any DSDT mod that would allow my SD card to stay mounted (powered maybe) during all the cycle wake-sleep-wake ?

I found a lot of approaching stuff on the thread but nothing exactly like that. this would make may day.

Any idea anyone ?

Thanks, Richard.

Yes, but it depends on the underlying hardware. I've found los of good info about my own laptop in my chipset doc (ICH7), and there is lots of good info on the SATA part of the device control. I assume the SSD is controled through SATA??

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