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