AMD R2000 Bilby 單板 串列埠在Grub和Linux下的使用

HankFu發表於2024-07-18

Ubuntu 20啟動時,自動載入了UART驅動,系統啟動資訊含有UART的相關資訊。

[    2.418748] printk: console [ttyS4] disabled
[    2.418757] AMDI0020:00: ttyS4 at MMIO 0xfedc9000 (irq = 3, base_baud = 3000000) is a 16550A
[    2.418820] printk: console [ttyS4] enabled
[    2.424359] printk: console [ttyS4] printing thread started

使用命令 “echo “hello” > /dev/ttyS4 ” , 在串列埠能得到字串“hello”。

Ubuntu 20.04.6 LTS Bilby-RV1-R2314ttyS4

Bilby-RV1-R2314 login: 
hello
hello
hello
hello

修改/etc/default/grub檔案, 增加下面“GRUB_TERMINAL_OUTPUT”行,串列埠上看得到 grub 選單。

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
GRUB_TERMINAL_OUTPUT="gfxterm console"

串列埠上看到的grub 選單:

*Ubuntu                                                                                                                     
Advanced options for Ubuntu 

串列埠上也能看到的grub的輸出資訊:

The highlighted entry will be executed automatically in 5s.                                                                    
The highlighted entry will be executed automatically in 4s.                                                                    
The highlighted entry will be executed automatically in 3s.                                                                    
The highlighted entry will be executed automatically in 2s.                                                                    
The highlighted entry will be executed automatically in 1s.                                                                    
The highlighted entry will be executed automatically in 0s.       

修改/etc/default/grub檔案, 增加引數"console=tty0 console=ttyS4,115200n8",串列埠上看得到 Linux的啟動資訊,也能有Linux的登陸介面,可以互動執行命令。

GRUB_CMDLINE_LINUX="console=tty0 console=ttyS4,115200n8"

Linux的串列埠介面:

Ubuntu 20.04.6 LTS Bilby-RV1-R2314 ttyS4

Bilby-RV1-R2314login: root    xilinx

Password: 
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.1.70-rt21+ x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

Expanded Security Maintenance for Applications is not enabled.

147 updates can be applied immediately.
110 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable

8 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm

New release '22.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login:  7 18 15:46:07 CST 2024 on ttyS4

Ubuntu 重啟動,也能看到列印。

xilinx@Bilby-RV1-R2314[  202.311794] reboot: Restarting system

相關文章