1 /* $NetBSD: dcareg.h,v 1.1.4.3 2004/09/21 13:15:27 skrll Exp $ */
4 * Copyright (c) 1982, 1986, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * @(#)dcareg.h 8.1 (Berkeley) 6/10/93
34 #include <hp300/dev/iotypes.h> /* XXX */
39 vu_char dca_pad
[0x800-1];
40 vu_char dca_data
; /* receive buf or xmit hold */
41 vu_char dca_ier
; /* interrupt enable */
42 vu_char dca_iir
; /* (RO) interrupt identify */
43 #define dca_fifo dca_iir /* (WO) FIFO control */
44 vu_char dca_cfcr
; /* line control */
45 vu_char dca_mcr
; /* modem control */
46 vu_char dca_lsr
; /* line status */
47 vu_char dca_msr
; /* modem status */
48 vu_char dca_scr
; /* scratch pad */
54 vu_char dca_id
; /* 0x01 (read) */
55 #define dca_reset dca_id /* 0x01 (write) */
57 vu_char dca_ic
; /* 0x03 */
59 vu_char dca_ocbrc
; /* 0x05 */
61 vu_char dca_lcsm
; /* 0x07 */
65 vu_char dca_data
; /* 0x11 */
67 vu_char dca_ier
; /* 0x13 */
69 vu_char dca_iir
; /* 0x15 (read) */
70 #define dca_fifo dca_iir /* 0x15 (write) */
72 vu_char dca_cfcr
; /* 0x17 */
74 vu_char dca_mcr
; /* 0x19 */
76 vu_char dca_lsr
; /* 0x1B */
78 vu_char dca_msr
; /* 0x1D */
82 /* interface reset/id (300 only) */
84 #define DCAREMID0 0x82
86 #define DCAREMID1 0xC2
88 /* interrupt control (300 only) */
89 #define DCAIPL(x) ((((x) >> 4) & 3) + 3)
94 * 16 bit baud rate divisor (lower byte in dca_data, upper in dca_ier)
95 * NB: This constant is for a 7.3728 clock frequency. The 300 clock
96 * frequency is 2.4576, giving a constant of 153600.
99 #define DCABRD(x) (153600 / (x))
102 #define DCABRD(x) (460800 / (x))
105 /* interrupt enable register */
106 #define IER_ERXRDY 0x1
107 #define IER_ETXRDY 0x2
111 /* interrupt identification register */
112 #define IIR_IMASK 0xf
113 #define IIR_RXTOUT 0xc
115 #define IIR_RXRDY 0x4
116 #define IIR_TXRDY 0x2
117 #define IIR_NOPEND 0x1
119 #define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */
121 /* fifo control register */
122 #define FIFO_ENABLE 0x01
123 #define FIFO_RCV_RST 0x02
124 #define FIFO_XMT_RST 0x04
125 #define FIFO_DMA_MODE 0x08
126 #define FIFO_TRIGGER_1 0x00
127 #define FIFO_TRIGGER_4 0x40
128 #define FIFO_TRIGGER_8 0x80
129 #define FIFO_TRIGGER_14 0xc0
131 /* character format control register */
132 #define CFCR_DLAB 0x80
133 #define CFCR_SBREAK 0x40
134 #define CFCR_PZERO 0x30
135 #define CFCR_PONE 0x20
136 #define CFCR_PEVEN 0x10
137 #define CFCR_PODD 0x00
138 #define CFCR_PENAB 0x08
139 #define CFCR_STOPB 0x04
140 #define CFCR_8BITS 0x03
141 #define CFCR_7BITS 0x02
142 #define CFCR_6BITS 0x01
143 #define CFCR_5BITS 0x00
145 /* modem control register */
146 #define MCR_LOOPBACK 0x10
152 /* line status register */
153 #define LSR_RCV_FIFO 0x80
154 #define LSR_TSRE 0x40
155 #define LSR_TXRDY 0x20
160 #define LSR_RXRDY 0x01
161 #define LSR_RCV_MASK 0x1f
163 /* modem status register */
168 #define MSR_DDCD 0x08
169 #define MSR_TERI 0x04
170 #define MSR_DDSR 0x02
171 #define MSR_DCTS 0x01