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