diff options
author | Jett Rink <jettrink@chromium.org> | 2018-11-13 14:53:54 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-16 05:02:03 -0800 |
commit | 2d1ab813cba0e2aeb6bc5ce482abcf33340d8f67 (patch) | |
tree | 7b8de4e027ee45feb1d014ff5205983e307e4f7f | |
parent | cd2364b2da37d851baa36378eb3c8dd5846ab98a (diff) | |
download | chrome-ec-2d1ab813cba0e2aeb6bc5ce482abcf33340d8f67.tar.gz |
ppc/nx20: add more fault condition prints
When the PPC detects a fault condition such as a short or reverse
current, we should print something to the EC console.
BRANCH=none
BUG=b:115307099
TEST=build. Couldn't get this to trip on demand though.
Change-Id: Ib5298074b08a7d7d0d278258822fb7edf562c7aa
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1334527
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | driver/ppc/nx20p348x.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c index 18523c196b..8a0d45851e 100644 --- a/driver/ppc/nx20p348x.c +++ b/driver/ppc/nx20p348x.c @@ -227,7 +227,8 @@ static int nx20p348x_init(int port) return rv; /* Mask interrupts for interrupt 1 register */ - mask = ~(NX20P348X_INT1_OC_5VSRC | NX20P348X_INT1_DBEXIT_ERR); + mask = ~(NX20P348X_INT1_OC_5VSRC | NX20P348X_INT1_SC_5VSRC | + NX20P348X_INT1_RCP_5VSRC | NX20P348X_INT1_DBEXIT_ERR); #ifdef CONFIG_USBC_PPC_NX20P3481 /* Unmask Fast Role Swap detect interrupt */ mask &= ~NX20P348X_INT1_FRS_DET; @@ -320,7 +321,7 @@ static void nx20p348x_handle_interrupt(int port) /* Check for 5V OC interrupt */ if (reg & NX20P348X_INT1_OC_5VSRC) { - CPRINTS("C%d: PPC detected overcurrent!", port); + CPRINTS("C%d: PPC detected Vbus overcurrent!", port); /* * TODO (b/69935262): The overcurrent action hasn't * been completed yet, but is required for TI PPC. When that @@ -328,6 +329,14 @@ static void nx20p348x_handle_interrupt(int port) */ } + /* Check for Vbus reverse current protection */ + if (reg & NX20P348X_INT1_RCP_5VSRC) + CPRINTS("C%d: PPC detected Vbus reverse current!", port); + + /* Check for Vbus short protection */ + if (reg & NX20P348X_INT1_SC_5VSRC) + CPRINTS("C%d: PPC Vbus short detected!", port); + #ifdef CONFIG_USBC_PPC_NX20P3481 /* Check for FRS detection */ if (reg & NX20P348X_INT1_FRS_DET) { |