xavier nx平台将控制台更改为其他串口2

free-jdx 2021-06-11 11:34:24 5856
1. 前言

承接上篇调试记录
https://www.ebaina.com/articles/140000012623

2. 有什么方法来重定向ttyTCU0与THS2?

您可以使用以下配置更新禁用内核消息。
$OUT/Linux_for_Tegra/bootloader/t186ref/BCT/tegra194-mb1-bct-misc-l4t.cfg

enable_combined_uart = 0;
spe_uart_instance = 0xff;

此外,如果想禁用引导加载程序消息;
修改Verbosity属性,然后刷新单板配置文件。
$OUT/Linux_for_Tegra/bootloader/t186ref/BCT/tegra194-mb1-soft-fuses-l4t.cfg

Verbosity = 0; # 0: Disabled: 1: Critical, 2: Error, 3: Warn, 4: Info, 5: Debug

在修改和刷机后,NX不能正常启动。
下面是来自THS2的引导加载程序消息输出。

[0000.024] W> RATCHET: MB1 binary ratchet value 4 is too large than ratchet level 2 from HW fuses.
[0000.033] I> MB1 (prd-version: 1.5.1.3-t194-41334769-d2a21c57)
[0000.038] I> Boot-mode: Coldboot
[0000.041] I> Chip revision : A02P
[0000.044] I> Bootrom patch version : 15 (correctly patched)
[0000.049] I> ATE fuse revision : 0x200
[0000.053] I> Ram repair fuse : 0x1
[0000.056] I> Ram Code : 0x0
[0000.059] I> rst_source : 0x0
[0000.061] I> rst_level : 0x0
[0000.065] I> Boot-device: QSPI
[0000.068] I> Qspi flash params source = brbct
[0000.072] I> Qspi using bpmp-dma
[0000.075] I> Qspi clock source : pllp
[0000.078] I> QSPI Flash Size = 32 MB
[0000.081] I> Qspi initialized successfully
[0000.085] W> No valid slot number is found in scratch register
[0000.091] W> Return default slot: _a
[0000.094] I> Active Boot chain : 0
[0000.097] I> Boot-device: QSPI
[0000.100] I> Qspi flash params source = brbct
[0000.106] W> MB1_PLATFORM_CONFIG: device prod data is empty in MB1 BCT.
[0000.114] I> Temperature = 65000
[0000.117] W> Skipping boost for clk: BPMP_CPU_NIC
[0000.121] W> Skipping boost for clk: BPMP_APB
[0000.125] W> Skipping boost for clk: AXI_CBB
[0000.129] W> Skipping boost for clk: AON_CPU_NIC
[0000.133] W> Skipping boost for clk: CAN1
[0000.137] W> Skipping boost for clk: CAN2
[0000.141] I> Boot-device: QSPI
[0000.144] I> Boot-device: QSPI
[0000.147] I> Qspi flash params source = mb1bct
[0000.151] I> Qspi using bpmp-dma
[0000.154] I> Qspi clock source : pllc_out0
[0000.158] I> Qspi reinitialized
[0000.161] I> Qspi flash params source = mb1bct
[0000.166] I> ECC region[0]: Start:0x0, End:0x0
[0000.170] I> ECC region[1]: Start:0x0, End:0x0
[0000.174] I> ECC region[2]: Start:0x0, End:0x0
[0000.178] I> ECC region[3]: Start:0x0, End:0x0
[0000.182] I> ECC region[4]: Start:0x0, End:0x0
[0000.187] I> Non-ECC region[0]: Start:0x80000000, End:0x100000000
[0000.192] I> Non-ECC region[1]: Start:0x0, End:0x0
[0000.197] I> Non-ECC region[2]: Start:0x0, End:0x0
[0000.201] I> Non-ECC region[3]: Start:0x0, End:0x0
[0000.206] I> Non-ECC region[4]: Start:0x0, End:0x0
[0000.211] E> FAILED: Thermal config
[0000.218] E> FAILED: MEMIO rail config
[0000.229] I> Boot-device: QSPI
[0000.232] I> Qspi flash params source = mb1bct
[0000.241] I> Qspi flash params source = mb1bct
[0000.252] I> Qspi flash params source = mb1bct
[0000.319] I> Qspi flash params source = mb1bct
[0000.328] I> Qspi flash params source = mb1bct
[0000.355] I> Qspi flash params source = mb1bct
[0000.367] I> MB1 done
[0000.375] I> Welcome to MB2(TBoot-BPMP) (version: 00.00.2018.32-mobile-2dfe4beb)
[0000.382] I> DMA Heap @ [0x526fa000 - 0x52ffa000]
[0000.387] I> Default Heap @ [0xd486400 - 0xd48a400]
[0000.392] E> DEVICE_PROD: Invalid value data = 70020000, size = 0.
[0000.398] W> device prod register failed
[0000.402] I> Boot-device: QSPI
[0000.405] I> Boot_device: QSPI_FLASH instance: 0
[0000.410] I> QSPI Flash Size = 32 MB
[0000.416] I> Qspi initialized successfully
[0000.420] I> qspi flash-0 params source = boot args
[0000.803] I> sdmmc DDR50 mode
[0000.808] I> sdmmc-3 params source = safe params
[0000.815] I> Found 47 partitions in QSPI_FLASH (instance 0)
[0000.822] W> Cannot find any partition table for 00000003
[0000.829] I> Found 11 partitions in SDMMC_USER (instance 3)
[0000.835] W> No valid slot number is found in scratch register
[0000.841] W> Return default slot: _a
[0000.844] I> Active Boot chain : 0
[0000.848] I> parsing oem signed section of bpmp-fw header done
[0000.854] I> bpmp-fw binary init read from storage
[0000.859] I> oem authentication of bpmp-fw header done
[0000.874] I> bpmp-fw binary done read from storage
[0000.879] I> bpmp-fw: Authentication init Done
[0000.884] I> parsing oem signed section of cpubl header done
[0000.889] I> cpubl binary init read from storage
[0000.894] I> bpmp-fw: Authentication Finalize Done
[0000.899] I> oem authentication of cpubl header done
[0000.906] I> cpubl binary done read from storage
[0000.911] I> cpubl: Authentication init Done
[0000.915] I> parsing oem signed section of rce header done
[0000.921] I> rce binary init read from storage
[0000.926] I> Relocating BR-BCT
[0000.929] I> cpubl: Authentication Finalize Done
[0000.934] I> oem authentication of rce header done
[0000.939] I> rce binary done read from storage
[0000.943] I> rce: Authentication init Done
[0000.948] I> parsing oem signed section of ape header done
[0000.954] I> ape binary init read from storage
[0000.958] I> rce: Authentication Finalize Done
[0000.963] I> oem authentication of ape header done
[0000.968] I> ape binary done read from storage
[0000.972] I> ape: Authentication init Done
[0000.977] I> parsing oem signed section of tos header done
[0000.982] I> tos binary init read from storage
[0000.987] I> ape: Authentication Finalize Done
[0000.992] I> oem authentication of tos header done
[0000.998] I> tos binary done read from storage
[0001.003] I> tos: Authentication init Done
[0001.007] I> parsing oem signed section of bpmp-fw-dtb header done
[0001.014] I> bpmp-fw-dtb binary init read from storage
[0001.019] I> tos: Authentication Finalize Done
[0001.025] I> oem authentication of bpmp-fw-dtb header done
[0001.030] I> bpmp-fw-dtb binary done read from storage
[0001.035] I> bpmp-fw-dtb: Authentication init Done
[0001.040] I> parsing oem signed section of cpubl-dtb header done
[0001.047] I> cpubl-dtb binary init read from storage
[0001.052] I> bpmp-fw-dtb: Authentication Finalize Done
[0001.098] I> oem authentication of cpubl-dtb header done
[0001.104] I> cpubl-dtb binary done read from storage
[0001.109] I> cpubl-dtb: Authentication init Done
[0001.114] I> parsing oem signed section of eks header done
[0001.119] I> eks binary init read from storage
[0001.124] I> cpubl-dtb: Authentication Finalize Done
[0001.129] I> oem authentication of eks header done
[0001.134] I> eks binary done read from storage
[0001.138] I> eks: Authentication init Done
[0001.142] I> eks: Authentication Finalize Done
[0001.147] 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

与可引导日志相比,NX似乎不能引导到lk。
是否可以禁用内核消息。
可以重定向到THS2吗?
让它在同一个端口上输出内核消息和引导加载程序消息。

“Verbosity = 0”引导加载程序解决方案部分有效。
由于lk消息仍然输出,因此只有引导加载程序消息被禁用。
(控制台应该输出,否则将无法引导。)

3. 参考TX2平台修改串口方法

阅读p2771-0000.conf.common,默认设置是

CMDLINE_ADD="console=ttyS0,115200n8 console=tty0 OS=l4t fbcon=map:0 net.ifnames=0";

应该修改设备树下路径下的配置

R28.1/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts

做以下更改以获取UART2上的控制台日志

(1)获取mb1/bootloader消息:
BCT变化:
文件名称:tegra186-mb1-bct-misc-si-l4t.cfg

cpu.nafll_b_cluster_data = 0x11F04461;
debug variables
debug.enable_log = 1;
-debug.uart_instance = 0;
+debug.uart_instance = 2;
sw_carveout variables

(2)dts的修改:

compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
compatible = "nvidia,tegra186-hsuart";
console-port;
sqa-automation-port;
status = "okay";

@@ -53,7 +53,7 @@
};
serial@c280000 {
compatible = "nvidia,tegra186-hsuart";
compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
status = "okay";
 };

(3)在内核命令行中添加ttyS2:

-CMDLINE_ADD=“console=ttyS0,115200n8 console=tty1 OS=l4t fbcon=map:0 net.ifnames=0”;
+CMDLINE_ADD=“console=ttyS2,115200n8 console=tty1 OS=l4t fbcon=map:0 net.ifnames=0”;

(4)将串口连接到UART2以获取控制台日志。

4. debug记录

(1)关闭日志测试
在使用之前设置的关闭日志测试之后

enable_combined_uart = 0;
spe_uart_instance = 0xff;
Verbosity = 0; # 0: Disabled: 1: Critical, 2: Error, 3: Warn, 4: Info, 5: Debug

如果关闭内核日志,系统将卡在引导加载程序
如果关闭引导加载程序消息并保持内核登录,系统将正常启动。

在Xavier NX mb1 misc配置中,没有那些需要修改的设置

debug.enable_log = 1;
-debug.uart_instance = 0;
+debug.uart_instance = 2;

相反,使用组合uart特性,似乎日志来自ttyTCU0和ttyTHS0端口

enable_combined_uart = 1;
spe_uart_instance = 0x2;
Does it uses other way to change console log uart or close tegra-combine-uart feature ?

(2)修改common dtsi
试图改变“控制台=ttyTCU0”到“控制台=ttyTHS2”
在tegra194-p3668-common.dtsi

似乎没有影响结合uart。
仍然在登录部分显示ttyTHS0
(连接UART1=ttyTHS2查看这些消息…)

qbic-desktop login: qbic
Password:
Last login: 五 八 7 17:24:12 CST 2020 on ttyTHS0
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.9.140+ aarch64)
Documentation: https://help.ubuntu.com 1
Management: https://landscape.canonical.com 1
Support: https://ubuntu.com/advantage 1
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the ‘unminimize’ command.
190 packages can be updated.
132 updates are security updates.
To run a command as administrator (user “root”), use "sudo ".
See “man sudo_root” for details.
qbic@qbic-desktop:~ qbic@qbic-desktop:~
qbic@qbic-desktop:~ qbic@qbic-desktop:~
qbic@qbic-desktop:~ qbic@qbic-desktop:~ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.140+ (root@skyangel) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Fri Jul 24 14:03:01 CST 2020
[ 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: tegra_comb_uart0 at MMIO32 0x000000000c168000 (options ‘’)
[ 0.000000] bootconsole [tegra_comb_uart0] enabled
[ 0.000000] Found tegra_fbmem: 00800000@a069d000
[ 0.000000] Found lut_mem: 00002008@a0697000
[ 0.000000] OF: fdt:Reserved memory: failed to reserve memory for node ‘fb1_carveout’: base 0x0000000000000000, size 0 MiB
[ 0.000000] OF: fdt:Reserved memory: failed to reserve memory for node ‘fb1_carveout’: base 0x0000000000000000, size 0 MiB
[ 0.000000] OF: fdt:Reserved memory: failed to reserve memory for node ‘fb2_carveout’: base 0x0000000000000000, size 0 MiB
[ 0.000000] OF: fdt:Reserved memory: failed to reserve memory for node ‘fb2_carveout’: base 0x0000000000000000, size 0 MiB
[ 0.000000] OF: fdt:Reserved memory: failed to reserve memory for node ‘fb3_carveout’: base 0x0000000000000000, size 0 MiB
[ 0.000000] OF: fdt:Reserved memory: failed to reserve memory for node ‘fb3_carveout’: base 0x0000000000000000, size 0 MiB
[ 0.000000] OF: reserved mem: initialized node ramoops_carveout, compatible id nvidia,ramoops
[ 0.000000] OF: reserved mem: initialized node vpr-carveout, compatible id nvidia,vpr-carveout
[ 0.000000] OF: reserved mem: initialized node grid-of-semaphores, compatible id nvidia,gosmem
[ 0.000000] cma: Reserved 64 MiB at 0x00000000c2000000
[ 0.000000] On node 0 totalpages: 2030589
[ 0.000000] DMA zone: 7152 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 457725 pages, LIFO batch:31
[ 0.000000] Normal zone: 24576 pages used for memmap
[ 0.000000] Normal zone: 1572864 pages, LIFO batch:31
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.1
[ 0.000000] percpu: Embedded 25 pages/cpu @ffffffc1ffd13000 s61656 r8192 d32552 u102400
[ 0.000000] pcpu-alloc: s61656 r8192 d32552 u102400 alloc=25*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5
[ 0.000000] Speculative Store Bypass Disable mitigation not required
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1998861
[ 0.000000] Kernel command line: console=ttyTHS2,115200 video=tegrafb no_console_suspend=1 earlycon=tegra_comb_uart,mmio32,0x0c168000 gpt tegra_fbmem=0x800000@0xa069d000 lut_mem=0x2008@0xa0697000 usbcore.old_scheme_first=1 tegraid=19.1.2.0.0 maxcpus=6 boot.slot_suffix= boot.ratchetvalues=0.4.2 vpr_resize sdhci_tegra.en_boot_part_access=1 quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTHS1,115200n8 fbcon=map:0 net.ifnames=0

看了更深的注释表[11-7]在章节[11.3 UART],
特别是条目#2关于引脚有GPIO功能,除了少数默认UART。

我有点困惑是否引脚203是指定-默认为UART1_TXD或如何使UART工作在40引脚扩展头。
在不同的终端上接收自己发送的信息有困难(1。回声;2. cat)

当执行一个简单的环回测试1通过跳针8和10在40引脚扩展头映射到引脚203 (UART1_TXD)和引脚205 (UART1_RXD)。

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
free-jdx
红包 93 5 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区