u32 ts;
};
-static void _mxc_serial_init(struct mxc_uart *base)
+static void _mxc_serial_init(struct mxc_uart *base, int use_dte)
{
writel(0, &base->cr1);
writel(0, &base->cr2);
while (!(readl(&base->cr2) & UCR2_SRST));
+ if (use_dte)
+ writel(0x404 | UCR3_ADNIMP, &base->cr3);
+ else
+ writel(0x704 | UCR3_ADNIMP, &base->cr3);
+
writel(0x704 | UCR3_ADNIMP, &base->cr3);
writel(0x8000, &base->cr4);
writel(0x2b, &base->esc);
writel(UCR1_UARTEN, &base->cr1);
}
-#ifndef CONFIG_DM_SERIAL
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
#ifndef CONFIG_MXC_UART_BASE
#error "define CONFIG_MXC_UART_BASE to use the MXC UART driver"
*/
static int mxc_serial_init(void)
{
- _mxc_serial_init(mxc_base);
+ _mxc_serial_init(mxc_base, false);
serial_setbrg();
}
#endif
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
int mxc_serial_setbrg(struct udevice *dev, int baudrate)
{
{
struct mxc_serial_platdata *plat = dev->platdata;
- _mxc_serial_init(plat->reg);
+ _mxc_serial_init(plat->reg, plat->use_dte);
return 0;
}
}
static const struct udevice_id mxc_serial_ids[] = {
+ { .compatible = "fsl,imx6sx-uart" },
{ .compatible = "fsl,imx6ul-uart" },
{ .compatible = "fsl,imx7d-uart" },
{ .compatible = "fsl,imx6q-uart" },
#endif
.probe = mxc_serial_probe,
.ops = &mxc_serial_ops,
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
.flags = DM_FLAG_PRE_RELOC,
+#endif
};
#endif
{
struct mxc_uart *base = (struct mxc_uart *)CONFIG_DEBUG_UART_BASE;
- _mxc_serial_init(base);
+ _mxc_serial_init(base, false);
_mxc_serial_setbrg(base, CONFIG_DEBUG_UART_CLOCK,
CONFIG_BAUDRATE, false);
}