How to use the uart 3 of TK1?

I design a custom TK1 board and I want to use 2 uarts.

I use the uart2 and uart3 and I can get acess to uart2 by TTYTHS1,but I can not use uart3.

Any config changes needed ? thank you

/dev/ttyTHS0, Line 0, UART: undefined, Port: 0x0000, IRQ: 68
Baud_base: 0, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal

ubuntu@tegra-ubuntu:~$ sudo setserial -a /dev/ttyTHS1
/dev/ttyTHS1, Line 1, UART: undefined, Port: 0x0000, IRQ: 69
Baud_base: 0, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal

ubuntu@tegra-ubuntu:~$ sudo setserial -a /dev/ttyTHS2
/dev/ttyTHS2, Line 2, UART: undefined, Port: 0x0000, IRQ: 78
Baud_base: 0, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal

As far as I know , ttyTHS0 is UART1,ttyTHS1 is UART2.So I guess ttyTHS2 must be uart3.It seems that the ttyTHS2 has the same confignation as the other two uarts.But in fact the port can not work

Did you line out pins of UART3 (Pin M2, M3, R8, R9) ? What’s pinmux setting of them? You can compare their pinmux settings with UART2’s first.

I design a custom TK1 board and I want to use 2 uarts.

I use the uart2 and uart3 and I can get acess to uart2 by TTYTHS1,but I can not use uart3.

Any config changes needed ? thank you

So the pins of UART3 are already lined out on your board, right?

Did you check the chapter 34.2: UART Programming Guidelines of TRM?

Thank you for your help.

The problem that uart3 can’t work may be cased by a kernel sourse bug.

Someone said he had modefied the kernel sourse files and made the uart3 work correctly.

I am not familiar with linux and I can’t find the source file. Under /drivers/tty/serial,there are many .c files ,I don’t

know which one is my target.

Do beware that setserial queries the driver for information on its settings, but does not query actual hardware. So if UART3 looks like it should work because of a setserial query, it may be that the UART still needs hardware configuration to match this. Going over the firmware dtb file may be useful to see if the UART was set up in some contradictory way (and no setup may mean a default way which is possibly still contradictory). To examine the dtb actually used look at the file named in the FDT entry of “/boot/extlinux/extlinux.conf”, and to reverse the binary dtb to a dts (lacking comments and some naming differences to the actual kernel source dts), try:

dtc -I dtb -O dts -o /tmp/extracted.dts /boot/the_firmware_in_extlinux.dtb

Note that your system may use its dtc program if installed, but the kernel source for that version of kernel also has a copy you can build in “scripts/dtc/dtc”. Consider that if the dtb does not match the driver setting that either the driver can be configured to match the dtb or the dtb can be altered via dts compile during kernel build to match driver. For a working UART, you can look and see what they do to match and observe differences with the one that fails.

/dev/ttyTHS0, Line 0, UART: undefined, Port: 0x0000, IRQ: 68
Baud_base: 0, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal

ubuntu@tegra-ubuntu:~$ sudo setserial -a /dev/ttyTHS1
/dev/ttyTHS1, Line 1, UART: undefined, Port: 0x0000, IRQ: 69
Baud_base: 0, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal

ubuntu@tegra-ubuntu:~$ sudo setserial -a /dev/ttyTHS2
/dev/ttyTHS2, Line 2, UART: undefined, Port: 0x0000, IRQ: 78
Baud_base: 0, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal

As far as I know , ttyTHS0 is UART1,ttyTHS1 is UART2.So I guess ttyTHS2 must be uart3.It seems that the ttyTHS2 has the same confignation as the other two uarts.But in fact the port can not work

By default ttyTHS2 is configured to use the J17 6-pin header at 115200 8N1. This header is basically also wired to the camera module. I’d have to look carefully at documents for UART references…carrier board numbering differs from numbering for the module or TX1 SoC documents. One thing which should remain constant across documents is the base address of the UART controller…sometimes it is easier to use the firmware method of ID, e.g., “serial@70006000” (though you would have to go through some trouble to map this to UART /dev names, e.g., to map a controller address to ttyTHS2…again, it is a matter of labels).