UART doesn't work

Hi Nvidia,
Our custom AGX ORIN board doesn’t work, please help solve this problem.
We use Jetpack 6.2 source code. Whether we cross - connect the TX and RX pins or connect the two serial ports, serial communication fails.

The dts:

		uarta: serial@3100000 {
			compatible = "nvidia,tegra234-uart", "nvidia,tegra20-uart";
			reg = <0x0 0x03100000 0x0 0x10000>;
			interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&bpmp TEGRA234_CLK_UARTA>;
			resets = <&bpmp TEGRA234_RESET_UARTA>;
			status = "disabled";
		};

		uartb: serial@3110000 {
			compatible = "nvidia,tegra234-uart", "nvidia,tegra20-uart";
			reg = <0x0 0x03110000 0x0 0x10000>;
			interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&bpmp TEGRA234_CLK_UARTB>;
			resets = <&bpmp TEGRA234_RESET_UARTB>;
			status = "disabled";
		};

		uartd: serial@3130000 {
			compatible = "nvidia,tegra234-uart", "nvidia,tegra20-uart";
			reg = <0x0 0x03130000 0x0 0x10000>;
			interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&bpmp TEGRA234_CLK_UARTD>;
			resets = <&bpmp TEGRA234_RESET_UARTD>;
			status = "disabled";
		};

		uarte: serial@3140000 {
			compatible = "nvidia,tegra234-uart", "nvidia,tegra20-uart";
			reg = <0x0 0x03140000 0x0 0x10000>;
			interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&bpmp TEGRA234_CLK_UARTE>;
			resets = <&bpmp TEGRA234_RESET_UARTE>;
			dmas = <&gpcdma 20>, <&gpcdma 20>;
			dma-names = "rx", "tx";
			status = "disabled";
		};

		uarti: serial@31d0000 {
			compatible = "arm,sbsa-uart";
			reg = <0x0 0x31d0000 0x0 0x10000>;
			interrupts = <GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH>;
			status = "disabled";
		};
		/* UARTA */
		serial@3100000 {
			reset-names = "serial";
			status = "okay";
		};

		/* UARTB */
		serial@3110000 {
			reset-names = "serial";
			status = "okay";
		};

		/* UARTD */
		serial@3130000 {
			reset-names = "serial";
			status = "okay";
		};

		/* UARTE */
		serial@3140000 {
			reset-names = "serial";
			status = "okay";
		};

		serial@31d0000 {
			current-speed = <115200>;
			//status = "okay";
			status = "disabled";
		};

The dmesg log:

[    0.000000] Kernel command line: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 nospectre_bhb video=efifb:off console=tty0 bl_prof_dataptr=2031616@0x102C610000 bl_prof_ro_ptr=65536@0x102C600000 
[    0.000578] printk: console [tty0] enabled
[    0.277963] printk: console [ttyTCU0] enabled
[    4.017373] printk: console [tty0]: printing thread started
[    4.018014] printk: console [ttyTCU0]: printing thread started
[    4.068357] 3100000.serial: ttyS1 at MMIO 0x3100000 (irq = 112, base_baud = 4250000) is a Tegra
[    4.072662] 3110000.serial: ttyS2 at MMIO 0x3110000 (irq = 113, base_baud = 4250000) is a Tegra
[    4.074752] 3130000.serial: ttyS0 at MMIO 0x3130000 (irq = 114, base_baud = 4250000) is a Tegra
[    4.076223] 3140000.serial: ttyS3 at MMIO 0x3140000 (irq = 115, base_baud = 4250000) is a Tegra
[    8.596101] systemd[1]: Created slice Slice /system/serial-getty.

pinctrl:

# cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups |grep uart
88 (uart2_tx_px4): 
        function=uartb
89 (uart2_rx_px5): 
        function=uartb
90 (uart2_rts_px6): 
        function=uartb
91 (uart2_cts_px7): 
92 (uart5_tx_py5): 
        function=uarte
93 (uart5_rx_py6): 
        function=uarte
94 (uart5_rts_py7): 
        function=uarte
95 (uart5_cts_pz0): 
120 (uart1_cts_pr5): 
121 (uart1_rts_pr4): 
        function=uarta
122 (uart1_rx_pr3): 
        function=uarta
123 (uart1_tx_pr2): 
        function=uarta
125 (uart4_cts_ph6): 
126 (uart4_rts_ph5): 
        function=uartd
127 (uart4_rx_ph4): 
        function=uartd
128 (uart4_tx_ph3): 
        function=uartd

Hi liteblue,

Which UART interface would you like to use?

Have you tried shorting TX/RX to perform loopback test?
You can refer to the following commands to perform this.
e.g. if you want to verify 3100000.serial(/dev/ttyS1) interface

$ sudo su
# stty -F /dev/ttyS1 115200 raw -echo
# cat /dev/ttyS1 &
# echo "test" > /dev/ttyS1

I have tried the loopback test. On my side, the address 3100000 corresponds to ttyS2.

I’m not sure if there’s any mistake. The IRQ for 0x3130000 is 115 in the dts file, but it shows as irq=114 in the log. The IRQ for 0x3140000 is 116 in the dts file, but it shows as irq=115 in the log. Is this correct?

The loop test shows that there is garbled characters in the echo output.

[    4.068357] 3100000.serial: ttyS1 at MMIO 0x3100000 (irq = 112, base_baud = 4250000) is a Tegra

Why I get different result from the log you shared?

Please confirm the exact UART interface you are using.

Perhaps the device registration changed after I adjusted the DTS. My goal is to make all four serial ports, namely UART A, B, D and E, available.

Please share your latest full dmesg and device tree.
It seems you’ve configured some nodes to use legacy serial driver.
I would prefer focusing on the specific UART interface to discuss. And you can verify for other UART interface with the similar steps. Which UART interface(uarta, uartb, uartd, uarte) you want to check first? Which pin you are using?

Finally, the issue was bypassed by changing ‘compatible’ to “nvidia,tegra194-hsuart”. Currently, UART functionality is available, but I don’t know why.
compatible = "nvidia,tegra194-hsuart";

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