aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFugang Duan <b38611@freescale.com>2014-07-10 22:34:27 -0400
committerFugang Duan <b38611@freescale.com>2014-07-11 00:12:06 -0400
commitdc49a7739f46c92cc52e43e538d98f45e8cd5920 (patch)
tree887c14131e6933068b13f943a17f289a9d126137
parentbc123587aab31201fee090653b9e30237f62a86f (diff)
ENGR00322379 tty: serial: imx: set uart to cpu mode by default
Now uart cannot work well with CSR/Atheros BT module with SDMA mode. Set it to cpu mode before SDMA mode work. To enable dma mode, just add "fsl,dma-mode" in the device tree for the node. Signed-off-by: Fugang Duan <B38611@freescale.com>
-rw-r--r--Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt2
-rw-r--r--drivers/tty/serial/imx.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
index c662eb36be29..17fd9bc716ec 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-imx-uart.txt
@@ -10,6 +10,8 @@ Optional properties:
10- fsl,irda-mode : Indicate the uart supports irda mode 10- fsl,irda-mode : Indicate the uart supports irda mode
11- fsl,dte-mode : Indicate the uart works in DTE mode. The uart works 11- fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
12 is DCE mode by default. 12 is DCE mode by default.
13- fsl,dma-mode : Indicate the uart works in dma mode. The uart works
14 is cpu mode by default.
13 15
14Example: 16Example:
15 17
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index a8f2215dffbc..5ecaee07cbac 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -208,6 +208,7 @@ struct imx_port {
208 unsigned int have_rtscts:1; 208 unsigned int have_rtscts:1;
209 unsigned int dte_mode:1; 209 unsigned int dte_mode:1;
210 unsigned int use_irda:1; 210 unsigned int use_irda:1;
211 unsigned int dma_mode:1;
211 unsigned int irda_inv_rx:1; 212 unsigned int irda_inv_rx:1;
212 unsigned int irda_inv_tx:1; 213 unsigned int irda_inv_tx:1;
213 unsigned short trcv_delay; /* transceiver delay */ 214 unsigned short trcv_delay; /* transceiver delay */
@@ -1357,7 +1358,7 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
1357 1358
1358 /* Can we enable the DMA support? */ 1359 /* Can we enable the DMA support? */
1359 if (is_imx6q_uart(sport) && !uart_console(port) 1360 if (is_imx6q_uart(sport) && !uart_console(port)
1360 && !sport->dma_is_inited) 1361 && !sport->dma_is_inited && sport->dma_mode)
1361 imx_uart_dma_init(sport); 1362 imx_uart_dma_init(sport);
1362 } else { 1363 } else {
1363 termios->c_cflag &= ~CRTSCTS; 1364 termios->c_cflag &= ~CRTSCTS;
@@ -1920,6 +1921,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
1920 if (of_get_property(np, "fsl,dte-mode", NULL)) 1921 if (of_get_property(np, "fsl,dte-mode", NULL))
1921 sport->dte_mode = 1; 1922 sport->dte_mode = 1;
1922 1923
1924 if (of_get_property(np, "fsl,dma-mode", NULL))
1925 sport->dma_mode = 1;
1926
1923 sport->devdata = of_id->data; 1927 sport->devdata = of_id->data;
1924 1928
1925 return 0; 1929 return 0;