We have configured the UART at the kernel boot time, but tqimx6q this board leads to the IMX6Q 5-way TTL interface, where Uart1 and Uart2 turn into 232 interfaces, this article will configure this 5-way UART interface.
DTS Configuration
Since the IMX6Q UART controller is already driven in the kernel, we only need to configure the Pinctrl of each port. Based on the tqimx6q schematic, we made the following modifications to our DTS:
... &uart1 {pinctrl-names = "default";p inctrl-0 = <&pinctrl_uart1_2>;status = "Okay";}; &uart2 {pinctrl-names = "default";p inctrl-0 = <&pinctrl_uart2_3>;status = "Okay";}; &uart3 {pinctrl-names = "default";p inctrl-0 = <&pinctrl_uart3_2>;status = "Okay";}; &uart4 {pinctrl-names = "default";p inctrl-0 = <&pinctrl_uart4_1>;status = "Okay";}; &uart5 {pintctrl-names = "default";p inctrl-0 = <&pinctrl_uart5_1>;status = "Okay";}; ... &iomuxc {pinctrl-names = "default"; Uart1 {pinctrl_uart1_2:uart1grp-2 {fsl,pins = <mx6qdl_pad_sd3_dat7__ Uart1_tx_data 0x1b0b1mx6qdl_pad_sd3_dat6__uart1_rx_data 0x1b0b1mx6qdl_pad_eim_d20__uart1_rts_b 0x1b0b1MX6QDL_PAD_ Eim_d19__uart1_cts_b 0x1b0b1>;};}; Uart2 {pinctrl_uart2_3:uart2grp-3 {fsl,pins = <mx6qdl_pad_eim_d26__uart2_tx_data 0x1b0b1mx6qdl_pad_eim_d27__ Uart2_rx_data 0x1b0b1mx6qdl_pad_eim_d28__uart2_cts_b 0x1b0b1mx6qdl_pad_eim_d29__uart2_rts_b 0x1b0b1>;};}; UART3 {pinctrl_uart3_2: uart3grp-2 {fsl,pins = <mx6qdl_pad_eim_d24__uart3_tx_data 0x1b0b1mx6qdl_pad_eim_d25__uart3_rx_data 0x1b0b1>;};}; Uart5 {pinctrl_uart5_1:uart5grp-1 {fsl,pins = <mx6qdl_pad_key_col1__uart5_tx_data 0x1b0b1mx6qdl_pad_key_row1__ Uart5_rx_data 0x1b0b1>;};};};
After modifying and compiling DTB, the new DTB can start the kernel normally.
Test method
There are many ways to test the serial port, you can write a special test program to test, this information online can find a lot, I do not give an example here. This article uses the lazy way, in uboot the Bootargs temporarily modifies the following content:
Setenv Bootargs ' noinitrd console=ttymxc1,115200 root=/dev/mmcblk0p1 rw rootfstype=ext4 init=/linuxrc '
Then the boot command is executed, and then the serial terminal connected to the UART2 can see the boot log of the kernel and, of course, can enter the Linux console normally. The other three serial ports are TTL mode, I do not have the level conversion module on hand, do not test.
So far, all the serial ports of tqimx6q have been transplanted. Any questions can be discussed in a message.
This article Girlkoo
This article link: http://blog.csdn.net/girlkoo/article/details/45608249
I.MX6Q (TQIMX6Q/TQE9) study notes--new BSP UART porting