xref: /original-bsd/sys/vax/uba/rkreg.h (revision 8da94fe2)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)rkreg.h	7.1 (Berkeley) 06/05/86
7  */
8 
9 #define NRK7CYL 	815
10 #define	NRK6CYL		411
11 #define NRKSECT		22
12 #define NRKTRK		3
13 
14 struct rkdevice
15 {
16 	short	rkcs1;		/* control status reg 1 */
17 	short	rkwc;		/* word count */
18 	u_short	rkba;		/* bus address */
19 	short	rkda;		/* disk address */
20 	short	rkcs2;		/* control status reg 2 */
21 	short	rkds;		/* drive status */
22 	short	rker;		/* driver error register */
23 	short	rkatt;		/* attention status/offset register */
24 	short	rkcyl;		/* current cylinder register */
25 	short	rkxxx;
26 	short	rkdb;		/* data buffer register */
27 	short	rkmr1;		/* maint reg 1 */
28 	short	rkec1;		/* burst error bit position */
29 	short	rkec2;		/* burst error bit pattern */
30 	short	rkmr2;		/* maint reg 2 */
31 	short	rkmr3;		/* maint reg 3 */
32 };
33 
34 /* rkcs1 */
35 #define RK_CCLR		0100000		/* controller clear (also error) */
36 #define	RK_CERR		RK_CCLR
37 #define	RK_DI		0040000		/* drive interrupt */
38 #define	RK_DTCPAR	0020000		/* drive to controller parity */
39 #define	RK_CFMT		0010000		/* 18 bit word format */
40 #define	RK_CTO		0004000		/* controller timeout */
41 #define	RK_CDT		0002000		/* drive type (rk07/rk06) */
42 /* bits 8 and 9 are the extended bus address */
43 #define	RK_CRDY		0000200		/* controller ready */
44 #define	RK_IE		0000100		/* interrupt enable */
45 /* bits 1 to 4 are the function code */
46 #define	RK_GO		0000001
47 
48 /* commands */
49 #define RK_SELECT	000		/* select drive */
50 #define RK_PACK		002		/* pack acknowledge */
51 #define RK_DCLR		004		/* drive clear */
52 #define	RK_UNLOAD	006		/* unload */
53 #define	RK_START	010		/* start spindle */
54 #define	RK_RECAL	012		/* recalibrate */
55 #define	RK_OFFSET	014		/* offset */
56 #define	RK_SEEK		016		/* seek */
57 #define	RK_READ		020		/* read data */
58 #define	RK_WRITE	022		/* write data */
59 #define	RK_RHDR		026		/* read header */
60 #define	RK_WHDR		030		/* write header */
61 
62 /* rkcs2 */
63 #define	RKCS2_DLT	0100000		/* data late */
64 #define	RKCS2_WCE	0040000		/* write check */
65 #define	RKCS2_UPE	0020000		/* unibus parity */
66 #define	RKCS2_NED	0010000		/* non-existant drive */
67 #define	RKCS2_NEM	0004000		/* non-existant memory */
68 #define	RKCS2_PGE	0002000		/* programming error */
69 #define	RKCS2_MDS	0001000		/* multiple drive select */
70 #define	RKCS2_UFE	0000400		/* unit field error */
71 #define	RKCS2_OR	0000200		/* output ready */
72 #define	RKCS2_IR	0000100		/* input ready */
73 #define	RKCS2_SCLR	0000040		/* subsystem clear */
74 #define	RKCS2_BAI	0000020		/* bus address increment inhibit */
75 #define	RKCS2_RLS	0000010		/* release */
76 /* bits 0-2 are drive select */
77 
78 #define	RKCS2_BITS \
79 "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MDS\11UFE\
80 \10OR\7IR\6SCLR\5BAI\4RLS"
81 
82 #define	RKCS2_HARD		(RKCS2_NED|RKCS2_PGE)
83 
84 /* rkds */
85 #define	RKDS_SVAL	0100000		/* status valid */
86 #define	RKDS_CDA	0040000		/* current drive attention */
87 #define	RKDS_PIP	0020000		/* positioning in progress */
88 /* bit 12 is spare */
89 #define	RKDS_WRL	0004000		/* write lock */
90 /* bits 9 and 10 are spare */
91 #define	RKDS_DDT	0000400		/* disk drive type */
92 #define	RKDS_DRDY	0000200		/* drive ready */
93 #define	RKDS_VV		0000100		/* volume valid */
94 #define	RKDS_DROT	0000040		/* drive off track */
95 #define	RKDS_SPLS	0000020		/* speed loss */
96 #define	RKDS_ACLO	0000010		/* ac low */
97 #define	RKDS_OFF	0000004		/* offset mode */
98 #define	RKDS_DRA	0000001		/* drive available */
99 
100 #define	RKDS_DREADY	(RKDS_DRA|RKDS_VV|RKDS_DRDY)
101 #define	RKDS_BITS \
102 "\10\20SVAL\17CDA\16PIP\14WRL\11DDT\
103 \10DRDY\7VV\6DROT\5SPLS\4ACLO\3OFF\1DRA"
104 #define	RKDS_HARD	(RKDS_ACLO|RKDS_SPLS)
105 
106 /* rker */
107 #define	RKER_DCK	0100000		/* data check */
108 #define	RKER_UNS	0040000		/* drive unsafe */
109 #define	RKER_OPI	0020000		/* operation incomplete */
110 #define	RKER_DTE	0010000		/* drive timing error */
111 #define	RKER_WLE	0004000		/* write lock error */
112 #define	RKER_IDAE	0002000		/* invalid disk address error */
113 #define	RKER_COE	0001000		/* cylinder overflow error */
114 #define	RKER_HRVC	0000400		/* header vertical redundancy check */
115 #define	RKER_BSE	0000200		/* bad sector error */
116 #define	RKER_ECH	0000100		/* hard ecc error */
117 #define	RKER_DTYE	0000040		/* drive type error */
118 #define	RKER_FMTE	0000020		/* format error */
119 #define	RKER_DRPAR	0000010		/* control-to-drive parity error */
120 #define	RKER_NXF	0000004		/* non-executable function */
121 #define	RKER_SKI	0000002		/* seek incomplete */
122 #define	RKER_ILF		0000001		/* illegal function */
123 
124 #define	RKER_BITS \
125 "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\
126 \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF"
127 #define	RKER_HARD	\
128 	(RKER_WLE|RKER_IDAE|RKER_COE|RKER_DTYE|RKER_FMTE|RKER_ILF)
129 
130 /* offset bits in rkas */
131 #define	RKAS_P400	0020		/*  +400 RK06,  +200 RK07 */
132 #define	RKAS_M400	0220		/*  -400 RK06,  -200 RK07 */
133 #define	RKAS_P800	0040		/*  +800 RK06,  +400 RK07 */
134 #define	RKAS_M800	0240		/*  -800 RK06,  -400 RK07 */
135 #define	RKAS_P1200	0060		/*  +800 RK06,  +400 RK07 */
136 #define	RKAS_M1200	0260		/* -1200 RK06, -1200 RK07 */
137