diff options
author | Scott Collyer <scollyer@google.com> | 2023-05-02 16:26:50 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-05-04 22:45:45 +0000 |
commit | 21a314ea7aad34fc7930ea207d07c6b1eb34b7c9 (patch) | |
tree | 7c2f45817121402569819e37c15a5e107b9f7df1 | |
parent | 04a2772c47a6f9d70a47bd7adea04cd01c2335f5 (diff) | |
download | chrome-ec-21a314ea7aad34fc7930ea207d07c6b1eb34b7c9.tar.gz |
rex: Enable usbc portion of KB8010 DB
This CL enables the usbc path for the KB8010 DB. The KB8010 driver is
still work in progress, but this these changes will allow basic usbc
and PD operation for this DB.
BUG=b:267589112
TEST=Test on SKU2 system and verified that can connect to both
external charger and power usbc hub.
Low-Coverage-Reason: Tracked in bug b:273928607
Change-Id: If38eba76d7f3540ee3f5425d0399fc9a4daa5053
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4500761
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: caveh jalali <caveh@chromium.org>
Commit-Queue: caveh jalali <caveh@chromium.org>
Reviewed-by: Madhurima Paruchuri <mparuchuri@google.com>
-rw-r--r-- | zephyr/program/rex/rex.dtsi | 7 | ||||
-rw-r--r-- | zephyr/program/rex/rex/src/usb_mux_config.c | 6 | ||||
-rw-r--r-- | zephyr/program/rex/rex/src/usbc_config.c | 4 | ||||
-rw-r--r-- | zephyr/program/rex/usbc.dtsi | 5 |
4 files changed, 22 insertions, 0 deletions
diff --git a/zephyr/program/rex/rex.dtsi b/zephyr/program/rex/rex.dtsi index 489ba31209..a095ed857e 100644 --- a/zephyr/program/rex/rex.dtsi +++ b/zephyr/program/rex/rex.dtsi @@ -285,6 +285,13 @@ irq = <&int_usb_c1_bc12>; }; + ppc_ktu1125_port1: ktu1125@38 { + compatible = "kinetic,ktu1125"; + status = "okay"; + reg = <0x38>; + is-alt; + }; + ppc_port1_nxp: nx20p348x@72 { compatible = "nxp,nx20p348x"; status = "okay"; diff --git a/zephyr/program/rex/rex/src/usb_mux_config.c b/zephyr/program/rex/rex/src/usb_mux_config.c index 2ad45559b5..6cbc944ad4 100644 --- a/zephyr/program/rex/rex/src/usb_mux_config.c +++ b/zephyr/program/rex/rex/src/usb_mux_config.c @@ -60,6 +60,12 @@ static void setup_usb_db(void) TCPC_ENABLE_ALTERNATE_BY_NODELABEL(1, tcpc_rt1716_port1); PPC_ENABLE_ALTERNATE_BY_NODELABEL(1, ppc_syv_port1); break; + case FW_USB_DB_USB4_KB8010: + LOG_INF("USB DB: Setting KB8010 mux"); + USB_MUX_ENABLE_ALTERNATIVE(usb_mux_chain_kb8010_port1); + TCPC_ENABLE_ALTERNATE_BY_NODELABEL(1, tcpc_rt1716_port1); + PPC_ENABLE_ALTERNATE_BY_NODELABEL(1, ppc_ktu1125_port1); + break; default: LOG_INF("USB DB: No known USB DB found"); } diff --git a/zephyr/program/rex/rex/src/usbc_config.c b/zephyr/program/rex/rex/src/usbc_config.c index 569ac3f76f..4a3b19c5e3 100644 --- a/zephyr/program/rex/rex/src/usbc_config.c +++ b/zephyr/program/rex/rex/src/usbc_config.c @@ -4,6 +4,7 @@ */ #include "cros_cbi.h" +#include "driver/ppc/ktu1125_public.h" #include "driver/ppc/nx20p348x.h" #include "driver/tcpm/ps8xxx_public.h" #include "ppc/syv682x_public.h" @@ -38,6 +39,9 @@ void ppc_interrupt(enum gpio_signal signal) if (usb_db_type == FW_USB_DB_USB4_ANX7452) { syv682x_interrupt(USBC_PORT_C1); } + if (usb_db_type == FW_USB_DB_USB4_KB8010) { + ktu1125_interrupt(USBC_PORT_C1); + } break; default: break; diff --git a/zephyr/program/rex/usbc.dtsi b/zephyr/program/rex/usbc.dtsi index fff5b021f9..ca94382aa6 100644 --- a/zephyr/program/rex/usbc.dtsi +++ b/zephyr/program/rex/usbc.dtsi @@ -42,6 +42,11 @@ usb-muxes = <&virtual_mux_c1>; alternative-chain; }; + usb_mux_chain_kb8010_port1: usb-mux-chain-1-kb8010 { + compatible = "cros-ec,usb-mux-chain"; + usb-muxes = <&virtual_mux_c1>; + alternative-chain; + }; }; port1-muxes { tcpci_mux_c1: tcpci-mux-c1 { |