How to use UART_E in DCE Mode

Hi,
I want to use UART_E in DCE mode, I used same in DTE mode earlier UART5 (157, 169), but now I want to use (75, 169) pins.

Below device tree code change:

pinctrl_uart4: uart4-grp {
 	fsl,pins = <
		MX7D_PAD_SAI1_TX_BCLK__UART5_DCE_RX 0x79 /*SODIMM 169*/
		MX7D_PAD_I2C4_SDA__UART5_DCE_TX 0x79 /*SODIMM 157*/
 		>;
 };

dmesg Log:
[    0.251575] 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 50, base_baud = 1500000) is a IMX
[    0.961105] console [ttymxc0] enabled
[    0.967147] 30890000.serial: ttymxc1 at MMIO 0x30890000 (irq = 51, base_baud = 1500000) is a IMX
[    0.980071] 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 52, base_baud = 1500000) is a IMX
[    0.993281] 30a60000.serial: ttymxc3 at MMIO 0x30a60000 (irq = 57, base_baud = 1500000) is a IMX
[    1.013155] loop: module loaded
[    1.023633] vdd1p0d: supplied by DCDC3
[    1.040348] spi_imx 30840000.ecspi: dma setup error -19, use pio

I tried loopback test but it’s not working.

root@colibri-imx7-emmc:~# stty -F /dev/ttymxc3 115200 -echo
root@colibri-imx7-emmc:~# cat < /dev/ttymxc3 &
[1] 460
root@colibri-imx7-emmc:~# echo "Hello" > /dev/ttymxc3

Any help will be appreciated.

Hi @neeraj.verma

First of all, UARTD ist UART4 and UARTE is UART5.

pinctrl_uart4: uart4-grp {
fsl,pins = <
MX7D_PAD_SAI1_TX_BCLK__UART5_DCE

So was this working?

Usually the SODIMM Pin 75 is muxed as gpio for the parallel camera interface. Have you seen this?

Best regards,
Jaski

Hi @jaski.tx ,

DTE mode working code is below which uses SODIMM (169, 157):

&uart5 {
	status = "okay";
};

&uart5 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart5>;
	assigned-clocks = <&clks IMX7D_UART5_ROOT_SRC>;
	assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
	fsl,dte-mode;
};
pinctrl_uart5: uart5-grp {
	fsl,pins = <
		MX7D_PAD_SAI1_TX_BCLK__UART5_DTE_RX 0x79 /*SODIMM 169*/
		MX7D_PAD_SAI1_RX_DATA__UART5_DTE_TX 0x79 /*SODIMM 157*/
 		>;
 	};

As per my new hardware design UART is in DCE mode and uses (169, 75) pins, hence I modified code as below:

&uart5 {
	status = "okay";
};

&uart5 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart5>;
	assigned-clocks = <&clks IMX7D_UART5_ROOT_SRC>;
	assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
	fsl,dce-mode;
};
pinctrl_uart5: uart5-grp {
	fsl,pins = <
		MX7D_PAD_SAI1_TX_BCLK__UART5_DTE_RX 0x79 /*SODIMM 169*/
		MX7D_PAD_I2C4_SDA__UART5_DCE_TX  0x79 /*SODIMM 75*/
 		>;
 	};

Yes, I saw pin 75 but commented out since I do not use Camera interface.
Could you please suggest me what is missing here?

Hi @jaski.tx ,
Could you please let me know your inputs? this will help us to validate design issues if any.

There is no property called fsl,dce-mode ( Documentation/devicetree/bindings/serial/fsl-imx-uart.txt ). If you want to use dce mode, then you should just delete the dte mode.

For pinmuxing, you should put RX and TX in DCE mode or DTE mode, but not mixup the modes.
Please have a look at this post which explains the different between DCE and DTE mode. Note, that post is for iMX6.

Best regards,
Jaski

Finally DTE is worked with below pin configurations for UART_E or UART5

pinctrl_uart5: uart5-grp {
     fsl,pins = <
         MX7D_PAD_SAI1_RX_DATA__UART5_DTE_TX 0x79 /*SODIMM 169*/
         MX7D_PAD_I2C4_SDA__UART5_DTE_RX  0x79 /*SODIMM 75*/
          >;
      };

Thank you.

Perfect that it works. I thought you were looking for DCE Mode as stated in the Title?

Best regards,
Jaski