summaryrefslogtreecommitdiff
path: root/drivers/serial/ns16550.c
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2018-08-27 15:55:24 +0530
committerTom Rini <trini@konsulko.com>2018-09-10 21:19:32 -0400
commit5d754197a745f0496935dbdcca775d8e3e7ffce8 (patch)
tree709fe640f6269c7941ad39648451b12ce2a27042 /drivers/serial/ns16550.c
parent8a86152db049f3df3f04e1112d7fe18f718c7d04 (diff)
serial: omap: Introduce DM specific omap serial
Add driver model support for OMAP_SERIAL while reusing the functions in ns16550.c Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Derald D. Woods <woods.technical@gmail.com>
Diffstat (limited to 'drivers/serial/ns16550.c')
-rw-r--r--drivers/serial/ns16550.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 9c80090aa7..f9041aa626 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -175,7 +175,7 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
;
serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
-#if defined(CONFIG_ARCH_OMAP2PLUS)
+#if defined(CONFIG_ARCH_OMAP2PLUS) || defined(CONFIG_OMAP_SERIAL)
serial_out(0x7, &com_port->mdr1); /* mode select reset TL16C750*/
#endif
@@ -183,7 +183,8 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
serial_out(ns16550_getfcr(com_port), &com_port->fcr);
if (baud_divisor != -1)
NS16550_setbrg(com_port, baud_divisor);
-#if defined(CONFIG_ARCH_OMAP2PLUS) || defined(CONFIG_SOC_DA8XX)
+#if defined(CONFIG_ARCH_OMAP2PLUS) || defined(CONFIG_SOC_DA8XX) || \
+ defined(CONFIG_OMAP_SERIAL)
/* /16 is proper to hit 115200 with 48MHz */
serial_out(0, &com_port->mdr1);
#endif
@@ -279,42 +280,6 @@ DEBUG_UART_FUNCS
#endif
-#ifdef CONFIG_DEBUG_UART_OMAP
-
-#include <debug_uart.h>
-
-static inline void _debug_uart_init(void)
-{
- struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
- int baud_divisor;
-
- baud_divisor = ns16550_calc_divisor(com_port, CONFIG_DEBUG_UART_CLOCK,
- CONFIG_BAUDRATE);
- serial_dout(&com_port->ier, CONFIG_SYS_NS16550_IER);
- serial_dout(&com_port->mdr1, 0x7);
- serial_dout(&com_port->mcr, UART_MCRVAL);
- serial_dout(&com_port->fcr, UART_FCR_DEFVAL);
-
- serial_dout(&com_port->lcr, UART_LCR_BKSE | UART_LCRVAL);
- serial_dout(&com_port->dll, baud_divisor & 0xff);
- serial_dout(&com_port->dlm, (baud_divisor >> 8) & 0xff);
- serial_dout(&com_port->lcr, UART_LCRVAL);
- serial_dout(&com_port->mdr1, 0x0);
-}
-
-static inline void _debug_uart_putc(int ch)
-{
- struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
-
- while (!(serial_din(&com_port->lsr) & UART_LSR_THRE))
- ;
- serial_dout(&com_port->thr, ch);
-}
-
-DEBUG_UART_FUNCS
-
-#endif
-
#ifdef CONFIG_DM_SERIAL
static int ns16550_serial_putc(struct udevice *dev, const char ch)
{
@@ -489,12 +454,6 @@ static const struct udevice_id ns16550_serial_ids[] = {
{ .compatible = "ingenic,jz4780-uart", .data = PORT_JZ4780 },
{ .compatible = "nvidia,tegra20-uart", .data = PORT_NS16550 },
{ .compatible = "snps,dw-apb-uart", .data = PORT_NS16550 },
- { .compatible = "ti,omap2-uart", .data = PORT_NS16550 },
- { .compatible = "ti,omap3-uart", .data = PORT_NS16550 },
- { .compatible = "ti,omap4-uart", .data = PORT_NS16550 },
- { .compatible = "ti,am3352-uart", .data = PORT_NS16550 },
- { .compatible = "ti,am4372-uart", .data = PORT_NS16550 },
- { .compatible = "ti,dra742-uart", .data = PORT_NS16550 },
{}
};
#endif /* OF_CONTROL && !OF_PLATDATA */