<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22377">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ec/lenovo/h8/acpi: Apply state on wake<br><br>Store the requested state wake state for bluetooth and WWAN.<br>Add new methods to init the state and apply the requested state on wake.<br>Call the new method on all devices.<br><br>Change-Id: I13c08b8c6b1bf0f3deb25a464b26880d8469c005<br>Signed-off-by: Patrick Rudolph <siro@das-labor.org><br>---<br>M src/ec/lenovo/h8/acpi/thinkpad.asl<br>M src/mainboard/lenovo/t400/acpi/platform.asl<br>M src/mainboard/lenovo/t420s/acpi/platform.asl<br>M src/mainboard/lenovo/t430/acpi/platform.asl<br>M src/mainboard/lenovo/t430s/acpi/platform.asl<br>M src/mainboard/lenovo/t520/acpi/platform.asl<br>M src/mainboard/lenovo/t530/acpi/platform.asl<br>M src/mainboard/lenovo/t60/acpi/platform.asl<br>M src/mainboard/lenovo/x1_carbon_gen1/acpi/platform.asl<br>M src/mainboard/lenovo/x200/acpi/platform.asl<br>M src/mainboard/lenovo/x201/acpi/platform.asl<br>M src/mainboard/lenovo/x220/acpi/platform.asl<br>M src/mainboard/lenovo/x230/acpi/platform.asl<br>M src/mainboard/lenovo/x60/acpi/platform.asl<br>14 files changed, 80 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/22377/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/ec/lenovo/h8/acpi/thinkpad.asl b/src/ec/lenovo/h8/acpi/thinkpad.asl<br>index b5ad013..2e8bf60 100644<br>--- a/src/ec/lenovo/h8/acpi/thinkpad.asl<br>+++ b/src/ec/lenovo/h8/acpi/thinkpad.asl<br>@@ -150,6 +150,11 @@<br> Return (0x0100)<br> }<br> <br>+ /* Has thinkpad_acpi module loaded */<br>+ Name (HAST, 0)<br>+<br>+ /* State after sleep */<br>+ Name (WBDC, 0)<br> /*<br> * Returns the current state:<br> * Bit 0: BT HW present<br>@@ -158,14 +163,15 @@<br> */<br> Method (GBDC, 0)<br> {<br>+ Store (One, HAST)<br>+<br> If (HBDC) {<br> Store(One, Local0)<br> If(\_SB.PCI0.LPCB.EC.BTEB)<br> {<br> Or(Local0, 2, Local0)<br> }<br>- /* FIXME: Implement state at resume, for now Enabled */<br>- Or(Local0, 4, Local0)<br>+ Or(Local0, ShiftLeft(WBDC, 2), Local0)<br> Return (Local0)<br> } Else {<br> Return (0)<br>@@ -179,14 +185,18 @@<br> */<br> Method (SBDC, 1)<br> {<br>+ Store (One, HAST)<br>+<br> If (HBDC) {<br> ShiftRight (And(Arg0, 2), 1, Local0)<br> Store (Local0, \_SB.PCI0.LPCB.EC.BTEB)<br>-<br>- /* FIXME: Store state at resume */<br>+ ShiftRight (And(Arg0, 4), 2, Local0)<br>+ Store (Local0, WBDC)<br> }<br> }<br> <br>+ /* State after sleep */<br>+ Name (WWAN, 0)<br> /*<br> * Returns the current state:<br> * Bit 0: WWAN HW present<br>@@ -195,14 +205,15 @@<br> */<br> Method (GWAN, 0)<br> {<br>+ Store (One, HAST)<br>+<br> If (HWAN) {<br> Store(One, Local0)<br> If(\_SB.PCI0.LPCB.EC.WWEB)<br> {<br> Or(Local0, 2, Local0)<br> }<br>- /* FIXME: Implement state at resume, for now Enabled */<br>- Or(Local0, 4, Local0)<br>+ Or(Local0, ShiftLeft(WWAN, 2), Local0)<br> Return (Local0)<br> } Else {<br> Return (0)<br>@@ -216,11 +227,12 @@<br> */<br> Method (SWAN, 1)<br> {<br>+ Store (One, HAST)<br>+<br> If (HWAN) {<br> ShiftRight (And(Arg0, 2), 1, Local0)<br> Store (Local0, \_SB.PCI0.LPCB.EC.WWEB)<br>-<br>- /* FIXME: Store state at resume */<br>+ ShiftRight (And(Arg0, 4), 2, WWAN)<br> }<br> }<br> <br>@@ -284,4 +296,24 @@<br> Store (Local0, \_SB.PCI0.LPCB.EC.UWBE)<br> }<br> }<br>+<br>+ /*<br>+ * Store initial state<br>+ */<br>+ Method (_INI, 0, NotSerialized)<br>+ {<br>+ Store (\_SB.PCI0.LPCB.EC.BTEB, WBDC)<br>+ Store (\_SB.PCI0.LPCB.EC.WWEB, WWAN)<br>+ }<br>+<br>+ /*<br>+ * Called from _WAK<br>+ */<br>+ Method (WAKE, 1)<br>+ {<br>+ If (HAST) {<br>+ Store (WBDC, \_SB.PCI0.LPCB.EC.BTEB)<br>+ Store (WWAN, \_SB.PCI0.LPCB.EC.WWEB)<br>+ }<br>+ }<br> }<br>diff --git a/src/mainboard/lenovo/t400/acpi/platform.asl b/src/mainboard/lenovo/t400/acpi/platform.asl<br>index 5c6f968..85357a5 100644<br>--- a/src/mainboard/lenovo/t400/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t400/acpi/platform.asl<br>@@ -31,6 +31,9 @@<br> <br> Method(_WAK,1)<br> {<br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> // CPU specific part<br> <br> // Notify PCI Express slots in case a card<br>diff --git a/src/mainboard/lenovo/t420s/acpi/platform.asl b/src/mainboard/lenovo/t420s/acpi/platform.asl<br>index 6f26c5a..e4c8a24 100644<br>--- a/src/mainboard/lenovo/t420s/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t420s/acpi/platform.asl<br>@@ -32,6 +32,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/t430/acpi/platform.asl b/src/mainboard/lenovo/t430/acpi/platform.asl<br>index efbf0ea..13ea2c1 100644<br>--- a/src/mainboard/lenovo/t430/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t430/acpi/platform.asl<br>@@ -18,6 +18,10 @@<br> /* ME may not be up yet. */<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br>+<br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> Return(Package(){0,0})<br> }<br> <br>diff --git a/src/mainboard/lenovo/t430s/acpi/platform.asl b/src/mainboard/lenovo/t430s/acpi/platform.asl<br>index 6f26c5a..e4c8a24 100644<br>--- a/src/mainboard/lenovo/t430s/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t430s/acpi/platform.asl<br>@@ -32,6 +32,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/t520/acpi/platform.asl b/src/mainboard/lenovo/t520/acpi/platform.asl<br>index 6f26c5a..e4c8a24 100644<br>--- a/src/mainboard/lenovo/t520/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t520/acpi/platform.asl<br>@@ -32,6 +32,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/t530/acpi/platform.asl b/src/mainboard/lenovo/t530/acpi/platform.asl<br>index 9cd327a..bf686f4 100644<br>--- a/src/mainboard/lenovo/t530/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t530/acpi/platform.asl<br>@@ -32,6 +32,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/t60/acpi/platform.asl b/src/mainboard/lenovo/t60/acpi/platform.asl<br>index 006b6f0..f9e991b 100644<br>--- a/src/mainboard/lenovo/t60/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/t60/acpi/platform.asl<br>@@ -29,6 +29,9 @@<br> <br> Method(_WAK,1)<br> {<br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> // CPU specific part<br> <br> // Notify PCI Express slots in case a card<br>diff --git a/src/mainboard/lenovo/x1_carbon_gen1/acpi/platform.asl b/src/mainboard/lenovo/x1_carbon_gen1/acpi/platform.asl<br>index 3e9225c..b63c91c 100644<br>--- a/src/mainboard/lenovo/x1_carbon_gen1/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/x1_carbon_gen1/acpi/platform.asl<br>@@ -30,6 +30,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/x200/acpi/platform.asl b/src/mainboard/lenovo/x200/acpi/platform.asl<br>index 5c6f968..85357a5 100644<br>--- a/src/mainboard/lenovo/x200/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/x200/acpi/platform.asl<br>@@ -31,6 +31,9 @@<br> <br> Method(_WAK,1)<br> {<br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> // CPU specific part<br> <br> // Notify PCI Express slots in case a card<br>diff --git a/src/mainboard/lenovo/x201/acpi/platform.asl b/src/mainboard/lenovo/x201/acpi/platform.asl<br>index 0a6d5f3..7d7013b 100644<br>--- a/src/mainboard/lenovo/x201/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/x201/acpi/platform.asl<br>@@ -63,6 +63,9 @@<br> <br> Method(_WAK,1)<br> {<br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/x220/acpi/platform.asl b/src/mainboard/lenovo/x220/acpi/platform.asl<br>index 9cd327a..bf686f4 100644<br>--- a/src/mainboard/lenovo/x220/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/x220/acpi/platform.asl<br>@@ -32,6 +32,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/x230/acpi/platform.asl b/src/mainboard/lenovo/x230/acpi/platform.asl<br>index 9cd327a..bf686f4 100644<br>--- a/src/mainboard/lenovo/x230/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/x230/acpi/platform.asl<br>@@ -32,6 +32,9 @@<br> Store (0, \_TZ.MEB1)<br> Store (0, \_TZ.MEB2)<br> <br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> /* Not implemented. */<br> Return(Package(){0,0})<br> }<br>diff --git a/src/mainboard/lenovo/x60/acpi/platform.asl b/src/mainboard/lenovo/x60/acpi/platform.asl<br>index 006b6f0..f9e991b 100644<br>--- a/src/mainboard/lenovo/x60/acpi/platform.asl<br>+++ b/src/mainboard/lenovo/x60/acpi/platform.asl<br>@@ -29,6 +29,9 @@<br> <br> Method(_WAK,1)<br> {<br>+ /* Wake the HKEY to init BT/WWAN */<br>+ \_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)<br>+<br> // CPU specific part<br> <br> // Notify PCI Express slots in case a card<br></pre><p>To view, visit <a href="https://review.coreboot.org/22377">change 22377</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22377"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I13c08b8c6b1bf0f3deb25a464b26880d8469c005 </div>
<div style="display:none"> Gerrit-Change-Number: 22377 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <siro@das-labor.org> </div>