Jump to content
Mieze

Pulsing Power LED while sleeping

13 posts in this topic

Recommended Posts

I was wondering for a long time if it is possible to have the power LED pulsing on a hackintosh in the same as a real Mac but never really found the time for an in-depth research. Reading through the datasheet of my board's SuperIO, a Nuvoton NCT6776D, I found the following table which confirms that the hardware supports this feature too. 

post-983225-0-31243800-1485988169_thumb.png

As sleep/wake is controlled by the DSDT, I had the idea that it might be possible to get the pulsing power LED just with a small DSDT patch and, to my great surprise, its much simpler than expected. But see for yourself. In the DSDT of my board, an Asrock B85 Killer, I found method SLED controlling the switch between on in S0 and blinking mode in S3 (sleep):

Method (SLED, 1, NotSerialized)
{
    ENFG (0x0B)
    If (Arg0)
    {
        If (LEqual (OPT7, 0x87))
        {
            Store (0x45, OPT7)
        }
    }
    Else
    {
        If (LNotEqual (OPT7, Zero))
        {
            Store (0x87, OPT7)
        }
    }

    EXFG ()
}

Replacing the line "Store (0x45, OPT7)" with "Store (0x4A, OPT7)" gave me a slowly pulsing power LED while the machine sleeps. That's really trivial. Ok, it's not as pretty as on a real Mac, but very close to the original. This patch should work for most of Asrock's series 8 and 9 ATX/µATX boards as far as I can see. The mini-ITX boards may be different, at least my Asrock B85M-ITX is, but it should be possible to get this feature working with them too.

 

Many of Asrock's 100 series board also come with the same SuperIO chip but the DSDT looks different. Here is an example from  an Asrock Z170M-Pro4S which woks in the same way. The following code snippet was found in method SIOS, which is called in order to prepare the SuperIO for sleep mode:

If (LEqual (Arg0, 0x03))
{
    Store (0x0A, LDN)
    Or (OPT0, 0x20, OPT0)
    Or (RGE4, 0x10, RGE4)
    Store (0x0B, LDN)
    If (LEqual (OPT7, 0x87))
    {
        Store (0x45, OPT7)
    }
}

Changing 0x45 to 0x4A should give you the pulsing power LED on this board too.

 

As far as I know, Nuvoton SuperIOs can be also found on many ASUS and MSI boards. The NCT5577D supports this feature too. Other chips might support it as well but you need to have a datasheet to verify it and learn how to control the LED.

 

Mieze

Share this post


Link to post
Share on other sites
Advertisement

Mieze. On the IT8728F chip, do you have it too?

Unfortunately, I don't  have Gigabyte boards but in case you manage to get a datasheet of this chip and send me your DSDT, I may be able to help you, provided the ITE8728F has this feature too.

 

Mieze

Share this post


Link to post
Share on other sites

Ok, thanks, I will check the datasheet and your DSDT tomorrow and report back. It's already 1 o'clock here in Germany and I need some sleep.  :cat:

 

Mieze


@JorgeMax: I'm unable to open your DSDT as MaciASL gives me an error message.

post-983225-0-62022300-1485995245_thumb.png

 

Mieze

Share this post


Link to post
Share on other sites

Ok, thanks, I will check the datasheet and your DSDT tomorrow and report back. It's already 1 o'clock here in Germany and I need some sleep.  :cat:

 

Mieze

@JorgeMax: I'm unable to open your DSDT as MaciASL gives me an error message.

attachicon.gifBildschirmfoto 2017-02-02 um 01.34.03.png

 

Mieze

Mieze, use this: RehabMan-MaciASL-2017-0117.zip

Share this post


Link to post
Share on other sites

@JorgeMax: I checked your datasheet and it seems that the ITE8728F doesn't support the fading mode but just plain old blicking with differnt frequencies. Here is the documentation of the LED control register from page 75 of the datasheet:

post-983225-0-30567200-1486068053_thumb.png

 

Mieze

Share this post


Link to post
Share on other sites

@JorgeMax: I checked your datasheet and it seems that the ITE8728F doesn't support the fading mode but just plain old blicking with differnt frequencies. Here is the documentation of the LED control register from page 75 of the datasheet:

attachicon.gifBildschirmfoto 2017-02-02 um 21.45.43.png

 

Mieze

 

Thank you, friend, for checking me out. I took a look at how the LED behaves during "sleep" on Windows, and it does not blink, only going off.

Share this post


Link to post
Share on other sites

Since my last BIOS update my PWR led start blinking more frequently during sleep, so I stareted to look for solution and I ended up here.

 

Here is code from my DSDT:

If (LEqual (Arg0, 0x03)) {
    Store (0x0A, LDN)
    Or (OPT0, 0x20, OPT0)
    Or (RGE4, 0x10, RGE4)
    Store (0x0B, LDN)
    If (LEqual (OPT7, 0x87))
    {
   		 Store (0x45, OPT7)
    }
}

Unfortunately, changing OPT7 value from 0x45 changes nothing.

 

Here are _PTS and _WAK methods:

 

    Method (_PTS, 1, NotSerialized)  // _PTS: Prepare To Sleep
    {
        If (Arg0)
        {
            LEDS (Arg0)
            \_SB.TPM.TPTS (Arg0)
            \_SB.PCI0.LPCB.SIO1.SIOS (Arg0)
            \_SB.PCI0.LPCB.SPTS (Arg0)
            \_SB.PCI0.NPTS (Arg0)
            RPTS (Arg0)
        }
    }

    Method (_WAK, 1, NotSerialized)  // _WAK: Wake
    {
        RWAK (Arg0)
        \_SB.PCI0.NWAK (Arg0)
        \_SB.PCI0.LPCB.SWAK (Arg0)
        \_SB.PCI0.LPCB.SIO1.SIOW (Arg0)
        LEDW (Arg0)
        Return (WAKP)
    }

LEDW is called when wake and LEDS during sleep, let's look at this methods. LEDS is empty..

 

    Method (LEDS, 1, NotSerialized)
    {
        If (LEqual (OBDP, 0x02))
        {
            DBGL (One)
            Store (Arg0, P80B)
        }
    }

    Method (LEDW, 1, NotSerialized)
    {
        If (LEqual (OBDP, 0x02))
        {
            DBGL (Zero)
            ShiftLeft (Arg0, 0x04, P80B)
        }

        If (LEqual (GNLD, 0x02))
        {
            SYSL (Zero)
        }

        If (LEqual (GNLD, One))
        {
            \_SB.PCI0.LPCB.SIO1.ENFG (0x0B)
            And (\_SB.PCI0.LPCB.SIO1.OPT7, Zero, \_SB.PCI0.LPCB.SIO1.OPT7)
            \_SB.PCI0.LPCB.SIO1.EXFG ()
        }
    }

 Store (0x45, OPT7) is called in SIOS as Mieze mentioned when Arg0 == 3 (sleep state) but it doesn't seems to make any effect.

 

Led is blinking more frequently on Windows and Mac.

 

If there is possibilty to take control over this, compering DSDT from older bios might reveal something but I doubt it.

 

My boards is Z370 asrock extreme 4

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Trung_Nguyen
      Hi, So I have been working to get the OpenCore bootloader to work on my E6230.
       
      What works:
      - QE/CI
      - Brightness slider
      - Brightness hotkey (Fn+Arrows)
      - USB2
      - Keyboard
      - Trackpad
      - Everything else except below, ig
       
      What does not(YET):
      - Audio (Actually, It detects the correct layout, but it doesn't recognize the speakers. My speakers are tested with the Preboot Diagnostics)
      - USB3.0(p/s: Patching PCI0._INI to get a Darwin system with OSYS=0x07D9 will stall the machine early)
      - Sleep/wake (cant wake up after sleep)
       
      Why I'm trying OpenCore:
      - Boot time is impressive (10s new installation here, compare to about a minute on Clover)
       
      P/s: If you haven't familiar with OpenCore, It loads ACPIs, Kexts in the order specified in the config.plist
      - My BIOS version is A11 (My battery does not hold any charge, AAR, I can't update the firmware).
       
      Please help me with the remaining, thanks
       
      Thanks
       
      EFI 2.zip
       
      Almost forgot: native ACPI
      origin.zip
    • By evilshot
      Добрый день! Работает все, кроме встроенного WiFi/Bluetooth( нет модуля, не могу проверить). Сижу пока на USB Wi-Fi TL-WN722N, в дальнейшем собираюсь покупать модуль от MacBook.
      Железо:
      Процессор i5-9600k Материнская плата ASRock z390 Phantome Gaming 6 Встроенное видео: Intel HD Graphics 630 - ok, аппаратное ускорение работает Дискретное видео: Планируется покупка Встроенная сеть: Intel I219V - ok Встроенная сеть: Dragon RTL8125AG - нет драйвера Встроенный WiFi: - Bстроенный Bluetooth 5.0: - Встроенный звук: Realtek ALC1220 - ok SSD: M2 WD green 128gb Память: 24 Gb DDR4-3000 Full-HD монитор - HDMI - подключен к встроенной видеокарте - ок USB 3.0, 3.1, 3. 1gen2-ok Аппаратный NVRAM - не работает, решается тем, что кловер необходимо ставить с EmuVariableUefi - ок. Много усилий и времени заняла настройка биоса в мат плате. Это того стоило. Конечно же не обошлось без добрых людей, которые помогали в ходе установки, настройки загрузчика и системы. Mojave стоит в качестве основной системы, Windows на виртуалке. Прикрепляю загрузчик, Legacy USB, Backup биоса, версии 4,10.
      Вам остается только, вписать модель iMAC( какая вам больше подойдет, у меня сейчас iMac 19.1) и завести iСервисы (FaceTime,imasseges,и т.д.)
      Желаю удачной установки системы
      Фото настроек биоса 
      https://cloud.mail.ru/public/3xd9/2Xtpm64zq
      OSX.BIN.zip
      EFI.zip
      FixUSBPort_AsRockZ390_PG6.zip
      Mojave10,14,6.BIN.zip
    • By MaLd0n
      ---INSTALLATION TUTORIAL---
       
      ---Original Post---
      https://olarila.com/forum/viewtopic.php?f=45&t=9172
       
      ---USB---
      https://pikeralpha.wordpress.com/2016/07/13/simple-skylake-usb-fix-no-kexts-required/
       
      ---CLOVER FOLDER---
       
      CLOVER.zip
       
       
      --MOBO
      GigaByte Z390 M Gaming



      --PROCESSOR
      Intel Core i9-9900K


      --COOLER
      CoolerMaster MasterLiquid ML120R RGB


      --MEMORY
      Corsair Dominator Platinum 16GB (2 x 8GB)


      --GPU
      Sapphiretech Radeon RX 590 8 GB GDDR5


       
      --SSD
      Samsung 970 EVO NVMe M2 Flash Drive


      --POWER SUPPLY
      EVGA 750 N1, 750W


      --WIRELESS
      TP-Link Archer T9E


      --BLUETOOTH
      Orico BTA-403


      --CASE
      Thermaltake View 21 Tempered Glass Edition


      --DSDT Patches--
      -FIX ERRORS AND WARNINGS -FIX ACPI ERRORS -REMOVE UNUSED SCOPES / DEVICES -HIGH PRECISION EVENT TIMER -SATA SERIE 10 ID -DMAC -REMOVE 22K LINES, PROBLEMATIC and UNUSED -FIX K.P in REBOOT -NVRAM / REAL TIME CLOCK -SLPB -DARWIN / WINDOWS 2015 -XHCI -PLUGIN TYPE -HDAS to HDEF -HDEF -REAL TIME CLOCK -ARTC -IRQs -SBUS -MIKEY -BUS1 -MCHC -ALS0 -SHUTDOWN -UAR1 -LAN -FWHD -USBX -PMCR -PPMC -XSPI -GMM -IMEI -EC -PNLF -ARPT -GFX0 -NVME -DTGP -ACQUIRE MUT0 0XFFFF -OPERATION REGION GPIO -MUTEX MUT0 0x00 -EXTERNAL REFERENCES -UNKNOWNOBJ -HDMI / HDAU -FULL RENAMED DEVICES  
      --SCREENSHOTS--





























      --BruceX--
       
      --USB-C-- test with SanDisk Ultra USB-STICK 128gb


       
      -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!
      Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Apple, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad, Sampath007, onemanosx, erroruser, Jenny David, Olarila Facebook Community, Hackintosh Facebook Community and many others!
      We're all here to have fun and learn from each other!
    • By Drovosek
      For my laptop Hp Pavilion 15-au028ur worked patch for HP 3165sf
      I also experimented with manual patching and assembled my own version:

      #Maintained by: RehabMan for: Laptop Patches #Battery_HP-DV6-1380ek.txt # created by RehabMan 2019-xx-xx # based on Battery_HP-DV6-1380ek.txt # additional patches for dv6-1380ek provided by chihab222, credit gsly # works for: #  HP Pavilion 15-au028ur, per Drovosek into method label B1B2 remove_entry; into definitionblock code_regex . insert begin Method (B1B2, 2, NotSerialized) { Return (Or (Arg0, ShiftLeft (Arg1, 8))) }\n end; # 16-bit EC0 registers #                BADC,   16, #                BFCC,   16, #                MCUR,   16, #                MBRM,   16, #                MBCV,   16, into device label EC0 code_regex BADC,\s+16, replace_matched begin ADC0,8,ADC1,8, end; into device label EC0 code_regex BFCC,\s+16, replace_matched begin FCC0,8,FCC1,8, end; into device label EC0 code_regex MCUR,\s+16, replace_matched begin CUR0,8,CUR1,8, end; into device label EC0 code_regex MBRM,\s+16, replace_matched begin BRM0,8,BRM1,8, end; into device label EC0 code_regex MBCV,\s+16, replace_matched begin BCV0,8,BCV1,8, end; # 16-bit method access into method label CLRI code_regex (\^.*)MBRM replaceall_matched begin B1B2\(%1BRM0,%1BRM1\) end; into method label UPBS code_regex (\^.*)MBRM replaceall_matched begin B1B2\(%1BRM0,%1BRM1\) end; into method label UPBI code_regex (\^.*)BFCC replaceall_matched begin B1B2\(%1FCC0,%1FCC1\) end; into method label UPBS code_regex (\^.*)MCUR replaceall_matched begin B1B2\(%1CUR0,%1CUR1\) end; into method label UPBS code_regex (\^.*)MBCV replaceall_matched begin B1B2\(%1BCV0,%1BCV1\) end;
      The only problem - when it reaches 100% charge, it no longer falls until you reset the CMOS (15-30 seconds hold down the power button on the laptop). In the rehabman guide there is a patch for ASUS in this case, there is a patch method FBST. There is no such method in my DSDT.
      Can someone help?
      Here's a patched and clean DSDT: https://vk.com/doc183234383_509697931
    • By jamesxxx1997
      Hi everyone~
      Now using mojave 10.14.4 , I am patching my dsdt and ssdt but have four syntax error with my dsdt.dsl , and I don't know how to fix it.
       
      My specs:
      lenovo thinkpad x1 yoga 3rd
      CPU : i7-8550u
      graphics : uhd620
       
      The file of my dsdt and ssdt , ioreg , and my efi is in this link:https://drive.google.com/drive/folders/1T1nv1QgqDtczXrohdlQUJ_8O-kPpoSEf?usp=sharing
       
      thanks!
×