<div>Hello Paul,</div><div> </div><div>Thank you for this patch, I've tried this (UART1 <->UART3 routing), but this just doesn't work on my hardware, even POST is not available.</div><div>Probably only way is to ask Aspeedtech support to clarify this.</div><div> </div><div>Thank you!</div><div> </div><div>26.07.2021, 17:52, "Paul Fertser" <fercerpav@gmail.com>:</div><blockquote><p>Hi Konstantin,<br /><br />On Mon, Jul 26, 2021 at 05:36:51PM +0300, Konstantin Klubnichkin wrote:</p><blockquote> I'm digging into AST2500 datasheet for last couple of days but can't find what<br /> may cause this behavior.</blockquote><p><br />My attempts at understanding this failed too, apparently the aspeed<br />documentation is incomplete or incorrect. So we have to use the<br />following patch from Phoenix (guess you'll see what it's doing right<br />away after spending so much time reading the datasheet ;) ):<br /><br />From 6d7afdfeb67288ff67864a25de2d4fa783f18336 Mon Sep 17 00:00:00 2001<br />From: Patrick Voelker <<a href="mailto:patrick_voelker@phoenix.com" rel="noopener noreferrer">patrick_voelker@phoenix.com</a>><br />Date: Wed, 21 Apr 2021 02:14:01 +0000<br />Subject: [PATCH] * Fix host serial routing and SOL so that it doesn't<br /> interfere with IRQ driven console in host Linux boot.<br /><br />---<br /> ...Fix-Host-UART-Routing-For-Better-SOL.patch | 63 +++++++++++++++++++<br /> .../recipes-bsp/u-boot/u-boot-%.bbappend | 1 +<br /> .../0109-Added-UART3-For-Better-SOL.patch | 33 ++++++++++<br /> .../linux/linux-aspeed_%.bbappend | 1 +<br /> .../0000-Attach-Console-To-ttyS2.patch | 12 ++++<br /> .../console/obmc-console/obmc-console.conf | 4 +-<br /> .../console/obmc-console_%.bbappend | 3 +<br /> 7 files changed, 114 insertions(+), 3 deletions(-)<br /> create mode 100644 meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/files/0009-Fix-Host-UART-Routing-For-Better-SOL.patch<br /> create mode 100644 meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed/0109-Added-UART3-For-Better-SOL.patch<br /> create mode 100644 meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/0000-Attach-Console-To-ttyS2.patch<br /><br />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<br />new file mode 100644<br />index 000000000000..13e359bef26c<br />--- /dev/null<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/files/0009-Fix-Host-UART-Routing-For-Better-SOL.patch<br />@@ -0,0 +1,63 @@<br />+diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h b/arch/arm/include/asm/arch-aspeed/ast_scu.h<br />+index 8fc7c3c934..32c6fbf10a 100755<br />+--- a/arch/arm/include/asm/arch-aspeed/ast_scu.h<br />++++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h<br />+@@ -53,11 +53,22 @@<br />+<br />+ /* HICRA Bits */<br />+ #define HICRA_I01_OFFSET (0)<br />+-#define HICRA_UART3_OFFSET (22)<br />+ #define HICRA_I01_MASK (7 << HICRA_I01_OFFSET)<br />+-#define HICRA_UART3_MASK (7 << HICRA_UART3_OFFSET)<br />+ #define HICRA_UART3_TO_IO1 (2 << HICRA_I01_OFFSET)<br />++#define HICRA_UART4_TO_IO1 (3 << HICRA_I01_OFFSET)<br />++<br />++#define HICRA_UART1_OFFSET (16)<br />++#define HICRA_UART1_MASK (7 << HICRA_UART1_OFFSET)<br />++#define HICRA_UART3_TO_UART1 (5 << HICRA_UART1_OFFSET)<br />++<br />++#define HICRA_UART3_OFFSET (22)<br />++#define HICRA_UART3_MASK (7 << HICRA_UART3_OFFSET)<br />+ #define HICRA_IO1_TO_UART3 (2 << HICRA_UART3_OFFSET)<br />++#define HICRA_UART1_TO_UART3 (5 << HICRA_UART3_OFFSET)<br />++<br />++#define HICRA_UART4_OFFSET (25)<br />++#define HICRA_UART4_MASK (7 << HICRA_UART4_OFFSET)<br />++#define HICRA_IO1_TO_UART4 (1 << HICRA_UART4_OFFSET)<br />+<br />+ /* HICRB Bits */<br />+ #define HICRB_EN80HSGIO (1 << 13) /* Enable 80hSGIO */<br />+diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c<br />+index cc47d7a73f..99dba8582a 100755<br />+--- a/board/aspeed/ast-g5/ast-g5.c<br />++++ b/board/aspeed/ast-g5/ast-g5.c<br />+@@ -73,12 +73,25 @@ void redirect_host_uart( void )<br />+ {<!-- --><br />+ uint32_t reg = 0x00;<br />+<br />+- /* Redirect UART3 (/dev/ttyS2) to IO1 (and vice-versa) */<br />+- reg = readl(AST_LPC_BASE + HICRA);<br />++ /* Redirect UART4 (/dev/ttyS3) to IO1 (and vice-versa)<br />++ And also redirect UART1 to UART3 (ttyS0 and ttyS2) to eachother (and vice-versa) */<br />++<br />++ // UART4 to IO1<br />+ reg &= ~HICRA_I01_MASK;<br />+- reg |= HICRA_UART3_TO_IO1;<br />++ reg |= HICRA_UART4_TO_IO1;<br />++<br />++ // IO1 to UART4<br />++ reg &= ~HICRA_UART4_MASK;<br />++ reg |= HICRA_IO1_TO_UART4;<br />++<br />++ // UART1 to UART3<br />+ reg &= ~HICRA_UART3_MASK;<br />+- reg |= HICRA_IO1_TO_UART3;<br />++ reg |= HICRA_UART1_TO_UART3;<br />++<br />++ // UART3 to UART1<br />++ reg &= ~HICRA_UART1_MASK;<br />++ reg |= HICRA_UART3_TO_UART1;<br />++<br />+ writel(reg, AST_LPC_BASE + HICRA);<br />+ }<br />+<br />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<br />index d98545d99a10..6a6bb5102b15 100755<br />--- a/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/u-boot-%.bbappend<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-bsp/u-boot/u-boot-%.bbappend<br />@@ -7,6 +7,7 @@ SRC_URI_append_aspeed += " \<br />     <a href="file://0005-enable-passthrough-in-uboot.patch" rel="noopener noreferrer">file://0005-enable-passthrough-in-uboot.patch</a> \<br />     <a href="http://file//0007-Fix-GIP-141-enable-port-80h-post-code-display-on-the-7-segment-LEDs.patch" rel="noopener noreferrer">file://0007-Fix-GIP-141-enable-port-80h-post-code-display-on-the-7-segment-LEDs.patch</a> \<br />     <a href="file://0008-add-host-uart-routing.patch" rel="noopener noreferrer">file://0008-Add-Host-UART-Routing.patch</a> \<br />+ <a href="file://0009-fix-host-uart-routing-for-better-sol.patch" rel="noopener noreferrer">file://0009-Fix-Host-UART-Routing-For-Better-SOL.patch</a> \<br />     "<br /> <br /> SRC_URI_remove = ""<br />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<br />new file mode 100644<br />index 000000000000..767af2a937db<br />--- /dev/null<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed/0109-Added-UART3-For-Better-SOL.patch<br />@@ -0,0 +1,33 @@<br />+diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts<br />+index 77233d360142..39786a59ae47 100644<br />+--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts<br />++++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts<br />+@@ -162,7 +162,7 @@<br />+ };<br />+<br />+ &uart1 {<!-- --><br />+- // Host Console<br />++ // Host In Console<br />+ status = "okay";<br />+ pinctrl-names = "default";<br />+ pinctrl-0 = <&pinctrl_txd1_default<br />+@@ -170,12 +170,17 @@<br />+ };<br />+<br />+ &uart2 {<!-- --><br />+- // SoL Host Console<br />++ // Not used<br />+ status = "okay";<br />+ };<br />+<br />+ &uart3 {<!-- --><br />+- // SoL BMC Console<br />++ // SoL Console<br />++ status = "okay";<br />++};<br />++<br />++&uart4 {<!-- --><br />++ // Host Out Console<br />+ status = "okay";<br />+ };<br />+<br />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<br />index 4f927b7e64d3..981a4924b526 100755<br />--- a/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed_%.bbappend<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-kernel/linux/linux-aspeed_%.bbappend<br />@@ -30,4 +30,5 @@ SRC_URI += " \<br />         <a href="http://file//0106-Add-get-MAC-address-through-NCSI-command-to-get-INTEL-MAC-address.patch" rel="noopener noreferrer">file://0106-Add-get-MAC-address-through-NCSI-command-to-get-INTEL-MAC-address.patch</a> \<br />         <a href="file://0107-fix-get-mac-address-from-mlx-card-increment-1.patch" rel="noopener noreferrer">file://0107-Fix-get-MAC-address-from-mlx-card-increment-1.patch</a> \<br />         <a href="file://0108-adjust-sirq-polarity.patch" rel="noopener noreferrer">file://0108-Adjust-SIRQ-Polarity.patch</a> \<br />+ <a href="file://0109-added-uart3-for-better-sol.patch" rel="noopener noreferrer">file://0109-Added-UART3-For-Better-SOL.patch</a> \<br />         "<br />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<br />new file mode 100644<br />index 000000000000..2967cc1f3758<br />--- /dev/null<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/0000-Attach-Console-To-ttyS2.patch<br />@@ -0,0 +1,12 @@<br />+diff --git a/conf/<a href="mailto:obmc-console@.service.in" rel="noopener noreferrer">obmc-console@.service.in</a> b/conf/<a href="mailto:obmc-console@.service.in" rel="noopener noreferrer">obmc-console@.service.in</a><br />+index c6cd1b4..7bf1de6 100644<br />+--- a/conf/<a href="mailto:obmc-console@.service.in" rel="noopener noreferrer">obmc-console@.service.in</a><br />++++ b/conf/<a href="mailto:obmc-console@.service.in" rel="noopener noreferrer">obmc-console@.service.in</a><br />+@@ -4,6 +4,6 @@ ConditionPathExists=/etc/obmc-console/server.%i.conf<br />+<br />+ [Service]<br />+ # Instance ID is the VUART basename<br />+-ExecStart=/usr/sbin/obmc-console-server --config /etc/obmc-console/server.%i.conf %i<br />++ExecStart=/usr/sbin/obmc-console-server --config /etc/obmc-console/server.%i.conf ttyS2<br />+ SyslogIdentifier=%i-console-server<br />+ Restart=always<br />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<br />index c5faabc0ab6d..8491f53653ec 100644<br />--- a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/obmc-console.conf<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console/obmc-console.conf<br />@@ -1,5 +1,3 @@<br /> baud = 115200<br />-lpc-address = 0x3f8<br />-sirq = 4<br />-local-tty = ttyS2<br />+local-tty = ttyS3<br /> local-tty-baud = 115200<br />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<br />index 50d7d4f0f160..53ee6d7124f3 100644<br />--- a/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console_%.bbappend<br />+++ b/meta-phoenix/meta-ptec-tp/recipes-phosphor/console/obmc-console_%.bbappend<br />@@ -1,2 +1,5 @@<br /> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"<br /> OBMC_CONSOLE_HOST_TTY = "ttyS2"<br />+<br />+SRC_URI += " <a href="file://0000-attach-console-to-ttys2.patch" rel="noopener noreferrer">file://0000-Attach-Console-To-ttyS2.patch</a> \<br />+ "</p>--<br />2.17.1<br /><br />--<br />Be free, use free (<a href="http://www.gnu.org/philosophy/free-sw.html" rel="noopener noreferrer">http://www.gnu.org/philosophy/free-sw.html</a>) software!<br /><a href="mailto:fercerpav@gmail.com" rel="noopener noreferrer">mailto:fercerpav@gmail.com</a></blockquote><div> </div><div> </div><div>-- </div><div>Best regards,</div><div>Konstantin Klubnichkin,</div><div>lead firmware engineer,</div><div>server hardware R&D group,</div><div>Yandex Moscow office.</div><div>tel: +7-903-510-33-33</div><div> </div>