[coreboot-gerrit] Patch set updated for coreboot: ec/lenovo/h8: Add USB Always On fields

Alexander Couzens (lynxis@fe80.eu) gerrit at coreboot.org
Sun Feb 26 20:49:07 CET 2017


Alexander Couzens (lynxis at fe80.eu) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12888

-gerrit

commit c85017fda3a3dd90a37066618b92092e00e625be
Author: Marian Tietz <mtcoreboot at gmail.com>
Date:   Sat Jan 9 17:41:14 2016 +0100

    ec/lenovo/h8: Add USB Always On fields
    
    USB AO is the internal name for the dedicated charging port
    on ThinkPads when in S3 or lower.
    
    AOEN is used for enabling the feature (on PTS) and AOCF is
    the configuration field for the different modes. The modes
    are (according to Peter Stuge):
    
        00 => AC S3 S4 S4 USB on, battery S3 USB on, battery S4 S5 off
        11 => AC S3 S4 S4 USB on, battery S3 S4 S5 USB off
        10, 01 => equivalent to 00
    
    This commit also activates this feature on the X220. On PTS activate the
    dedicated charging port to work under AC in all states and in battery under
    S3. On wake-up the port is set back to USB2 mode.
    
    To test this functionality USB devices (e.g. a smartphone) should be
    able to negotiate full power from the dedicated charging port in S3
    using a normal data cable. Without the Always On functionality this
    is not possible.
    
    Change-Id: Ief8de3e41fd6a701c6b3dbce81118d5eeb0fa648
    Signed-off-by: Marian Tietz <mtcoreboot at gmail.com>
---
 src/ec/lenovo/h8/acpi/ec.asl                |  4 ++++
 src/mainboard/lenovo/x220/acpi/platform.asl | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index b69acf8..340443d 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -32,6 +32,10 @@ Device(EC)
 				HSPA, 1,
 		Offset (0x0C),
 				LEDS, 8,	/* LED state */
+		Offset (0x0D),
+				AOEN, 1,	/* USB Always On Enable */
+				    , 1,
+				AOCF, 2,	/* USB Always On Config */
 		Offset (0x1a),
 				DKR2, 1,	/* Dock register 2 */
 		Offset (0x2a),
diff --git a/src/mainboard/lenovo/x220/acpi/platform.asl b/src/mainboard/lenovo/x220/acpi/platform.asl
index 3e9225c..70e6088 100644
--- a/src/mainboard/lenovo/x220/acpi/platform.asl
+++ b/src/mainboard/lenovo/x220/acpi/platform.asl
@@ -20,6 +20,15 @@
 Method(_PTS,1)
 {
 	\_SB.PCI0.LPCB.EC.RADI(0)
+
+	Store (1, \_SB.PCI0.LPCB.EC.AOEN)
+
+	/*
+	 * 00 => AC S3 S4 S4 USB on, battery S3 USB on, battery S4 S5 off
+	 * 11 => AC S3 S4 S4 USB on, battery S3 S4 S5 USB off
+	 * 10, 01 => equivalent to 00
+	 */
+	Store (0, \_SB.PCI0.LPCB.EC.AOCF)
 }
 
 /* The _WAK method is called on system wakeup */
@@ -30,6 +39,9 @@ Method(_WAK,1)
 	Store (0, \_TZ.MEB1)
 	Store (0, \_TZ.MEB2)
 
+	/* Deactivate dedicated charging port, activate USB2.0 */
+	Store (0, \_SB.PCI0.LPCB.EC.AOEN)
+
 	/* Not implemented.  */
 	Return(Package(){0,0})
 }



More information about the coreboot-gerrit mailing list