bppreg.h revision 1.1 1 1.1 pk /* $NetBSD: bppreg.h,v 1.1 1998/09/21 21:20:48 pk Exp $ */
2 1.1 pk
3 1.1 pk /*-
4 1.1 pk * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 1.1 pk * All rights reserved.
6 1.1 pk *
7 1.1 pk * This code is derived from software contributed to The NetBSD Foundation
8 1.1 pk * by Paul Kranenburg.
9 1.1 pk *
10 1.1 pk * Redistribution and use in source and binary forms, with or without
11 1.1 pk * modification, are permitted provided that the following conditions
12 1.1 pk * are met:
13 1.1 pk * 1. Redistributions of source code must retain the above copyright
14 1.1 pk * notice, this list of conditions and the following disclaimer.
15 1.1 pk * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 pk * notice, this list of conditions and the following disclaimer in the
17 1.1 pk * documentation and/or other materials provided with the distribution.
18 1.1 pk * 3. All advertising materials mentioning features or use of this software
19 1.1 pk * must display the following acknowledgement:
20 1.1 pk * This product includes software developed by the NetBSD
21 1.1 pk * Foundation, Inc. and its contributors.
22 1.1 pk * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 pk * contributors may be used to endorse or promote products derived
24 1.1 pk * from this software without specific prior written permission.
25 1.1 pk *
26 1.1 pk * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 pk * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 pk * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 pk * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 pk * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 pk * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 pk * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 pk * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 pk * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 pk * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 pk * POSSIBILITY OF SUCH DAMAGE.
37 1.1 pk */
38 1.1 pk
39 1.1 pk /* Hardware Configuration Register */
40 1.1 pk #define BPP_HCR_DSS_MASK 0x003f /* Data before strobe */
41 1.1 pk #define BPP_HCR_DSS_SHFT 0 /* (in Sbus clocks)*/
42 1.1 pk #define BPP_HCR_DSW_MASK 0x7f00 /* Data Strobe Width */
43 1.1 pk #define BPP_HCR_DSW_SHFT 8 /* (in Sbus clocks)*/
44 1.1 pk #define BPP_HCR_TEST 0x8000 /* */
45 1.1 pk #define BPP_HCR_BITS "\177\020" \
46 1.1 pk "f\0\6DSS\0f\10\7DSW\0b\17TEST\0"
47 1.1 pk
48 1.1 pk
49 1.1 pk /* Operation Configuration Register */
50 1.1 pk #define BPP_OCR_IDLE 0x0008 /* State machines are idle */
51 1.1 pk #define BPP_OCR_SRST 0x0080 /* Reset bit */
52 1.1 pk #define BPP_OCR_ACK_OP 0x0100 /* ACK handshake operation */
53 1.1 pk #define BPP_OCR_BUSY_OP 0x0200 /* BUSY handshake operation */
54 1.1 pk #define BPP_OCR_EN_DIAG 0x0400 /* */
55 1.1 pk #define BPP_OCR_ACK_DSEL 0x0800 /* ack line is bidirectional */
56 1.1 pk #define BPP_OCR_BUSY_DSEL 0x1000 /* busy line is bidirectional */
57 1.1 pk #define BPP_OCR_DS_DSEL 0x2000 /* data strobe line is bidirectional */
58 1.1 pk #define BPP_OCR_DATA_SRC 0x4000 /* Data source for `memory clear' */
59 1.1 pk #define BPP_OCR_MEM_SRC 0x8000 /* Enable `memory clear' */
60 1.1 pk #define BPP_OCR_BITS "\177\020" \
61 1.1 pk "b\3IDLE\0b\7SRST\0b\10ACK_OP\0b\11BUSY_OP\0" \
62 1.1 pk "b\12EN_DIAG\0b\13ACK_DSEL\0b\14BUSY_DSEL\0" \
63 1.1 pk "b\15DS_DSEL\0b\16DATA_SRC\0b\17MEM_SRC\0"
64 1.1 pk /* User settable bits */
65 1.1 pk #define BPP_OCR_USER \
66 1.1 pk (BPP_OCR_ACK_OP|BPP_OCR_BUSY_OP|BPP_OCR_ACK_DSEL|\
67 1.1 pk BPP_OCR_BUSY_DSEL|BPP_OCR_DS_DSEL)
68 1.1 pk
69 1.1 pk /* Transfer Control Register */
70 1.1 pk #define BPP_TCR_DS 0x01 /* Data Strobe */
71 1.1 pk #define BPP_TCR_ACK 0x02 /* Acknowledge */
72 1.1 pk #define BPP_TCR_BUSY 0x04 /* Busy */
73 1.1 pk #define BPP_TCR_DIR 0x08 /* Direction control */
74 1.1 pk #define BPP_TCR_BITS "\177\020" \
75 1.1 pk "b\0DS\0b\1ACK\0b\2BUSY\0b\3DIR\0"
76 1.1 pk #define BPP_TCR_USER (BPP_TCR_DS|BPP_TCR_ACK|BPP_TCR_BUSY)
77 1.1 pk
78 1.1 pk /* Output Register */
79 1.1 pk #define BPP_OR_SLCTIN 0x01 /* Select */
80 1.1 pk #define BPP_OR_AFXN 0x02 /* Auto Feed */
81 1.1 pk #define BPP_OR_INIT 0x04 /* Initialize */
82 1.1 pk #define BPP_OR_BITS "\177\020" \
83 1.1 pk "b\0SLCTIN\0b\1AFXN\0b\2INIT\0"
84 1.1 pk #define BPP_OR_USER (BPP_OR_SLCTIN|BPP_OR_AFXN)
85 1.1 pk
86 1.1 pk /* Input Register (read-only) */
87 1.1 pk #define BPP_IR_ERR 0x01 /* Err input pin */
88 1.1 pk #define BPP_IR_SLCT 0x02 /* Select input pin */
89 1.1 pk #define BPP_IR_PE 0x04 /* Paper Out input pin */
90 1.1 pk #define BPP_IR_BITS "\177\020" \
91 1.1 pk "b\0ERR\0b\1SLCT\0b\2PE\0"
92 1.1 pk
93 1.1 pk /* Interrupt Control Register */
94 1.1 pk #define BPP_ERR_IRQ_EN 0x0001 /* Error interrupt enable */
95 1.1 pk #define BPP_ERR_IRP 0x0002 /* ERR interrupt polarity */
96 1.1 pk #define BPP_SLCT_IRQ_EN 0x0004 /* Select interrupt enable */
97 1.1 pk #define BPP_SLCT_IRP 0x0008 /* Select interrupt polarity */
98 1.1 pk #define BPP_PE_IRQ_EN 0x0010 /* Paper Empty interrupt enable */
99 1.1 pk #define BPP_PE_IRP 0x0020 /* PE interrupt polarity */
100 1.1 pk #define BPP_BUSY_IRQ_EN 0x0040 /* BUSY interrupt enable */
101 1.1 pk #define BPP_BUSY_IRP 0x0080 /* BUSY interrupt polarity */
102 1.1 pk #define BPP_ACK_IRQ_EN 0x0100 /* ACK interrupt enable */
103 1.1 pk #define BPP_DS_IRQ_EN 0x0200 /* Data Strobe interrupt enable */
104 1.1 pk #define BPP_ERR_IRQ 0x0400 /* ERR interrupt pending */
105 1.1 pk #define BPP_SLCT_IRQ 0x0800 /* SLCT interrupt pending */
106 1.1 pk #define BPP_PE_IRQ 0x1000 /* PE interrupt pending */
107 1.1 pk #define BPP_BUSY_IRQ 0x2000 /* BUSY interrupt pending */
108 1.1 pk #define BPP_ACK_IRQ 0x4000 /* ACK interrupt pending */
109 1.1 pk #define BPP_DS_IRQ 0x8000 /* DS interrupt pending */
110 1.1 pk
111 1.1 pk /* Define mask for each of all irq request, all polarity and all enable bits */
112 1.1 pk #define BPP_ALLIRQ (BPP_ERR_IRQ|BPP_SLCT_IRQ|BPP_PE_IRQ| \
113 1.1 pk BPP_BUSY_IRQ|BPP_ACK_IRQ|BPP_DS_IRQ)
114 1.1 pk #define BPP_ALLEN (BPP_ERR_IRQ_EN|BPP_SLCT_IRQ_EN| \
115 1.1 pk BPP_PE_IRQ_EN|BPP_BUSY_IRQ_EN| \
116 1.1 pk BPP_ACK_IRQ_EN|BPP_DS_IRQ_EN)
117 1.1 pk #define BPP_ALLIRP (BPP_ERR_IRP|BPP_PE_IRP|BPP_BUSY_IRP)
118 1.1 pk #define BPP_IRQ_USER BPP_ALLIRP
119 1.1 pk
120 1.1 pk #define BPP_IRQ_BITS "\177\020" \
121 1.1 pk "b\0ERR_IRQ_EN\0b\1ERR_IRP\0b\2SLCT_IRQ_EN\0" \
122 1.1 pk "b\3SLCT_IRP\0b\4PE_IRQ_EN\0b\5PE_IRP\0" \
123 1.1 pk "b\6BUSY_IRQ_EN\0b\7BUSY_IRP\0b\10ACK_IRQ_EN\0" \
124 1.1 pk "b\11DS_IRQ_EN\0b\12ERR_IRQ\0b\13SLCT_IRQ\0" \
125 1.1 pk "b\14PE_IRQ\0b\15BUSY_IRQ\0b\16ACK_IRQ\0" \
126 1.1 pk "b\17DS_IRQ\0"
127