summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-08-16 08:41:50 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-13 18:58:36 -0700
commit3c53f0413a966da25cbe803f614acd36d5c87685 (patch)
treede06a639b68728ed34d71df66a259503972500f4
parenta68497b87a0fcdfa1e4130600687fdb40430df84 (diff)
downloadchrome-ec-3c53f0413a966da25cbe803f614acd36d5c87685.tar.gz
ite: Add support for 3rd Type C port in bbram
DragonEgg has 3 Type C ports and needs BRAM_IDX_PD2 as only 2 ports were supproted previously. BUG=b:111281797 BRANCH=none TEST=Verfied that error messages from invalid bram_idx went away. Change-Id: I242850a89413f0a573155e5e325f4e0a540d33e6 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1178996 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--chip/it83xx/registers.h5
-rw-r--r--chip/it83xx/system.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/chip/it83xx/registers.h b/chip/it83xx/registers.h
index 57d73f7a26..cd7fcc0c2a 100644
--- a/chip/it83xx/registers.h
+++ b/chip/it83xx/registers.h
@@ -1105,11 +1105,12 @@ enum bram_indices {
BRAM_IDX_RESET_FLAGS2 = 2,
BRAM_IDX_RESET_FLAGS3 = 3,
- /* PD state data for CONFIG_USB_PD_DUAL_ROLE uses 2 bytes */
+ /* PD state data for CONFIG_USB_PD_DUAL_ROLE uses 1 byte per port */
BRAM_IDX_PD0 = 4,
BRAM_IDX_PD1 = 5,
+ BRAM_IDX_PD2 = 6,
- /* index 6 ~ 7 are reserved */
+ /* index 7 is reserved */
BRAM_IDX_SCRATCHPAD0 = 8,
BRAM_IDX_SCRATCHPAD1 = 9,
diff --git a/chip/it83xx/system.c b/chip/it83xx/system.c
index 02153424e1..98bf0e092a 100644
--- a/chip/it83xx/system.c
+++ b/chip/it83xx/system.c
@@ -290,6 +290,8 @@ static int bram_idx_lookup(enum system_bbram_idx idx)
return BRAM_IDX_PD0;
if (idx == SYSTEM_BBRAM_IDX_PD1)
return BRAM_IDX_PD1;
+ if (idx == SYSTEM_BBRAM_IDX_PD2)
+ return BRAM_IDX_PD2;
#endif
return -1;
}