为 RK3128 嵌入式 Linux 设备启用 UART TTY

问题描述 投票:0回答:1

背景

我有一个使用 U-Boot 引导加载程序的嵌入式 Android 设备。该系统还使用Busybox套件。

我可以通过 UART 端口访问 U-Boot shell,并且可以转储、修改和上传新文件系统,但我无法通过终端访问操作系统。我对 U-Boot 的一个限制是

saveenv
命令已被禁用,但是,
setenv
命令似乎适用于当前启动会话。

bootargs
U-Boot 变量当前设置为
storagemedia=nand
(没有
console=
设置)。

到目前为止,我已经尝试在各种串行端口上使用

echo
并修改 inittab 文件来为 UART 端口设置 TTY shell。

我尝试设置 TTY shell

::respawn:/sbin/getty -L serial 115200 -n -l /bin/autologin
::respawn:/sbin/getty -L serial0 115200 -n -l /bin/autologin
::respawn:/sbin/getty -L s0 115200 -n -l /bin/autologin
::respawn:/sbin/getty -L console 115200 -n -l /bin/autologin

inittab文件中的原始行(不起作用)

# [THE ORIGINAL LINE] ttyFIQ0::respawn:/sbin/getty -L ttyFIQ0 0 vt100 #
无论我做什么,我从 UART 端口收到的最后几行是:

## Booting Android Image at 0x62ce3248 ... Kernel load addr 0x62ce3a48 size 4400 KiB ## Flattened Device Tree blob at 61f00000 Booting using the fdt blob at 0x61f00000 XIP Kernel Image ... OK CACHE: Misaligned operation at range [62ce3a48, 6312f888] Loading Device Tree to 60ff1000, end 60fff36c ... OK Adding bank: 0x60000000 - 0x61000000 (size: 0x01000000) Adding bank: 0x61200000 - 0x70000000 (size: 0x0ee00000) Starting kernel ...

Starting kernel ...

 消息之后,我没有收到任何表明 TTY shell 正在运行的信息,尽管操作系统已完美启动并运行。如果我在收到 
Starting kernel ...
 消息后在终端中输入任何内容,操作系统就会冻结。

问题

如何为将使用 UART 端口的操作系统设置 TTY shell,以便我最终可以通过终端与嵌入式设备操作系统交互?

linux-kernel embedded-linux u-boot tty rockchip
1个回答
0
投票
我无法在

UART0 端口上建立 shell 连接的原因是 UART0 端口正在被 fiq-debugger 使用,这阻止了我在 UART0

 端口上启动 
getty 程序通过设备ttyFIQ0
。查看 
.dtb 文件(在 Flattened Device Tree blob at 61f00000
 中)后,我注意到串行设备(名称类似 
serial@20060000
)的状态设置为 
status = disabled

我修改了

.dtb

 文件以启用所有串行端口(将其状态设置为 
status = okay
)。然后,我还必须将 
.dtb
 文件中 
serial-id
fiq-debugger 属性修改为0x00
 以外的值,因为 
0x00
 指的是 
UART0,这是我使用的电路板上唯一可访问的 UART 端口。

最后,我修改了设备上的

inittab 文件,以在端口 ttyS0

 上运行 
getty 程序(该设备最初在 .dtb 文件中被禁用)。通过最后的更改,RK3128 允许在 UART0 上使用串行终端。

© www.soinside.com 2019 - 2024. All rights reserved.