From 41a43e4b149af0bbfa82ca1b9479dd7dfb2455de Mon Sep 17 00:00:00 2001 From: Chalapathi Venkataramashetty Date: Wed, 13 Oct 2021 22:52:34 +0000 Subject: [PATCH] Enable UART mux setting before SOL activation via SSH Switching UART routing when starting obmc-service introduces garbled character printing out on physical host serial output and it's inevitable so this commit moves the routing logic into host console connection flow in SSH SOL to avoid the issue until SOL is actually activated. Tested: SOL activation is working fine via SSH Signed-off-by: Chalapathi Venkataramashetty --- svr-runopts.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/svr-runopts.c b/svr-runopts.c index 2c905dd..6fc25e8 100644 --- a/svr-runopts.c +++ b/svr-runopts.c @@ -414,6 +414,17 @@ void svr_getopts(int argc, char ** argv) { } if (svr_opts.forced_command) { + if (strcmp(svr_opts.forced_command, "/usr/bin/obmc-console-client") == 0) { + FILE *fp; + fp = fopen("/sys/bus/platform/drivers/aspeed-uart-routing/" + "1e789098.uart-routing/hicra", + "w"); + if (fp != NULL) { + char *uartMuxCtrlVal = "0x03450003"; + fprintf(fp, "%s", uartMuxCtrlVal); + fclose(fp); + } + } dropbear_log(LOG_INFO, "Forced command set to '%s'", svr_opts.forced_command); } #if DROPBEAR_PLUGIN -- 2.17.1