summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2017-08-10 21:29:49 +0200
committerStefan Agner <stefan.agner@toradex.com>2017-08-31 19:57:39 -0700
commit8215b596c0b27598a8a36b82bc70b5e0202c3a90 (patch)
tree0a77810408eaebbf8950e9c76845aabe187dc267 /board
parent735d3a6c8eb0ed8891d7d6018297cb24eea1661c (diff)
colibri_imx6ull.c: setup all used uart to dte mode
Setup all UARTs in DTE mode, so that when Linux does the pinmuxing the data direction is already correct and no two outputs are working against each other. Make sure that with the switch also the UARTs' RI and DCD interrupts are masked. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'board')
-rw-r--r--board/toradex/colibri-imx6ull/colibri_imx6ull.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/board/toradex/colibri-imx6ull/colibri_imx6ull.c b/board/toradex/colibri-imx6ull/colibri_imx6ull.c
index bf8643fcb5..6e15362360 100644
--- a/board/toradex/colibri-imx6ull/colibri_imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri_imx6ull.c
@@ -188,8 +188,30 @@ static void setup_iomux_fec(void)
}
#endif
+/*
+ * UARTs are used in DTE mode, switch the mode on all UARTs before
+ * any pinmuxing connects a (DCE) output to a transceiver output.
+ */
+#define UCR3 0x88 /* FIFO Control Register */
+#define UCR3_RI (1<<8) /* RIDELT DTE mode */
+#define UCR3_DCD (1<<9) /* DCDDELT DTE mode */
+#define UFCR 0x90 /* FIFO Control Register */
+#define UFCR_DCEDTE (1<<6) /* DCE=0 */
+
+static void setup_dtemode_uart(void)
+{
+ setbits_le32((u32 *)(UART1_BASE + UFCR), UFCR_DCEDTE);
+ setbits_le32((u32 *)(UART2_BASE + UFCR), UFCR_DCEDTE);
+ setbits_le32((u32 *)(UART5_BASE + UFCR), UFCR_DCEDTE);
+
+ clrbits_le32((u32 *)(UART1_BASE + UCR3), UCR3_DCD | UCR3_RI);
+ clrbits_le32((u32 *)(UART2_BASE + UCR3), UCR3_DCD | UCR3_RI);
+ clrbits_le32((u32 *)(UART5_BASE + UCR3), UCR3_DCD | UCR3_RI);
+}
+
static void setup_iomux_uart(void)
{
+ setup_dtemode_uart();
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
}