Reclaiming UART 2 as usable regular UART

Hi,
I am trying to reclaim UART 2 to be used in linux as a regular uart. I have create the attached set of patches to change the device tree to turn off the combined UART as well as remove the console argument to the kernel. It seems that the device tree change does in fact disable the combined uart for debug. I am only seeing the bootloader messages and then output stops which would work fine for my application. However, it seems that the kernel is not booting at all.

I have been flashing as follows:

sudo ./flash.sh -k MB1_BCT jetson-xavier-nx-devkit-emmc mmcblk0p1
sudo ./flash.sh -k kernel-dtb jetson-xavier-nx-devkit-emmc mmcblk0p1
sudo ./flash.sh -k spe-fw jetson-xavier-nx-devkit-emmc mmcblk0p1
sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1

What am I doing wrong?

It would be extremely helpful to get a patch from Nvidia that would make the UART2 available as a regular UART. There seem to be a lot of places that need to be changed to make that whole arrangement work since it is not just disabling the UART in the device tree but the console argument is added in various places.

Also we have some r5 AON code that uses print_isr. Will that cause problems or will it just be ignored?tegra194-mb1-bct-misc-l4t.cfg.patch (432 Bytes)
tegra186-mb1-bct-misc-si-l4t-storm.cfg.patch (522 Bytes)
p3668.conf.common.patch (540 Bytes)
flash.sh.patch (339 Bytes)

tegra194-p3668-common.dtsi.patch (412 Bytes)

[0000.376] I> Welcome to MB2(TBoot-BPMP) (version: 00.00.2018.32-mobile-feba594)
[0000.383] I> DMA Heap @ [0x526fa000 - 0x52ffa000]                              
[0000.388] I> Default Heap @ [0xd486400 - 0xd48a400]                            
[0000.393] E> DEVICE_PROD: Invalid value data = 70020000, size = 0.             
[0000.399] W> device prod register failed                                       
[0000.403] I> Boot-device: QSPI                                                 
[0000.406] I> Boot_device: QSPI_FLASH instance: 0                               
[0000.411] I> QSPI Flash Size = 32 MB                                           
[0000.417] I> Qspi initialized successfully                                     
[0000.421] I> qspi flash-0 params source = boot args                            
[0000.832] I> sdmmc DDR50 mode                                                  
[0000.837] I> sdmmc-3 params source = safe params                               
[0000.846] I> Found 47 partitions in QSPI_FLASH (instance 0)                    
[0000.853] W> Cannot find any partition table for 00000003                      
[0000.863] I> Found 11 partitions in SDMMC_USER (instance 3)                    
[0000.869] W> No valid slot number is found in scratch register                 
[0000.875] W> Return default slot: _a                                           
[0000.878] I> Active Boot chain : 0                                             
[0000.882] I> parsing oem signed section of bpmp-fw header done                 
[0000.888] I> bpmp-fw binary init read from storage                             
[0000.894] I> oem authentication of bpmp-fw header done                         
[0000.908] I> bpmp-fw binary done read from storage                             
[0000.913] I> bpmp-fw: Authentication init Done                                 
[0000.918] I> parsing oem signed section of cpubl header done                   
[0000.923] I> cpubl binary init read from storage                               
[0000.928] I> bpmp-fw: Authentication Finalize Done                             
[0000.933] I> oem authentication of cpubl header done                           
[0000.941] I> cpubl binary done read from storage                               
[0000.946] I> cpubl: Authentication init Done                                   
[0000.950] I> parsing oem signed section of rce header done                     
[0000.956] I> rce binary init read from storage                                 
[0000.961] I> Relocating BR-BCT                                                 
[0000.964] I> cpubl: Authentication Finalize Done                               
[0000.969] I> oem authentication of rce header done                             
[0000.974] I> rce binary done read from storage                                 
[0000.978] I> rce: Authentication init Done                                     
[0000.983] I> parsing oem signed section of ape header done                     
[0000.988] I> ape binary init read from storage                                 
[0000.993] I> rce: Authentication Finalize Done                                 
[0000.998] I> oem authentication of ape header done                             
[0001.002] I> ape binary done read from storage                                 
[0001.007] I> ape: Authentication init Done                                     
[0001.011] I> parsing oem signed section of tos header done                     
[0001.017] I> tos binary init read from storage                                 
[0001.021] I> ape: Authentication Finalize Done                                 
[0001.026] I> oem authentication of tos header done                             
[0001.033] I> tos binary done read from storage                                 
[0001.038] I> tos: Authentication init Done                                     
[0001.042] I> parsing oem signed section of bpmp-fw-dtb header done             
[0001.049] I> bpmp-fw-dtb binary init read from storage                         
[0001.054] I> tos: Authentication Finalize Done                                 
[0001.060] I> oem authentication of bpmp-fw-dtb header done                     
[0001.065] I> bpmp-fw-dtb binary done read from storage                         
[0001.070] I> bpmp-fw-dtb: Authentication init Done                             
[0001.076] I> parsing oem signed section of cpubl-dtb header done               
[0001.082] I> cpubl-dtb binary init read from storage                           
[0001.087] I> bpmp-fw-dtb: Authentication Finalize Done                         
[0001.144] I> oem authentication of cpubl-dtb header done                       
[0001.150] I> cpubl-dtb binary done read from storage                           
[0001.155] I> cpubl-dtb: Authentication init Done                               
[0001.160] I> parsing oem signed section of eks header done                     
[0001.165] I> eks binary init read from storage                                 
[0001.170] I> cpubl-dtb: Authentication Finalize Done                           
[0001.175] I> oem authentication of eks header done                             
[0001.180] I> eks binary done read from storage                                 
[0001.184] I> eks: Authentication init Done                                     
[0001.188] I> eks: Authentication Finalize Done                                 
[0001.192] 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: 197: key_mgnt_processing .......                                   
hwkey-agent: 189: Setting EKB key 0 to slot 14                                  
hwkey-agent: 167: Init hweky-agent services!!                                   
luks-srv: 40: luks-srv is running!!                                             
luks-srv: 157: Init luks-srv IPC services!!                                     
platform_bootstrap_epilog: trusty bootstrap complete  

```[tegra194-p3668-common.dtsi.patch|attachment](upload://xQI7aGKrJWMRga7DcUmDp9mmLvx.patch) (412 Bytes)

Any ideas?

tegra186-mb1-bct-misc-si-l4t-storm.cfg.patch → This file is not needed. t186 is for TX2 series.

sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1

and only this command would work. Other commands are not needed either.

I am not sure what is your expected result. Since you disable the MB1 uart log, it will not give log to you in the console.
So you saw nothing, which has nothing wrong.

Please refer to this post for disabling the combined UART.

  1. MB1 bct config
  2. device tree (kernel)
  3. device tree (bpmp)

Yes I did follow the instructions in that post. The problem is that the computer doesn’t boot anymore. It seems that maybe the kernel would like to see the serial port and is not happy that it is not there anymore?

My point in previous comment was how did you know it is not booting since you disabled the log print…

Do you have a monitor or something else there?

Yes I have a monitor connected via HDMI and would at least expect some terminal output.

Hi,

Can you use clean software from jetapck and along with the instructions from the post?

I believe this should work without any problem. Not sure if your “Also we have some r5 AON code that uses print_isr.” could cause problem or not. So better not including them first.

The part that is a bit unclear in the previous post is which dtb file to disassemble and modify.

Is it
$L4T_PATH/bootloader/tegra194-a02-bpmp-p3668-a00.dtb
or this one
$L4T_PATH/bootloader/t186ref/tegra194-a02-bpmp-p3668-a00.dtb
or both?

And what are the exact changes. It looks like your diff is from the source dtsi instead of the disassembled file.

Also the previous changes seems to disable the combine serial port but still set it up as a console for the kernel. We would like to just use the serial port as a regular serial port without the kernel using it.

Could you provide changes that just make uart 2 a regular serial port that we can use for other applications? Thank you!

A Jetson Xavier (including NX) is designated (the SoC at least) as T194. You’ll see this as “tegra194” in the .dtb file name. Thus:
tegra194-a02-bpmp-p3668-a00.dtb
(each part of that name has a meaning related to the different components, e.g., SoC, versus carrier board, versus revision)

Thanks! what is the difference between the dtb file in the bootloader/t186ref folder and the bootloader folder? Both files have the same name.

Hi,
It looks like I was able to now sucessfully disable the combined UART and can boot but I don’t think it is enabled as a regular UART. I see the following UARTs:
ttyTHS0, ttyTHS1, ttyTHS4, and ttyTCU0.

What changes do I need to make to which device tree file for the second UART to be available? Thanks!

If your “regular” UART means ttyTHSx instead of ttyTCU0, please remove “console-port” in “combined-uart” in your device tree. And please disable combined-uart.

Thanks! what is the difference between the dtb file in the bootloader/t186ref folder and the bootloader folder? Both files have the same name.

The one under bootloader is a copy from bootloader/t186ref. That file only appears after you flash the board once.

Thank you. I got it resolved. I was missing one more dtb file modification. The “flash” dtb file in t186ref.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.