diff options
author | Andrew McRae <amcrae@google.com> | 2020-08-27 11:34:12 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-29 22:40:55 +0000 |
commit | 78abff4e675a007442299f6df39627e7a2359f02 (patch) | |
tree | 57097de790eeccacc257a5472cd0a48435e928d6 | |
parent | a142263372b6e59dbb88e37d3ea13d21750e5713 (diff) | |
download | chrome-ec-78abff4e675a007442299f6df39627e7a2359f02.tar.gz |
Puff: Restore VBUS (if sourcing) upon CPU start
The PPC (sn5s330) internally disables PP1 if the source drops,
so upon CPU restart when the rail is up, check whether we are
sourcing VBUS and re-enable it if necessary.
BUG=b:161963268
TEST=Run firmware_FwScreenPressPower test and monitor VBUS via twinkie.
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: Ibe1c2151526ac1c20690e1891272efbb811f3d8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377063
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Commit-Queue: Andrew McRae <amcrae@chromium.org>
Tested-by: Andrew McRae <amcrae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383789
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
-rw-r--r-- | board/puff/board.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/puff/board.c b/board/puff/board.c index 02b5b0d6bd..7073ebaa76 100644 --- a/board/puff/board.c +++ b/board/puff/board.c @@ -472,6 +472,22 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +static void board_chipset_startup(void) +{ + /* + * Workaround to restore VBUS on PPC. + * PP1 is sourced from PP5000_A, and when the CPU shuts down and + * this rail drops, the PPC will internally turn off PP1_EN. + * When the CPU starts again, and the rail is restored, the PPC + * does not turn PP1_EN on again, causing VBUS to stay turned off. + * The workaround is to check whether the PPC is sourcing VBUS, and + * if so, make sure it is enabled. + */ + if (ppc_is_sourcing_vbus(0)) + ppc_vbus_source_enable(0, 1); +} +DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, + HOOK_PRIO_DEFAULT); /******************************************************************************/ /* USB-C PPC Configuration */ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = { |