diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-30 12:04:57 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-07 04:13:08 +0000 |
commit | d8646a8aae7dcd621018472cf8166422f9b66d07 (patch) | |
tree | 2bd1427395ba7931394f50f569acfde68239aef7 /zephyr | |
parent | 882f1f7846fb8b733bd3ce896157d4f03f95f07b (diff) | |
download | chrome-ec-d8646a8aae7dcd621018472cf8166422f9b66d07.tar.gz |
Zephyr: Add Kconfigs for RUNTIME_CONFIG
Add support for USB_PD_TCPC_RUNTIME_CONFIG and USB_MUX_RUNTIME_CONFIG
so that we get the correct type for tcpc_config[] and usb_mux[].
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>
Cq-Depend: chromium:2607401
Change-Id: Ic4c982f5d697cd6b61d83f2f12657220a5325094
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607508
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/Kconfig.usbc | 41 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 11 |
2 files changed, 51 insertions, 1 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc index 0837119f6e..c3d92807d0 100644 --- a/zephyr/Kconfig.usbc +++ b/zephyr/Kconfig.usbc @@ -361,6 +361,29 @@ config PLATFORM_EC_USB_PD_TCPM_TCPCI endchoice # Type-C Port Manager (TCPM) +menuconfig PLATFORM_EC_USB_MUX + bool "USB muxes" + default y + help + Enables support for USB muxes. These allow multiplexing + +if PLATFORM_EC_USB_MUX + +config PLATFORM_EC_USB_MUX_RUNTIME_CONFIG + bool "USB mux runtime config" + default y + help + Allows the configuration of the USB mux to be set up at runtime. This + makes the usb_muxes[] array writable, i.e. not const. It should be + declared as such in the board config. + + This is useful when the board has runtime information that changes + the configuration, such as Chromium OS Board Info (CBI set in the + factory. Without this, multiple EC images would need to be installed + depending on the board. + +endif # PLATFORM_EC_USB_MUX + config PLATFORM_EC_CONSOLE_CMD_PPC_DUMP bool "Console command: ppc_dump" depends on PLATFORM_EC_USBC_PPC @@ -372,10 +395,24 @@ config PLATFORM_EC_CONSOLE_CMD_PPC_DUMP reference to the datasheet for the part this can help you figure out what is going on. +if PLATFORM_EC_USB_PD_TCPM_TCPCI + +config PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG + bool "Type-C Port Controller runtime config" + default y + help + Allows the configuration of the TCPC to be set up at runtime. This + makes the tcpc_config[] array writable, i.e. not const. It should be + declared as such in the board config. + + This is useful when the board has runtime information that sets + the configuration, such as Chromium OS Board Info (CBI set in the + factory. Without this, multiple EC images would need to be installed + depending on the board. + config PLATFORM_EC_CMD_TCPC_DUMP bool "Console command: tcpc_dump" # anx7447 also supports this command, but is not yet enabled - depends on PLATFORM_EC_USB_PD_TCPM_TCPCI default y help Allows dumping of the Type-C Port Controller (TCPC) state, which is @@ -383,6 +420,8 @@ config PLATFORM_EC_CMD_TCPC_DUMP Universal Serial Bus Type-C Port Controller Interface Specification this can help you figure out what is going on. +endif # PLATFORM_EC_USB_PD_TCPM_TCPCI + endif # PLATFORM_EC_USBC_PPC endif # PLATFORM_EC_USBC diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 317f313238..bdede518a3 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -391,4 +391,15 @@ enum battery_type { #define CONFIG_USBC_PPC_SYV682X #endif +#undef CONFIG_USB_PD_TCPC_RUNTIME_CONFIG +#undef CONFIG_USB_MUX_RUNTIME_CONFIG +#ifdef CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG +#define CONFIG_USB_PD_TCPC_RUNTIME_CONFIG + +#ifdef CONFIG_PLATFORM_EC_USB_MUX_RUNTIME_CONFIG +#define CONFIG_USB_MUX_RUNTIME_CONFIG +#endif /* CONFIG_PLATFORM_EC_USB_MUX_RUNTIME_CONFIG */ + +#endif /* CONFIG_PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG */ + #endif /* __CROS_EC_CONFIG_CHIP_H */ |