I. MX6Q (TQIMX6Q/TQE9) study notes -- UART transplantation for the new BSP version, tqimx6qtqe9
We have configured the system UART when the kernel is started, but the tqimx6q Development Board introduces the five TTL interfaces of imx6q, where uart1 and uart2 are converted to the 232 interface, this article will configure these five Uart interfaces.
DTS Configuration
Because the kernel already has an imx6q uart Controller Driver, we only need to configure pinctrl for each port. Based on the schematic diagram of tqimx6q, we modify DTS as follows:
...&uart1 {pinctrl-names = "default";pinctrl-0 = <&pinctrl_uart1_2>;status = "okay";};&uart2 {pinctrl-names = "default";pinctrl-0 = <&pinctrl_uart2_3>;status = "okay";};&uart3 {pinctrl-names = "default";pinctrl-0 = <&pinctrl_uart3_2>;status = "okay";};&uart4 {pinctrl-names = "default";pinctrl-0 = <&pinctrl_uart4_1>;status = "okay";};&uart5 {pintctrl-names = "default";pinctrl-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 the modification, re-compile and write DTB. The new DTB can start the kernel normally.
Test Method
There are many methods to test the serial port. You can compile a special test program to test the serial port. You can find a lot of information on the Internet. I will not give an example here. This article uses the lazy method to temporarily change bootargs to the following content in uboot:
setenv bootargs 'noinitrd console=ttymxc1,115200 root=/dev/mmcblk0p1 rw rootfstype=ext4 init=/linuxrc'
Then execute the boot command. Then, connect to the serial port terminal of uart2 to view the startup log of the kernel. Of course, you can access the linux console normally. The other three serial ports are in TTL mode. If I do not have this level conversion module on hand, I will not test it.
So far, all the serial ports of tqimx6q have been transplanted. If you have any questions, leave a message for discussion.
Author: girlkoo
Link: http://blog.csdn.net/girlkoo/article/details/45608249