source: rtems/c/src/lib/libbsp/powerpc/ppcn_60x/console/ns16550_p.h @ 0c04c377

4.104.114.84.95
Last change on this file since 0c04c377 was 0c04c377, checked in by Joel Sherrill <joel.sherrill@…>, on 02/18/99 at 16:48:14

./clock/Makefile.in,v
./clock/clock.c,v
./console/Makefile.in,v
./console/config.c,v
./console/console.c,v
./console/console.h,v
./console/debugio.c,v
./console/i8042.c,v
./console/i8042_p.h,v
./console/i8042vga.c,v
./console/i8042vga.h,v
./console/ns16550.c,v
./console/ns16550.h,v
./console/ns16550_p.h,v
./console/ns16550cfg.c,v
./console/ns16550cfg.h,v
./console/vga.c,v
./console/vga_p.h,v
./console/z85c30.c,v
./console/z85c30.h,v
./console/z85c30_p.h,v
./console/z85c30cfg.c,v
./console/z85c30cfg.h,v
./include/Makefile.in,v
./include/bsp.h,v
./include/chain.h,v
./include/coverhd.h,v
./include/extisrdrv.h,v
./include/nvram.h,v
./include/pci.h,v
./include/tod.h,v
./network/Makefile.in,v
./network/amd79c970.c,v
./network/amd79c970.h,v
./nvram/Makefile.in,v
./nvram/ds1385.h,v
./nvram/mk48t18.h,v
./nvram/nvram.c,v
./nvram/prepnvr.h,v
./nvram/stk11c68.h,v
./pci/Makefile.in,v
./pci/pci.c,v
./start/Makefile.in,v
./start/start.s,v
./startup/Makefile.in,v
./startup/bspclean.c,v
./startup/bspstart.c,v
./startup/bsptrap.s,v
./startup/device-tree,v
./startup/genpvec.c,v
./startup/linkcmds,v
./startup/rtems-ctor.cc,v
./startup/sbrk.c,v
./startup/setvec.c,v
./startup/spurious.c,v
./startup/swap.c,v
./timer/Makefile.in,v
./timer/timer.c,v
./tod/Makefile.in,v
./tod/cmos.h,v
./tod/tod.c,v
./universe/Makefile.in,v
./universe/universe.c,v
./vectors/Makefile.in,v
./vectors/README,v
./vectors/align_h.s,v
./vectors/vectors.s,v
./wrapup/Makefile.in,v
./Makefile.in,v
./README,v
./STATUS,v
./bsp_specs,v

  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1998 by Radstone Technology
3 *
4 *
5 * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY
6 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
7 * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
8 * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU.
9 *
10 * You are hereby granted permission to use, copy, modify, and distribute
11 * this file, provided that this notice, plus the above copyright notice
12 * and disclaimer, appears in all copies. Radstone Technology will provide
13 * no support for this code.
14 *
15 */
16
17#ifndef _NS16550_P_H_
18#define _NS16550_P_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23/*
24 * Define serial port read registers structure.
25 */
26
27typedef volatile struct _SP_READ_REGISTERS {
28    unsigned char ReceiveBuffer;
29    unsigned char InterruptEnable;
30    unsigned char InterruptId;
31    unsigned char LineControl;
32    unsigned char ModemControl;
33    unsigned char LineStatus;
34    unsigned char ModemStatus;
35    unsigned char ScratchPad;
36} SP_READ_REGISTERS, *PSP_READ_REGISTERS;
37
38/*
39 * Define serial port write registers structure.
40 */
41
42typedef volatile struct _SP_WRITE_REGISTERS {
43    unsigned char TransmitBuffer;
44    unsigned char InterruptEnable;
45    unsigned char FifoControl;
46    unsigned char LineControl;
47    unsigned char ModemControl;
48    unsigned char Reserved1;
49    unsigned char ModemStatus;
50    unsigned char ScratchPad;
51} SP_WRITE_REGISTERS, *PSP_WRITE_REGISTERS;
52
53/*
54 * Define serial port interrupt enable register structure.
55 */
56
57#define SP_INT_RX_ENABLE        0x01
58#define SP_INT_TX_ENABLE        0x02
59#define SP_INT_LS_ENABLE        0x04
60#define SP_INT_MS_ENABLE        0x08
61
62/*
63 * Define serial port interrupt id register structure.
64 */
65
66typedef struct _SP_INTERRUPT_ID {
67    unsigned char InterruptPending : 1;
68    unsigned char Identification : 3;
69    unsigned char Reserved1 : 2;
70    unsigned char FifoEnabled : 2;
71} SP_INTERRUPT_ID, *PSP_INTERRUPT_ID;
72
73/*
74 * Define serial port fifo control register structure.
75 */
76#define SP_FIFO_ENABLE  0x01
77#define SP_FIFO_RXRST   0x02
78#define SP_FIFO_TXRST   0x04
79#define SP_FIFO_DMA             0x08
80#define SP_FIFO_RXLEVEL 0xc0
81
82/*
83 * Define serial port line control register structure.
84 */
85#define SP_LINE_SIZE    0x03
86#define SP_LINE_STOP    0x04
87#define SP_LINE_PAR             0x08
88#define SP_LINE_ODD             0x10
89#define SP_LINE_STICK   0x20
90#define SP_LINE_BREAK   0x40
91#define SP_LINE_DLAB    0x80
92
93/*
94 * Line status register character size definitions.
95 */
96#define FIVE_BITS 0x0                   /* five bits per character */
97#define SIX_BITS 0x1                    /* six bits per character */
98#define SEVEN_BITS 0x2                  /* seven bits per character */
99#define EIGHT_BITS 0x3                  /* eight bits per character */
100
101/*
102 * Line speed divisor definition.
103 */
104#define NS16550_Baud(baud_rate) (115200/baud_rate)
105
106/*
107 * Define serial port modem control register structure.
108 */
109#define SP_MODEM_DTR    0x01
110#define SP_MODEM_RTS    0x02
111#define SP_MODEM_IRQ    0x08
112#define SP_MODEM_LOOP   0x10
113#define SP_MODEM_DIV4   0x80
114
115/*
116 * Define serial port line status register structure.
117 */
118#define SP_LSR_RDY              0x01
119#define SP_LSR_EOVRUN   0x02
120#define SP_LSR_EPAR             0x04
121#define SP_LSR_EFRAME   0x08
122#define SP_LSR_BREAK    0x10
123#define SP_LSR_THOLD    0x20
124#define SP_LSR_TX               0x40
125#define SP_LSR_EFIFO    0x80
126
127typedef struct _ns16550_context
128{
129        unsigned8       ucModemCtrl;
130} ns16550_context;
131
132/*
133 * Driver functions
134 */
135static boolean ns16550_probe(int minor);
136
137static void ns16550_init(int minor);
138
139static int ns16550_open(
140        int     major,
141        int     minor,
142        void    * arg
143);
144
145static int ns16550_close(
146        int     major,
147        int     minor,
148        void    * arg
149);
150
151static void ns16550_write_polled(
152        int   minor,
153        char  cChar
154);
155
156static void ns16550_assert_RTS(
157        int minor
158);
159
160static void ns16550_negate_RTS(
161        int minor
162);
163
164static void ns16550_assert_DTR(
165        int minor
166);
167
168static void ns16550_negate_DTR(
169        int minor
170);
171
172static void ns16550_initialize_interrupts(int minor);
173
174static int ns16550_flush(int major, int minor, void *arg);
175
176static int ns16550_write_support_int(
177        int   minor,
178        const char *buf,
179        int   len
180);
181
182static int ns16550_write_support_polled(
183        int   minor,
184        const char *buf,
185        int   len
186        );
187
188static int ns16550_inbyte_nonblocking_polled(
189        int minor
190);
191
192#ifdef __cplusplus
193}
194#endif
195
196#endif /* _NS16550_P_H_ */
Note: See TracBrowser for help on using the repository browser.