diff options
-rw-r--r-- | board/brya/usbc_config.c | 12 | ||||
-rw-r--r-- | zephyr/projects/brya/usbc.dts | 18 |
2 files changed, 27 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; } diff --git a/zephyr/projects/brya/usbc.dts b/zephyr/projects/brya/usbc.dts index 04e2702306..181acd837e 100644 --- a/zephyr/projects/brya/usbc.dts +++ b/zephyr/projects/brya/usbc.dts @@ -34,6 +34,7 @@ status = "okay"; port = <&i2c_charger>; }; + usb-muxes = <&usb_c0_bb_retimer &virtual_mux_c0>; }; port0-muxes { usb_c0_bb_retimer: jhl8040r-c0 { @@ -43,6 +44,9 @@ int-pin = <&usb_c0_rt_int_odl>; reset-pin = <&usb_c0_rt_rst_odl>; }; + virtual_mux_c0: virtual-mux-c0 { + compatible = "cros-ec,usbc-mux-virtual"; + }; }; port1@1 { @@ -65,6 +69,16 @@ TCPC_FLAGS_CONTROL_VCONN | TCPC_FLAGS_CONTROL_FRS)>; }; + usb-muxes = <&virtual_mux_c1 &tcpci_mux_c1>; + }; + port1-muxes { + tcpci_mux_c1: tcpci-mux-c1 { + compatible = "cros-ec,usbc-mux-tcpci"; + hpd-update = "ps8xxx_tcpc_update_hpd_status"; + }; + virtual_mux_c1: virtual-mux-c1 { + compatible = "cros-ec,usbc-mux-virtual"; + }; }; port2@2 { @@ -84,6 +98,7 @@ i2c-addr-flags = "NCT38XX_I2C_ADDR2_1_FLAGS"; tcpc-flags = <(TCPC_FLAGS_TCPCI_REV2_0)>; }; + usb-muxes = <&usb_c2_bb_retimer &virtual_mux_c2>; }; port2-muxes { usb_c2_bb_retimer: jhl8040r-c2 { @@ -93,6 +108,9 @@ int-pin = <&usb_c2_rt_int_odl>; reset-pin = <&usb_c2_rt_rst_odl>; }; + virtual_mux_c2: virtual-mux-c2 { + compatible = "cros-ec,usbc-mux-virtual"; + }; }; }; }; |