Hello Toradex Community
I’m trying to disable the ‘Verdin CAN_1’ (aka main_mcan0
) peripheral which uses the SODIMMs 20 and 22. My goal is to use the SODIMM 20 as UART5_RXD and SODIMM 22 as UART5_TDX instead.
im working with the following setup:
- Verdin AM62 1GB WB IT (V1.1A)
- Verdin Development Board (V1.1F)
- TorizonCore Version: 6.5.0+build.8
- Host-System Win 10 (WSL2)
I’m relatively new to the Device-Tree game and used the the following tutorials/threads as a start:
- Device Tree Overlays on Torizon (Toradex Tutorial)
- How to Write Device Tree Overlays (Toradex Tutorial)
- Pin multiplexing on AM62 (Toradex Community)
I’ve started to write a dt-overlay to implement the desired modification:
/dts-v1/;
/plugin/; //Indicates a Device Tree Overlay
// Header file with pin definitions
#include <k3-pinctrl.h>
/ {
compatible = "toradex,verdin-am62"; // Set hardware compatibility
};
/* disable Verdin CAN_1 */
&main_mcan0 {
status = "disabled";
};
/* configure pins for uart*/
&main_pmx0 {
pinctrl_mcan0_uart5: main-mcan0-pins-uart5 {
pinctrl-single,pins = <
AM62X_IOPAD(0x01d8, PIN_INPUT_PULLUP, 1) /* (C15) UART5_RXD */ /* SODIMM 20 */
AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* (E15) UART5_TXD */ /* SODIMM 22 */
>;
};
};
I hope until here the dt-overlay is correct. But now the struggle begins.
Any other already configured peripheral adds the pinctrl
to a node, like ‘Verdin UART_1’ does here (k3-am62-verdin.dtsi):
/* Verdin UART_1 */
&main_uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
status = "disabled"; //will be enabled later in k3-am62-verdin-dev.dtsi
};
Also in k3-am62a-main.dtsi the clock for this peripheral is configured?!?
main_uart1: serial@2810000 {
compatible = "ti,am64-uart", "ti,am654-uart";
reg = <0x00 0x02810000 0x00 0x100>;
interrupts = <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&k3_pds 152 TI_SCI_PD_EXCLUSIVE>;
clocks = <&k3_clks 152 0>;
clock-names = "fclk";
status = "disabled";
};
I dont know how i should do the above for my UART5. Because the node &main_uart5
is already in use for ‘On-module Bluetooth’ (see k3-am62-verdin-wifi.dtsi). I tried to used the seemingly unused node &main_uart6
in the dt-overlay like:
&main_uart6 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mcan0_uart5>;
status = "okay";
};
After that the whole TorizonCore build with the added dt-overlay finished successfully, but i cant see any new UART in the Linux. The only thing I saw was the marked line below:
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/86ed0c547c7bbab93bbf612e6e049042edcbfeaf0e61960a33850d8172ac28b2/0
[ 0.028120] Serial: AMBA PL011 UART driver
[ 0.978712] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[ 1.010025] usbcore: registered new interface driver usbserial_generic
[ 1.010047] usbserial: USB Serial support registered for generic
[ 1.220492] 4a00000.serial: ttyS3 at MMIO 0x4a00000 (irq = 291, base_baud = 3000000) is a 8250
[ 1.222122] 2b300000.serial: ttyS1 at MMIO 0x2b300000 (irq = 292, base_baud = 3000000) is a 8250
[ 1.223553] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 293, base_baud = 3000000) is a 8250
[ 1.232810] 2810000.serial: ttyS0 at MMIO 0x2810000 (irq = 294, base_baud = 3000000) is a 8250
[ 1.234101] omap8250 2850000.serial: PM domain pd:156 will not be powered off
[ 1.234523] 2850000.serial: ttyS4 at MMIO 0x2850000 (irq = 295, base_baud = 3000000) is a 8250
[ 1.234695] serial serial0: tty port ttyS4 registered
[ 1.235554] omap8250 2860000.serial: failed to get alias <---------------------------------------
[ 6.238108] systemd[1]: Unnecessary job was removed for /sys/devices/platform/bus@f0000/2800000.serial/tty/ttyS2.
[ 6.306810] systemd[1]: Created slice Slice /system/serial-getty.
So i added a new alias, like it was done for the already configured UARTs and my dt-overlay ended up like this:
/dts-v1/;
/plugin/; //Indicates a Device Tree Overlay
// Header file with pin definitions
#include <k3-pinctrl.h>
/ {
compatible = "toradex,verdin-am62"; // Set hardware compatibility
aliases {
serial5 = &main_uart6;
};
};
/* disable Verdin CAN_1 */
&main_mcan0 {
status = "disabled";
};
/* configure pins for uart*/
&main_pmx0 {
pinctrl_mcan0_uart5: main-mcan0-pins-uart5 {
pinctrl-single,pins = <
AM62X_IOPAD(0x01d8, PIN_INPUT_PULLUP, 1) /* (C15) UART5_RXD */ /* SODIMM 20 */
AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* (E15) UART5_TXD */ /* SODIMM 22 */
>;
};
};
&main_uart6 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mcan0_uart5>;
status = "okay";
};
But then I got the following error in the torizoncore build:
=> Adding device-tree overlay 'device-trees/overlays/custom-overlay.dts'
device-trees/overlays/custom-overlay.dts:9.13-11.7: ERROR (path_references): /aliases: Reference to non-existent node or label "main_uart6"
So where I went wrong?
- Is the usage of the node
&main_uart6
the wrong approach? - Why does the adding of a additional alias failed?
And one last question: Where does the symlinks “verdin-uart1” etc. in the Torizon linux come from?
torizon@verdin-am62-15207085:~$ ls -lah /dev/verdin-uart*
lrwxrwxrwx 1 root root 5 Apr 28 17:42 /dev/verdin-uart1 -> ttyS0
lrwxrwxrwx 1 root root 5 Apr 28 17:42 /dev/verdin-uart2 -> ttyS1
lrwxrwxrwx 1 root root 5 Apr 28 17:42 /dev/verdin-uart3 -> ttyS2
lrwxrwxrwx 1 root root 5 Apr 28 17:42 /dev/verdin-uart4 -> ttyS3
Sorry for the long post, but I tried to cover everything I did to give you the entire overview.
Thank in advance
Uwe