OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [char/] [68332serial.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* 68332serial.h: Definitions for the mc68332 serial driver.
2
 *
3
 * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
4
 *                     D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
5
 *                     The Silver Hammer Group, Ltd.
6
 *
7
 * Based on 68328serial.h
8
 *
9
 */
10
#ifndef _MC683XX_SERIAL_H
11
#define _MC683XX_SERIAL_H
12
 
13
#include <linux/config.h>
14
 
15
struct serial_struct {
16
        int     type;
17
        int     line;
18
        int     port;
19
        int     irq;
20
        int     flags;
21
        int     xmit_fifo_size;
22
        int     custom_divisor;
23
        int     baud_base;
24
        unsigned short  close_delay;
25
        char    reserved_char[2];
26
        int     hub6;  /* FIXME: We don't have AT&T Hub6 boards! */
27
        unsigned short  closing_wait; /* time to wait before closing */
28
        unsigned short  closing_wait2; /* no longer used... */
29
        int     reserved[4];
30
};
31
 
32
/*
33
 * For the close wait times, 0 means wait forever for serial port to
34
 * flush its output.  65535 means don't wait at all.
35
 */
36
#define S_CLOSING_WAIT_INF      0
37
#define S_CLOSING_WAIT_NONE     65535
38
 
39
/*
40
 * Definitions for S_struct (and serial_struct) flags field
41
 */
42
#define S_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes 
43
                                   on the callout port */
44
#define S_FOURPORT  0x0002      /* Set OU1, OUT2 per AST Fourport settings */
45
#define S_SAK   0x0004  /* Secure Attention Key (Orange book) */
46
#define S_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
47
 
48
#define S_SPD_MASK      0x0030
49
#define S_SPD_HI        0x0010  /* Use 56000 instead of 38400 bps */
50
 
51
#define S_SPD_VHI       0x0020  /* Use 115200 instead of 38400 bps */
52
#define S_SPD_CUST      0x0030  /* Use user-specified divisor */
53
 
54
#define S_SKIP_TEST     0x0040 /* Skip UART test during autoconfiguration */
55
#define S_AUTO_IRQ  0x0080 /* Do automatic IRQ during autoconfiguration */
56
#define S_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
57
#define S_PGRP_LOCKOUT    0x0200 /* Lock out cua opens based on pgrp */
58
#define S_CALLOUT_NOHUP   0x0400 /* Don't do hangups for cua device */
59
 
60
#define S_FLAGS 0x0FFF  /* Possible legal S flags */
61
#define S_USR_MASK 0x0430       /* Legal flags that non-privileged
62
                                 * users can set or reset */
63
 
64
/* Internal flags used only by kernel/chr_drv/serial.c */
65
#define S_INITIALIZED   0x80000000 /* Serial port was initialized */
66
#define S_CALLOUT_ACTIVE        0x40000000 /* Call out device is active */
67
#define S_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
68
#define S_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */
69
#define S_CLOSING               0x08000000 /* Serial port is closing */
70
#define S_CTS_FLOW              0x04000000 /* Do CTS flow control */
71
#define S_CHECK_CD              0x02000000 /* i.e., CLOCAL */
72
 
73
/* Software state per channel */
74
 
75
#ifdef __KERNEL__
76
/*
77
 * This is our internal structure for each serial port's state.
78
 *
79
 * Many fields are paralleled by the structure used by the serial_struct
80
 * structure.
81
 *
82
 * For definitions of the flags field, see tty.h
83
 */
84
 
85
struct m68k_serial {
86
        char soft_carrier;  /* Use soft carrier on this channel */
87
        char break_abort;   /* Is serial console in, so process brk/abrt */
88
#if 0
89
        char cons_keyb;     /* Channel runs the keyboard */
90
        char cons_mouse;    /* Channel runs the mouse */
91
        char kgdb_channel;  /* Kgdb is running on this channel */
92
#endif
93
        char is_cons;       /* Is this our console. */
94
 
95
        /* We need to know the current clock divisor
96
         * to read the bps rate the chip has currently
97
         * loaded.
98
         */
99
        unsigned char clk_divisor;  /* May be 1, 16, 32, or 64 */
100
        int baud;
101
        int                     magic;
102
        int                     baud_base;
103
        int                     port;
104
        int                     irq;
105
        int                     flags;          /* defined in tty.h */
106
        int                     type;           /* UART type */
107
        struct tty_struct       *tty;
108
        int                     read_status_mask;
109
        int                     ignore_status_mask;
110
        int                     timeout;
111
        int                     xmit_fifo_size;
112
        int                     custom_divisor;
113
        int                     x_char; /* xon/xoff character */
114
        int                     close_delay;
115
        unsigned short          closing_wait;
116
        unsigned short          closing_wait2;
117
        unsigned long           event;
118
        unsigned long           last_active;
119
        int                     line;
120
        int                     count;      /* # of fd on device */
121
        int                     blocked_open; /* # of blocked opens */
122
        long                    session; /* Session of opening process */
123
        long                    pgrp; /* pgrp of opening process */
124
        unsigned char           *xmit_buf;
125
        int                     xmit_head;
126
        int                     xmit_tail;
127
        int                     xmit_cnt;
128
        struct tq_struct        tqueue;
129
        struct tq_struct        tqueue_hangup;
130
        struct termios          normal_termios;
131
        struct termios          callout_termios;
132
        struct wait_queue       *open_wait;
133
        struct wait_queue       *close_wait;
134
};
135
 
136
 
137
#define SERIAL_MAGIC 0x5301
138
 
139
/*
140
 * The size of the serial xmit buffer is 1 page, or 4096 bytes
141
 */
142
#define SERIAL_XMIT_SIZE 4096
143
 
144
/*
145
 * Events are used to schedule things to happen at timer-interrupt
146
 * time, instead of at rs interrupt time.
147
 */
148
#define RS_EVENT_WRITE_WAKEUP   0
149
 
150
#endif /* __KERNEL__ */
151
 
152
#ifdef CONFIG_M68332
153
 
154
 
155
#define BASE 0xfffff900
156
#define VSP(X) (*(volatile unsigned short *)(X))
157
#define VCP(X) (*(volatile unsigned char *)(X))
158
 
159
 
160
#define SYNCR VSP(0xfffa04)
161
#define QILR VSP(0xfffc04)
162
#define QSMCR VSP(0xfffc00)
163
 
164
#define SCCR0 VSP(0xfffc08)
165
 
166
 
167
 
168
#define SCCR1 VSP(0xfffc0a)
169
#define SCCR1_LOOPS (1<<14)
170
#define SCCR1_WOMS (1<<13)
171
#define SCCR1_ILT (1<<12)
172
#define SCCR1_PT (1<<11)
173
#define SCCR1_PE (1<<10)
174
#define SCCR1_M (1<<9)
175
#define SCCR1_WAKE (1<<8)
176
#define SCCR1_TIE (1<<7)
177
#define SCCR1_TCIE (1<<6)
178
#define SCCR1_RIE (1<<5)
179
#define SCCR1_ILIE (1<<4)
180
#define SCCR1_TE (1<<3)
181
#define SCCR1_RE (1<<2)
182
#define SCCR1_RWU (1<<1)
183
#define SCCR1_SBK (1<<0)
184
 
185
#define SCSR  VSP(0xfffc0c)
186
#define SCSR_TDRE (1<<8)
187
#define SCSR_TC  (1<<7)
188
#define SCSR_RDRF (1<<6)
189
#define SCSR_RAF (1<<5)
190
#define SCSR_IDLE (1<<4)
191
#define SCSR_OR (1<<3)
192
#define SCSR_NF (1<<2)
193
#define SCSR_FE (1<<1)
194
#define SCSR_PF (1<<0)
195
 
196
#define SCDR  VSP(0xfffC0e)
197
 
198
#define FREF 32768
199
 
200
#endif
201
 
202
#endif /* !(_MC683XX_SERIAL_H) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.