summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Sanders <nsanders@chromium.org>2018-08-23 19:01:19 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-25 07:31:18 -0700
commitb79cd75882007448db3cb9467fc11b6b4f726283 (patch)
tree9ab879917417beb1e058171c0e268e6e9bd382a5
parentfa43b6dc158d5f3b9cc10f3c1f79c45ef8ed6f05 (diff)
downloadchrome-ec-b79cd75882007448db3cb9467fc11b6b4f726283.tar.gz
servo_v4: clear bbram PD state on reboot
Preserved bbram state causes failure to reinit on reboot. Clear on board init. BRANCH=None BUG=b:111573811 TEST=PD reinits on reboot. Change-Id: Ifdf98b5793cb99e2900ac5dc53263a86317b6b07 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1187883 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/servo_v4/board.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/board/servo_v4/board.c b/board/servo_v4/board.c
index 8511788e7a..982ed9ccfb 100644
--- a/board/servo_v4/board.c
+++ b/board/servo_v4/board.c
@@ -15,6 +15,7 @@
#include "queue_policies.h"
#include "registers.h"
#include "spi.h"
+#include "system.h"
#include "task.h"
#include "timer.h"
#include "update_fw.h"
@@ -31,6 +32,7 @@
#include "gpio_list.h"
#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args)
+#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args)
/******************************************************************************
* Board pre-init function.
@@ -434,6 +436,10 @@ static void board_init(void)
init_uservo_port();
init_usb3_port();
+ /* Clear BBRAM, we don't want any PD state carried over on reset. */
+ system_set_bbram(SYSTEM_BBRAM_IDX_PD0, 0);
+ system_set_bbram(SYSTEM_BBRAM_IDX_PD1, 0);
+
/*
* Enable SBU mux. The polarity is set each time a new PD attach event
* occurs. But, the SBU mux is not disabled on detach so that the H1 USB