diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-10-22 11:37:05 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-23 10:10:56 -0700 |
commit | 847978564a3ac343c191be94e7a83076ead33f70 (patch) | |
tree | d2b5292d9b3280b888fc3d8249d70dbe760a18ab /common/system.c | |
parent | accc98d7c3fdcad6e35ac2ebeb63fbda3abf8d2e (diff) | |
download | chrome-ec-847978564a3ac343c191be94e7a83076ead33f70.tar.gz |
pd: send soft reset on boot if VBUS is present
On boot, if VBUS is present, then when PD protocol gets to
SNK_DISCOVERY state, if it times out waiting for source cap,
then send attempt to send a soft reset first instead of
directly sending a hard reset. This allows us to not lose
VBUS in the case that we were in a stable contract as a sink
before this boot (for example a sysjump or EC reboot).
BUG=chrome-os-partner:44085, chrome-os-partner:44952
BRANCH=none
TEST=test on glados and samus. test by sysjumping between
RO and RW with zinger plugged in and no battery, and verify
that we don't lose power. also test rebooting with a battery
and verify we don't lose power. also tested with a third
party PD charger.
Change-Id: Ib7ce46d8b9843db66805ba3237d8919d611324e0
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/308201
Reviewed-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r-- | common/system.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/common/system.c b/common/system.c index 851836effb..fa3a557d8b 100644 --- a/common/system.c +++ b/common/system.c @@ -439,11 +439,6 @@ static void jump_to_image(uintptr_t init_addr) usleep(MSEC); gpio_set_level(GPIO_ENTERING_RW, 0); -#ifdef CONFIG_USB_POWER_DELIVERY - /* Notify USB PD module that we are about to reset */ - pd_prepare_reset(); -#endif - #if defined(CONFIG_I2C) && !defined(CONFIG_I2C_SLAVE_ONLY) /* Prepare I2C module for sysjump */ i2c_prepare_sysjump(); @@ -735,10 +730,6 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd) case EC_REBOOT_JUMP_RW: return system_run_image_copy(SYSTEM_IMAGE_RW); case EC_REBOOT_COLD: -#ifdef CONFIG_USB_POWER_DELIVERY - /* Notify USB PD module that we are about to reset */ - pd_prepare_reset(); -#endif #ifdef HAS_TASK_PDCMD /* Reboot the PD chip as well */ board_reset_pd_mcu(); @@ -934,11 +925,6 @@ static int command_reboot(int argc, char **argv) ccputs("Rebooting!\n\n\n"); cflush(); -#ifdef CONFIG_USB_POWER_DELIVERY - /* Notify USB PD module that we are about to reset */ - pd_prepare_reset(); -#endif - system_reset(flags); return EC_SUCCESS; } |