How to call UART0 “ttyPS0” and UART1 “ttyPS1”?

本文解决了在使用Xilinx设备中,当同时启用UART0和UART1时,系统命名混乱的问题。通过在设备树中正确配置串口别名,确保UART0始终被命名为ttyPS0,而UART1则命名为ttyPS1。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://forums.xilinx.com/t5/Embedded-Linux/How-to-call-UART0-quot-ttyPS0-quot-and-UART1-quot-ttyPS1-quot/td-p/518435
How to call UART0 “ttyPS0” and UART1 “ttyPS1”?
Jump to solution
I wanted to use both UARTs and ran into serious weirdness.

UART0 is the serial console. So far it also used to be called “ttyPS0” by the system.

I enabled the second UART, routed through EMIO, and suddenly lost my kernel console.

After a few frustrating hours, I found the cause:

When UART0 is the only UART, it is “ttyPS0”.

When UART0 and UART1 are both present, UART0 will suddenly be called “ttyPS1” and UART1 takes over the “ttyPS0” name.

Since this is rather silly, and because the use of UART1 is optional and I don’t want to use different bootargs just because someone decided that 1 is 0 or so, I’d like my UART0 to remain “ttyPS0”.

How can I get the kernel to call UART0 “ttyPS0” and UART1 “ttyPS1” like mere mortals would expect?

Re: How to call UART0 “ttyPS0” and UART1 “ttyPS1”?
I think I found it, I needed to specify BOTH serial aliasses. In the DT root, adding these references fixes it so that UART0 is ttyS0. When setting just one, it will see UART1 first and assign it #0, after which it probes UART0 and cannot assign it to #0.

Something like this:

aliases {

serial0 = &uart0;

serial1 = &uart1;

};

Now it works as expected, ttyPS0 is the console and ttyPS1 can be used for funky things in logic.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值