summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/0001-Enable-UART-mux-setting-before-SOL-activation-via-SS.patch
blob: 22aed3a07430a0f2cb2fd277d628a576a5abe4af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 41a43e4b149af0bbfa82ca1b9479dd7dfb2455de Mon Sep 17 00:00:00 2001
From: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com>
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 <chalapathix.venkataramashetty@intel.com>
---
 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