Line 19... |
Line 19... |
|
|
/* Prototypes */
|
/* Prototypes */
|
void uart_reset();
|
void uart_reset();
|
void uart_clock();
|
void uart_clock();
|
|
|
|
/* Definitions */
|
|
#define UART_ADDR_SPACE (8) /* UART memory address space size in bytes */
|
|
#define UART_RX_BUF (8192) /* VAPI should not send more that this amout of char before requesting something back */
|
|
#define UART_MAX_FIFO_LEN (16) /* rx FIFO for uart 16550 */
|
|
|
/* Registers */
|
/* Registers */
|
|
|
struct dev_16450 {
|
struct dev_16450 {
|
struct {
|
struct {
|
unsigned char txbuf;
|
unsigned char txbuf[UART_MAX_FIFO_LEN];
|
unsigned char rxbuf;
|
unsigned char rxbuf[UART_MAX_FIFO_LEN];
|
unsigned char dll;
|
unsigned char dll;
|
unsigned char dlh;
|
unsigned char dlh;
|
unsigned char ier;
|
unsigned char ier;
|
unsigned char iir;
|
unsigned char iir;
|
unsigned char lcr;
|
unsigned char lcr;
|
Line 36... |
Line 41... |
unsigned char lsr;
|
unsigned char lsr;
|
unsigned char msr;
|
unsigned char msr;
|
unsigned char scr;
|
unsigned char scr;
|
} regs; /* Visible registers */
|
} regs; /* Visible registers */
|
struct {
|
struct {
|
unsigned char txser;
|
unsigned long txser; /* Character just sending */
|
unsigned char rxser;
|
unsigned long rxser; /* Character just receiving */
|
unsigned char loopback;
|
unsigned char loopback;
|
} iregs; /* Internal registers */
|
} iregs; /* Internal registers */
|
struct {
|
struct {
|
unsigned char txser;
|
int txbuf_head;
|
unsigned char rxser;
|
int txbuf_tail;
|
unsigned char txbuf;
|
int rxbuf_head;
|
unsigned char rxbuf;
|
int rxbuf_tail;
|
|
unsigned int txser_full;
|
|
unsigned int rxser_full;
|
|
unsigned int txbuf_full;
|
|
unsigned int rxbuf_full;
|
unsigned char thre_int;
|
unsigned char thre_int;
|
unsigned long txser_clks;
|
unsigned long txser_clks;
|
unsigned long rxser_clks;
|
unsigned long rxser_clks;
|
} istat; /* Internal status */
|
} istat; /* Internal status */
|
|
|
unsigned long char_clks;
|
unsigned long char_clks;
|
|
|
|
/* Required by VAPI - circular buffer */
|
|
unsigned long vapi_buf[UART_RX_BUF]; /* Buffer to store incoming characters to,
|
|
since we cannot handle them so fast - we
|
|
are serial */
|
|
int vapi_buf_head_ptr; /* Where we write to */
|
|
int vapi_buf_tail_ptr; /* Where we read from */
|
|
|
|
/* Length of FIFO, 16 for 16550, 1 for 16450 */
|
|
int fifo_len;
|
|
|
|
/* Required by standard file streams */
|
FILE * rxfs;
|
FILE * rxfs;
|
FILE * txfs;
|
FILE * txfs;
|
unsigned long baseaddr;
|
|
};
|
};
|
|
|
/* Definitions */
|
|
#define FULL 1
|
|
#define EMPTY 0
|
|
#define UART_ADDR_SPACE 8 /* UART memory address space size in bytes */
|
|
|
|
/*
|
/*
|
* Addresses of visible registers
|
* Addresses of visible registers
|
*
|
*
|
*/
|
*/
|
#define UART_RXBUF 0 /* R: Rx buffer, DLAB=0 */
|
#define UART_RXBUF 0 /* R: Rx buffer, DLAB=0 */
|