xref: /csrg-svn/sys/tahoe/stand/cyvar.h (revision 25862)
1*25862Ssam /*	cyvar.h	1.1	86/01/12	*/
2*25862Ssam 
3*25862Ssam #define TM_ATTENTION(addr,x) 	movob(addr,x)	/* also known as: GO */
4*25862Ssam 
5*25862Ssam #define TM_RESET(addr,x) TM_ATTENTION((addr+1),x) /* reset controller */
6*25862Ssam #define TM_SHORT(x)	(short)((((x) >> 8) & 0xff) + (((x) << 8) & 0xff00))
7*25862Ssam 
8*25862Ssam #define GATE_OPEN			(char)(0x00)
9*25862Ssam #define GATE_CLOSED			(char)(0xFF)
10*25862Ssam 
11*25862Ssam #define cyaddr	((char *)(0xf4000 + IOBASE))	/* controller physical addr */
12*25862Ssam #define b_repcnt  b_bcount
13*25862Ssam #define b_command b_resid
14*25862Ssam 
15*25862Ssam /* Group. I Control status/commands */
16*25862Ssam #define CONFIG	(0x00000000L)	/* configure */
17*25862Ssam #define SET_PA	(0x08000000L)	/* set page */
18*25862Ssam #define NO_OP	(0x20000000L)	/* no operation */
19*25862Ssam #define DRIVE_S	(0x28000000L)	/* drive status */
20*25862Ssam #define TAPE_AS	(0x74000000L)	/* tape assign */
21*25862Ssam #define DRIVE_R	(0x90000000L)	/* drive reset */
22*25862Ssam 
23*25862Ssam /* Group. II Tape position commands */
24*25862Ssam #define REWD_OV	(0x04000000L)	/* rewind overlapped */
25*25862Ssam #define READ_FO	(0x1C000000L)	/* read foreign tape */
26*25862Ssam #define REWD_TA	(0x34000000L)	/* rewind tape */
27*25862Ssam #define OFF_UNL	(0x38000000L)	/* off_line and unload */
28*25862Ssam #define WRIT_FM	(0x40000000L)	/* write filemark */
29*25862Ssam #define SERH_FM	(0x44000000L)	/* search filemark */
30*25862Ssam #define SRFM_FD	(0x44000000L)	/* search filemark forward */
31*25862Ssam #define SRFM_BK	(0xC4000000L)	/* search filemark backward */
32*25862Ssam #define SPACE	(0x48000000L)	/* skip record */
33*25862Ssam #define SP_FORW	(0x48000000L)	/* space forward */
34*25862Ssam #define SP_BACK	(0xC8000000L)	/* space backwords */
35*25862Ssam #define ERASE_F	(0x4C000000L)	/* erase fixed length */
36*25862Ssam #define ERASE_T	(0x50000000L)	/* erase to end of tape */
37*25862Ssam #define SPAC_FM	(0x70000000L)	/* space filemark */
38*25862Ssam #define SERH_MU	(0x94000000L)	/* search multiple filemarks */
39*25862Ssam 
40*25862Ssam /* Group. III Data transfer commands */
41*25862Ssam #define READ_BU	(0x10000000L)	/* read buffered */
42*25862Ssam #define WRIT_BU	(0x14000000L)	/* write buffered */
43*25862Ssam #define EDIT_BU	(0x18000000L)	/* edit buffered */
44*25862Ssam #define READ_TA	(0x2C000000L)	/* read tape */
45*25862Ssam #define WRIT_TA	(0x30000000L)	/* write tape */
46*25862Ssam #define EDIT_TA	(0x3C000000L)	/* edit tape */
47*25862Ssam #define READ_ST	(0x60000000L)	/* read streaming */
48*25862Ssam #define WRIT_ST	(0x64000000L)	/* write streaming */
49*25862Ssam 
50*25862Ssam /* Group. IV Special commands */
51*25862Ssam #define EXCHANG	(0x0C000000L)	/* exchange system and tapemaster RAM */
52*25862Ssam #define BLOCK_M	(0x80000000L)	/* block move */
53*25862Ssam 
54*25862Ssam /* Group. V Diagnostic commands */
55*25862Ssam #define TEST_SH	(0x54000000L)	/* short memory test */
56*25862Ssam #define TEST_LG	(0x58000000L)	/* long memory test */
57*25862Ssam #define TEST_CN	(0x5C000000L)	/* controller confidence test */
58*25862Ssam #define TEST_RW	(0x68000000L)	/* test read/write timeing */
59*25862Ssam /* Control byte[0] bit assignments */
60*25862Ssam #define CW_TSm	(0x0C)	/* tape select mask, 2 bit field */
61*25862Ssam #define CW_TSs	(2)	/* tape select shift, 2 bit field <<shift */
62*25862Ssam #define CW_M	(0x10)	/* mailbox flag */
63*25862Ssam #define CW_I	(0x20)	/* interrupt flag */
64*25862Ssam #define CW_L	(0x40)	/* link flag */
65*25862Ssam #define CW_BL	(0x80)	/* bus lock flag */
66*25862Ssam 
67*25862Ssam /* Control byte[1] bit assignments */
68*25862Ssam #define CW_BS	(0x01)	/* bank select */
69*25862Ssam #define CW_R	(0x04)	/* reverse flag */
70*25862Ssam #define CW_SD	(0x08)	/* speed/density */
71*25862Ssam #define CW_25ips	(0x00)	/* 25 inches per second speed */
72*25862Ssam #define CW_100ips	(0x08)	/* 100 inches per second speed */
73*25862Ssam #define CW_C	(0x10)	/* continuous */
74*25862Ssam #define CW_W	(0x80)	/* width */
75*25862Ssam #define CW_8bits	(0x00)	/* width 8 bits */
76*25862Ssam #define CW_16bits	(0x80)	/* width 16 bits */
77*25862Ssam 
78*25862Ssam /* status byte[0] bit assignements */
79*25862Ssam #define CS_P	(0x02)	/* Protected, no write ring */
80*25862Ssam #define CS_FB	(0x04)	/* formatter busy */
81*25862Ssam #define CS_DR	(0x08)	/* drive ready */
82*25862Ssam #define CS_EOT	(0x10)	/* end of tape detected */
83*25862Ssam #define CS_LP	(0x20)	/* tape is at load point */
84*25862Ssam #define CS_OL	(0x40)	/* drive on_line */
85*25862Ssam #define CS_FM	(0x80)	/* Filemark detected */
86*25862Ssam 
87*25862Ssam /* status byte[1] bit assignements */
88*25862Ssam #define CS_ERm	(0x1F)	/* Command (Error) mask */
89*25862Ssam #define CS_CR	(0x20)	/* Command (Retry) */
90*25862Ssam #define CS_CC	(0x40)	/* Command (Complete) */
91*25862Ssam #define CS_CE	(0x80)	/* Command (Entered) */
92*25862Ssam 
93*25862Ssam /* block move control byte[0] bit assignments */
94*25862Ssam #define BM_SI	(0x01)	/* increment source address */
95*25862Ssam #define BM_SW	(0x02)	/* source width */
96*25862Ssam #define BM_DI	(0x04)	/* increment destination address */
97*25862Ssam #define BM_DW	(0x08)	/* destination width */
98*25862Ssam #define BM_M	(0x10)	/* mailbox flag */
99*25862Ssam #define BM_I	(0x20)	/* interrupt flag */
100*25862Ssam #define BM_L	(0x40)	/* link flag */
101*25862Ssam #define BM_BL	(0x80)	/* bus lock flag */
102*25862Ssam 
103*25862Ssam /* block move control byte[1] bit assignments */
104*25862Ssam #define BM_T	(0x01)	/* translate flag */
105*25862Ssam #define BM_S	(0x02)	/* search flag */
106*25862Ssam #define BM_NC	(0x04)	/* non_compare flag */
107*25862Ssam #define BM_TH	(0x08)	/* throttle flag */
108*25862Ssam #define BM_SL	(0x10)	/* source local flag */
109*25862Ssam #define BM_DL	(0x20)	/* destination local flag */
110*25862Ssam 
111*25862Ssam /* block move status bit assignments */
112*25862Ssam #define BS_ERm	(0x1F)	/* Command (Error) mask */
113*25862Ssam #define BS_HIT	(0x20)	/* found match during search */
114*25862Ssam #define BS_CC	(0x40)	/* Command (Complete) */
115*25862Ssam #define BS_CE	(0x80)	/* Command (Entered) */
116*25862Ssam /* SC_ERROR & BM_ERROR codes */
117*25862Ssam #define ER_NONE	(0x00)		/* no error */
118*25862Ssam #define ER_TO1	(0x01)		/* timed out data busy false */
119*25862Ssam #define ER_TO2	(0x02)		/* data busy false,formatter,ready */
120*25862Ssam #define ER_TO3	(0x03)		/* time out ready busy false */
121*25862Ssam #define ER_TO4	(0x04)		/* time out ready busy true */
122*25862Ssam #define ER_TO5	(0x05)		/* time out data busy true */
123*25862Ssam #define ER_TO6	(0x06)		/* time out memory */
124*25862Ssam #define ER_BLAN	(0X07)		/* blank tape */
125*25862Ssam #define ER_DIAG	(0x08)		/* micro-diagnostic */
126*25862Ssam #define ER_END	(0x09)		/* EOT forward, BOT rev. */
127*25862Ssam #define ER_HARD	(0x0A)		/* retry unsuccessful */
128*25862Ssam #define ER_FIFO	(0x0B)		/* FIFO over/under flow */
129*25862Ssam /*		(0x0C)		/* Not used */
130*25862Ssam #define ER_PARI	(0x0D)		/* drive to tapemaster parity error */
131*25862Ssam #define ER_PSUM	(0x0E)		/* prom checksum */
132*25862Ssam #define ER_TOF	(0x0F)		/* time out tape strobe */
133*25862Ssam #define ER_TRN	(0x10)		/* tape not ready */
134*25862Ssam #define ER_PRO	(0x11)		/* write, no enable ring */
135*25862Ssam /*		(0x12)		/* Not used */
136*25862Ssam #define ER_JUMP	(0x13)		/* missing diagnostic jumper */
137*25862Ssam #define ER_BLIN	(0x14)		/* bad link, link inappropriate */
138*25862Ssam #define ER_FMAR	(0x15)		/* unexpected filemark */
139*25862Ssam #define ER_PARA	(0x16)		/* bad parameter, byte count ? */
140*25862Ssam /*		(0x17)		/* Not used */
141*25862Ssam #define ER_ER	(0x18)		/* unidentified hardware error */
142*25862Ssam #define ER_STER	(0x19)		/* streaming terminated */
143*25862Ssam 
144*25862Ssam #define WRITE_FMARK	5
145