AnsweredAssumed Answered

why is linux i.mx6  uart dcedte setup in imx_set_termios

Question asked by Andrew Dyer on Mar 25, 2015
Latest reply on Apr 24, 2015 by Andrew Dyer

I am trying to set up the i.MX6 uart1 port as a DTE port to connect to a modem with full modem control.  Linux kernel is 3.10.17-1.0.2_ga.  I am seeing odd behaviour for the DCEDTE bit.

 

If I add the fsl,dte-mode property to my device tree, I see the property reflected in the kernel view of the device tree (/proc/device-tree/soc/aips-bus@02000000/spba-bus@02000000/serial@02020000/fsl,dte-mode file exists).  If I look at the UART1_UFCR register, the DCEDTE bit is not set.  At this no software has the port open (co console, no getty, no ppp, no autodialer).  When I check the IOMUXC all of the uart IO selected for uart1.

 

# /unit_tests/memtool UART1.UFCR

SOC: i.MX6DL

UART1    Addr:0x2020000

  UART1.UFCR Addr:0x02020090 Value:0x00000801 -

     UART1.UFCR.RXTL(0..5)      :0x1

             Receiver Trigger Level .

     UART1.UFCR.DCEDTE(6..6)    :0x0    <---------------------

             DCE/DTE mode select .

     UART1.UFCR.RFDIV(7..9)     :0x0

             Reference Frequency Divider.

     UART1.UFCR.TXTL(10..15)    :0x2

             Transmitter Trigger Level .

 

Digging in drivers/tty/serial/imx.c it looks like the DCEDTE bit is set in imx_set_termios().  As far as I can tell this function isn't called unless the port is opened. 

 

I think this is a bug - DCEDTE affects the IOMUX direction for all the port bits.  It seems to me that it should be set much earlier, preserved across the whole driver, and set regardless if the port is opened or not to minimize any IO contention.

Outcomes