summaryrefslogtreecommitdiff
path: root/board/brya
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2022-04-21 17:23:51 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-03 14:12:51 +0000
commit03bff63345be6a2f52f5f031ed4f724d7fd01794 (patch)
treef86b1bbc4fe08cfb08a9fb719b07689f11f5d2c2 /board/brya
parent2b80d1c6d28573030c115f8219801fdd4e9cd2d2 (diff)
downloadchrome-ec-03bff63345be6a2f52f5f031ed4f724d7fd01794.tar.gz
zephyr: move Brya USB mux configuration into the DTS
Move the Brya board USB mux configuration into the devicetree. BUG=b:229411952 TEST=zmake testall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I4a388caca7833391b76bb4261b64f30cf3b26ecc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3607990 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Sam Hurst <shurst@google.com>
Diffstat (limited to 'board/brya')
-rw-r--r--board/brya/usbc_config.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/board/brya/usbc_config.c b/board/brya/usbc_config.c
index 6f6ae0d84f..eb72412423 100644
--- a/board/brya/usbc_config.c
+++ b/board/brya/usbc_config.c
@@ -125,6 +125,7 @@ BUILD_ASSERT(ARRAY_SIZE(ppc_chips) == USBC_PORT_COUNT);
unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
+#ifndef CONFIG_ZEPHYR
/* USBC mux configuration - Alder Lake includes internal mux */
static const struct usb_mux usbc0_tcss_usb_mux = {
.usb_port = USBC_PORT_C0,
@@ -175,7 +176,6 @@ const struct usb_mux usb_muxes[] = {
};
BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT);
-#ifndef CONFIG_ZEPHYR
/* BC1.2 charger detect configuration */
const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
[USBC_PORT_C0] = {
@@ -286,16 +286,22 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
if (get_board_id() == 1)
rst_signal = IOEX_ID_1_USB_C0_RT_RST_ODL;
else
-#endif /* !CONFIG_ZEPHYR */
rst_signal = IOEX_USB_C0_RT_RST_ODL;
+#else
+ /* On Zephyr use bb_controls generated from DTS */
+ rst_signal = bb_controls[me->usb_port].retimer_rst_gpio;
+#endif /* !CONFIG_ZEPHYR */
} else if (me->usb_port == USBC_PORT_C2) {
/* TODO: explore how to handle board id in zephyr*/
#ifndef CONFIG_ZEPHYR
if (get_board_id() == 1)
rst_signal = IOEX_ID_1_USB_C2_RT_RST_ODL;
else
-#endif /* !CONFIG_ZEPHYR */
rst_signal = IOEX_USB_C2_RT_RST_ODL;
+#else
+ /* On Zephyr use bb_controls generated from DTS */
+ rst_signal = bb_controls[me->usb_port].retimer_rst_gpio;
+#endif /* !CONFIG_ZEPHYR */
} else {
return EC_ERROR_INVAL;
}