diff options
author | Scott Collyer <scollyer@google.com> | 2021-02-08 02:36:30 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-30 01:43:02 +0000 |
commit | b44852f3fc9d03a445cab2a6b340228fdd7cc3ed (patch) | |
tree | 66d74e967d3823a97e8d91b5f90c3f2c470937e8 /board/quiche | |
parent | 95b03aaa8c5d23fbd2ac12e1a5bc759d42a5b754 (diff) | |
download | chrome-ec-b44852f3fc9d03a445cab2a6b340228fdd7cc3ed.tar.gz |
quiche: Add console command to change lane control signal
There is a gpio signal controlled by the EC to communicate to the MST
hub if 2 lane or 4 lane DP should be trained. The lane control GPIO
signal must be set when the MST is in reset. This CL adds a console
command 'dp_lane' to execute this sequence.
BUG=b:183288657
BRANCH=None
TEST=verified lane control is low for 'dplane 4' and high following
'dplane 2'
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I65d197ad55e86bba9b9ea5374c89cc6505b1100f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2682788
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/quiche')
-rw-r--r-- | board/quiche/board.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/board/quiche/board.c b/board/quiche/board.c index a7f354e654..0abb6d76c2 100644 --- a/board/quiche/board.c +++ b/board/quiche/board.c @@ -346,3 +346,35 @@ void board_debug_gpio(int trigger, int enable, int pulse_usec) break; } } + +static int command_dplane(int argc, char **argv) +{ + char *e; + int lane; + + if (argc < 2) + return EC_ERROR_PARAM_COUNT; + + lane = strtoi(argv[1], &e, 10); + + if ((lane != 2) && (lane != 4)) + return EC_ERROR_PARAM1; + + /* put MST into reset */ + gpio_set_level(GPIO_MST_RST_L, 0); + msleep(1); + /* Set lane control to requested level */ + gpio_set_level(GPIO_MST_HUB_LANE_SWITCH, lane == 2 ? 1 : 0); + msleep(1); + /* Take MST out of reset */ + gpio_set_level(GPIO_MST_RST_L, 1); + + ccprintf("MST lane set: %s, lane_ctrl = %d\n", + lane == 2 ? "2 lane" : "4 lane", + gpio_get_level(GPIO_MST_HUB_LANE_SWITCH)); + + return EC_SUCCESS; +} +DECLARE_CONSOLE_COMMAND(dplane, command_dplane, + "<2 | 4>", + "MST lane control."); |