minix/kernel/arch/earm/omap_serial.c
Kees Jongenburger 5d15ac7c20 arm:kernel simplify the in kernel serial.
Simplify the in kernel serial header to a minimum. The driver doing
the real handling is the tty driver.

Change-Id: I5d487d71a3d22906313aa8af5e9d84b0751a6868
2013-05-24 11:17:52 +02:00

23 lines
532 B
C

#include <sys/types.h>
#include <machine/cpu.h>
#include <io.h>
#include "omap_serial.h"
void omap3_ser_putc(char c)
{
int i;
/* Wait until FIFO's empty */
for (i = 0; i < 100000; i++)
if (mmio_read(OMAP3_DEBUG_UART_LSR) & OMAP3_LSR_THRE)
break;
/* Write character */
mmio_write(OMAP3_DEBUG_UART_THR, c);
/* And wait again until FIFO's empty to prevent TTY from overwriting */
for (i = 0; i < 100000; i++)
if (mmio_read(OMAP3_DEBUG_UART_LSR) & (OMAP3_LSR_THRE | OMAP3_LSR_TEMT))
break;
}