VIM2 Ubuntu UART

Hi! Which /dev/tty matches UART_RX_AO_B, UART_TX_AO_B pins?

$uname -a
Linux Khadas 4.9.190 #51 SMP PREEMPT Fri Aug 30 11:44:18 CST 2019 aarch64 aarch64 aarch64 GNU/Linux

There is no /dev/ttyS4 here, only ttyS0 and ttyS1!

@parumsancto It’s /dev/ttyS0.

From command line you will find it: console=ttyS0,115200n8

$ cat /proc/cmdline

Thank you for reply!

cat /proc/cmdline
root=UUID=54e386e0-9e27-4690-9ff6-ff8068d24de8 rootfstype=ext4 rootflags=data=writeback rw ubootpart=NULL console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0 logo=osd1,loaded,0x3d800000,1080p60hz vout=1080p60hz,enable hdmimode=1080p60hz fsck.repair=yes net.ifnames=0 ddr_size=2 wol_enable=0 jtag=disable mac=c8:63:14:70:3a:9b androidboot.mac=c8:63:14:70:3a:9b save_ethmac= fan=auto khadas_board=VIM2 hwver=VIM2.V14 coherent_pool=2M reboot_mode=cold_boot imagetype=EMMC uboottype=vendor

ttyS0 matches Linux_RX, Linux_TX (pin 18,19).
But I need UART_RX_AO_B, UART_TX_AO_B (pin 15,16).
Which /dev/tty matches this pins?

You need to enable uart_AO_B which is disabled by default.

For example:

Enable uart_AO_B (UART_RX_AO_B, UART_TX_AO_B)

khadas@Khadas:~$ sudo fdtput -t s /dtb.img /serial@c81004e0 status okay

Note: serial@c81004e0 is for uart_AO_B.

Check the status again:

khadas@Khadas:~$ fdtget /dtb.img /serial@c81004e0 status
okay

Ok, it’s enabled now, reboot the system and you will find the node for uart_AO_B.

khadas@Khadas:~$ sudo reboot

Check the tty nodes:

khadas@Khadas:~$ ll /dev/ttyS*
crw------- 1 root tty     238, 0 Dec 13 13:12 /dev/ttyS0
crw-rw---- 1 root dialout 238, 1 Dec 13 13:09 /dev/ttyS1
crw-rw---- 1 root dialout 238, 4 Dec 13 13:09 /dev/ttyS4

So /dev/ttyS4 is what you want for uart_AO_B.

Working!
Now I see ttyS4.

Where I can read about other properties in dtb.img, like I2C, USB interfaces?
For example, how to enable I2C_A interface?

You can check the dts:

There is no property “serial@c81004e0” in this file. Are you shure?

You also need to look into the “*.dtsi” files included in this dts file.