diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-14 14:19:22 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-16 03:18:31 +0000 |
commit | e14f7cc304c5bae37399665aa0885cfc506ff607 (patch) | |
tree | c61ee93de813bd4ebfd59d52ad3824f78c66e38c /board/volteer | |
parent | 4ddd4ff87b580f78ccd112fbcb14bf7d6a087f28 (diff) | |
download | chrome-ec-e14f7cc304c5bae37399665aa0885cfc506ff607.tar.gz |
volteer: Add USB4 PD support functions
Add a few functions needed by the USB4 Power Delivery features.
BUG=b:175434113
BRANCH=none
TEST=make BOARD=volteer -j30
With a zephyr-chrome CL, build volteer on zephyr
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Iaab8efe5d04617bb8641fb2939ddeeaa62dc2523
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631097
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/volteer')
-rw-r--r-- | board/volteer/board.c | 41 | ||||
-rw-r--r-- | board/volteer/usbc_config.c | 41 |
2 files changed, 41 insertions, 41 deletions
diff --git a/board/volteer/board.c b/board/volteer/board.c index f22a2ebd58..c7e40892d2 100644 --- a/board/volteer/board.c +++ b/board/volteer/board.c @@ -68,47 +68,6 @@ static void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); -__override enum tbt_compat_cable_speed board_get_max_tbt_speed(int port) -{ - enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); - - if (port == USBC_PORT_C1) { - if (usb_db == DB_USB4_GEN2) { - /* - * Older boards violate 205mm trace length prior - * to connection to the re-timer and only support up - * to GEN2 speeds. - */ - return TBT_SS_U32_GEN1_GEN2; - } else if (usb_db == DB_USB4_GEN3) { - return TBT_SS_TBT_GEN3; - } - } - - /* - * Thunderbolt-compatible mode not supported - * - * TODO (b/147726366): All the USB-C ports need to support same speed. - * Need to fix once USB-C feature set is known for Volteer. - */ - return TBT_SS_RES_0; -} - -__override bool board_is_tbt_usb4_port(int port) -{ - enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); - - /* - * Volteer reference design only supports TBT & USB4 on port 1 - * if the USB4 DB is present. - * - * TODO (b/147732807): All the USB-C ports need to support same - * features. Need to fix once USB-C feature set is known for Volteer. - */ - return ((port == USBC_PORT_C1) - && ((usb_db == DB_USB4_GEN2) || (usb_db == DB_USB4_GEN3))); -} - /******************************************************************************/ /* Physical fans. These are logically separate from pwm_channels. */ diff --git a/board/volteer/usbc_config.c b/board/volteer/usbc_config.c index 2898d9e32e..bc2d368ffd 100644 --- a/board/volteer/usbc_config.c +++ b/board/volteer/usbc_config.c @@ -232,6 +232,47 @@ struct bb_usb_control bb_controls[] = { }; BUILD_ASSERT(ARRAY_SIZE(bb_controls) == USBC_PORT_COUNT); +__override enum tbt_compat_cable_speed board_get_max_tbt_speed(int port) +{ + enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); + + if (port == USBC_PORT_C1) { + if (usb_db == DB_USB4_GEN2) { + /* + * Older boards violate 205mm trace length prior + * to connection to the re-timer and only support up + * to GEN2 speeds. + */ + return TBT_SS_U32_GEN1_GEN2; + } else if (usb_db == DB_USB4_GEN3) { + return TBT_SS_TBT_GEN3; + } + } + + /* + * Thunderbolt-compatible mode not supported + * + * TODO (b/147726366): All the USB-C ports need to support same speed. + * Need to fix once USB-C feature set is known for Volteer. + */ + return TBT_SS_RES_0; +} + +__override bool board_is_tbt_usb4_port(int port) +{ + enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); + + /* + * Volteer reference design only supports TBT & USB4 on port 1 + * if the USB4 DB is present. + * + * TODO (b/147732807): All the USB-C ports need to support same + * features. Need to fix once USB-C feature set is known for Volteer. + */ + return ((port == USBC_PORT_C1) + && ((usb_db == DB_USB4_GEN2) || (usb_db == DB_USB4_GEN3))); +} + static void ps8815_reset(void) { int val; |