Jump to content

GA-EX58 and GA-X58A DSDT native power management modifications


  • Please log in to reply
1675 replies to this topic

#181
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

It's the OS that dictates which interrupt controller to use. I don't think that Apple even supports PIC because it's impossible (?) to use on the SMP systems.



So does that mean the bit about PICM or PICF or APIC is essentially meaningless in an OS X DSDT
Therefore it is safe to delete all PICM/PICF etc

Method (_PRT, 0, NotSerialized)                {                    If (LNot (PICF))                    {                        Return (PICM)                    }                    Else                    {                        Return (APIC)                    }                }

If this is so then we can junk loads of stuff on LNKx & BUFA etc

But when I tried this I got a hang on boot while initialising USB

#182
FUT1L1TY

FUT1L1TY

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 110 posts

There's a solution to make resume after sleep to work properly without requiring user to tick the "Start up automatically after a power failure" checkbox.

Guys at the DSDT fixes for Gigabyte boards thread narrowed down the problem to the GEN_PMCON_3 register (spec page 454, see description for bit 0).


sr2, I tried the changes you specified but got the following compiler error:
dsdt.dsl   499:             Store (Zero, SLPE)Error    4063 -       Object does not exist ^  (SLPE)
Looking through your dsdt.aml I found SLPE here:
OperationRegion (PMRS, SystemIO, 0x0430, One)    Field (PMRS, ByteAcc, NoLock, Preserve)    {            ,   4,         SLPE,   1,                 Offset (0x08),         GPSE,   16,         GPSS,   16,                 Offset (0x12),             ,   1,         SWGC,   1    }
The closest I have is this:
OperationRegion (AGPS, SystemIO, 0x0438, 0x04)    Field (AGPS, ByteAcc, NoLock, Preserve)    {        GPSE,   16,         GPSS,   16    }    OperationRegion (GPCN, SystemIO, 0x0442, One)    Field (GPCN, ByteAcc, NoLock, Preserve)    {            ,   1,         SWGC,   1,                 Offset (0x01)    }
Can I replace my code with yours or is it not that simple? I've enclosed my dsdt (prior to applying your patch) in case you would like to take a look. Thank you. I'm looking forward to getting this working.

Attached Files



#183
sr2

sr2

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts

So does that mean the bit about PICM or PICF or APIC is essentially meaningless in an OS X DSDT
Therefore it is safe to delete all PICM/PICF etc

Method (_PRT, 0, NotSerialized)                {                    If (LNot (PICF))                    {                        Return (PICM)                    }                    Else                    {                        Return (APIC)                    }                }

Do you mean that you also deleted all APIC packages? Btw this method should look like this after cleanup:
Method (_PRT, 0, NotSerialized)
				{
						Return (APIC)
				}

If this is so then we can junk loads of stuff on LNKx & BUFA etc

But when I tried this I got a hang on boot while initialising USB

Can you upload your (working) DSDT somewhere so I can try to strip PIC and LNK stuff?

sr2, I tried the changes you specified but got the following compiler error:

dsdt.dsl   499:             Store (Zero, SLPE)Error    4063 -       Object does not exist ^  (SLPE)
Can I replace my code with yours or is it not that simple? I've enclosed my dsdt (prior to applying your patch) in case you would like to take a look. Thank you. I'm looking forward to getting this working.


Yes, you can replace AGPS and GPCN operation regions with the PMRS one. Also see item #16 in the first post to get the reasoning behind adding SLPE field.

Also I have tried your DSDT with my modifications to see whether wake-up works or not. It seems like it does, but I had trouble waking up my machine by using either keyboard or mouse. I was able to wake it up by pulling out usb stick . I don't have this problem with my DSDT though.

Here's a diff between original and modified DSDT:
--- original.dsl	2010-01-02 17:06:48.000000000 +0300
+++ modified.dsl	2010-01-03 11:01:41.000000000 +0300
@@ -427,6 +427,13 @@
		 APMD,   8
	 }
 
+	OperationRegion (PMRS, SystemIO, 0x0430, 0x01)
+	Field (PMRS, ByteAcc, NoLock, Preserve)
+	{
+		, 4,
+		SLPE, 1
+	}
+
	 OperationRegion (AGPS, SystemIO, 0x0438, 0x04)
	 Field (AGPS, ByteAcc, NoLock, Preserve)
	 {
@@ -493,20 +500,18 @@
	 {
		 Or (Arg0, 0xF0, Local0)
		 Store (Local0, DBG1)
-		OSTP ()
-		If (LEqual (Arg0, One)) {}
-		If (LEqual (Arg0, 0x03)) {}
+		OSTP()
+
		 If (LEqual (Arg0, 0x05))
		 {
			 Store (0x99, SMIP)
+			Store (One, \_SB.PCI0.PX40.AG3E)
+			Store (Zero, SLPE)
+			Sleep (0x10)
		 }
-
-		If (LEqual (Arg0, 0x04))
+		Else
		 {
-			If (LNot (PICF))
-			{
-				Sleep (0x64)
-			}
+			Store (Zero, \_SB.PCI0.PX40.AG3E)
		 }
	 }
 
@@ -3216,6 +3221,12 @@
					 Return (Local0)
				 }
 
+				OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
+				Field (LPC0, ByteAcc, NoLock, Preserve)
+				{
+					AG3E,   1
+				}
+
				 OperationRegion (PREV, PCI_Config, 0x08, One)
				 Scope (\)
				 {
Also I'll attach your modified DSDT so you don't need to apply modifications again.
Attached File  dsdt.zip   19.72KB   9 downloads

#184
kdawg

kdawg

    InsanelyMac Legend

  • Donators
  • 508 posts
  • Gender:Male
  • Location:Boston, MA

So does that mean the bit about PICM or PICF or APIC is essentially meaningless in an OS X DSDT
Therefore it is safe to delete all PICM/PICF etc

Method (_PRT, 0, NotSerialized)                {                    If (LNot (PICF))                    {                        Return (PICM)                    }                    Else                    {                        Return (APIC)                    }                }

If this is so then we can junk loads of stuff on LNKx & BUFA etc

But when I tried this I got a hang on boot while initialising USB

Your _PRTs should look something like this.
Method (_PRT, 0, NotSerialized) {			  
					Return (Package (0x04) {				   
						Package (0x04){0xFFFF,Zero,Zero,0x11}, 
						Package (0x04){0xFFFF,One,Zero,0x12}, 
						Package (0x04){0xFFFF,0x02,Zero,0x13}, 
						Package (0x04){0xFFFF,0x03,Zero,0x10}
					})
				}

Check the DSDT in my signature for more on getting rid of those things. Or are you saying you don't need _PRT all together?

#185
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

Do you mean that you also deleted all APIC packages? Btw this method should look like this after cleanup:

Method (_PRT, 0, NotSerialized)
				{
						Return (APIC)
				}


Can you upload your (working) DSDT somewhere so I can try to strip PIC and LNK stuff?



Yes, you can replace AGPS and GPCN operation regions with the PMRS one. Also see item #16 in the first post to get the reasoning behind adding SLPE field.

Also I have tried your DSDT with my modifications to see whether wake-up works or not. It seems like it does, but I had trouble waking up my machine by using either keyboard or mouse. I was able to wake it up by pulling out usb stick . I don't have this problem with my DSDT though.

Here's a diff between original and modified DSDT:
--- original.dsl	2010-01-02 17:06:48.000000000 +0300
+++ modified.dsl	2010-01-03 11:01:41.000000000 +0300
@@ -427,6 +427,13 @@
		 APMD,   8
	 }
 
+	OperationRegion (PMRS, SystemIO, 0x0430, 0x01)
+	Field (PMRS, ByteAcc, NoLock, Preserve)
+	{
+		, 4,
+		SLPE, 1
+	}
+
	 OperationRegion (AGPS, SystemIO, 0x0438, 0x04)
	 Field (AGPS, ByteAcc, NoLock, Preserve)
	 {
@@ -493,20 +500,18 @@
	 {
		 Or (Arg0, 0xF0, Local0)
		 Store (Local0, DBG1)
-		OSTP ()
-		If (LEqual (Arg0, One)) {}
-		If (LEqual (Arg0, 0x03)) {}
+		OSTP()
+
		 If (LEqual (Arg0, 0x05))
		 {
			 Store (0x99, SMIP)
+			Store (One, \_SB.PCI0.PX40.AG3E)
+			Store (Zero, SLPE)
+			Sleep (0x10)
		 }
-
-		If (LEqual (Arg0, 0x04))
+		Else
		 {
-			If (LNot (PICF))
-			{
-				Sleep (0x64)
-			}
+			Store (Zero, \_SB.PCI0.PX40.AG3E)
		 }
	 }
 
@@ -3216,6 +3221,12 @@
					 Return (Local0)
				 }
 
+				OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
+				Field (LPC0, ByteAcc, NoLock, Preserve)
+				{
+					AG3E,   1
+				}
+
				 OperationRegion (PREV, PCI_Config, 0x08, One)
				 Scope (\)
				 {
Also I'll attach your modified DSDT so you don't need to apply modifications again.
Attached File  dsdt.zip   19.72KB   9 downloads


Thanks for the tips folks.

I accidentally overwrote my dsdt with the full edits, I'll have to see if I can find it in timemachine

If not I can recreate fairly easily from my latest incremental edit

I'll upload it as soon as I get it back which may be in the next 24hrs

edit : It may come as no surprise, but if you turn off JMicron etc and remove it from DSDT then the following
error disappears

Unknown AHCI Standard Controller:Vendor:	UnknownProduct:	AHCI Standard ControllerSpeed:	3 GigabitDescription:	AHCI Version 1.00 Supported

Attached Files



#186
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

Thanks for the tips folks.

I accidentally overwrote my dsdt with the full edits, I'll have to see if I can find it in timemachine

If not I can recreate fairly easily from my latest incremental edit

I'll upload it as soon as I get it back which may be in the next 24hrs

edit : It may come as no surprise, but if you turn off JMicron etc and remove it from DSDT then the following
error disappears

Unknown AHCI Standard Controller:Vendor:	UnknownProduct:	AHCI Standard ControllerSpeed:	3 GigabitDescription:	AHCI Version 1.00 Supported


I managed to find it in TimeMachine

DO NOT USE unless you have a backup DSDT - This Fails on Boot

This has most of my edits todate inc removal of JMicron, etc plus removal of LNK, BUFA etc
but the APIC needs fixing

Attached Files



#187
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

I managed to find it in TimeMachine

DO NOT USE unless you have a backup DSDT - This Fails on Boot

This has most of my edits todate inc removal of JMicron, etc plus removal of LNK, BUFA etc
but the APIC needs fixing



Here is what I currently use without JMicron but with PICM/PICF still in

Seems to work without problem, the previous version was a delta on this

Attached Files



#188
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

Here is what I currently use without JMicron but with PICM/PICF still in

Seems to work without problem, the previous version was a delta on this



I would add that if people use this without thinking...

I removed all the IDE 1 & 2 and changed to SATA

It is not specifying ICH10® but ESB2 (you don't need a kext for orange icons)
Some people claim it causes Seagate HD's to die, but I'm using WD - not caused me any problems

It includes the DSDT fix so you don't need EvoReboot or OpenHaltRestart kexts (restart doesn't work without
the hacked RC4 boot file though)

I think Firewire may have got moved to the wrong place, haven't got around to putting it back

#189
sr2

sr2

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts
LocusOfControl,

I assume that you have the Gigabyte GA-EX58-UD5. One little question: why your DSDT looks almost like the DSDT from here? Aren't those DSDTs are made for GA-EP35-DS3L owners?

I don't mean that it's a bad thing to copy & paste some parts from the above mentioned DSDTs, but you have done it quite radically and I can see differences in the "core" stuff (e.g. _PRT objects) on the first sight.

Oh, and if you're already set to go with your current DSDT I think you can remove _INI method and the PWRC OperationRegion from both EHC1 and EHC2 devices. I think this was done because Gigabyte GA-EP45-DS3 didn't announce any PM capabilities for EHCI controllers (see this). Gigabyte GA-EX58-UD5 does this right:

00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 (prog-if 20 [EHCI])
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-



#190
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

LocusOfControl,

I assume that you have the Gigabyte GA-EX58-UD5. One little question: why your DSDT looks almost like the DSDT from here? Aren't those DSDTs are made for GA-EP35-DS3L owners?

I don't mean that it's a bad thing to copy & paste some parts from the above mentioned DSDTs, but you have done it quite radically and I can see differences in the "core" stuff (e.g. _PRT objects) on the first sight.

Oh, and if you're already set to go with your current DSDT I think you can remove _INI method and the PWRC OperationRegion from both EHC1 and EHC2 devices. I think this was done because Gigabyte GA-EP45-DS3 didn't announce any PM capabilities for EHCI controller (see this). Gigabyte GA-EX58-UD5 does this right:



I don't know if you have followed that thread but I believe the intention was to create a generic GB DSDT aligned
with Apple terminology. This was based on earlier efforts on Asus boards.

edit : Ta, it seems you have been following a lot of threads

If you look you will see that most values are the same just renamed although the processor info is as per d00d

It is possible I made some early errors since I'm just getting the hang of this ;)
It does seem work without issue for me as I generally make incremental edits and test, but there is probably room
for improvement

#191
mm67

mm67

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 673 posts
  • Gender:Male
  • Location:Finland

LocusOfControl,

I assume that you have the Gigabyte GA-EX58-UD5. One little question: why your DSDT looks almost like the DSDT from here? Aren't those DSDTs are made for GA-EP35-DS3L owners?

I don't mean that it's a bad thing to copy & paste some parts from the above mentioned DSDTs, but you have done it quite radically and I can see differences in the "core" stuff (e.g. _PRT objects) on the first sight.

Oh, and if you're already set to go with your current DSDT I think you can remove _INI method and the PWRC OperationRegion from both EHC1 and EHC2 devices. I think this was done because Gigabyte GA-EP45-DS3 didn't announce any PM capabilities for EHCI controllers (see this). Gigabyte GA-EX58-UD5 does this right:


Are the PM capabilities set right already at boot, on Gigabyte P35 and P45 boards those capabilities get correct values after system has gone to sleep for first time. That's however too late since OS X checks those values only when booting.

#192
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

Are the PM capabilities set right already at boot, on Gigabyte P35 and P45 boards those capabilities get correct values after system has gone to sleep for first time. That's however too late since OS X checks those values only when booting.


mm67, I'm not sure what you mean, could you clarify ?

"Are the PM capabilities set right already at boot"

#193
mm67

mm67

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 673 posts
  • Gender:Male
  • Location:Finland

mm67, I'm not sure what you mean, could you clarify ?

"Are the PM capabilities set right already at boot"


On P35 and P45 boards output of lspci changes after sleep. Run lspci -nnvv -s 0:1d.7 right after boot, then put system to sleep, wake up and run the same command again. Look for changes on this line:

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

#194
FUT1L1TY

FUT1L1TY

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 110 posts

Yes, you can replace AGPS and GPCN operation regions with the PMRS one. Also see item #16 in the first post to get the reasoning behind adding SLPE field.

Also I have tried your DSDT with my modifications to see whether wake-up works or not. It seems like it does, but I had trouble waking up my machine by using either keyboard or mouse. I was able to wake it up by pulling out usb stick . I don't have this problem with my DSDT though.

Also I'll attach your modified DSDT so you don't need to apply modifications again.


sr2, Thank you. That did the trick. Sleep and wake are now working. However, I did not have any troubles using the mouse or keyboard to wake up my machine. Please note, my keyboard and mouse are set to "legacy enabled" in BIOS. I'm not sure if that makes a difference or not. Also, I'm still in Leopard. Thanks again. It's great having sleep back.

#195
sr2

sr2

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts

If you look you will see that most values are the same just renamed although the processor info is as per d00d

I wasn't talking specifically about naming, for example compare the packages returned from the _PRT method of the PCIB device in your DSDT and the one returned from the _PRT method of the HUB0 device in the vanilla DSDT (control goes through Else route).

Are the PM capabilities set right already at boot, on Gigabyte P35 and P45 boards those capabilities get correct values after system has gone to sleep for first time. That's however too late since OS X checks those values only when booting.

Yes. The quote I've posted earlier is taken from the lspci dump that was taken right after I booted my Linux box.

#196
mm67

mm67

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 673 posts
  • Gender:Male
  • Location:Finland

I wasn't talking specifically about naming, for example compare the packages returned from the _PRT method of the PCIB device in your DSDT and the one returned from the _PRT method of the HUB0 device in the vanilla DSDT (control goes through Else route).


Yes. The quote I've posted earlier is taken from the lspci dump that was taken right after I booted my Linux box.


In that case you can remove that patch from dsdt, it wont do anything on your boards.

#197
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

On P35 and P45 boards output of lspci changes after sleep. Run lspci -nnvv -s 0:1d.7 right after boot, then put system to sleep, wake up and run the same command again. Look for changes on this line:

Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)


Here is what I get


Sun 3 Jan 2010 23:59:57 GMT
LocusOfControl:$ lspci -nnvv -s 0:1d.7 | grep PMEClk
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

....
SLEEP
....
LocusOfControl:$ lspci -nnvv -s 0:1d.7 | grep PMEClk
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
LocusOfControl:$

#198
mm67

mm67

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 673 posts
  • Gender:Male
  • Location:Finland

Here is what I get


Sun 3 Jan 2010 23:59:57 GMT
LocusOfControl:$ lspci -nnvv -s 0:1d.7 | grep PMEClk
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)

....
SLEEP
....
LocusOfControl:$ lspci -nnvv -s 0:1d.7 | grep PMEClk
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
LocusOfControl:$


Yes, no need for that patch, Gigabyte has finally fixed even one problem with their boards.

#199
LocusOfControl

LocusOfControl

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 399 posts
  • Gender:Male
  • Location:SG9tZSBvZiB0aGUgbWVhdCBhbmQgcG90YXRvIHBpZQ==

Yes, no need for that patch, Gigabyte has finally fixed even one problem with their boards.


Thanks for the info ..

#200
d00d

d00d

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 479 posts
  • Gender:Male
  • Location:MHT, HYA
Update 4: With DVID wake from S3 sleep is sometimes unsuccessful, so I'm not using it currently.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy