Ignore:
Timestamp:
2010-07-27T20:13:05Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1720cf9
Parents:
a9b5b5f
Message:

Operate S3C24xx UART in FIFO mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c

    ra9b5b5f r3d9d948  
    5757#define S3C24XX_UTRSTAT_TX_EMPTY        0x4
    5858#define S3C24XX_UTRSTAT_RDATA           0x1
     59
     60/* Bits in UFSTAT register */
     61#define S3C24XX_UFSTAT_TX_FULL          0x4000
     62#define S3C24XX_UFSTAT_RX_FULL          0x0040
     63#define S3C24XX_UFSTAT_RX_COUNT         0x002f
    5964
    6065static irq_cmd_t uart_irq_cmds[] = {
     
    155160        (void) iid; (void) call;
    156161
    157         if ((pio_read_32(&uart->io->utrstat) & S3C24XX_UTRSTAT_RDATA) != 0) {
     162        while ((pio_read_32(&uart->io->ufstat) & S3C24XX_UFSTAT_RX_COUNT) != 0) {
    158163                uint32_t data = pio_read_32(&uart->io->urxh) & 0xff;
     164                pio_read_32(&uart->io->uerstat);
    159165
    160166                if (uart->client_phone != -1) {
     
    206212static void s3c24xx_uart_sendb(s3c24xx_uart_t *uart, uint8_t byte)
    207213{
    208         /* Wait for transmitter to be empty. */
    209         while ((pio_read_32(&uart->io->utrstat) & S3C24XX_UTRSTAT_TX_EMPTY) == 0)
     214        /* Wait for space becoming available in Tx FIFO. */
     215        while ((pio_read_32(&uart->io->ufstat) & S3C24XX_UFSTAT_TX_FULL) != 0)
    210216                ;
    211217
Note: See TracChangeset for help on using the changeset viewer.