Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/20450
Change subject: ec/lenovo/h8/smm: Support USB always on AC only ......................................................................
ec/lenovo/h8/smm: Support USB always on AC only
Add support for UAO AC only mode. Needs tests on all platforms.
Change-Id: Ib52aab427ff687b00129024cde65b78060d21e32 Signed-off-by: Patrick Rudolph siro@das-labor.org --- M src/ec/lenovo/h8/smm.c M src/mainboard/lenovo/x201/cmos.layout M src/mainboard/lenovo/x220/cmos.layout 3 files changed, 17 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/20450/1
diff --git a/src/ec/lenovo/h8/smm.c b/src/ec/lenovo/h8/smm.c index 31009a6..6005c31 100644 --- a/src/ec/lenovo/h8/smm.c +++ b/src/ec/lenovo/h8/smm.c @@ -18,18 +18,30 @@
#include "h8.h"
+enum usb_always_on { + UAO_OFF = 0, + UAO_AC_AND_BATTERY, + UAO_AC_ONLY +}; + void h8_usb_always_on(void) { - u8 val; + enum usb_always_on val; u8 reg;
if (get_option(&val, "usb_always_on") != CB_SUCCESS) - val = 0; + val = UAO_OFF;
- if (val) { + if (val == UAO_AC_AND_BATTERY) { reg = ec_read(H8_USB_ALWAYS_ON); reg &= ~H8_USB_ALWAYS_ON_AC_ONLY; reg |= H8_USB_ALWAYS_ON_ENABLE; ec_write(H8_USB_ALWAYS_ON, reg); + } else if (val == UAO_AC_ONLY) { + reg = ec_read(H8_USB_ALWAYS_ON); + reg |= H8_USB_ALWAYS_ON_AC_ONLY; + reg |= H8_USB_ALWAYS_ON_ENABLE; + ec_write(H8_USB_ALWAYS_ON, reg); + ec_set_bit(0x2, 3); } } diff --git a/src/mainboard/lenovo/x201/cmos.layout b/src/mainboard/lenovo/x201/cmos.layout index 7270232..8b40585 100644 --- a/src/mainboard/lenovo/x201/cmos.layout +++ b/src/mainboard/lenovo/x201/cmos.layout @@ -125,6 +125,7 @@ 10 6 160M 11 0 Disable 11 1 AC and battery +11 2 AC only
# ----------------------------------------------------------------- checksums diff --git a/src/mainboard/lenovo/x220/cmos.layout b/src/mainboard/lenovo/x220/cmos.layout index 77979b3..93e7ba9 100644 --- a/src/mainboard/lenovo/x220/cmos.layout +++ b/src/mainboard/lenovo/x220/cmos.layout @@ -136,6 +136,7 @@ 11 6 224M 12 0 Disable 12 1 AC and battery +12 2 AC only
# ----------------------------------------------------------------- checksums