Enable UART4 on Verdin imx8mp

Hello,
I have read into the topic of accessing UART4 from the Cortex-A cores in this thread. However, applying the same steps for the imx8mp did not yield the wanted results. First off, the imx8mp_bl31_setup.c did not contain a line where RDC_PDAP_UART4 is assigned to a domain. I added this line, as suggested in the thread with permission to D0 and changed the device tree status of the uart node.

Is there anything else required to enable UART4 on the imx8m-plus?

Greetings
Martin

Please note that On modules with Wi-Fi/Bluetooth, the UART_4 is shared with the Bluetooth
UART. This means the UART_4 can only be used externally, if the Bluetooth UART is not in use.

I think UART4 should be enabled for external use. To be extra sure I removed the wifi and Bluetooth node from the device tree of Linux. When I open a tty connection (using picocom) to the USB debug serial of UART4 and type input into the terminal, the UARTC TX LED on the Dahlia Carrier Board (V1.1C) flashes. However, sending output directly to the UART4 (located at 0x30a60000) seems to not work, as no character is being printed. When running echo hello > /dev/ttymxc3 from Linux (with UART3 = /dev/ttymxc2 as stdout, the process is blocking for ~15 sec. but does not print anything onto the tty terminal of UART4.

Hello @martin.schoenstedt ,
I will run some tests next week and let you know about the results.

Best regards,
Josep

1 Like

Hey @josep.tx ,
have you found out anything?

Greetings
Martin

Hello @martin.schoenstedt ,
Sorry for the late reply. Is it possible to share with us your modified device tree so we can test on the same environment?

Best regards,
Josep

Hi @josep.tx

This is the device tree we use https://share.toradex.com/bpx0w3nalez273n we use a ramdisk and the <initrd-end> value is replaced with the actual end address.
If you need more files / information then feel free to ask.

Greetings
Martin

Hello ,
Thanks for posting about this issue on the forum .
I am also in need of enabling uart4 at verdin mx8mp with mallow carrier . I am running without wifi/bluetooth . is there any information on how to do it ?

I have enabled uart4 at dts files and also followed the steps here Enable UART4 on the verdin - #3 by StevenMedusa . For mx8mp there was no such line but I added it anyways . but altogether it did not succeed . I would be thankful if i get any tips on this issue .

Best Regards
hassin

Hi @Hasin,

I’m assuming you have a Verdin iMX8MP WB module, you are not using wifi/bt, and you want to use uart4. Is that correct?

On Verdin iMX8MP with WB module, UART4 is used by bluetooth. You can see how it is defined in the device tree imx8mp-verdin-wifi.dtsi (here I am refering to linux-toradex branch toradex_6.6-2.2.x-imx):

/* On-module Bluetooth */
&uart4 {
        uart-has-rtscts;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_bt_uart>;
        status = "okay";

        bluetooth {
                compatible = "mrvl,88w8997";
                max-speed = <921600>;
        };
};

If you want to use uart4, you need to free bluetooth from using it. Also, you need to use the pinctrl for uart4 instead of pinctrl_bt_uart for the uart4 node. You can see how this is done in the device tree for the verdin imx8mp nonwifi module. A simple exmaple would be to define the node as below:

 &uart4 {
        uart-has-rtscts;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart4>;
        status = "okay";
};

I am not sure if you need the property uart-has-rtscts;. That depends on your use-case. This is what you will need in your custom device tree or device tree overlay file, compiled.

One thing to note here is, if you use the M7 core and our device tree overlay file for it - ie, verdin-imx8mp_hmp_overlay.dtbo, you will lose access to uart4, since that node is being disabled in the overlay, so that it could be used by the M core.