Serial@3140000与serial@3100000配置

背景:orin nx系列, jetpack6.2.1,ubuntu22.04,自研底板
系统配7个串口:1个调试串口+2个来自核心板(serial@3140000与serial@3100000)+4个usb转串口
目前来自核心板的串口工作不正常
相关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 = “okay”;
};

        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 = "okay";
        };

查看dmesg:
root@wel-tegra:/home/wel# dmesg |grep tty
[ 0.000000] Kernel command line: root=PARTUUID=a652c988-be1c-4346-93ab-ac9e08688c44 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 video=efifb:off console=tty0 net.ifnames=0 biosdevname=0 usbcore.autosuspend=-1 tegra.xusb.disable_power_off=1 usb-storage.quirks=0:0:0 bl_prof_dataptr=2031616@0x271E10000 bl_prof_ro_ptr=65536@0x271E00000
[ 0.000391] printk: console [tty0] enabled
[ 0.090270] 31d0000.serial: ttyAMA0 at MMIO 0x31d0000 (irq = 117, base_baud = 0) is a SBSA
[ 0.270976] printk: console [ttyTCU0] enabled
[ 2.645040] printk: console [tty0]: printing thread started
[ 2.646165] printk: console [ttyTCU0]: printing thread started
[ 2.720139] 3100000.serial: ttyTHS1 at MMIO 0x3100000 (irq = 112, base_baud = 0) is a TEGRA_UART
[ 2.720722] 3140000.serial: ttyTHS2 at MMIO 0x3140000 (irq = 113, base_baud = 0) is a TEGRA_UART
[ 10.554749] systemd[1]: Created slice Slice /system/serial-getty.
[ 11.398971] cdc_acm 1-3.4:1.0: ttyACM0: USB ACM device
[ 11.400983] cdc_acm 1-3.4:1.2: ttyACM1: USB ACM device
[ 11.402111] cdc_acm 1-3.4:1.4: ttyACM2: USB ACM device
[ 11.404639] cdc_acm 1-3.4:1.6: ttyACM3: USB ACM device
root@wel-tegra:/home/wel# echo “ttyTHS1” > /dev/ttyTHS1
root@wel-tegra:/home/wel# echo “ttyTHS1” > /dev/ttyTHS1
root@wel-tegra:/home/wel# echo “ttyTHS2” > /dev/ttyTHS2
root@wel-tegra:/home/wel# echo “ttyTHS2” > /dev/ttyTHS2
root@wel-tegra:/home/wel# echo “ttyTHS2” > /dev/ttyTHS2
3140000中断与dts不一致
查看:
root@wel-tegra:/home/wel# sudo dtc -I fs /proc/device-tree | grep -i “serial|uart” | head -50
: Warning (unit_address_vs_reg): /camera-ivc-channels/ivccapture@4: node has a unit name, but no reg or ranges property
: Warning (unit_address_vs_reg): /camera-ivc-channels/ivccontrol@3: node has a unit name, but no reg or ranges property
: Warning (interrupt_provider): /bpmp/i2c/vrs@3c: Missing #address-cells in interrupt provider
: Warning (alias_paths): /aliases:qspi0: aliases property is not a valid node (/bus@0/spi@3270000)
serial-number = “1421423032250\0”;
serial@3100000 {
compatible = “nvidia,tegra194-hsuart”;
reset-names = “serial”;
serial@3140000 {
compatible = “nvidia,tegra194-hsuart”;
reset-names = “serial”;
uarte_pins {
nvidia,function = “uarte”;
nvidia,pins = “uart2_tx_px4\0uart2_rx_px5”;
uarta_pins {
nvidia,function = “uarta”;
nvidia,pins = “uart1_tx_pr2\0uart1_rx_pr3”;
serial@3110000 {
compatible = “nvidia,tegra234-uart\0nvidia,tegra20-uart”;
serial@31d0000 {
compatible = “arm,sbsa-uart”;
clock-names = “nvdisplayhub_clk\0nvdisplay_disp_clk\0nvdisplay_p0_clk\0nvdisplay_p1_clk\0dpaux0_clk\0fuse_clk\0dsipll_vco_clk\0dsipll_clkoutpn_clk\0dsipll_clkouta_clk\0sppll0_vco_clk\0sppll0_clkoutpn_clk\0sppll0_clkouta_clk\0sppll0_clkoutb_clk\0sppll0_div10_clk\0sppll0_div25_clk\0sppll0_div27_clk\0sppll1_vco_clk\0sppll1_clkoutpn_clk\0sppll1_div27_clk\0vpll0_ref_clk\0vpll0_clk\0vpll1_clk\0nvdisplay_p0_ref_clk\0rg0_clk\0rg1_clk\0disppll_clk\0disphubpll_clk\0dsi_lp_clk\0dsi_core_clk\0dsi_pixel_clk\0pre_sor0_clk\0pre_sor1_clk\0dp_link_ref_clk\0sor_linka_input_clk\0sor_linka_afifo_clk\0sor_linka_afifo_m_clk\0rg0_m_clk\0rg1_m_clk\0sor0_m_clk\0sor1_m_clk\0pllhub_clk\0sor0_clk\0sor1_clk\0sor_pad_input_clk\0pre_sf0_clk\0sf0_clk\0sf1_clk\0dsi_pad_input_clk\0pre_sor0_ref_clk\0pre_sor1_ref_clk\0sor0_ref_pll_clk\0sor1_ref_pll_clk\0sor0_ref_clk\0sor1_ref_clk\0osc_clk\0dsc_clk\0maud_clk\0aza_2xbit_clk\0aza_bit_clk\0mipi_cal_clk\0uart_fst_mipi_cal_clk\0sor0_div_clk”;
serial1 = “/bus@0/serial@3100000”;
serial2 = “/bus@0/serial@3140000”;
serial0 = “/serial”;
stdout-path = “serial0:115200n8”;
serial {
uarte_pins = “/bus@0/pinmux@2430000/uarte_pins”;
uarti = “/bus@0/serial@31d0000”;
uarte = “/bus@0/serial@3140000”;
uarta = “/bus@0/serial@3100000”;
uarta_pins = “/bus@0/pinmux@2430000/uarta_pins”;
tcu = “/serial”;
发现compatible是“nvidia,tegra194-hsuart”;与dts中不一样
在tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi与tegra234-p3768-0000+p3767-0000.dts中compatible = “nvidia,tegra194-hsuart”;给屏蔽了
root@wel-tegra:/home/wel# dmesg |grep tty
[ 0.000000] Kernel command line: root=PARTUUID=c6ca4e0d-4f67-4f26-b5fd-d1c9ee20b312 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 video=efifb:off console=tty0 net.ifnames=0 biosdevname=0 usbcore.autosuspend=-1 tegra.xusb.disable_power_off=1 usb-storage.quirks=0:0:0 bl_prof_dataptr=2031616@0x271E10000 bl_prof_ro_ptr=65536@0x271E00000
[ 0.000399] printk: console [tty0] enabled
[ 0.084903] 31d0000.serial: ttyAMA0 at MMIO 0x31d0000 (irq = 117, base_baud = 0) is a SBSA
[ 0.273947] printk: console [ttyTCU0] enabled
[ 2.341232] printk: console [tty0]: printing thread started
[ 2.341826] printk: console [ttyTCU0]: printing thread started
[ 2.439082] 3100000.serial: ttyS1 at MMIO 0x3100000 (irq = 112, base_baud = 4250000) is a Tegra
[ 2.442258] 3140000.serial: ttyS2 at MMIO 0x3140000 (irq = 113, base_baud = 4250000) is a Tegra
[ 10.446944] systemd[1]: Created slice Slice /system/serial-getty.
[ 11.293027] cdc_acm 1-3.4:1.0: ttyACM0: USB ACM device
[ 11.304599] cdc_acm 1-3.4:1.2: ttyACM1: USB ACM device
[ 11.324623] cdc_acm 1-3.4:1.4: ttyACM2: USB ACM device
[ 11.339532] cdc_acm 1-3.4:1.6: ttyACM3: USB ACM device
由ttyTHS1,ttyTHS2变为ttyS1,ttyS2
但这两种都无法工作,怎么回事?

*** Please note that this reply is generated by LLM automatically ***

The provided context is related to the Jetson Orin series, specifically the Jetson Orin NX and Jetson Orin Nano, which are system-on-modules (SoMs) developed by NVIDIA. The context includes information about bring-up hardware validation, boot validation, and commands for flashing the device.

Bring-up Hardware Validation:

The bring-up hardware validation process involves checking the power and reset sequence, recovery mode, NvTest (NVIDIA Tegra MODS) for DDR, eMMC, and CPU, and JTAG connection check.

Boot Validation:

The boot validation process involves verifying TegraFlash, UART output, KBD connection, board flashing profile, MB1/MB2 BCT configuration file, kernel device tree, file system support, and boot scripts. It also includes booting to the kernel, kernel command line, or custom desktop.

Commands for Flashing the Device:

The provided commands are used for flashing the Jetson Orin NX and Jetson Orin Nano devices. The commands include:

  • sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash -p " -c bootloader/generic/cfg/flash_t234_qspi.xml --no-systemimg" jetson-orin-nano-devkit internal
  • sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash -p '-N <ip_addr>:<root_path>' --external-device <storage-device> -c tools/kernel_flash/flash_l4t_external.xml --external-only --append jetson-orin-nano-devkit eth0
  • sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --flash-only

These commands are used for flashing the device with a specific configuration, such as using an external storage device or flashing only the kernel.

Generating a Specified Partition BUP:

The provided information also includes a section on generating a specified partition BUP (Bootloader Update Package) image for a carrier board connected to the host system. The process involves running a command to create the BUP image, which is used for updating the bootloader on the device.

Device Tree and UART Configuration:

The provided information also includes a section on the device tree and UART configuration for the Jetson Orin NX and Jetson Orin Nano devices. The device tree is used to configure the hardware components on the device, and the UART configuration is used to configure the serial communication interface.

Comparison between Jetson Orin NX and Jetson Orin Nano:

Both the Jetson Orin NX and Jetson Orin Nano are SoMs developed by NVIDIA, but they have some differences in terms of their hardware configuration and features. The Jetson Orin NX has a more powerful processor and more memory than the Jetson Orin Nano, making it more suitable for applications that require high-performance computing. The Jetson Orin Nano, on the other hand, is more power-efficient and has a smaller form factor, making it more suitable for applications that require low power consumption and a small footprint.

In summary, the provided context is related to the Jetson Orin series, specifically the Jetson Orin NX and Jetson Orin Nano, and includes information about bring-up hardware validation, boot validation, commands for flashing the device, generating a specified partition BUP, device tree and UART configuration, and a comparison between the two devices.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi jeremyzhang,

Based on my understanding, it should be 3110000.serial(UART-B, from M.2 Key E) and 3100000.serial(UART-A, from 40-pins header).
Please refer to https://elinux.org/Jetson/L4T/peripheral/#Mapping_3 for their mapping.

UART-E (3140000.serial) is not available on Orin NX/Nano, please enable UART-B(3110000.serial) instead.

Please share the full dmesg and device tree as file here if you still have the issue.

切换到:UART-B(3110000.serial)
windows用的sscom,linux是cutecom
cutecom发给sscom,正常
sscom发给cutecom, 每次8个字符以下正常, 8个及8个以上,cutecom收到的不正常显示
比如sscom发送12345678,cutecom显示
如果sscom发送123456789,cutecom显示9(如果是Hex:00 00 00 00 00 00 00 00 39)

Could you try to remove dmas related properties in device node(serial@3110000) to check if it could help for this issue?

取消://dmas = <&gpcdma 9>, <&gpcdma 9>;报下面的错误:
[ 184.417704] serial-tegra 3110000.serial: DMA channel alloc failed: -19
[ 184.417719] serial-tegra 3110000.serial: Tx Dma allocation failed, err = -19
[ 187.000336] serial-tegra 3110000.serial: DMA channel alloc failed: -19
[ 187.000345] serial-tegra 3110000.serial: Tx Dma allocation failed, err = -19
dts:
uartb: serial@3110000 {
compatible = “nvidia,tegra194-hsuart”;
reg = <0x0 0x03110000 0x0 0x10000>;
reg-shift = <2>;
interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
nvidia,memory-clients = <14>;
clocks = <&bpmp TEGRA234_CLK_UARTB>, <&bpmp TEGRA234_CLK_PLLP_OUT0>;
clock-names = “serial”, “parent”;
resets = <&bpmp TEGRA234_RESET_UARTB>;
//dmas = <&gpcdma 9>, <&gpcdma 9>;
dma-names = “rx”, “tx”;
reset-names = “serial”;
status = “disabled”;
};

Please also comment out this line.