diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-01-15 13:55:17 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-27 21:39:26 +0000 |
commit | 1bc6f164256f0cf59fbf32e6ee2b9b090e22e273 (patch) | |
tree | afc42128275fec049ec98e339df403997c555aaf | |
parent | 1f0710427b951e2ae638c23cfe9da9047792bd26 (diff) | |
download | chrome-ec-1bc6f164256f0cf59fbf32e6ee2b9b090e22e273.tar.gz |
PS8805: Treat unexpected chip info values as error
During the chip PS8805 reset, the firmware needs time to initiate.
Before firmware initiated, the chip stills responses the I2C read
but returns some wrong values, e.g. random VENDOR or PRODUCT id,
zero firmware version.
This breaks the TCPC fw sync logic, as it misleads the logic that
TCPC resumes back but actually not. Should treat the wrong chip
info as error. So the update logic will retry.
BRANCH=None
BUG=b:147706600
TEST=Performed the TCPC fw sync; then checked the chip info as expected.
Change-Id: I0ef8cb8943d414e051e67f6ff4afc4013ebb6bc9
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2003532
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | driver/tcpm/ps8xxx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c index d2e4748b9c..aeef8cd6e4 100644 --- a/driver/tcpm/ps8xxx.c +++ b/driver/tcpm/ps8xxx.c @@ -157,6 +157,13 @@ static int ps8xxx_get_chip_info(int port, int live, (*chip_info)->fw_version_number = val; } + /* Treat unexpected values as error (FW not initiated from reset) */ + if (live && ( + (*chip_info)->vendor_id != PS8XXX_VENDOR_ID || + (*chip_info)->product_id != PS8XXX_PRODUCT_ID || + (*chip_info)->fw_version_number == 0)) + return EC_ERROR_UNKNOWN; + #if defined(CONFIG_USB_PD_TCPM_PS8751) && \ defined(CONFIG_USB_PD_VBUS_DETECT_TCPC) /* |