#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */
#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */
+
+/* imx8 names these bitsfields instead: */
+#define UCR3_DTRDEN BIT(3) /* bit not used in this chip */
+#define UCR3_RXDMUXSEL BIT(2) /* RXD muxed input selected; 'should always be set' */
+
#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
#define UCR3_BPEN (1<<0) /* Preset registers enable */
#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
writel(UCR2_WS | UCR2_IRTS | UCR2_RXEN | UCR2_TXEN | UCR2_SRST,
&base->cr2);
+
+ /*
+ * setting the baudrate triggers a reset, returning cr3 to its
+ * reset value but UCR3_RXDMUXSEL "should always be set."
+ * according to the imx8 reference-manual
+ */
+ writel(readl(&base->cr3) | UCR3_RXDMUXSEL, &base->cr3);
+
writel(UCR1_UARTEN, &base->cr1);
}