From 28f07760f384789a6a28801c0c42d9d61af2f99b Mon Sep 17 00:00:00 2001 From: Sam Hurst Date: Tue, 24 Mar 2020 16:46:14 -0700 Subject: TCPMv2: Restore PD state after Sysjump When a PD explicit contract is negotiated in RO, the contract is maintained while performing a sysjump to RW. This is done by serializing the PD Power, Data, and VCONN Roles, along with the explicit contract flag. After jumping to RW, deserialization is performed by restoring the power roles and setting the explicit contract flag. BUG=b:152350558,b:152027807,b:152967274 BRANCH=none TEST=make -j buildall Manual tests: Used total phase to verify that charging voltage was maintained across sysjump from RO to RW and that DP was reestablished when a dock was used. Tested that Kohaku booted properly without a battery and a charger connected to port 0. This test was repeated with a charger connected to port 1. Signed-off-by: Sam Hurst Change-Id: I349c41f2279e9af9830564d44ac73ad8435f1f80 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2119131 Tested-by: Sam Hurst Reviewed-by: Denis Brockus Commit-Queue: Denis Brockus --- include/system.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/system.h') diff --git a/include/system.h b/include/system.h index ced5446eee..03a2c15238 100644 --- a/include/system.h +++ b/include/system.h @@ -355,6 +355,9 @@ enum system_bbram_idx { SYSTEM_BBRAM_IDX_TRY_SLOT, }; +/* Maximum number of bbram indexes allotted for PD port state data */ +#define MAX_SYSTEM_BBRAM_IDX_PD_PORTS 3 + /** * Get/Set byte in battery-backed storage. * -- cgit v1.2.1