summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2021-04-27 18:35:46 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-21 00:02:21 +0000
commitadf54799a4643a20867ea1c3f9720b7f74041262 (patch)
treeec308a3ae2a265a1029e065610702e41ff65d887
parent6f86646f22dbd165f3c60bd5c137f1bf5e608945 (diff)
downloadchrome-ec-adf54799a4643a20867ea1c3f9720b7f74041262.tar.gz
ps8xxx: Add support for ps8815 A2 with bad FW
This adds the low level chip ID of the ps8815 A2 so we can recognize the chip when its main firmware is inoperative. BRANCH=none BUG=b:186189039 TEST=with next patch in series, verified the brya EC reports the correct device ID when the firmware is corrupted. Change-Id: I2696b9c20fdefd8afd02f7394a45f1c4c5636d71 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2857796 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--driver/tcpm/ps8xxx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c
index 3bc85f48e8..4643c669c0 100644
--- a/driver/tcpm/ps8xxx.c
+++ b/driver/tcpm/ps8xxx.c
@@ -560,6 +560,9 @@ static int ps8805_make_device_id(int port, int *id)
* identify the chip as A1.
*
* See b/159289062.
+ *
+ * The ps8815 A2 reports device ID 0x0001 instead of 0x0003 when the
+ * firmware is bad (mis-programmed).
*/
static int ps8815_make_device_id(int port, int *id)
{
@@ -574,6 +577,7 @@ static int ps8815_make_device_id(int port, int *id)
&val);
if (status != EC_SUCCESS)
return status;
+
switch (val) {
case 0x0a00:
*id = 1;
@@ -581,6 +585,9 @@ static int ps8815_make_device_id(int port, int *id)
case 0x0a01:
*id = 2;
break;
+ case 0x0a02:
+ *id = 3;
+ break;
default:
return EC_ERROR_UNKNOWN;
}