xref: /netbsd/sys/dev/qbus/dlreg.h (revision bf9ec67e)
1 /*	$NetBSD: dlreg.h,v 1.4 2000/05/14 09:46:17 bjh21 Exp $	*/
2 /*
3  * Ben Harris, 1997
4  *
5  * This file is in the Public Domain.
6  */
7 /*
8  * dlreg.h -- Definitions for the DL11 and DLV11 serial cards.
9  *
10  * Style in imitation of dzreg.h.
11  */
12 
13 #ifdef notdef
14 union w_b
15 {
16 	u_short word;
17 	struct {
18 		u_char byte_lo;
19 		u_char byte_hi;
20 	} bytes;
21 };
22 
23 struct DLregs
24 {
25 	volatile u_short dl_rcsr; /* Receive Control/Status Register (R/W) */
26 	volatile u_short dl_rbuf; /* Receive Buffer (R) */
27 	volatile u_short dl_xcsr; /* Transmit Control/Status Register (R/W) */
28 	volatile union w_b u_xbuf; /* Transmit Buffer (W) */
29 #define dl_xbuf u_xbuf.bytes.byte_lo
30 };
31 
32 typedef struct DLregs dlregs;
33 #endif
34 
35 #define	DL_UBA_RCSR	0
36 #define	DL_UBA_RBUF	2
37 #define	DL_UBA_XCSR	4
38 #define	DL_UBA_XBUFL	6
39 
40 /* RCSR bits */
41 
42 #define DL_RCSR_RX_DONE		0x0080 /* Receiver Done (R) */
43 #define DL_RCSR_RXIE		0x0040 /* Receiver Interrupt Enable (R/W) */
44 #define DL_RCSR_READER_ENABLE	0x0001 /* [paper-tape] Reader Enable (W) */
45 #define DL_RCSR_BITS		"\20\1READER_ENABLE\7RXIE\10RX_DONE\n"
46 
47 /* RBUF bits */
48 
49 #define DL_RBUF_ERR		0x8000 /* Error (R) */
50 #define DL_RBUF_OVERRUN_ERR	0x4000 /* Overrun Error (R) */
51 #define DL_RBUF_FRAMING_ERR	0x2000 /* Framing Error (R) */
52 #define DL_RBUF_PARITY_ERR	0x1000 /* Parity Error (R) */
53 #define DL_RBUF_DATA_MASK	0x00FF /* Receive Data (R) */
54 #define DL_RBUF_BITS	"\20\15PARITY_ERR\16FRAMING_ERR\17OVERRUN_ERR\20ERR\n"
55 
56 /* XCSR bits */
57 
58 #define DL_XCSR_TX_READY	0x0080 /* Transmitter Ready (R) */
59 #define DL_XCSR_TXIE		0x0040 /* Transmit Interrupt Enable (R/W) */
60 #define DL_XCSR_TX_BREAK	0x0001 /* Transmit Break (R/W) */
61 #define DL_XCSR_BITS		"\20\1TX_BREAK\7TXIE\10TX_READY\n"
62 
63 /* XBUF is just data byte right justified. */
64