From 025f8592fbc8fa728dbb5535d9fa74427391e398 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 5 Feb 2021 13:16:20 -0700 Subject: zephyr: Add support for retimer firmware updates Enable CONFIG_USBC_RETIMER_FW_UPDATE so that retimer chips can be updated on boot. BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer, see that the new code is included Signed-off-by: Simon Glass Change-Id: Ie620f322d32bae46c00ff4e8d5477261a7dbe279 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678926 Reviewed-by: Jack Rosenthal --- zephyr/CMakeLists.txt | 2 ++ zephyr/Kconfig.usbc | 14 ++++++++++++++ zephyr/shim/include/config_chip.h | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index dc02a3eb0d..8e3ed422f9 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -186,6 +186,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USB_POWER_DELIVERY zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_PD "${PLATFORM_EC}/common/usbc/usb_pd_console.c") +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_RETIMER_FW_UPDATE + "${PLATFORM_EC}/common/usbc/usb_retimer_fw_update.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_RETIMER_INTEL_BB "${PLATFORM_EC}/driver/retimer/bb_retimer.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_SS_MUX diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 7587514c04..596c32f663 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -783,6 +783,20 @@ config PLATFORM_EC_USB_MUX_VIRTUAL and is is informed when status changes, via the EC_CMD_USB_PD_MUX_INFO host command. +config PLATFORM_EC_USBC_RETIMER_FW_UPDATE + bool "Support firmware update of USB Type-C retimers" + default y + depends on PLATFORM_EC_USBC_SS_MUX + help + Enable this to support USB Type-C retimer firmware update. Each + Type-C retimer indicates its capability of supporting firmware update + independently in its usb_mux_driver. + + During AP boot-up, the AP scans each PD port for retimers but only + if there are no Type-C devices attached to the port. The firmware + update can only be performed on retimers which show up in the AP + thunderbolt device entries. + endif # PLATFORM_EC_USB_MUX config PLATFORM_EC_CONSOLE_CMD_PPC_DUMP diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index f445cd1212..48e50cc2cf 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -683,6 +683,11 @@ enum battery_type { #define CONFIG_USB_PD_ALT_MODE_UFP #endif +#undef CONFIG_USBC_RETIMER_FW_UPDATE +#ifdef CONFIG_PLATFORM_EC_USBC_RETIMER_FW_UPDATE +#define CONFIG_USBC_RETIMER_FW_UPDATE +#endif + #undef CONFIG_USBC_RETIMER_INTEL_BB #ifdef CONFIG_PLATFORM_EC_USBC_RETIMER_INTEL_BB -- cgit v1.2.1