How to switch debug console from uartc to uarta?

Hi Nvidia,

We are useing 32.7.1 BSP on customize board , and would like to change debug console from uartc(serial@c280000) to urata(serial@3100000)
Don’t need MB1/MB2/Cboot message , only kernel stage message needed output to uarta ,

here is our modify

Blockquote
1.dts
serial@3100000 {
compatible = “nvidia,tegra20-uart”, “nvidia,tegra186-hsuart”;
console-port;
sqa-automation-port;
/delete-property/ resets;
/delete-property/ reset-names;
status = “okay”;
};
chosen {
bootargs =“console=ttyS0,115200”;
board-has-eeprom;
nvidia,tegra-joint_xpu_rail;
};
we didn’t disable combined-uart in devicetree file.

2.flash bsp
a)p3668.conf.common , change CMD_ADD ttyTCU0,115200n8 to CMD_ADD=“ttyS0,115200n8”
b)extlinux.conf : modify console=ttyTCU0,115200n8 to ttyS0,115200n8

after modify, we flash image and try to boot system up,
kernel message ( message still on uartc ) stop booting and reboot again and again

Here is where kernel stop :

We tried to serach solutions on forum, but still get fail
Need your help to show us how to switch debug console from uartc to uarta
Thanks

Hi yi-chia.lan,

May I know what’s your use case to switch debug console to uarta?

Are you getting these messages from uartc or uarta?
Please share the full log and also device tree for further check.

Hi KevinFFF,

use case :
uarta - need to be act as debug console (with kernel message output)
uartb - generic rs232 serial port
uartc - not use. (inside the box , can not pull line out to show message on normal usage)

we getting these message from uartc (open box connect to original uartc for checking)

Here is our dtsi included in our dts file to set uarta as debug console.
(these modify is reference from tx2 dts files)
enable-debugconsole-uarta.dtsi.txt (365 Bytes)

Here is our booting log (from uartc)
log.txt (78.1 KB)

Regards

It seems there’re just some kernel messages in serial console, could you share the result of cat /proc/cmdline on your board?

This uart is combined UART and the messages are coming from different firmwares.

Do you want to output all debug messages to uarta? Or just need to output kernel messages?

Is this custom carrier board designed by you?

Hi KevinFFF,

Here is my kernel command line :

Blockquote
console=ttyTCU0,115200 video=tegrafb earlycon=tegra_comb_uart,mmio32,0x0c168000 gpt rootfs.slot_suffix= tegra_fbmem=0x800000@0xa06b1000 lut_mem=0x2008@0xa06ae000 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=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 pci=nomsi console=ttyS0,115200n8

yes, we would like to output all debug message to uarta on our customize carrier board.

By the way, we can have kernel message output from uarta when using BSP 35.4.1 with same modify. But it just not work on BSP 32.7.1.
Due to we are not going to updade our system to 35.4.1 , please kindly to help us.

Please share the detailed steps how you output kernel messages to uarta in R35.4.1.

Hi KevinFFF,

1. DTB modify
$ sudo -s
$ cd /boot/dtb
$ dtc -I dtb -O dts -o kernel_tegra194-p3668-dlap211-nosuspend-afm.dts kernel_tegra194-p3668-dlap211-nosuspend-afm.dtb
>> EDIT FILE : kernel_tegra194-p3668-dlap211-nosuspend-afm.dts
---------------------------------------------------
			serial@3100000 {
-								compatible = "nvidia,tegra186-hsuart";
+               compatible = "nvidia,tegra20-uart";
+               console-port;
+               sqa-automation-port;
                iommus = <0x02 0x20>;
                interconnects = <0x03 0x16>;
                interconnect-names = "dma-mem";
                dma-coherent;
                reg = <0x00 0x3100000 0x00 0x10000>;
                reg-shift = <0x02>;
                interrupts = <0x00 0x70 0x04>;
                nvidia,memory-clients = <0x0e>;
                dmas = <0x1b 0x08 0x1b 0x08>;
                dma-names = "rx\0tx";
                clocks = <0x04 0x9b 0x04 0x66>;
                clock-names = "serial\0parent";
                assigned-clocks = <0x04 0x9b>;
                assigned-clock-parents = <0x04 0x66>;
-               resets = <0x04 0x64>;
-               reset-names = "serial";                
                nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
                status = "okay";
                phandle = <0x2b8>;
        };



$ mv kernel_tegra194-p3668-dlap211-nosuspend-afm.dtb kernel_tegra194-p3668-dlap211-nosuspend-afm.dtb.orig
$ dtc -I dts -O dtb -o kernel_tegra194-p3668-dlap211-nosuspend-afm.dtb kernel_tegra194-p3668-dlap211-nosuspend-afm.dts

2. extlinux file 
$ cd /boot/extlinux/
>> EDIT FILE : extlinux.conf
------------------------------------------------
<before>
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=efifb:off nospectre_bhb
<after>
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=efifb:off nospectre_bhb console=ttyS0,115200n8

$ sync
>> reboot system

Regards

1 Like

Do you want to implement this on R32.7.1?
If so, may I know the reason why you don’t want to work on R35.4.1?.

Since R32.7.1 is quite an old release, it may take time to verify this use case on R32.

Hi KevinFFF,

Because our customer still useing 32.7.1 , and not yet want to upgarede to 35.4.1.
And, yes , we need this implement on R32.7.1.

Regards