xref: /original-bsd/sys/vax/mba/mbareg.h (revision a95f03a8)
1 /*-
2  * Copyright (c) 1982, 1986 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.proprietary.c%
6  *
7  *	@(#)mbareg.h	7.2 (Berkeley) 05/08/91
8  */
9 
10 /*
11  * VAX MASSBUS adapter registers
12  */
13 
14 struct mba_regs
15 {
16 	int	mba_csr;		/* configuration register */
17 	int	mba_cr;			/* control register */
18 	int	mba_sr;			/* status register */
19 	int	mba_var;		/* virtual address register */
20 	int	mba_bcr;		/* byte count register */
21 	int	mba_dr;
22 	int	mba_pad1[250];
23 	struct mba_drv {		/* per drive registers */
24 		int	mbd_cs1;		/* control status */
25 		int	mbd_ds;			/* drive status */
26 		int	mbd_er1;		/* error register */
27 		int	mbd_mr1;		/* maintenance register */
28 		int	mbd_as;			/* attention status */
29 		int	mbd_da;			/* desired address (disks) */
30 #define	mbd_fc	mbd_da				/* frame count (tapes) */
31 		int	mbd_dt;			/* drive type */
32 		int	mbd_la;			/* look ahead (disks) */
33 #define	mbd_ck	mbd_la				/* ??? (tapes) */
34 		int	mbd_sn;			/* serial number */
35 		int	mbd_of;			/* ??? */
36 #define	mbd_tc	mbd_of				/* ??? */
37 		int	mbd_fill[22];
38 	} mba_drv[8];
39 	struct	pte mba_map[256];	/* io space virtual map */
40 	int	mba_pad2[256*5];	/* to size of a nexus */
41 };
42 
43 /*
44  * Bits in mba_cr
45  */
46 #define	MBCR_INIT	0x1		/* init mba */
47 #define	MBCR_IE		0x4		/* enable mba interrupts */
48 
49 /*
50  * Bits in mba_sr
51  */
52 #define	MBSR_DTBUSY	0x80000000	/* data transfer busy */
53 #define	MBSR_NRCONF	0x40000000	/* no response confirmation */
54 #define	MBSR_CRD	0x20000000	/* corrected read data */
55 #define	MBSR_CBHUNG	0x00800000	/* control bus hung */
56 #define	MBSR_PGE	0x00080000	/* programming error */
57 #define	MBSR_NED	0x00040000	/* non-existant drive */
58 #define	MBSR_MCPE	0x00020000	/* massbus control parity error */
59 #define	MBSR_ATTN	0x00010000	/* attention from massbus */
60 #define	MBSR_SPE	0x00004000	/* silo parity error */
61 #define	MBSR_DTCMP	0x00002000	/* data transfer completed */
62 #define	MBSR_DTABT	0x00001000	/* data transfer aborted */
63 #define	MBSR_DLT	0x00000800	/* data late */
64 #define	MBSR_WCKUP	0x00000400	/* write check upper */
65 #define	MBSR_WCKLWR	0x00000200	/* write check lower */
66 #define	MBSR_MXF	0x00000100	/* miss transfer error */
67 #define	MBSR_MBEXC	0x00000080	/* massbus exception */
68 #define	MBSR_MDPE	0x00000040	/* massbus data parity error */
69 #define	MBSR_MAPPE	0x00000020	/* page frame map parity error */
70 #define	MBSR_INVMAP	0x00000010	/* invalid map */
71 #define	MBSR_ERRCONF	0x00000008	/* error confirmation */
72 #define	MBSR_RDS	0x00000004	/* read data substitute */
73 #define	MBSR_ISTIMO	0x00000002	/* interface sequence timeout */
74 #define	MBSR_RDTIMO	0x00000001	/* read data timeout */
75 
76 #define MBSR_BITS \
77 "\20\40DTBUSY\37NRCONF\36CRD\30CBHUNG\24PGE\23NED\22MCPE\21ATTN\
78 \17SPE\16DTCMP\15DTABT\14DLT\13WCKUP\12WCKLWR\11MXF\10MBEXC\7MDPE\
79 \6MAPPE\5INVMAP\4ERRCONF\3RDS\2ISTIMO\1RDTIMO"
80 
81 #define	MBSR_HARD	(MBSR_PGE|MBSR_ERRCONF|MBSR_ISTIMO|MBSR_RDTIMO)
82 
83 #define MBSR_EBITS	(~(MBSR_DTBUSY|MBSR_CRD|MBSR_ATTN|MBSR_DTCMP))
84 
85 #ifdef KERNEL
86 extern	char	mbsr_bits[];
87 #endif
88 
89 /*
90  * Commands for mbd_cs1
91  */
92 #define	MB_WCOM		0x30
93 #define	MB_RCOM		0x38
94 #define	MB_GO		0x1
95 
96 /*
97  * Bits in mbd_ds.
98  */
99 #define	MBDS_ERR	0x00004000	/* error in drive */
100 #define	MBDS_MOL	0x00001000	/* medium on line */
101 #define	MBDS_DPR	0x00000100	/* drive present */
102 #define	MBDS_DRY	0x00000080	/* drive ready */
103 
104 #define	MBDS_DREADY	(MBDS_MOL|MBDS_DPR|MBDS_DRY)
105 
106 /*
107  * Bits in mbd_dt
108  */
109 #define	MBDT_NSA	0x8000		/* not sector addressible */
110 #define	MBDT_TAP	0x4000		/* is a tape */
111 #define	MBDT_MOH	0x2000		/* moving head */
112 #define	MBDT_7CH	0x1000		/* 7 channel */
113 #define	MBDT_DRQ	0x800		/* drive request required */
114 #define	MBDT_SPR	0x400		/* slave present */
115 
116 #define	MBDT_TYPE	0x1ff
117 #define	MBDT_MASK	(MBDT_NSA|MBDT_TAP|MBDT_TYPE)
118 
119 /* type codes for disk drives */
120 #define	MBDT_RP04	020
121 #define	MBDT_RP05	021
122 #define	MBDT_RP06	022
123 #define	MBDT_RP07	042
124 #define	MBDT_RM02	025
125 #define	MBDT_RM03	024
126 #define	MBDT_RM05	027
127 #define	MBDT_RM80	026
128 #define	MBDT_ML11A	0110
129 #define	MBDT_ML11B	0111
130 
131 /* type codes for tape drives */
132 #define	MBDT_TM03	050
133 #define	MBDT_TE16	051
134 #define	MBDT_TU45	052
135 #define	MBDT_TU77	054
136 #define	MBDT_TU78	0101
137