Serial Over Lan (SOL) no login prompt on Linux IRQ mode

Paul Fertser fercerpav at gmail.com
Tue Jul 27 00:52:46 AEST 2021


Hi Konstantin,

On Mon, Jul 26, 2021 at 05:36:51PM +0300, Konstantin Klubnichkin wrote:
> I'm digging into AST2500 datasheet for last couple of days but can't find what
> may cause this behavior.

My attempts at understanding this failed too, apparently the aspeed
documentation is incomplete or incorrect. So we have to use the
following patch from Phoenix (guess you'll see what it's doing right
away after spending so much time reading the datasheet ;) ):

>From 6d7afdfeb67288ff67864a25de2d4fa783f18336 Mon Sep 17 00:00:00 2001
From: Patrick Voelker <patrick_voelker at phoenix.com>
Date: Wed, 21 Apr 2021 02:14:01 +0000
Subject: [PATCH] * Fix host serial routing and SOL so that it doesn't
 interfere with IRQ driven console in host Linux boot.

---
 ...Fix-Host-UART-Routing-For-Better-SOL.patch | 63 +++++++++++++++++++
 .../recipes-bsp/u-boot/u-boot-%.bbappend      |  1 +
 .../0109-Added-UART3-For-Better-SOL.patch     | 33 ++++++++++
 .../linux/linux-aspeed_%.bbappend             |  1 +
 .../0000-Attach-Console-To-ttyS2.patch        | 12 ++++
 .../console/obmc-console/obmc-console.conf    |  4 +-
 .../console/obmc-console_%.bbappend           |  3 +
 7 files changed, 114 insertions(+), 3 deletions(-)
 create mode 100644 meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/files/0009-Fix-Host-UART-Routing-For-Better-SOL.patch
 create mode 100644 meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed/0109-Added-UART3-For-Better-SOL.patch
 create mode 100644 meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/0000-Attach-Console-To-ttyS2.patch

diff --git a/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/files/0009-Fix-Host-UART-Routing-For-Better-SOL.patch b/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/files/0009-Fix-Host-UART-Routing-For-Better-SOL.patch
new file mode 100644
index 000000000000..13e359bef26c
--- /dev/null
+++ b/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/files/0009-Fix-Host-UART-Routing-For-Better-SOL.patch
@@ -0,0 +1,63 @@
+diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h
+index 8fc7c3c934..32c6fbf10a 100755
+--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
++++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
+@@ -53,11 +53,22 @@
+ 
+ /* HICRA Bits */
+ #define HICRA_I01_OFFSET    (0)
+-#define HICRA_UART3_OFFSET  (22)
+ #define HICRA_I01_MASK      (7 << HICRA_I01_OFFSET)
+-#define HICRA_UART3_MASK    (7 << HICRA_UART3_OFFSET)
+ #define HICRA_UART3_TO_IO1  (2 << HICRA_I01_OFFSET)
++#define HICRA_UART4_TO_IO1  (3 << HICRA_I01_OFFSET)
++
++#define HICRA_UART1_OFFSET  (16)
++#define HICRA_UART1_MASK    (7 << HICRA_UART1_OFFSET)
++#define HICRA_UART3_TO_UART1  (5 << HICRA_UART1_OFFSET)
++
++#define HICRA_UART3_OFFSET  (22)
++#define HICRA_UART3_MASK    (7 << HICRA_UART3_OFFSET)
+ #define HICRA_IO1_TO_UART3  (2 << HICRA_UART3_OFFSET)
++#define HICRA_UART1_TO_UART3  (5 << HICRA_UART3_OFFSET)
++
++#define HICRA_UART4_OFFSET  (25)
++#define HICRA_UART4_MASK    (7 << HICRA_UART4_OFFSET)
++#define HICRA_IO1_TO_UART4  (1 << HICRA_UART4_OFFSET)
+ 
+ /* HICRB Bits */
+ #define HICRB_EN80HSGIO (1 << 13)       /* Enable 80hSGIO */
+diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
+index cc47d7a73f..99dba8582a 100755
+--- a/board/aspeed/ast-g5/ast-g5.c
++++ b/board/aspeed/ast-g5/ast-g5.c
+@@ -73,12 +73,25 @@ void redirect_host_uart( void )
+ {
+     uint32_t reg = 0x00;
+ 
+-    /* Redirect UART3 (/dev/ttyS2) to IO1 (and vice-versa) */
+-    reg = readl(AST_LPC_BASE + HICRA);
++    /* Redirect UART4 (/dev/ttyS3) to IO1 (and vice-versa)
++        And also redirect UART1 to UART3 (ttyS0 and ttyS2) to eachother (and vice-versa) */
++
++    // UART4 to IO1
+     reg &= ~HICRA_I01_MASK;
+-    reg |= HICRA_UART3_TO_IO1;
++    reg |= HICRA_UART4_TO_IO1;
++
++    // IO1 to UART4
++    reg &= ~HICRA_UART4_MASK;
++    reg |= HICRA_IO1_TO_UART4;
++
++    // UART1 to UART3
+     reg &= ~HICRA_UART3_MASK;
+-    reg |= HICRA_IO1_TO_UART3;
++    reg |= HICRA_UART1_TO_UART3;
++
++    // UART3 to UART1
++    reg &= ~HICRA_UART1_MASK;
++    reg |= HICRA_UART3_TO_UART1;
++
+ 	writel(reg, AST_LPC_BASE + HICRA);
+ }
+ 
diff --git a/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/u-boot-%.bbappend b/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/u-boot-%.bbappend
index d98545d99a10..6a6bb5102b15 100755
--- a/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/u-boot-%.bbappend
+++ b/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/u-boot-%.bbappend
@@ -7,6 +7,7 @@ SRC_URI_append_aspeed += " \
     file://0005-enable-passthrough-in-uboot.patch \
     file://0007-Fix-GIP-141-enable-port-80h-post-code-display-on-the-7-segment-LEDs.patch \
     file://0008-Add-Host-UART-Routing.patch \
+    file://0009-Fix-Host-UART-Routing-For-Better-SOL.patch \
     "
 
 SRC_URI_remove = ""
diff --git a/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed/0109-Added-UART3-For-Better-SOL.patch b/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed/0109-Added-UART3-For-Better-SOL.patch
new file mode 100644
index 000000000000..767af2a937db
--- /dev/null
+++ b/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed/0109-Added-UART3-For-Better-SOL.patch
@@ -0,0 +1,33 @@
+diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+index 77233d360142..39786a59ae47 100644
+--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
++++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+@@ -162,7 +162,7 @@
+ };
+ 
+ &uart1 {
+-	// Host Console
++	// Host In Console
+ 	status = "okay";
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&pinctrl_txd1_default
+@@ -170,12 +170,17 @@
+ };
+ 
+ &uart2 {
+-	// SoL Host Console
++	// Not used
+ 	status = "okay";
+ };
+ 
+ &uart3 {
+-	// SoL BMC Console
++	// SoL Console
++	status = "okay";
++};
++
++&uart4 {
++	// Host Out Console
+ 	status = "okay";
+ };
+ 
diff --git a/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed_%.bbappend b/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed_%.bbappend
index 4f927b7e64d3..981a4924b526 100755
--- a/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed_%.bbappend
+++ b/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed_%.bbappend
@@ -30,4 +30,5 @@ SRC_URI += " \
 	file://0106-Add-get-MAC-address-through-NCSI-command-to-get-INTEL-MAC-address.patch \
 	file://0107-Fix-get-MAC-address-from-mlx-card-increment-1.patch \
 	file://0108-Adjust-SIRQ-Polarity.patch \
+	file://0109-Added-UART3-For-Better-SOL.patch \
 	"
diff --git a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/0000-Attach-Console-To-ttyS2.patch b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/0000-Attach-Console-To-ttyS2.patch
new file mode 100644
index 000000000000..2967cc1f3758
--- /dev/null
+++ b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/0000-Attach-Console-To-ttyS2.patch
@@ -0,0 +1,12 @@
+diff --git a/conf/obmc-console at .service.in b/conf/obmc-console at .service.in
+index c6cd1b4..7bf1de6 100644
+--- a/conf/obmc-console at .service.in
++++ b/conf/obmc-console at .service.in
+@@ -4,6 +4,6 @@ ConditionPathExists=/etc/obmc-console/server.%i.conf
+ 
+ [Service]
+ # Instance ID is the VUART basename
+-ExecStart=/usr/sbin/obmc-console-server --config /etc/obmc-console/server.%i.conf %i
++ExecStart=/usr/sbin/obmc-console-server --config /etc/obmc-console/server.%i.conf ttyS2
+ SyslogIdentifier=%i-console-server
+ Restart=always
diff --git a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/obmc-console.conf b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/obmc-console.conf
index c5faabc0ab6d..8491f53653ec 100644
--- a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/obmc-console.conf
+++ b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/obmc-console.conf
@@ -1,5 +1,3 @@
 baud = 115200
-lpc-address = 0x3f8
-sirq = 4
-local-tty = ttyS2
+local-tty = ttyS3
 local-tty-baud = 115200
diff --git a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console_%.bbappend b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console_%.bbappend
index 50d7d4f0f160..53ee6d7124f3 100644
--- a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console_%.bbappend
@@ -1,2 +1,5 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 OBMC_CONSOLE_HOST_TTY = "ttyS2"
+
+SRC_URI += " file://0000-Attach-Console-To-ttyS2.patch \
+	   "
-- 
2.17.1

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav at gmail.com


More information about the openbmc mailing list