Enable UART instead of 'Verdin CAN_1' on Verdin AM62

Hallo @andi.tx ,

you were right with the similar post. Sorry I have missed that. I read the whole thread and managed to get the additional alias right. The difference to How to configure custom UART? is that I want to disable the ‘Verdin CAN_1’ (aka &main_mcan0) instead of ‘Verdin SPI_1’ (aka &main_spi1) and than configure a new UART. Here is my dt-overlay:

/dts-v1/;
/plugin/; //Indicates a Device Tree Overlay

// Header file with pin definitions
#include <k3-pinctrl.h>

/ {
    compatible = "toradex,verdin-am62"; // Set hardware compatibility
};

/* add a new alias so the serial device will show up in '/dev' and delete alias can0*/
&{/} {
    aliases {
        /delete-property/ can0;
        serial5 = "/bus@f0000/serial@2860000";
    };
};

/* disable Verdin CAN_1 */
&main_mcan0 {
    status = "disabled";
};

/* configure pins for uart*/
&main_pmx0 {
    pinctrl_uartx: main-uartx-pins-default {
        pinctrl-single,pins = <
            AM62X_IOPAD(0x01d8, PIN_INPUT_PULLUP, 6) /* (C15) PR0_UART0_RXD */ /* SODIMM 20 */
            AM62X_IOPAD(0x01dc, PIN_OUTPUT,       6) /* (E15) PR0_UART0_TXD */ /* SODIMM 22 */
        >;
    };
};

&main_uart6 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uartx>;
    status = "okay";
};

The deletion of the can0 alias doesn’t seem to work, because it is still listed if I type ls -l /proc/device-tree/aliases/

With mesg | grep -i serial i can see that there is an additional UART in /dev/ttyS5:

torizon@verdin-am62-15207085:~$ dmesg | grep -i serial
[    0.000000] Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/819abd8275813c9fe50da7865bb4a1afc247d28123b05d7d55c60ab0fbcfdf3b/0
[    0.028067] Serial: AMBA PL011 UART driver
[    0.976584] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[    1.007444] usbcore: registered new interface driver usbserial_generic
[    1.007467] usbserial: USB Serial support registered for generic
[    1.210839] 4a00000.serial: ttyS3 at MMIO 0x4a00000 (irq = 291, base_baud = 3000000) is a 8250
[    1.212369] 2b300000.serial: ttyS1 at MMIO 0x2b300000 (irq = 292, base_baud = 3000000) is a 8250
[    1.213788] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 293, base_baud = 3000000) is a 8250
[    1.222936] 2810000.serial: ttyS0 at MMIO 0x2810000 (irq = 294, base_baud = 3000000) is a 8250
[    1.224093] omap8250 2850000.serial: PM domain pd:156 will not be powered off
[    1.224486] 2850000.serial: ttyS4 at MMIO 0x2850000 (irq = 295, base_baud = 3000000) is a 8250
[    1.224653] serial serial0: tty port ttyS4 registered
[    1.225962] 2860000.serial: ttyS5 at MMIO 0x2860000 (irq = 296, base_baud = 3000000) is a 8250
[    7.251402] systemd[1]: Unnecessary job was removed for /sys/devices/platform/bus@f0000/2800000.serial/tty/ttyS2.
[    7.349531] systemd[1]: Created slice Slice /system/serial-getty.

I can also configurate it like:

torizon@verdin-am62-15207085:~$ stty < /dev/ttyS5
speed 9600 baud; line = 0;
-brkint -imaxbel
torizon@verdin-am62-15207085:~$ stty -F /dev/ttyS5 115200
torizon@verdin-am62-15207085:~$ stty < /dev/ttyS5
speed 115200 baud; line = 0;
-brkint -imaxbel

I connected a UART-USB-dongle via the Level-Shifter on the Verdin-Eval-Board with SODIMM 20/22, but still I can’t read/write to /dev/ttyS5. I tripple checked that my UART-USB-dongle setup is working.


I guess the problem here is:

&main_uart6 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uartx>;
    status = "okay";
};

because I’m trying to assign the Pin configuration PR0_UART0 (aka pinctrl_uartx) to the node &main_uart6, which is not valid. Am I right? But which node do I use instead?
And why is the deletion of the can0 alias not working?

Best Regards

Uwe