Ignore:
Timestamp:
2010-11-26T20:08:10Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
45df59a
Parents:
fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

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

    rfb150d78 r46c20c8  
    2727 */
    2828
    29 /** @addtogroup libcmips32
     29/** @addtogroup genarch
    3030 * @{
    3131 */
    32 /** @file
     32/**
     33 * @file
     34 * @brief Samsung S3C24xx on-chip UART driver.
    3335 */
    3436
    35 #ifndef LIBC_mips32__ISTATE_H_
    36 #define LIBC_mips32__ISTATE_H_
     37#ifndef S3C24XX_UART_H_
     38#define S3C24XX_UART_H_
    3739
    3840#include <sys/types.h>
    3941
    40 /** Interrupt context.
    41  *
    42  * This is a copy of the kernel definition with which it must be kept in sync.
    43  */
    44 typedef struct istate {
    45         uint32_t at;
    46         uint32_t v0;
    47         uint32_t v1;
    48         uint32_t a0;
    49         uint32_t a1;
    50         uint32_t a2;
    51         uint32_t a3;
    52         uint32_t t0;
    53         uint32_t t1;
    54         uint32_t t2;
    55         uint32_t t3;
    56         uint32_t t4;
    57         uint32_t t5;
    58         uint32_t t6;
    59         uint32_t t7;
    60         uint32_t t8;
    61         uint32_t t9;
    62         uint32_t gp;
    63         uint32_t sp;
    64         uint32_t ra;
     42/** S3C24xx UART I/O */
     43typedef struct {
     44        uint32_t ulcon;
     45        uint32_t ucon;
     46        uint32_t ufcon;
     47        uint32_t umcon;
    6548
    66         uint32_t lo;
    67         uint32_t hi;
     49        uint32_t utrstat;
     50        uint32_t uerstat;
     51        uint32_t ufstat;
     52        uint32_t umstat;
    6853
    69         uint32_t status; /* cp0_status */
    70         uint32_t epc; /* cp0_epc */
    71         uint32_t k1; /* We use it as thread-local pointer */
    72 } istate_t;
     54        uint32_t utxh;
     55        uint32_t urxh;
    7356
    74 static inline uintptr_t istate_get_pc(istate_t *istate)
    75 {
    76         return istate->epc;
    77 }
     57        uint32_t ubrdiv;
     58} s3c24xx_uart_io_t;
    7859
    79 static inline uintptr_t istate_get_fp(istate_t *istate)
    80 {
    81         /* TODO */
    82         return 0;
    83 }
     60/* Bits in UTRSTAT register */
     61#define S3C24XX_UTRSTAT_TX_EMPTY        0x4
     62#define S3C24XX_UTRSTAT_RDATA           0x1
     63
     64/* Bits in UFSTAT register */
     65#define S3C24XX_UFSTAT_TX_FULL          0x4000
     66#define S3C24XX_UFSTAT_RX_FULL          0x0040
     67#define S3C24XX_UFSTAT_RX_COUNT         0x002f
     68
     69/* Bits in UCON register */
     70#define UCON_RX_INT_LEVEL               0x100
     71
     72/* Bits in UFCON register */
     73#define UFCON_TX_FIFO_TLEVEL_EMPTY      0x00
     74#define UFCON_RX_FIFO_TLEVEL_1B         0x00
     75#define UFCON_FIFO_ENABLE               0x01
     76
     77
     78/** S3C24xx UART instance */
     79typedef struct {
     80        /** Physical device address */
     81        uintptr_t paddr;
     82
     83        /** Device I/O structure */
     84        s3c24xx_uart_io_t *io;
     85
     86        /** Callback phone to the client */
     87        int client_phone;
     88
     89        /** Device handle */
     90        devmap_handle_t devmap_handle;
     91} s3c24xx_uart_t;
    8492
    8593#endif
Note: See TracChangeset for help on using the changeset viewer.