SOL,obmc-console-client can't connect to the host OS

xiuzhi 1450335857 at qq.com
Mon Nov 26 19:18:21 AEDT 2018


Hi Jeremy,
   Thank you for your patient explanation extremely . 
Yes, Pysical uart4 of AST2500 connect to uart0 of host CPU directly on my platform. 
Now, 'cat /dev/ttyS3' on AST2500 can read string from the host ttyS0.
But I can not get any information from obmc-console-client with the   /etc/obmc-console.conf:
lpc-address = 0x1E78F000
sirq = 35
local-tty = ttyS5
local-tty-baud = 9600



The serials  are: 
root at haiguang1:~# cat /proc/tty/driver/serial                                            
serinfo:1.0 driver revision:                                                             
0: uart:16550A mmio:0x1E783000 irq:31 tx:0 rx:0         
1: uart:unknown port:00000000 irq:0                                                      
2: uart:unknown port:00000000 irq:0                                                      
3: uart:16550A mmio:0x1E78F000 irq:35 tx:12774 rx:11013 fe:2981 brk:34                   
4: uart:16550A mmio:0x1E784000 irq:32 tx:31307 rx:1379 RTS|CTS|DTR|DSR|CD                
5: uart:16550A mmio:0x1E787000 irq:33 tx:0 rx:0 RTS|DTR



root at haiguang1:~# ls -l /dev/tty*                                                        
crw-rw-rw-    1 root     tty         5,   0 Nov  7  2018 /dev/tty                        
crw-rw----    1 root     dialout     4,  64 Nov  7  2018 /dev/ttyS0                      
crw-rw----    1 root     dialout     4,  65 Nov  7  2018 /dev/ttyS1                      
crw-rw----    1 root     dialout     4,  66 Nov  7  2018 /dev/ttyS2                      
crw-rw----    1 root     dialout     4,  67 Nov  7  2018 /dev/ttyS3                      
crw-------    1 root     tty         4,  68 Jan  5 23:24 /dev/ttyS4                      
crw-rw----    1 root     dialout     4,  69 Nov  7  2018 /dev/ttyS5                      
lrwxrwxrwx    1 root     root             5 Nov  7  2018 /dev/ttyVUART0 -> ttyS5
I also changed or removed  the "local-tty" from ttyS5 to  ttyS3, and then
 systemctl restart obmc-console\@ttyVUART0, It didn't work.
root at haiguang1:~# strace obmc-console-server --config /etc/obmc-console.conf ttyVUART0
execve("/usr/sbin/obmc-console-server", ["obmc-console-server", "--config", "/etc/obmc-console.conf", "ttyVUART0"], 0x7edd0d5c /* 15 vars */) = 0
brk(NULL)                               = 0x1807000
uname({sysname="Linux", nodename="haiguang1", ...}) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=6589, ...}) = 0
mmap2(NULL, 6589, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76f32000
close(3)                                = 0
openat(AT_FDCWD, "/lib/tls/v6l/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v6l", 0x7e945580)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/tls", 0x7e945580)          = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/v6l/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/v6l", 0x7e945580)          = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\274\206\376M4\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1259744, ...}) = 0
mmap2(0x4dfd0000, 1325608, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4dfd0000
mprotect(0x4e0ff000, 61440, PROT_NONE)  = 0
mmap2(0x4e10e000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12e000) = 0x4e10e000
mmap2(0x4e112000, 6696, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4e112000
close(3)                                = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f30000
set_tls(0x76f308b0, 0x76f30fa8, 0x4dfc1000, 0x76f308b0, 0x4dfc1000) = 0
mprotect(0x23000, 4096, PROT_READ)      = 0
mprotect(0x4e10e000, 8192, PROT_READ)   = 0
mprotect(0x4dfc0000, 4096, PROT_READ)   = 0
munmap(0x76f32000, 6589)                = 0
brk(NULL)                               = 0x1807000
brk(0x1828000)                          = 0x1828000
openat(AT_FDCWD, "/etc/obmc-console.conf", O_RDONLY) = 3
brk(0x1849000)                          = 0x1849000
read(3, "lpc-address = 0x1E78F000\nsirq = "..., 4096) = 75
read(3, "", 4021)                       = 0
close(3)                                = 0
lstat64("/dev", {st_mode=S_IFDIR|0755, st_size=2040, ...}) = 0
lstat64("/dev/ttyVUART0", {st_mode=S_IFLNK|0777, st_size=5, ...}) = 0
readlink("/dev/ttyVUART0", "ttyS5", 4095) = 5
lstat64("/dev/ttyS5", {st_mode=S_IFCHR|0660, st_rdev=makedev(4, 69), ...}) = 0
lstat64("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat64("/sys/class", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/class/tty", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/class/tty/ttyS5", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
readlink("/sys/class/tty/ttyS5", "../../devices/platform/ahb/ahb:a"..., 4095) = 60
lstat64("/sys/devices", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb/1e787000.serial", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb/1e787000.serial/tty", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb/1e787000.serial/tty/ttyS5", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
lstat64("/sys/devices", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb/1e787000.serial", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb/1e787000.serial/tty", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
lstat64("/sys/devices/platform/ahb/ahb:apb/1e787000.serial/tty/ttyS5", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
openat(AT_FDCWD, "/sys/devices/platform/ahb/ahb:apb/1e787000.serial/sirq", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
write(3, "0x23", 4)                     = 4
close(3)                                = 0
openat(AT_FDCWD, "/sys/devices/platform/ahb/ahb:apb/1e787000.serial/lpc_address", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
write(3, "0x1e78f000", 10)              = 10
close(3)                                = 0
openat(AT_FDCWD, "/dev/ttyS5", O_RDWR)  = 3
fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
ioctl(3, TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B9600 -opost -isig -icanon -echo ...}) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(1, "3 handlers\n", 113 handlers
)            = 11
openat(AT_FDCWD, "/var/log/obmc-console.log", O_RDWR|O_CREAT, 0644) = 4
ftruncate(4, 0)                         = 0
write(1, "  log [active]\n", 15  log [active]
)        = 15
socket(AF_UNIX, SOCK_STREAM, 0)         = 5
bind(5, {sa_family=AF_UNIX, sun_path=@"obmc-console\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 110) = 0
listen(5, 1)                            = 0
write(1, "  socket [active]\n", 18  socket [active]
)     = 18
openat(AT_FDCWD, "/dev/ttyS3", O_RDWR|O_NONBLOCK) = 6
fcntl64(6, F_GETFL)                     = 0x802 (flags O_RDWR|O_NONBLOCK)
ioctl(6, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(6, SNDCTL_TMR_CONTINUE or TCSETSF, {B9600 opost isig icanon echo ...}



The obmc-console-client didn't work until I did the following command:
1, del  /dev/ttyVUART0 
2, ln -s /dev/ttyS3 /dev/ttyVUART0 
3,modify the first line lpc-address of /etc/obmc-console.conf
lpc-address = 0x3F8 , 
the other three options can change to anything.
4,systemctl restart obmc-console\@ttyVUART0
5, obmc-console-client,  it works.
Why and how to  achieve this link the ttyVUART0 to ttyS3 by modifying the compilation configuration ?


Best,
Xiuzhi

Hi Xiuzhi,

>  >What hardware platform is this?
> My platform is AMD X86 platform.

OK, so some of my assumptions about how things are hooked up may not be 
correct then. But just to check:

You mention that you're connecting to the host through a physical UART 
connection (UART4: GPIOF5-GPIOF7). Does this mean that you have a
separate SuperIO chip doing UART on the host side? (and you have *not*
connected to the AST2500's LPC bus?) 

If this is the case, you will not be using the VUART - we use that on 
our machines where the host is mastering the AST2500's LPC slave - and
so this means that the 0x3f8 port on host LPC is directly interfacing to
the AST2500's VUART, not a separate SuperIO chip with a UART.

This also means that you'll need to change the `cat /dev/ttyVUART0` 
tests to use the proper UART on the BMC side (because you're not using 
the VUART device).

I think the main issue is that you seem to be mixing up the Linux device
names (ttySx, which are zero-based in the default setup) with the
hardware device names (UARTn, which are one-based). Try referring to the
MMIO base addresses (0x1e78x000) to check that you're using the right
uart. I suspect that you want to be using ttyS3 if you're using UART4
from the datasheet.

Since you're using a physical UART too, you'll need to ensure that the
baud rates are the same on host and BMC.

Also, I would suggest not using any of the obmc-console stuff until 
you'
ve confirmed that you can transfer data just using the serial 
devices on
host and BMC directly with `cat`.

> Which serial parameter should I use in the BMC file 
> etc/obmc-console.conf, BMC uart4 port or Host uart0?

Ah, that's a different setting.

The serial device that you specify on the obmc-console-server command
line is the UART that is connected to the host. This command-line
argument is configured through obmc-console at .service.

The serial device specified in the `local-tty` setting of obmc-
console.conf is a separate device that is typically connected to a BMC-
controlled port on the rear panel of the machine. This configures obmc-
console-server to mirror the serial data (from the host) to that port.

So, I'd suggest removing the `local-tty` setting when you start using
obmc-console, to avoid confusion. You can add it back (specifying a
serial port that is connected to only the BMC) when you want to mirror
to that port.

Regards,


Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20181126/7aa415b5/attachment-0001.html>


More information about the openbmc mailing list