summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/system.c14
-rw-r--r--include/usb_pd.h2
2 files changed, 10 insertions, 6 deletions
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 */
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 5b2647052d..261ddd5077 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -2573,7 +2573,6 @@ static inline void pd_log_event(uint8_t type, uint8_t size_port,
static inline int pd_vdm_get_log_entry(uint32_t *payload) { return 0; }
#endif /* CONFIG_USB_PD_LOGGING */
-#ifdef CONFIG_USB_PD_ALT_MODE_DFP
/**
* Prepare for a sysjump by exiting any alternate modes, if PD communication is
* allowed.
@@ -2582,7 +2581,6 @@ static inline int pd_vdm_get_log_entry(uint32_t *payload) { return 0; }
* re-awoken the calling task.
*/
void pd_prepare_sysjump(void);
-#endif
/* ----- SVDM handlers ----- */