Jump to content
InsanelyMac Forum

zhangqq

Members
  • Content count

    15
  • Joined

  • Last visited

About zhangqq

  • Rank
    InsanelyMac Protégé
  1. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Hi tluck, current.dsl 719: And (\_SB.PCI0.LPC.PIRA, 0x8F, Local0) Optimize 6075 - NamePath optimized ^ (^^PCI0.LPC_.PIRA) It means we can manually change And (\_SB.PCI0.LPC.PIRA, 0x8F, Local0) to And (^^PCI0.LPC.PIRA, 0x8F, Local0). I think the reason is the latter code is shorter so it may(I'm not sure) be faster for AML interpreter to execute it. current.dsl 722: ShiftLeft (0x01, Local0, IRA1) Optimize 6039 - ^ Integer optimized to single-byte AML opcode (One) It means we can manually change ShiftLeft (0x01, Local0, IRA1) to ShiftLeft (One, Local0, IRA1). current.dsl 726: Store (0x00, IRA1) Optimize 6039 - ^ Integer optimized to single-byte AML opcode (Zero) It means we can manually change Store (0x00, IRA1) to Store (Zero, IRA1). For IASL v4, to change 0x01 to One and to change 0x00 to Zero are not always allowed. For example Package(0x01) ==> Package(One) is not allowed for IASL v4( v5 is ok ). I prefer to keep 0x01 and 0x00 without changed.
  2. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Hi tluck, I studied dsdt.aml from a real MBP8,2 and found it is not optimized. I think maybe the difference is here: CreateWordField (BUFA, \_SB.LNKA._Y00._INT, IRA1) // _INT: Interrupts CreateWordField (BUFA, One, IRA1) Do you know why \_SB.LNKA._Y00._INT always equals to One ? The most interesting thing is my 10.8.5 UEFI system also works after I applied the new dsdt.aml. (I manually did all other optimizations so I don't need iasl to do any optimizations for me. )
  3. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Hi tluck, I hope my discovery ends the long time struggle against the UEFI sleep issue. Please use MaciASL to open dsdt.dsl and dsdt.aml together and search _Y00. You will find the difference. My solution is to turn off all iasl optimizations to compile dsdt.dsl. I use "iasl -oa dsdt.dsl". Then use MaciASL to open dsdt.dsl and dsdt.aml again and search _Y00 to see the result. My UEFI system can sleep now. You can find the most recent iasl from the MaciASL/contents/MacOS folder. I added some more info below. Original version is here: Name (BUFA, ResourceTemplate () { IRQ (Level, ActiveLow, Shared, _Y00) {} }) CreateWordField (BUFA, \_SB.LNKA._Y00._INT, IRA1) // _INT: Interrupts Optimized version is here: Name (BUFA, ResourceTemplate () { IRQ (Level, ActiveLow, Shared, ) {} }) CreateWordField (BUFA, One, IRA1) You will find _Y01, _Y02, ... are optimized. I also test this method with 10.8.5 and it works too.
  4. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Yes tluck, My W520 works with AppleACPIPlatform.kext 2.0 but only when I turn off VT-D and I also ptached DSDT for battery. I will study your DSDT again.Thank you very much!
  5. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Hi tluck, Could you tell me how you make AppleACPIPlatform.kext 2.0 work? I can only use 1.3.6 on my W520. Thank you! I just found I have to turn off vt-d to use AppleACPIPlacform.kext 2.0. I downloaded your AppleHDA.kext and found AppleHDAHardwareConfigDriver is version 2.5.2fc2 which should be 2.6.0.
  6. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    My solution of speaker no sound after sleep. (I can only use the Fn key and the power button to activate my W520. ) Method (_L1D, 0, NotSerialized) // _Lxx: Level-Triggered GPE { Store (B1B2 (\_SB.PCI0.LPC.EC.HWK0, \_SB.PCI0.LPC.EC.HWK1), Local0) Store (Local0, RRBF) Sleep (0x0A) If (And (Local0, 0x02)) {} If (And (Local0, 0x04)) { Notify (\_SB.LID, 0x02) Notify (\_SB.PCI0.HDEF, 0x02) // Add this line } If (And (Local0, 0x08)) { Notify (\_SB.SLPB, 0x02) Notify (\_SB.PCI0.HDEF, 0x02) // Add this line } If (And (Local0, 0x10)) { Notify (\_SB.SLPB, 0x02) Notify (\_SB.PCI0.HDEF, 0x02) // Add this line } If (And (Local0, 0x40)) {} If (And (Local0, 0x80)) { Notify (\_SB.SLPB, 0x02) Notify (\_SB.PCI0.HDEF, 0x02) // Add this line } }
  7. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    I just studied P8Z68-V PRO's dsdt and found something interesting. Name (SMCR, 0x0430) OperationRegion (SLPR, SystemIO, SMCR, 0x08) Field (SLPR, ByteAcc, NoLock, Preserve) { , 4, SLPE, 1, , 31, SLPX, 1 } Method (SWAK, 1, NotSerialized) { Store (Zero, SLPE) If (LNot (RTCS)) { Notify (PWRB, 0x02) } } Method (_PTS, 1, NotSerialized) { Store (Zero, P80D) P8XH (Zero, Arg0) If (Arg0) { Store (One, \_SB.PCI0.LPCB.SLPX) <==I think this is another one we missed. Store (One, \_SB.PCI0.LPCB.SLPE) <== ASUS put SLPE here, it is the same as our SLPE. If (LAnd (LGreater (Arg0, 0x03), LLess (Arg0, 0x06))) { Store (Arg0, \_SB.SMIC) Store (One, GP27) } } } Method (_WAK, 1, Serialized) { ShiftLeft (Arg0, 0x04, DBG8) \_SB.PCI0.LPCB.SWAK (Arg0) Store (Zero, \_SB.PCI0.LPCB.PLED) Return (Package (0x02) { Zero, Zero }) } } I found the follow combination worked. 1) SlpSmiAtWake => true 2) Add SLPE = 0 to _WAK and SLPE = 1 to _PTS(arg0 = 1,3,4,5)
  8. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    If (LEqual (Arg0, 0x05)) { TRAP () AWON (0x05) Store (Zero, SLPE) Sleep (0x10) I guess store(zero,SLPE) should be store(one, SLPE). (I won't use the tags for shutdown now.) I also add Store (One, SLPE) and Sleep (0x10) to arg0 = 0x01 0x03 0x04. Then I add Store (Zero, SLPE) and Sleep (0x10) ad the beginning of _WAK and _INI. The shutdown and sleep work fine till now.
  9. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Without those tags it just hung when shutting down(I already added SLPE ).
  10. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    I'm using a W520 and I found I had to use the following tags for shutdown to work. <key>ResetAddress</key> <string>0x64</string> <key>ResetValue</key> <string>0xFE</string>
  11. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Please read this page: http://www.projectosx.com/forum/index.php?s=4e2f811a5fc31ca5f359dc8ffd98f7f5&showtopic=2656&st=120&p=35700&&do=findComment&comment=35700 The history of the question is [bUG] Shutdown issue with UEFI boot. The behavior: when we press "Sleep" or "Shutdown" display went OFF but lights and fans continue working. Then reset only. It happen not every time, it may happens 1:10. With CloverEFI legacy boot it may happens 1:100. The problem is resolved with follow new keys: HaltEnabler - set SLP_SMI_EN=0 at early start. FixShutdown_0004 - prevent set SLP_SMI_EN=1 at _PTS with Arg0=5 (shutdown) SuspendOverride - extend this fix to Arg0=3,4,5 (also sleep and suspend) SlpSmiAtWake - set SLP_SMI_EN=0 at method _WAK, so at every wake up. Not all users need all these keys but set all to true is safe. You may loose some behavior but you can boot anyway. Now we (me, TimeWalker, endless) have full success with the issue. Sleep/Shutdown/Wake works fine with UEFI boot.
  12. zhangqq

    Lenovo ThinkPad T420 with UEFI Only

    Hi pvhien, Could you upload your EFI folder and the kexts here? THX!
  13. zhangqq

    Clover General discussion

    I have a very strange problem with my ThinkPad W520. My W520 works very good with Chameleon and I installed Clover with the dsdt and 8 ssdt files I used with Chameleon. The new ML system looks very good. Everything works including sleep, reboot and shutdown. But after the hard driver test with NovaBench, the system died when I put it to sleep. And I also found the system would die randomly when I put it to sleep after several times sleep and waking up. I used this W520 with Chameleon for 10 months and never found this issue before. Can anyone help me? THX! [New Updates] I used the legacy mode to boot Clover this morning, everything worked fine. So it should be the problem of Phoenix UEFI.
  14. Hi, Could you patched the 10.8 HDA kext for W520 again? I tried many times to port 10.7.4 to 10.8 but all failed. THX!!
×