summaryrefslogtreecommitdiff
path: root/zephyr/program/rex
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/program/rex')
-rw-r--r--zephyr/program/rex/program.conf2
-rw-r--r--zephyr/program/rex/rex.dtsi25
-rw-r--r--zephyr/program/rex/rex/src/usb_mux_config.c8
-rw-r--r--zephyr/program/rex/usbc.dtsi6
4 files changed, 40 insertions, 1 deletions
diff --git a/zephyr/program/rex/program.conf b/zephyr/program/rex/program.conf
index 1e19f687de..75351088fe 100644
--- a/zephyr/program/rex/program.conf
+++ b/zephyr/program/rex/program.conf
@@ -96,7 +96,7 @@ CONFIG_PLATFORM_EC_USB_PD_DATA_RESET_MSG=y
CONFIG_PLATFORM_EC_USB_PD_VBUS_MEASURE_CHARGER=y
CONFIG_PLATFORM_EC_USB_PID=0x504D
-#USB Mux
+# USB Mux
CONFIG_PLATFORM_EC_USB_MUX_TASK=y
# External power
diff --git a/zephyr/program/rex/rex.dtsi b/zephyr/program/rex/rex.dtsi
index 28f719d356..83d10b95d1 100644
--- a/zephyr/program/rex/rex.dtsi
+++ b/zephyr/program/rex/rex.dtsi
@@ -253,6 +253,17 @@
*/
rst-gpios = <&gpio7 4 (GPIO_OPEN_DRAIN | GPIO_ACTIVE_LOW)>;
};
+
+ rt1716_tcpc_port1: rt1716@4e {
+ compatible = "richtek,rt1715-tcpc";
+ reg = <0x4e>;
+ /* a duplicate of the <&gpio_usb_c1_tcpc_int_odl> node in
+ * "named-gpios". This is the Zephyr preferred style,
+ * the "named-gpios" node will be dealt with at a later date.
+ */
+ irq-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
+ is-alt;
+ };
};
&i2c5_0 {
@@ -282,6 +293,20 @@
status = "okay";
reg = <0x72>;
};
+
+ ppc_port1_syv: ppc_syv@40 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x40>;
+ frs_en_gpio = <&gpio_usb_c1_frs_en>;
+ is-alt;
+ };
+
+ usb_c1_anx7452_retimer: usb-c1-anx7452-retimer@10{
+ compatible = "analogix,anx7452";
+ reg = <0x10>;
+ usb-en-pin = <&gpio_usb_c1_rt_rst_r_odl>;
+ };
};
&i2c7_0 {
diff --git a/zephyr/program/rex/rex/src/usb_mux_config.c b/zephyr/program/rex/rex/src/usb_mux_config.c
index a549235f3c..a3d2d4ab0c 100644
--- a/zephyr/program/rex/rex/src/usb_mux_config.c
+++ b/zephyr/program/rex/rex/src/usb_mux_config.c
@@ -11,6 +11,8 @@
#include "hooks.h"
#include "ioexpander.h"
#include "usb_mux.h"
+#include "usbc/ppc.h"
+#include "usbc/tcpci.h"
#include "usbc/usb_muxes.h"
#include <zephyr/drivers/gpio.h>
@@ -47,5 +49,11 @@ static void setup_mux(void)
if (val == FW_USB_DB_USB3) {
LOG_INF("USB DB: Setting USB3 mux");
}
+ if (val == FW_USB_DB_USB4_ANX7452) {
+ LOG_INF("USB DB: Setting ANX7452 mux");
+ USB_MUX_ENABLE_ALTERNATIVE(usb_mux_chain_anx7452_port1);
+ TCPC_ENABLE_ALTERNATE_BY_NODELABEL(1, rt1716_tcpc_port1);
+ PPC_ENABLE_ALTERNATE_BY_NODELABEL(1, ppc_port1_syv);
+ }
}
DECLARE_HOOK(HOOK_INIT, setup_mux, HOOK_PRIO_INIT_I2C);
diff --git a/zephyr/program/rex/usbc.dtsi b/zephyr/program/rex/usbc.dtsi
index 84ae79fae6..e4565092ee 100644
--- a/zephyr/program/rex/usbc.dtsi
+++ b/zephyr/program/rex/usbc.dtsi
@@ -37,6 +37,12 @@
compatible = "cros-ec,usb-mux-chain";
usb-muxes = <&virtual_mux_c1 &tcpci_mux_c1>;
};
+ usb_mux_chain_anx7452_port1: usb-mux-chain-1-anx7452 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&usb_c1_anx7452_retimer
+ &virtual_mux_c1>;
+ alternative-chain;
+ };
};
port1-muxes {
tcpci_mux_c1: tcpci-mux-c1 {