Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
akashgj opened this issue Jan 3, 2020 · 4 comments
Open

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

akashgj opened this issue Jan 3, 2020 · 4 comments

Comments

@akashgj
Copy link

akashgj commented Jan 3, 2020

I am 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.

@Kitsok
Copy link

Kitsok commented Jul 26, 2021

I didn't try to set polling mode, but have the same: if VUART is used for host-BMC serial communications, it works only during POST stage.
Update: Just tried to enable polling mode via setserial and there is a communication via VUART.

@amboar
Copy link
Member

amboar commented Aug 4, 2021

There's a solution discussed in this thread:

https://lore.kernel.org/openbmc/[email protected]/T/#m544ebf6b9177ed928d6a93ec2cee7be6c9a85ad2

Unfortunately lore didn't archive the message with the solution for the UART routing (possibly due to it being an HTML message), but it's available here:

https://lists.ozlabs.org/pipermail/openbmc/attachments/20210802/bfd7d272/attachment.htm

@Kitsok
Copy link

Kitsok commented Aug 4, 2021

The recipe is the following:

  1. In DTS disable UART1(ttyS0), UART2(ttyS1), enable UART3(ttyS2), UART4(ttyS3), disable VUART, enable uart_routing
  2. In obmc-console prepare config server.ttyS3.conf with
    baud = 115200 local-tty = ttyS3 local-tty-baud = 115200
  3. Set up routing via sysfs (UART1<->UART4)
    root@:/sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e78909c.uart_routing# echo -n uart4 > uart1 root@:/sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e78909c.uart_routing# echo -n uart1 > uart4 root@:/sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e78909c.uart_routing# cat uart* io1 io2 io3 io4 uart2 uart3 [uart4] io6 [io2] io3 io4 io1 uart3 uart4 uart1 io6 [io3] io4 io1 io2 uart4 uart1 uart2 io6 io4 io1 io2 io3 [uart1] uart2 uart3 io6 [io5] io1 io2 io3 io4 uart1 uart2 uart3 uart4 io6 root@:/sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e78909c.uart_routing#
  4. Enable UART1 and 2 clocks either using devmem (wrong way)
    uart1_clock_en() { local val=$(devmem 0x1e6e200c) local val2=$(iotools and $val 0xffff7fff) devmem 0x1e6e200c w $val2 || : }
    or by patching kernel:
    `
    diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
    index bc8d130..a32502b 100644
    --- a/drivers/clk/clk-aspeed.c
    +++ b/drivers/clk/clk-aspeed.c
    @@ -67,8 +67,8 @@ static const struct aspeed_gate_data aspeed_gates[] = {
    [ASPEED_CLK_GATE_D1CLK] = { 10, 13, "d1clk-gate", NULL, 0 }, /* GFX CRT /
    [ASPEED_CLK_GATE_YCLK] = { 13, 4, "yclk-gate", NULL, 0 }, /
    HAC /
    [ASPEED_CLK_GATE_USBPORT1CLK] = { 14, 14, "usb-port1-gate", NULL, 0 }, /
    USB2 hub/USB2 host port 1/USB1.1 dev */
  • [ASPEED_CLK_GATE_UART1CLK] = { 15, -1, "uart1clk-gate", "uart", 0 }, /* UART1 */
  • [ASPEED_CLK_GATE_UART2CLK] = { 16, -1, "uart2clk-gate", "uart", 0 }, /* UART2 */
  • [ASPEED_CLK_GATE_UART1CLK] = { 15, -1, "uart1clk-gate", "uart", CLK_IS_CRITICAL }, /* UART1 */
  • [ASPEED_CLK_GATE_UART2CLK] = { 16, -1, "uart2clk-gate", "uart", CLK_IS_CRITICAL }, /* UART2 /
    [ASPEED_CLK_GATE_UART5CLK] = { 17, -1, "uart5clk-gate", "uart", 0 }, /
    UART5 /
    [ASPEED_CLK_GATE_ESPICLK] = { 19, -1, "espiclk-gate", NULL, 0 }, /
    eSPI /
    [ASPEED_CLK_GATE_MAC1CLK] = { 20, 11, "mac1clk-gate", "mac", 0 }, /
    MAC1 */
    --
    2.7.4

`
In latter case it is probably necessary to set up 0x1e6e200c register in U-Boot.
5. It is also vital to allow LPC reset of UART1 and UART2 from LPC, but in my case it's there by default.

In case you want to use VUART there are 2 ways:

  1. In BIOS, before control is passed to OS loader, disable UART in SIO (not verified)
    or
  2. In OS set UART driver polling mode using setserial irq 0.
    Hope this can help.

@amboar
Copy link
Member

amboar commented Aug 4, 2021

Fundamentally that all shouldn't be necessary. I haven't had the bandwidth to understand the problem and figure out what's going wrong.

The VUARTs work fine with interrupts on Power systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants