summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-10-12 13:02:05 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-15 20:34:50 +0000
commitc389ca4c78520fd816e4471a4e7d3ba571fc9a58 (patch)
tree596b9ac3991573643742d009132f298b5c3667ac
parent0899b717501b72f3ba88c3ee4e749ec60ad90819 (diff)
downloadchrome-ec-c389ca4c78520fd816e4471a4e7d3ba571fc9a58.tar.gz
sn5s330: Set RCP threshold to 3 mV for PP1
This CL adjusts the RCP (reverse current protection) voltage threshold for PP1 to 3 mV when in ideal diode mode. This change fixes an issue on honeybuns for port C0 when connecting to M1 based host machines and charging at higher VBUS values ( > 15V). BRANCH=quiche BUG=b:199339421 TEST=verfied bit 4 of function set 10 register is clear > ppc 0 dump FUNC_SET1 [50h] = 0x05 FUNC_SET2 [51h] = 0x18 FUNC_SET3 [52h] = 0x68 FUNC_SET4 [53h] = 0xfc FUNC_SET5 [54h] = 0x37 FUNC_SET6 [55h] = 0xc1 FUNC_SET7 [56h] = 0x70 FUNC_SET8 [57h] = 0xbd FUNC_SET9 [58h] = 0x34 FUNC_SET10 [59h] = 0x60 ODM partner verified this change fixed the ~3% devices that were failing and did interop testing with other host machines to verify no regressions. Those results are linked in the buganizer issue. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Id798debc11f8586acc6c9feef104478375ee4fea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3219573 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
-rw-r--r--driver/ppc/sn5s330.c11
-rw-r--r--driver/ppc/sn5s330.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/driver/ppc/sn5s330.c b/driver/ppc/sn5s330.c
index 4abf85cf50..9cc5918bf1 100644
--- a/driver/ppc/sn5s330.c
+++ b/driver/ppc/sn5s330.c
@@ -333,6 +333,17 @@ static int sn5s330_init(int port)
return status;
}
+ /*
+ * Set RCP voltage threshold to 3mV instead of 6mV default for the
+ * source path. This modification helps prevent false RCP triggers
+ * against certain port partners when VBUS is set to 20V.
+ */
+ status = clr_flags(port, SN5S330_FUNC_SET10, SN5S330_PP1_RCP_OFFSET);
+ if (status) {
+ ppc_prints("Failed to set FUNC_SET10!", port);
+ return status;
+ }
+
/* Turn off PP1 FET. */
status = sn5s330_pp_fet_enable(port, SN5S330_PP1, 0);
if (status) {
diff --git a/driver/ppc/sn5s330.h b/driver/ppc/sn5s330.h
index f94a3e8e10..188499e34a 100644
--- a/driver/ppc/sn5s330.h
+++ b/driver/ppc/sn5s330.h
@@ -122,6 +122,9 @@ enum sn5s330_pp_idx {
#define SN5S330_VSAFE0V_STAT BIT(2)
#define SN5S330_VSAFE0V_MASK BIT(3)
+/* FUNC_SET_10 */
+#define SN5S330_PP1_RCP_OFFSET BIT(4)
+
/*
* INT_MASK_RISE/FALL_EDGE_1
*