diff options
author | Sam Hurst <shurst@google.com> | 2020-05-26 10:13:07 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-25 02:32:40 +0000 |
commit | b38f3970ef0ea24c77a8ceeddd0f3eae3692c702 (patch) | |
tree | 51cb97f0775a49af7c70560630230dafabf3938a /board/servo_v4p1/pathsel.c | |
parent | 0aec4b23c58d2adc9385b3afee03fb812f950c1d (diff) | |
download | chrome-ec-b38f3970ef0ea24c77a8ceeddd0f3eae3692c702.tar.gz |
servo_v4p1: Add USB3 routing to DUT or HOST functionality
This functionality is only available in RO and enables
the USB3 ports A0 and A1 to be routed to the DUT or HOST.
BRANCH=none
BUG=b:146793000
TEST=make -j buildall
Signed-off-by: Sam Hurst <shurst@google.com>
Change-Id: I1fb11fcf918d3351094fd3e2f0553a3aa551f945
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2216403
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/servo_v4p1/pathsel.c')
-rw-r--r-- | board/servo_v4p1/pathsel.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/board/servo_v4p1/pathsel.c b/board/servo_v4p1/pathsel.c new file mode 100644 index 0000000000..40100ce22a --- /dev/null +++ b/board/servo_v4p1/pathsel.c @@ -0,0 +1,59 @@ +/* Copyright 2020 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "gpio.h" +#include "ioexpanders.h" +#include "pathsel.h" + +void init_pathsel(void) +{ + /* Connect TypeA port to DUT hub */ + usb3_a0_to_dut(); + /* Connect data lines */ + usb3_a0_mux_en_l(0); + /* Enable power */ + usb3_a0_pwr_en(1); + + /* Connect TypeA port to DUT hub */ + usb3_a1_to_dut(); + /* Connect data lines */ + gpio_set_level(GPIO_USB3_A1_MUX_EN_L, 0); + /* Enable power */ + usb3_a1_pwr_en(1); +} + +void usb3_a0_to_dut(void) +{ + usb3_a0_mux_sel(1); + gpio_set_level(GPIO_FASTBOOT_DUTHUB_MUX_SEL, 1); +} + +void usb3_a1_to_dut(void) +{ + usb3_a1_mux_sel(1); + gpio_set_level(GPIO_FASTBOOT_DUTHUB_MUX_SEL, 1); +} + +void usb3_a0_to_host(void) +{ + usb3_a0_mux_sel(0); +} + +void usb3_a1_to_host(void) +{ + usb3_a1_mux_sel(0); +} + +void host_to_dut(void) +{ + gpio_set_level(GPIO_FASTBOOT_DUTHUB_MUX_SEL, 0); + uservo_fastboot_mux_sel(MUX_SEL_FASTBOOT); +} + +void uservo_to_host(void) +{ + gpio_set_level(GPIO_FASTBOOT_DUTHUB_MUX_SEL, 1); + uservo_fastboot_mux_sel(MUX_SEL_USERVO); +} |