[PATCH] serial: i.MX uart: Allow DTE mode in lowlevel code

Sascha Hauer s.hauer at pengutronix.de
Tue Nov 8 05:42:29 PST 2016


Some consoles must be configured for DTE mode. Allow to set this
in lowlevel code.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/serial/imx-uart.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/serial/imx-uart.h b/include/serial/imx-uart.h
index 901b26a..b40044e 100644
--- a/include/serial/imx-uart.h
+++ b/include/serial/imx-uart.h
@@ -146,6 +146,15 @@ static inline void imx_uart_setup(void __iomem *uartbase,
 	writel(UCR1_UARTEN, uartbase + UCR1);
 }
 
+static inline void imx_uart_set_dte(void __iomem *uartbase)
+{
+	u32 ufcr;
+
+	ufcr = readl(uartbase + UFCR);
+	ufcr |= UFCR_DCEDTE;
+	writel(ufcr, uartbase + UFCR);
+}
+
 static inline void imx50_uart_setup(void __iomem *uartbase)
 {
 	imx_uart_setup(uartbase, 66666666);
-- 
2.10.1




More information about the barebox mailing list