xavier nx平台将控制台更改为其他串口1
1. 前言
代替默认的ttyTCU0。
是否有办法将控制台端口更改为其他uart端口?
试图修改tegra194-p3668-common.dtsi和cboot源代码切换/禁用控制台uart,
并它没有影响控制台仍然来自ttyTHS0 /ttyTCU0与tegra组合uart机制。
tegra194-p3668-common.dtsi
chosen {
bootargs =“console=ttyTHS1,115200”;
board-has-eeprom;
nvidia,tegra-joint_xpu_rail;
};
2. 查询方法
Jetson Xavier NX将三个uart带出主连接器;
可以访问NX Product Design Guide,
并检查[表10-7]的引脚描述。
可以搜索由ttyUSB启用发送串行数据的串行端口,
在Ubuntu主机上检查$ ls -la /dev/ttyUSB,
并使用picocom或minicom工具连接uart日志
默认波特率设置为115200/8n1。
3. 查询设备节点& 设备树映射
可以参考内核初始消息,检查所有挂载的串行端口,
$ dmesg | grep THS
可以访问L4T sources包的公共发布源
可以检查设备树设置的映射。
$L4T_Sources/r32.4.3/Linux_for_Tegra/source/public/hardware/nvidia/soc/t19x/kernel-dts/tegra194-soc/tegra194-soc-uart.dtsi
现在使用的bsp是L4T r32.4.3
tegra194-p3668-common.dtsi中默认的uart相关设置是
serial@3100000 {
compatible = "nvidia,tegra186-hsuart";
status = "okay";
};
serial@3140000 {
compatible = "nvidia,tegra186-hsuart";
status = "okay";
};
combined-uart {
console-port;
combined-uart;
status = "okay";
};`
dmesg THS设备如下
[ 1.616093] 3100000.serial: ttyTHS0 at MMIO 0x3100000 (irq = 47, base_baud = 0) is a TEGRA_UART
[ 1.617093] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 48, base_baud = 0) is a TEGRA_UART
[ 1.617781] 3140000.serial: ttyTHS4 at MMIO 0x3140000 (irq = 49, base_baud = 0) is a TEGRA_UART
控制台日志从ttyTHS0实际输出
这是否意味着THS0是UART3引脚236,238
(电路板的实际控制台输出是UART1引脚203~209)
在表10-7中
THS0 THS1 THS4与uart1,uart2,uart3之间的默认相关设置映射应该是什么
它似乎不符合规格显示(控制台输出从pin236 238)
qbic-desktop login: Ubuntu 18.04.4 LTS qbic-desktop ttyTHS0
4. 分析问题
控制台日志从ttyTHS0
实际上使用pin-203/pin-205进行UART传输。
参考下面的例子,
根据设备树定义,serial@3100000注册为uart-a
aliases {
serial0 = &uarta;
...
uarta: serial@3100000 {
compatible = "nvidia,tegra186-hsuart";
应该检查pinmux电子表格10或pinmux配置文件以作为参考。
例如
$OUT/Linux_for_Tegra/bootloader/tegra19x-mb1-pinmux-p3668-a01.cfg
pinmux.0x024300a8 = 0x00000400; # uart1_tx_pr2: uarta, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
pinmux.0x024300a0 = 0x00000454; # uart1_rx_pr3: uarta, pull-down, tristate-enable, input-enable, io_high_voltage-disable, lpdr-disable
它是串行内核驱动程序在内核初始化期间注册tty设备
可以查看下面的源代码以获得更多细节。
$L4T_Sources/r32.4.3/Linux_for_Tegra/source/public/kernel/
kernel-4.9/drivers/tty/serial/serial_core.c
5. 查询结果
这些是L4T上的uart映射
tegra19x-mb1-pinmux-p3668-a01.cfg
pinmux.0x024300a8 = 0x00000400; # uart1_tx_pr2: uarta, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
pinmux.0x024300a0 = 0x00000454; # uart1_rx_pr3: uarta, pull-down, tristate-enable, input-enable, io_high_voltage-disable, lpdr-disable
pinmux.0x02430098 = 0x00000055; # uart1_rts_pr4: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x02430090 = 0x00000055; # uart1_cts_pr5: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x0243d070 = 0x00000400; # uart2_tx_px4: uartb, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
pinmux.0x0243d078 = 0x00000450; # uart2_rx_px5: uartb, tristate-enable, input-enable, io_high_voltage-disable, lpdr-disable
pinmux.0x0243d080 = 0x00000408; # uart2_rts_px6: uartb, pull-up, tristate-disable, input-disable, lpdr-disable
pinmux.0x0243d088 = 0x00000458; # uart2_cts_px7: uartb, pull-up, tristate-enable, input-enable, lpdr-disable
pinmux.0x0c302010 = 0x00000400; # uart3_tx_pcc5: uartc, tristate-disable, input-disable, io_high_voltage-disable, lpdr-disable
pinmux.0x0c302008 = 0x00000450; # uart3_rx_pcc6: uartc, tristate-enable, input-enable, io_high_voltage-disable, lpdr-disable
pinmux spreadsheets
UART1_TXD 203 UART1_TX GPIO3_PR.02
UART1_RXD 205 UART1_RX GPIO3_PR.03
UART1_RTS* 207 UART1_RTS GPIO3_PR.04
UART1_CTS* 209 UART1_CTS GPIO3_PR.05
UART2_TXD 236 UART3_TX GPIO3_PCC.05
UART2_RXD 238 UART3_RX GPIO3_PCC.06
tegra194-soc-uart.dtsi
serial0 = &uarta;
serial1 = &uartb;
serial2 = &uartc;
启用所有uart
log:
[ 1.437891] 3100000.serial: ttyTHS0 at MMIO 0x3100000 (irq = 47, base_baud = 0) is a TEGRA_UART
[ 1.439066] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 48, base_baud = 0) is a TEGRA_UART
[ 1.441064] c280000.serial: ttyTHS2 at MMIO 0xc280000 (irq = 49, base_baud = 0) is a TEGRA_UART
[ 1.441848] 3130000.serial: ttyTHS3 at MMIO 0x3130000 (irq = 50, base_baud = 0) is a TEGRA_UART
[ 1.442556] 3140000.serial: ttyTHS4 at MMIO 0x3140000 (irq = 51, base_baud = 0) is a TEGRA_UART
[ 1.443210] 3150000.serial: ttyTHS5 at MMIO 0x3150000 (irq = 52, base_baud = 0) is a TEGRA_UART
[ 1.444184] c290000.serial: ttyTHS6 at MMIO 0xc290000 (irq = 53, base_baud = 0) is a TEGRA_UART
[ 1.444902] 3170000.serial: ttyTHS7 at MMIO 0x3170000 (irq = 54, base_baud = 0) is a TEGRA_UART
根据以上信息,
THS0 =uarta=pr2/pr3=203/205 UART1_TX UART1_RX
THS2 = uartc = pcc5 / pcc6 = 236/238 UART3_TX UART3_RX
因为载体板的引脚头设计UART3
打开终端输出消息到/dev/ttyTHS2进行测试,并使用示波器监控UART3_TX信号。(pin236)
可以用J14接线uart传输,检查" ll /dev/ttyUSB* "来设置连接。
J14 pin 3/4 = UART2_TXD,UART2_RXD /UART3_TX,UART3_RX =pin 236,238
端口映射为ttyTHS2。
HW调试后,该端口可用于一般uart使用后,kenel启动
但是bootloader和lk log是从这个端口输出的。(UART2_TXD THS2 UART2_RXD)
ttyTCU0登录控制台绑定到THS0。
- 分享
- 举报
-
浏览量:6293次2021-06-11 11:34:24
-
浏览量:10223次2021-06-08 17:32:00
-
2021-05-06 16:03:00
-
浏览量:6242次2021-07-09 15:17:28
-
浏览量:9249次2021-05-19 17:32:00
-
浏览量:7213次2021-07-31 15:26:23
-
浏览量:7957次2021-06-04 16:25:58
-
浏览量:8612次2021-05-14 14:43:43
-
浏览量:9458次2021-04-27 17:56:41
-
浏览量:7442次2021-05-11 17:51:48
-
浏览量:7880次2021-06-09 14:49:23
-
浏览量:9488次2021-05-26 14:17:15
-
浏览量:7465次2021-06-09 14:29:23
-
浏览量:9410次2021-07-21 16:55:40
-
浏览量:5938次2021-05-28 13:52:17
-
浏览量:7918次2021-06-17 14:48:29
-
浏览量:7401次2021-05-27 16:16:56
-
浏览量:6017次2021-06-03 17:33:36
-
浏览量:10896次2021-05-06 16:22:01
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
free-jdx
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明