ec/starlabs/merlin: Apply EC settings when suspending

Currently, the settings from CMOS were written to the
EC, which was pointless.

Now, when suspending, the EC values are stored in CMOS
when suspending and subsequently restored when waking.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I998d5509cd5e95736468f88663a1423217cf6ddf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60165
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
Sean Rhodes 2021-12-16 09:18:12 +00:00 committed by Felix Held
parent 1dc1a56a5d
commit 45f9ca4824
1 changed files with 11 additions and 4 deletions

View File

@ -6,14 +6,21 @@ Method (RPTS, 1, NotSerialized)
If ((Arg0 == 0x04) || (Arg0 == 0x05)) If ((Arg0 == 0x04) || (Arg0 == 0x05))
{ {
/* Store current EC settings */ /* Store current EC settings in CMOS */
\_SB.PCI0.LPCB.EC.TPLE = \_SB.PCI0.LPCB.TPLC \_SB.PCI0.LPCB.TPLC = \_SB.PCI0.LPCB.EC.TPLE
\_SB.PCI0.LPCB.EC.FLKE = \_SB.PCI0.LPCB.FLKC \_SB.PCI0.LPCB.FLKC = \_SB.PCI0.LPCB.EC.FLKE
\_SB.PCI0.LPCB.EC.KLBE = \_SB.PCI0.LPCB.KLBC \_SB.PCI0.LPCB.KLSC = \_SB.PCI0.LPCB.EC.KLSE
\_SB.PCI0.LPCB.KLBC = \_SB.PCI0.LPCB.EC.KLBE
} }
} }
Method (RWAK, 1, Serialized) Method (RWAK, 1, Serialized)
{ {
\_SB.PCI0.LPCB.EC.OSFG = 0x01 \_SB.PCI0.LPCB.EC.OSFG = 0x01
/* Restore EC settings from CMOS */
\_SB.PCI0.LPCB.EC.TPLE = \_SB.PCI0.LPCB.TPLC
\_SB.PCI0.LPCB.EC.FLKE = \_SB.PCI0.LPCB.FLKC
\_SB.PCI0.LPCB.EC.KLSE = \_SB.PCI0.LPCB.KLSC
\_SB.PCI0.LPCB.EC.KLBE = \_SB.PCI0.LPCB.KLBC
} }