summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-02-25 07:38:35 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-02-26 07:54:15 +0100
commit246266c205b6608d785bdc2de1d71309f3c0e70c (patch)
tree745596ee1f13c606a87d24cd05eb43416c1fd5e8 /drivers/serial/serial_imx.c
parent68a5d9c0ebedebf1e64b735ad124922c825e91ab (diff)
downloadbarebox-246266c205b6608d785bdc2de1d71309f3c0e70c.tar.gz
serial: imx: Support DTE mode
Based on Kernel commit 20ff2fe60a: serial: imx: add support for DTE mode Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/serial_imx.c')
-rw-r--r--drivers/serial/serial_imx.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index 68b438b..563813a 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -55,6 +55,7 @@ static struct imx_serial_devtype_data imx21_data = {
struct imx_serial_priv {
struct console_device cdev;
int baudrate;
+ int dte_mode;
struct notifier_block notify;
void __iomem *regs;
struct clk *clk;
@@ -93,9 +94,12 @@ static int imx_serial_init_port(struct console_device *cdev)
writel(0, regs + UBMR);
writel(0, regs + priv->devtype->uts);
-
/* Configure FIFOs */
- writel(0xa81, regs + UFCR);
+ val = 0xa81;
+ if (priv->dte_mode)
+ val |= UFCR_DCEDTE;
+
+ writel(val, regs + UFCR);
if (priv->devtype->onems)
@@ -240,6 +244,9 @@ static int imx_serial_probe(struct device_d *dev)
}
}
+ if (of_property_read_bool(dev->device_node, "fsl,dte-mode"))
+ priv->dte_mode = 1;
+
imx_serial_init_port(cdev);
/* Enable UART */