Jump to content

Pulsing Power LED while sleeping


Mieze
 Share

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

  • Like 4
Link to comment
Share on other sites

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

Link to comment
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

Link to comment
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

Link to comment
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

  • Like 1
Link to comment
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.

Link to comment
Share on other sites

  • 1 year later...

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

Link to comment
Share on other sites

 Share

×
×
  • Create New...