Xvidia NX平台禁用UART调试记录

1. 前言

操作步骤如下: bootloader/t186ref/BCT/tegra194-mb1-bct-misc-flash.cfg

-enable_combined_uart = 1;
-spe_uart_instance = 2;
+enable_combined_uart = 0;
+spe_uart_instance = 0xff;

bootloader/t186ref/BCT/tegra194-mb1-bct-misc-l4t.cfg

-enable_combined_uart = 1;
-spe_uart_instance = 0x2;
+enable_combined_uart = 0;
+spe_uart_instance = 0xff;

p3668.conf.common

-CMDLINE_ADD="console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0";
+CMDLINE_ADD="console=ttyTHS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0";

flash.sh

- CMDLINE_ADD="console=ttyTCU0,115200n8";
+ CMDLINE_ADD="console=ttyTHS0,115200n8";

common/tegra194-p3668-common.dtsi

- bootargs ="console=ttyTCU0,115200";
+ bootargs ="console=ttyTHS0,115200";

combined-uart {
console-port;
combined-uart;
- status = "okay";
+ status = "disabled";
};

修改完后使用 jetson-disk-image-creator.sh和flash开发SoM创建一个sdcard映像

板子就会启动并正常工作 但如果我尝试flash生产SoM,

在刷机阶段会出现以下问题

[  13.0009 ] Sending bootloader and pre-requisite binaries
[  13.0022 ] tegrarcm_v2 --download blob blob.bin
[  13.0033 ] Applet version 01.00.0000
[  13.0183 ] Sending blob
[  13.0185 ] [................................................] 100%
[  13.7927 ]
[  13.7960 ] tegrarcm_v2 --boot recovery
[  13.7983 ] Applet version 01.00.0000
[  13.8223 ]
[  14.8264 ] tegrarcm_v2 --isapplet

如果我试图恢复 bootloader/t186ref/BCT/tegra194-mb1-bct-misc-flash.cfg中的更改

并在bootloader/t186ref/BCT/tegra194-mb1-bct-misc-flash.cfg 中保留以下更改并恢复其他更改

-enable_combined_uart = 1;
+enable_combined_uart = 0;

可以flash,但在引导期间出现以下问题

[0001.165] I> EKB detected (length: 0x410) @ VA:0x52714400
ipc-unittest-main: 1519: Welcome to IPC unittest!!!
ipc-unittest-main: 1531: waiting forever
ipc-unittest-srv: 329: Init unittest services!!!
hwkey-agent: 40: hwkey-agent is running!!
hwkey-agent: 182: key_mgnt_processing .......
hwkey-agent: 157: Init hweky-agent services!!
platform_bootstrap_epilog: trusty bootstrap complete

2. 参考Xavier上禁用组合uart修改方法

(1)更新misc配置文件

diff --git a/misc/tegra194-mb1-bct-misc.cfg b/misc/tegra194-mb1-bct-misc.cfg

@@ -105,8 +105,8 @@ aocluster.evp_reset_addr = 0xc480000;
 enable_sce = 0;
 enable_rce = 1;
 enable_ape = 1;
-enable_combined_uart = 1;
-spe_uart_instance = 2;
+enable_combined_uart = 0;
+spe_uart_instance = 0xff;

(2)更新设备树禁用组合UART

+       serial@c280000 {
+               compatible = "nvidia,tegra20-uart";
+               clock-frequency = <0x18519600>;
+               console-port;
+               status = "okay";
+               /delete-property/ resets;
+               /delete-property/ reset-names;
+       };
+
        serial@3140000 {
                compatible = "nvidia,tegra186-hsuart";
                status = "okay";
diff --git a/common/tegra194-p2888-0001-p2822-0000-common.dtsi b/common/tegra194-p2888-0001-p2822-0000-common.dtsi

@@ -34,7 +34,8 @@
        compatible = "nvidia,galen", "nvidia,jetson-xavier", "nvidia,p2822-0000+p2888-0001", "nvidia,tegra194";

        chosen {
-               bootargs ="console=ttyTCU0,115200";
+               bootargs ="console=ttyS2,115200 earlycon=uart8250,mmio32,0x0c280000";
+               stdout-path = &uartc;
                board-has-eeprom;
        };

(3)内核命令行禁用组合UART

diff --git a/scripts/board_config/p2972-0000.conf.common b/scripts/board_config/p2972-0000.conf.common

 ROOTFSSIZE=28GiB;
- CMDLINE_ADD="console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4";
+ CMDLINE_ADD="console=ttyS2,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4";

(4)将bpmp-dtb文件反汇编为文本进行修改

diff --git a/include/platforms/bpmp-p2888-a01.dtsi b/include/platforms/bpmp-p2888-a01.dtsi

@@ -6,7 +6,7 @@
 #include "parts/uphy/tegra194-bpmp-p2888-uphy.dtsi"
 #include "parts/emc-strap/emc-p2888.dtsi"
 #include "parts/i2c/cvm-i2c-common.dtsi"
-#include "parts/policy/serial-3-comb-uart.dtsi"
+#include "parts/policy/serial-2-input.dtsi"
 #include "parts/policy/mail-common.dtsi"

diff --git a/include/platforms/bpmp-p2888-a02.dtsi b/include/platforms/bpmp-p2888-a02.dtsi

@@ -6,7 +6,7 @@
 #include "parts/uphy/tegra194-bpmp-p2888-uphy.dtsi"
 #include "parts/emc-strap/emc-p2888.dtsi"
 #include "parts/i2c/cvm-i2c-common.dtsi"
-#include "parts/policy/serial-3-comb-uart.dtsi"
+#include "parts/policy/serial-2-input.dtsi"
 #include "parts/policy/mail-common.dtsi"

diff --git a/include/platforms/bpmp-p2888-a04.dtsi b/include/platforms/bpmp-p2888-a04.dtsi

@@ -6,7 +6,7 @@
 #include "parts/uphy/tegra194-bpmp-p2888-uphy.dtsi"
 #include "parts/emc-strap/emc-p2888.dtsi"
 #include "parts/i2c/cvm-i2c-common.dtsi"
-#include "parts/policy/serial-3-comb-uart.dtsi"
+#include "parts/policy/serial-2-input.dtsi"
 #include "parts/policy/mail-common.dtsi"

这个解决方案是为Xavier 试图将上述解决方案合并到Xavier NX

(tegra194-p3509-0000-a00.dtsi, tegra194-p3668-common.dtsi, tegra194-mb1-bct-misc-l4t.cfg, tegra194-mb1-bct-misc-flash.cfg)

3. bpmp-dtb文件修改

这是配置BPMP固件禁用联合UART, 下面是将DTB文件反汇编为文本文件的命令, 例如

$ dtc -I dtb -O dts -o temp.dts tegra.dtb

可以从bpmp-dtb blob中排除下面的内容来禁用它

serial {
                port = <0x3>;
                has_input;

                combined-uart {
                        enabled;
                };
        };

可以包括下面的添加串行2输入

/ {
    serial {
        port = <2>;
        has_input;
};

执行命令将其转换为另一个新的DTB文件进行验证, 例如,

$ dtc -I dts -O dtb -o new-output.dtb temp.dts

按照上述流程执行 但Xavier Nx仍然卡在Init内核中

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.140 (user@user-HP-EliteDesk-800-G4-TWR) (gcc v0
[ 0.000000] Boot CPU: AArch64 Processor [4e0f0040]
[ 0.000000] OF: fdt:memory scan node memory, reg size 48,
[ 0.000000] OF: fdt: - 80000000 , 2c000000
[ 0.000000] OF: fdt: - ac200000 , 44600000
[ 0.000000] OF: fdt: - 100000000 , 180000000
[ 0.000000] earlycon: uart8250 at MMIO32 0x000000000c280000 (options ‘’)
[ 0.000000] bootconsole [uart8250] enabled
[ 0.000000] Found tegra_fbmem: 00140000@a069c000
[ 0.000000] Found lut_mem: 00002008@a0696000

卡住地方与添加到设备树地址0x000000000c280000的UART相关。

4. 修改p3668.conf.common

更新NX平台配置文件p3668.conf.common

可以参考jetson-xavier-nx-devkit.con

f获取其配置文件 例如,

source "${LDK_DIR}/p3668.conf.common";

5. 总结

Jetson Xavier NX将三个uart带出主连接器;

有3个uart可用,UART0到M2;UART1 40-PIN;UART2调试。

可以访问NX产品设计指南,并检查Xavier NX uart引脚描述。

修改misc配置文件,告诉引导加载程序不要使用调试UART,

如果使用其他uart#作为调试UART 应该更改内核dts中的值也为bootparam和串行节点作为当前UART0。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

free-xx

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值