From d174f05944c3d80125aac081682e703ed0c22f0d Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Mon, 20 Apr 2020 11:07:25 -0700 Subject: USB/PD: Skip pd_prepare_sysjump for EFS2 boards Since in EFS2, USB/PD won't be enabled in RO or if it's enabled in RO, EC won't jump to RW, pd_prepare_sysjump is not needed. Even if PD is enabled because the device is not write protected, EFS2 jumps to RW before PD tasks start. So, there is no states to clean up. Signed-off-by: Daisuke Nojiri BUG=chromium:1072743, b:137493121, b:154440914 BRANCH=none TEST=Boot Puff successfully. Change-Id: Ie598105779d2a605cb63842cb6c8428f0e2c5367 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2157728 Reviewed-by: Peter Marheine Reviewed-by: Kangheui Won Commit-Queue: Kangheui Won Tested-by: Kangheui Won --- common/system.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'common/system.c') diff --git a/common/system.c b/common/system.c index 72a3244fb0..610363a61a 100644 --- a/common/system.c +++ b/common/system.c @@ -496,10 +496,16 @@ static void jump_to_image(uintptr_t init_addr) usleep(MSEC); gpio_set_level(GPIO_ENTERING_RW, 0); -#ifdef CONFIG_USB_PD_ALT_MODE_DFP - /* Note: must be before i2c module is locked down */ - pd_prepare_sysjump(); -#endif + /* + * Since in EFS2, USB/PD won't be enabled in RO or if it's enabled in + * RO, EC won't jump to RW, pd_prepare_sysjump is not needed. Even if + * PD is enabled because the device is not write protected, EFS2 jumps + * to RW before PD tasks start. So, there is no states to clean up. + */ + if (!IS_ENABLED(CONFIG_VBOOT_EFS2) && + IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP)) + /* Note: must be before i2c module is locked down */ + pd_prepare_sysjump(); #ifdef CONFIG_I2C_MASTER /* Prepare I2C module for sysjump */ -- cgit v1.2.1