Kernel: busy wait until serial out has finished
This commit is contained in:
parent
aefc6db005
commit
87de141141
2 changed files with 8 additions and 2 deletions
|
@ -9,9 +9,14 @@ void omap3_ser_putc(char c)
|
||||||
|
|
||||||
/* Wait until FIFO's empty */
|
/* Wait until FIFO's empty */
|
||||||
for (i = 0; i < 100000; i++)
|
for (i = 0; i < 100000; i++)
|
||||||
if (mmio_read(OMAP3_UART3_LSR) & OMAP3_LSR_TX_FIFO_E)
|
if (mmio_read(OMAP3_UART3_LSR) & OMAP3_LSR_THRE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Write character */
|
/* Write character */
|
||||||
mmio_write(OMAP3_UART3_THR, c);
|
mmio_write(OMAP3_UART3_THR, c);
|
||||||
|
|
||||||
|
/* And wait again until FIFO's empty to prevent TTY from overwriting */
|
||||||
|
for (i = 0; i < 100000; i++)
|
||||||
|
if (mmio_read(OMAP3_UART3_LSR) & (OMAP3_LSR_THRE | OMAP3_LSR_TEMT))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
#define OMAP3_SSR 0x044 /* Supplementary status register */
|
#define OMAP3_SSR 0x044 /* Supplementary status register */
|
||||||
|
|
||||||
/* Line status register fields */
|
/* Line status register fields */
|
||||||
#define OMAP3_LSR_TX_FIFO_E (1 << 5) /* Transmit FIFO empty */
|
#define OMAP3_LSR_TEMT 0x40 /* Transmitter empty */
|
||||||
|
#define OMAP3_LSR_THRE 0x20 /* Transmit-hold-register empty */
|
||||||
|
|
||||||
/* Supplementary status register fields */
|
/* Supplementary status register fields */
|
||||||
#define OMAP3_SSR_TX_FIFO_FULL (1 << 0) /* Transmit FIFO full */
|
#define OMAP3_SSR_TX_FIFO_FULL (1 << 0) /* Transmit FIFO full */
|
||||||
|
|
Loading…
Reference in a new issue