openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Serial Over Lan (SOL) no login prompt on Linux IRQ mode
@ 2019-12-27  6:54 AKASH G J
  2019-12-27  7:33 ` Yong Li
  0 siblings, 1 reply; 10+ messages in thread
From: AKASH G J @ 2019-12-27  6:54 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]

Hi all,

We are using BMC Aspeed AST-2500 in our motherboard with OpenBMC firmware.
'obmc-console' is used to get host messages over BMC. obmc-console.conf
looks like




*lpc-address = 0x3f8sirq = 4local-tty = ttyS4local-tty-baud = 115200*

BIOS serial redirection is enabled over COM port 0 (*0x3f8, sirq=4,
baudrate=115200*) for super-IO.

we set */dev/ttyS0* in CentOS to work in polling mode by making its *irq=0*
using the following command

$ setserial /dev/ttyS0 uart 16550a irq 0

Now we are getting CentOS login prompt on SOL.

When we change /dev/ttyS0 back to interrupt mode with irq=4, we are not
getting login prompt on SOL.

Whether anything is required to be done in OpenBMC firmware/BIOS to enable
irq mode for SOL ?



Thanks,

Akash

[-- Attachment #2: Type: text/html, Size: 2654 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2019-12-27  6:54 Serial Over Lan (SOL) no login prompt on Linux IRQ mode AKASH G J
@ 2019-12-27  7:33 ` Yong Li
  2019-12-30  0:02   ` AKASH G J
  0 siblings, 1 reply; 10+ messages in thread
From: Yong Li @ 2019-12-27  7:33 UTC (permalink / raw)
  To: 'AKASH G J', openbmc

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

HI Akash,

 

Just FYI, we are using the below conf file. You can find other related files from https://github.com/Intel-BMC/openbmc/blob/intel/meta-openbmc-mods/meta-ast2500/recipes-phosphor/console/obmc-console/obmc-console.conf

 

cat /etc/obmc-console.conf

baud = 115200

local-tty = ttyS3

local-tty-baud = 115200

 

Thanks,

Yong

From: openbmc <openbmc-bounces+yong.b.li=linux.intel.com@lists.ozlabs.org> On Behalf Of AKASH G J
Sent: Friday, December 27, 2019 2:54 PM
To: openbmc@lists.ozlabs.org
Subject: Serial Over Lan (SOL) no login prompt on Linux IRQ mode

 

Hi all,

 

We are using BMC Aspeed AST-2500 in our motherboard with OpenBMC firmware. 'obmc-console' is used to get host messages over BMC. obmc-console.conf looks like 

lpc-address = 0x3f8
sirq = 4
local-tty = ttyS4
local-tty-baud = 115200

 

BIOS serial redirection is enabled over COM port 0 (0x3f8, sirq=4, baudrate=115200) for super-IO.

 

we set /dev/ttyS0 in CentOS to work in polling mode by making its irq=0 using the following command 

 

$ setserial /dev/ttyS0 uart 16550a irq 0 

Now we are getting CentOS login prompt on SOL. 

When we change /dev/ttyS0 back to interrupt mode with irq=4, we are not getting login prompt on SOL.

 

Whether anything is required to be done in OpenBMC firmware/BIOS to enable irq mode for SOL ?

 

 

 

Thanks,

 

Akash


[-- Attachment #2: Type: text/html, Size: 5788 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2019-12-27  7:33 ` Yong Li
@ 2019-12-30  0:02   ` AKASH G J
  2021-07-26 14:36     ` Konstantin Klubnichkin
  0 siblings, 1 reply; 10+ messages in thread
From: AKASH G J @ 2019-12-30  0:02 UTC (permalink / raw)
  To: Yong Li; +Cc: openbmc

[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]

I tried with the configuration

cat /etc/obmc-console.conf

baud = 115200

local-tty = ttyS4

local-tty-baud = 115200


Still we are not getting CentOS login prompt on SOL in IRQ mode.


Whether anything is required to be done in OpenBMC firmware/BIOS to enable
irq mode for SOL ?


Thanks,


Akash

On Fri, Dec 27, 2019 at 1:03 PM Yong Li <yong.b.li@linux.intel.com> wrote:

> HI Akash,
>
>
>
> Just FYI, we are using the below conf file. You can find other related
> files from
> https://github.com/Intel-BMC/openbmc/blob/intel/meta-openbmc-mods/meta-ast2500/recipes-phosphor/console/obmc-console/obmc-console.conf
>
>
>
> cat /etc/obmc-console.conf
>
> baud = 115200
>
> local-tty = ttyS3
>
> local-tty-baud = 115200
>
>
>
> Thanks,
>
> Yong
>
> *From:* openbmc <openbmc-bounces+yong.b.li=
> linux.intel.com@lists.ozlabs.org> *On Behalf Of *AKASH G J
> *Sent:* Friday, December 27, 2019 2:54 PM
> *To:* openbmc@lists.ozlabs.org
> *Subject:* Serial Over Lan (SOL) no login prompt on Linux IRQ mode
>
>
>
> Hi all,
>
>
>
> We are using BMC Aspeed AST-2500 in our motherboard with OpenBMC firmware.
> 'obmc-console' is used to get host messages over BMC. obmc-console.conf
> looks like
>
>
>
>
> *lpc-address = 0x3f8sirq = 4local-tty = ttyS4local-tty-baud = 115200*
>
>
>
> BIOS serial redirection is enabled over COM port 0 (*0x3f8, sirq=4,
> baudrate=115200*) for super-IO.
>
>
>
> we set */dev/ttyS0* in CentOS to work in polling mode by making its
> *irq=0* using the following command
>
>
>
> $ setserial /dev/ttyS0 uart 16550a irq 0
>
> Now we are getting CentOS login prompt on SOL.
>
> When we change /dev/ttyS0 back to interrupt mode with irq=4, we are not
> getting login prompt on SOL.
>
>
>
> Whether anything is required to be done in OpenBMC firmware/BIOS to enable
> irq mode for SOL ?
>
>
>
>
>
>
>
> Thanks,
>
>
>
> Akash
>

[-- Attachment #2: Type: text/html, Size: 5388 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2019-12-30  0:02   ` AKASH G J
@ 2021-07-26 14:36     ` Konstantin Klubnichkin
  2021-07-26 14:52       ` Paul Fertser
  0 siblings, 1 reply; 10+ messages in thread
From: Konstantin Klubnichkin @ 2021-07-26 14:36 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/html, Size: 5026 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2021-07-26 14:36     ` Konstantin Klubnichkin
@ 2021-07-26 14:52       ` Paul Fertser
  2021-07-26 16:42         ` Konstantin Klubnichkin
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Fertser @ 2021-07-26 14:52 UTC (permalink / raw)
  To: Konstantin Klubnichkin; +Cc: openbmc

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@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@.service.in b/conf/obmc-console@.service.in
+index c6cd1b4..7bf1de6 100644
+--- a/conf/obmc-console@.service.in
++++ b/conf/obmc-console@.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@gmail.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2021-07-26 14:52       ` Paul Fertser
@ 2021-07-26 16:42         ` Konstantin Klubnichkin
  2021-07-26 16:51           ` Paul Fertser
  0 siblings, 1 reply; 10+ messages in thread
From: Konstantin Klubnichkin @ 2021-07-26 16:42 UTC (permalink / raw)
  To: Paul Fertser; +Cc: openbmc

[-- Attachment #1: Type: text/html, Size: 11810 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2021-07-26 16:42         ` Konstantin Klubnichkin
@ 2021-07-26 16:51           ` Paul Fertser
  2021-07-27  8:53             ` Konstantin Klubnichkin
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Fertser @ 2021-07-26 16:51 UTC (permalink / raw)
  To: Konstantin Klubnichkin; +Cc: openbmc

On Mon, Jul 26, 2021 at 07:42:22PM +0300, Konstantin Klubnichkin wrote:
> 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.
> Probably only way is to ask Aspeedtech support to clarify this.

What's your hardware? On our board we have LPC connection between
AST2500 and Lewisburg PCH. If your UEFI is configuring SIRQ in
Continuous mode (should be default I guess) then you might also want
this (even though VUART wouldn't be used with the configuration used
by the patch I've sent earlier):

+diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+index fffdb2b67c08..77233d360142 100644
+--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
++++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
+@@ -157,6 +157,7 @@
+ 
+ &vuart {
+       // VUART Host Console
++      aspeed,sirq-polarity-sense = <&syscon 0x70 25>;
+       status = "okay";
+ };
+ 

I suggest you try these two patches verbatim, this whole remapping
business is tricky so probably you've missed something in your earlier
tests.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2021-07-26 16:51           ` Paul Fertser
@ 2021-07-27  8:53             ` Konstantin Klubnichkin
  2021-07-27  9:30               ` Paul Fertser
  0 siblings, 1 reply; 10+ messages in thread
From: Konstantin Klubnichkin @ 2021-07-27  8:53 UTC (permalink / raw)
  To: Paul Fertser; +Cc: openbmc

[-- Attachment #1: Type: text/html, Size: 2986 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2021-07-27  8:53             ` Konstantin Klubnichkin
@ 2021-07-27  9:30               ` Paul Fertser
  2021-11-24 20:33                 ` Oskar Senft
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Fertser @ 2021-07-27  9:30 UTC (permalink / raw)
  To: Konstantin Klubnichkin; +Cc: openbmc

On Tue, Jul 27, 2021 at 11:53:57AM +0300, Konstantin Klubnichkin wrote:
> SIRQ polarity is something I didn't try, will do it. And yes, SIRQ bit is zero,
> but all other bits are also zero in that register, that confuses me.

I was also able to manually export the SIRQ pin via sysfs and when
manually toggling it the host was seeing UART interrupts and getting
data to and from VUART. That lead nowhere though, so we resorted to
hardware routing in ast2500 between "real UARTs".

> Instead I configure UART routing by direct writing to registers via /dev/mem
> (yes, I know that it's a bad practive, but it's development).

Should work the same.

> With the routing I have absolutely no data in BMC UARTs neither during POST nor
> is OS.
> What I'm missing is how that routing works. Is it on-crystal or UART need to be
> routed to SoC pins thus TX/RX are connected via pins?

With the configuration as shown the host is sending data to and from
"COM1" (0x3f8,4) and any program on BMC is able to interact with it
via /dev/ttyS2, without any additional hardware connections, all
purely in software, the routing happens inside aspeed. Do not forget
to enable ttyS2 in your board's DTS. VUART is not involved at all.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Serial Over Lan (SOL) no login prompt on Linux IRQ mode
  2021-07-27  9:30               ` Paul Fertser
@ 2021-11-24 20:33                 ` Oskar Senft
  0 siblings, 0 replies; 10+ messages in thread
From: Oskar Senft @ 2021-11-24 20:33 UTC (permalink / raw)
  To: Paul Fertser, openbmc, Konstantin Klubnichkin

I just stumbled across this old-ish thread. I did run into a similar
problem ages ago. The problem is that the SIRQ polarity used by the
Aspeed must match what the "receiving end" (usually the PCH) is
expecting. I agree that the Aspeed doc is missing some details here. I
believe they might have clarified this on AST2600. Anyway, this
setting can be changed in the DTS via aspeed,lpc-interrupts [1] or at
runtime via the sysfs node sirq_polarity [2]. On the board I'm working
on (TYAN S7106 and S8036), this had to be set to HIGH:

&vuart {
    status = "okay";

    /* We enable the VUART here, but leave it in a state that does
     * not interfere with the SuperIO. The goal is to have both the
     * VUART and the SuperIO available and decide at runtime whether
     * the VUART should actually be used. For that reason, configure
     * an "invalid" IO address and an IRQ that is not used by the
     * BMC.
     */

    aspeed,lpc-io-reg = <0xffff>;
    aspeed,lpc-interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
};

Note that this change hasn't been added to upstream
aspeed-bmc-tyan-s7106.dts yet, just because I'm slow ...

Note that I previously introduced aspeed,sirq-polarity-sense for the
DTS, which tried to do this automatically, but it turned out to cause
issues, so it has been deprecated

I hope this write-up helps anyone in the future.

Oskar.

[1]: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/serial/8250.yaml#L204
[2]: https://github.com/torvalds/linux/blob/master/Documentation/ABI/stable/sysfs-driver-aspeed-vuart#L17

On Tue, Jul 27, 2021 at 5:30 AM Paul Fertser <fercerpav@gmail.com> wrote:
>
> On Tue, Jul 27, 2021 at 11:53:57AM +0300, Konstantin Klubnichkin wrote:
> > SIRQ polarity is something I didn't try, will do it. And yes, SIRQ bit is zero,
> > but all other bits are also zero in that register, that confuses me.
>
> I was also able to manually export the SIRQ pin via sysfs and when
> manually toggling it the host was seeing UART interrupts and getting
> data to and from VUART. That lead nowhere though, so we resorted to
> hardware routing in ast2500 between "real UARTs".
>
> > Instead I configure UART routing by direct writing to registers via /dev/mem
> > (yes, I know that it's a bad practive, but it's development).
>
> Should work the same.
>
> > With the routing I have absolutely no data in BMC UARTs neither during POST nor
> > is OS.
> > What I'm missing is how that routing works. Is it on-crystal or UART need to be
> > routed to SoC pins thus TX/RX are connected via pins?
>
> With the configuration as shown the host is sending data to and from
> "COM1" (0x3f8,4) and any program on BMC is able to interact with it
> via /dev/ttyS2, without any additional hardware connections, all
> purely in software, the routing happens inside aspeed. Do not forget
> to enable ttyS2 in your board's DTS. VUART is not involved at all.
>
> --
> Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
> mailto:fercerpav@gmail.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-24 20:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27  6:54 Serial Over Lan (SOL) no login prompt on Linux IRQ mode AKASH G J
2019-12-27  7:33 ` Yong Li
2019-12-30  0:02   ` AKASH G J
2021-07-26 14:36     ` Konstantin Klubnichkin
2021-07-26 14:52       ` Paul Fertser
2021-07-26 16:42         ` Konstantin Klubnichkin
2021-07-26 16:51           ` Paul Fertser
2021-07-27  8:53             ` Konstantin Klubnichkin
2021-07-27  9:30               ` Paul Fertser
2021-11-24 20:33                 ` Oskar Senft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).