diff options
author | Bill Richardson <wfrichar@chromium.org> | 2016-03-30 12:44:40 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-03-31 14:53:52 -0700 |
commit | 9e0c450f726d3d6dfd3486d7b816fd90621a6321 (patch) | |
tree | 1a74bb11d78974f6a1eb0c7d6b9587fc435d407b /include | |
parent | e2deea36495ae4c6541db0ff0899c700b731ced7 (diff) | |
download | chrome-ec-9e0c450f726d3d6dfd3486d7b816fd90621a6321.tar.gz |
Cr50: First attempt at USB suspend with deep sleep
This is still in testing mode, so you have to take special steps
to enable it (keep reading). But if you do the right dance, it
does go into deep sleep for USB suspend, and resumes correctly.
However, it doesn't yet wake for any other reason. That's coming next.
Normal sleep is not yet supported, either.
BUG=chrome-os-partner:49955, chrome-os-partner:50721
BRANCH=none
TEST=make buildall; extensive tests on Cr50
Testing is a pain.
First, you can't print anything in the idle task, because that
just makes it stop being idle, so the only way to detect when
it's triggered is by wiring up a GPIO and instrumenting things.
Second, you have to manually reenable USB suspend on the host
every time the Cr50 boots with
echo auto > /sys/bus/usb/devices/<BLEH>/power/control
where <BLEH> is the correct device.
Third, for reasons probably related to the mysteries of HID
devices combined with crbug.com/431886, you have to build the
firmware without CONFIG_USB_HID (and the related items in
board.h)
Finally, because it's still a work in progress, you have to type
idle d
at the serial console after every boot (or resume) to reenable
deep sleep in the idle task.
If you do all that, then you'll see that it does go into deep
sleep. Ping it again with "lsusb -v -d 18d1:5014" or
./test/usb_test/device_configuration, and it wakes up and
responds!
If you disconnect the USB while it's in deep sleep, it stays
asleep. When you plug it in again, it wakes up, but it correctly
recognizes that it shouldn't resume and does a normal reset
instead.
Change-Id: I3cc66e48ce671142a4d12edbe0eb9fdacecea0d9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336279
Reviewed-by: Dominic Rizzo <domrizzo@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/system.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h index 6c8bbea06d..67a867f39e 100644 --- a/include/system.h +++ b/include/system.h @@ -313,6 +313,7 @@ enum { SLEEP_MASK_SPI = (1 << 6), /* SPI communications ongoing */ SLEEP_MASK_I2C_SLAVE = (1 << 7), /* I2C slave communication ongoing */ SLEEP_MASK_FAN = (1 << 8), /* Fan control loop ongoing */ + SLEEP_MASK_USB_DEVICE = (1 << 9), /* Generic USB device in use */ SLEEP_MASK_FORCE_NO_DSLEEP = (1 << 15), /* Force disable. */ |