summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-14 14:14:08 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-16 03:18:29 +0000
commit4ddd4ff87b580f78ccd112fbcb14bf7d6a087f28 (patch)
treed4d99dae5a127d20f6072798a6f5489b94732e8d /zephyr
parent0b5e0506fec0cbb4b1493edd0007cd1ad93c1c98 (diff)
downloadchrome-ec-4ddd4ff87b580f78ccd112fbcb14bf7d6a087f28.tar.gz
zephyr: Add options for USB4 Power Delivery
Allow enabling USB4 Power Delivery features as well as Thunderbolt 3 compatibility mode, which is available with USB4. 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: I19dfeaa5dfadcddbdb27e67ff40a70b92c594cf1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631096 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/CMakeLists.txt4
-rw-r--r--zephyr/Kconfig.usbc18
-rw-r--r--zephyr/shim/include/config_chip.h10
3 files changed, 32 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 8db9fcde63..a4ff934e68 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -147,6 +147,10 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_SS_MUX
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_MUX_VIRTUAL
"${PLATFORM_EC}/driver/usb_mux/virtual.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
+ "${PLATFORM_EC}/common/usbc/tbt_alt_mode.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_PD_USB4
+ "${PLATFORM_EC}/common/usbc/usb_mode.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_OCP
"${PLATFORM_EC}/common/usbc_ocp.c")
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index 939fa96d09..cf7c6bf50b 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -489,6 +489,24 @@ config PLATFORM_EC_USB_PD_TRY_SRC
for laptops, for example, since when attaching to a cellphone we want
the laptop to charge the phone, not vice versa.
+config PLATFORM_EC_USB_PD_USB4
+ bool "USB4 support"
+ depends on PLATFORM_EC_CONFIG_USB_PD_REV30
+ default y
+ help
+ This enables support for entering into USB4 mode between two port
+ partners. The provides new features such as higher speeds and more
+ flexible multiplexing of data on the cable for different purposes,
+ e.g. attaching multiple displays and storage devices on the same bus.
+
+config PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
+ bool "Thunderbolt-compatible mode support"
+ depends on PLATFORM_EC_CONFIG_USB_PD_REV30
+ default y
+ help
+ Enable this to allow entering into Thunderbolt-compatible mode between
+ two port partners. This does not require that USB4 mode be enabled.
+
endif # PLATFORM_EC_USB_POWER_DELIVERY
menuconfig PLATFORM_EC_USBC_PPC
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index d357d315ab..fd635ee6a3 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -574,4 +574,14 @@ enum battery_type {
#define CONFIG_CMD_USB_PD_CABLE
#endif
+#undef CONFIG_USB_PD_TBT_COMPAT_MODE
+#ifdef CONFIG_PLATFORM_EC_USB_PD_TBT_COMPAT_MODE
+#define CONFIG_USB_PD_TBT_COMPAT_MODE
+#endif
+
+#undef CONFIG_USB_PD_USB4
+#ifdef CONFIG_PLATFORM_EC_USB_PD_USB4
+#define CONFIG_USB_PD_USB4
+#endif
+
#endif /* __CROS_EC_CONFIG_CHIP_H */