Uart3(ttyTHS3)cannot use

Hi,
In our custorm board, I want use TX2 UART3(ttyTHS3).And I change the dts like this

wifi_over_pcie {
            gpio-hog;
            gpios = <TEGRA_MAIN_GPIO(R, 4) 0>;
            output-low;
            //output-high;
            label = "wifi-over-pcie";
            //status = "disabled";
            status = "okay";
        };

I check gpio status

sudo] password for nvidia: 
GPIOs 248-255, platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-248 (                    |external-connection:) in  hi    
 gpio-253 (                    |spmic_gpio_input_5  ) in  lo    
 gpio-254 (                    |spmic_gpio_input_6  ) in  hi    

GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
 gpio-272 (                    |temp_alert          ) in  hi    
 gpio-312 (                    |Power               ) in  hi    
 gpio-313 (                    |Volume Up           ) in  hi    
 gpio-314 (                    |Volume Down         ) in  hi    
 gpio-315 (                    |wifi-wake-ap        ) in  lo    

GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
 gpio-412 (                    |vdd-usb0-5v         ) in  hi    
 gpio-413 (                    |vdd-usb1-5v         ) in  hi    
 gpio-420 (                    |eqos_phy_reset      ) out hi    
 gpio-421 (                    |eqos_phy_intr       ) in  hi    
 gpio-424 (                    |wifi-enable         ) out hi    
 gpio-440 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-441 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-444 (                    |wp                  ) in  hi    
 gpio-445 (                    |cd                  ) in  hi    
 gpio-446 (                    |en-vdd-sd           ) out lo    
 gpio-456 (                    |cam0-pwdn           ) out lo    
 gpio-460 (                    |wifi-over-pcie      ) out lo    
 gpio-461 (                    |cam0-rst            ) out lo    
 gpio-479 (                    |external-connection:) in  lo

then I change output-high

GPIOs 248-255, platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-248 (                    |external-connection:) in  hi    
 gpio-253 (                    |spmic_gpio_input_5  ) in  lo    
 gpio-254 (                    |spmic_gpio_input_6  ) in  hi    

GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
 gpio-272 (                    |temp_alert          ) in  hi    
 gpio-312 (                    |Power               ) in  hi    
 gpio-313 (                    |Volume Up           ) in  hi    
 gpio-314 (                    |Volume Down         ) in  hi    
 gpio-315 (                    |wifi-wake-ap        ) in  lo    

GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
 gpio-412 (                    |vdd-usb0-5v         ) in  hi    
 gpio-413 (                    |vdd-usb1-5v         ) in  hi    
 gpio-420 (                    |eqos_phy_reset      ) out hi    
 gpio-421 (                    |eqos_phy_intr       ) in  hi    
 gpio-424 (                    |wifi-enable         ) out hi    
 gpio-440 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-441 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-444 (                    |wp                  ) in  hi    
 gpio-445 (                    |cd                  ) in  hi    
 gpio-446 (                    |en-vdd-sd           ) out lo    
 gpio-456 (                    |cam0-pwdn           ) out lo    
 gpio-460 (                    |wifi-over-pcie      ) out hi    
 gpio-461 (                    |cam0-rst            ) out lo    
 gpio-479 (                    |external-connection:) in  lo

But uart still not work

hello Donel,

according to Tegra TRM, please refer to Chapter-38 for UART.
you should refer to [UART Register Access] session for address offsets for UART controllers,
please also check device tree settings, you should enable UART-C instance as below.
for example,

<i>$l4t-r32.2/public_sources/kernel_src/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi</i>

        serial@c280000 {
                compatible = "nvidia,tegra186-hsuart";
                status = "okay";
        };

also, UART-C should be enumerated as /dev/ttyTHS2 for testing.
thanks

Hi JerryChang,
I am sure.I have already enable UART3(UARTD).

serial@3100000 {
        compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
        console-port;
        sqa-automation-port;
        status = "okay";
    };

    serial@3110000 {
        compatible = "nvidia,tegra186-hsuart";
        status = "okay";
    };

    serial@c280000 {
        compatible = "nvidia,tegra186-hsuart";
        status = "okay";
    };

    serial@3130000 {
        compatible = "nvidia,tegra186-hsuart";
        dma-names = "tx";
        status = "okay";
    };

And dmesg show this message

.serialno=0321317186851 bl_prof_dataptr=0x10000@0x277040000 sdhci_tegra.en_boot_part_access=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
[    0.203363] iommu: Adding device 3100000.serial to group 14
[    0.203573] iommu: Adding device 3110000.serial to group 15
[    0.203768] iommu: Adding device c280000.serial to group 16
[    0.203971] iommu: Adding device 3130000.serial to group 17
[    0.418522] 3100000.serial: ttyS0 at MMIO 0x3100000 (irq = 37, base_baud = 25500000) is a Tegra
[    2.581672] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 38, base_baud = 0) is a TEGRA_UART
[    2.622398] c280000.serial: ttyTHS2 at MMIO 0xc280000 (irq = 39, base_baud = 0) is a TEGRA_UART
[    2.733270] serial-tegra 3130000.serial: RX in PIO mode
[    2.758434] 3130000.serial: ttyTHS3 at MMIO 0x3130000 (irq = 40, base_baud = 0) is a TEGRA_UART

I noticed 31300000 register as ttyTHS3 device. I test ttyTHS1 and ttytTHS2 is good. Only ttyTHS3 is not.

I socpe uart1 uart2 and uart3 TX signal . Both UART1_TX and UART2_TX is high when no transcation. But UART3_TX signal always keep low level whatever transcation or no transcation.

hello Donel,

please have a try to start getty with the ttyTHS device.
for example,

$ sudo /sbin/getty -a ubuntu -L 115200 ttyTHS3 &

I’m having this same issue at the moment.

UARTA, B and C (ttyS0, ttyTHS2 and ttyTHS1) are all high when awaiting transaction, but UART3 (ttyTHS3) is low and will not send anything. They all seem to be configured the same way with the device tree (although UARTD has an additional dma-names = “tx”;)

I don’t think this can be a pinmux issue either, seems those pins have no other available mapping. (Not even GPIO)

If you what you mean by UART3 is the UART connected to H10, H9, G10, and G9, then yes, you will need to set the GPIO that controls the internal MUX to low(0). UART3 gets routed internally, by default, on the Jetson TX2 module through a MUX that goes to the module’s WiFi/BT chip. Unless you set QSPI_IO3 low those signals will not come out on H10, H9, G10, and G9.

On the pinmux spreadsheet unhide row 231 for QSPIO_IO3/GPIO3_PR.04. You need to set it to “Drive 0” in the spreadsheet and regenerate your pinmux, reprogram, etc. If you are not generating your own BCT and do not need the UART support till the kernel, you can export GPIO #460 (R.04), set it to an output with the value driven low(0). This should also allow your UART3 signals to be routed outside of the module.

1 Like

Thanks! That will for sure be what is doing it. Which document did you find that diagram in? I scoured the TRM looking for any reference of the sort to UART3 and couldn’t find one.

It is in the download center under the title “Jetson TX2 Series OEM Product Design Guide”. Not sure this link will work unless you are logged in:

Hello, I have a question。When I using uart port to send data, how can I know that the data is really send finished ??

Please open a new topic for this issue. Thanks