Lines Matching +full:4 +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * (c) 1997-1998 Grant R. Guenther <grant@torque.net>
5 * This is a low-level driver for the KBIC-951A and KBIC-971A
23 #define r12w() (delay_p, inw(pi->port + 1) & 0xffff)
25 #define j44(a, b) ((((a >> 4) & 0x0f) | (b & 0xf0)) ^ 0x88)
26 #define j53(w) (((w >> 3) & 0x1f) | ((w >> 4) & 0xe0))
30 * cont = 0 - access the IDE register file
31 * cont = 1 - access the IDE command set
41 switch (pi->mode) { in kbic_read_regr()
43 w0(regr | 0x18 | s); w2(4); w2(6); w2(4); w2(1); w0(8); in kbic_read_regr()
44 a = r1(); w0(0x28); b = r1(); w2(4); in kbic_read_regr()
47 w0(regr|0x38 | s); w2(4); w2(6); w2(4); w2(5); w0(8); in kbic_read_regr()
48 a = r12w(); w2(4); in kbic_read_regr()
51 w0(regr | 0x08 | s); w2(4); w2(6); w2(4); w2(0xa5); w2(0xa1); in kbic_read_regr()
52 a = r0(); w2(4); in kbic_read_regr()
55 case 4: in kbic_read_regr()
57 w0(0x20 | s); w2(4); w2(6); w2(4); w3(regr); in kbic_read_regr()
58 a = r4(); b = r4(); w2(4); w2(0); w2(4); in kbic_read_regr()
62 return -1; in kbic_read_regr()
69 switch (pi->mode) { in kbic_write_regr()
73 w0(regr | 0x10 | s); w2(4); w2(6); w2(4); in kbic_write_regr()
74 w0(val); w2(5); w2(4); in kbic_write_regr()
77 case 4: in kbic_write_regr()
79 w0(0x20 | s); w2(4); w2(6); w2(4); w3(regr); in kbic_write_regr()
81 w2(4); w2(0); w2(4); in kbic_write_regr()
88 pi->saved_r0 = r0(); in k951_connect()
89 pi->saved_r2 = r2(); in k951_connect()
90 w2(4); in k951_connect()
95 w0(pi->saved_r0); in k951_disconnect()
96 w2(pi->saved_r2); in k951_disconnect()
109 pi->saved_r0 = r0(); in k971_connect()
110 pi->saved_r2 = r2(); in k971_connect()
112 w2(4); in k971_connect()
118 w0(pi->saved_r0); in k971_disconnect()
119 w2(pi->saved_r2); in k971_disconnect()
123 * count must be congruent to 0 MOD 4, but all known applications
130 switch (pi->mode) { in kbic_read_block()
132 w0(0x98); w2(4); w2(6); w2(4); in kbic_read_block()
144 w2(4); in kbic_read_block()
148 w0(0xb8); w2(4); w2(6); w2(4); in kbic_read_block()
149 for (k = 0; k < count / 4; k++) { in kbic_read_block()
151 w2(4); w2(5); in kbic_read_block()
153 buf[4 * k] = j53(r12w()); in kbic_read_block()
155 buf[4 * k + 1] = j53(r12w()); in kbic_read_block()
156 w2(4); w2(5); in kbic_read_block()
157 buf[4 * k + 3] = j53(r12w()); in kbic_read_block()
159 buf[4 * k + 2] = j53(r12w()); in kbic_read_block()
161 w2(4); in kbic_read_block()
164 w0(0x88); w2(4); w2(6); w2(4); in kbic_read_block()
171 w2(4); in kbic_read_block()
174 w0(0xa0); w2(4); w2(6); w2(4); w3(0); in kbic_read_block()
177 w2(4); w2(0); w2(4); in kbic_read_block()
179 case 4: in kbic_read_block()
180 w0(0xa0); w2(4); w2(6); w2(4); w3(0); in kbic_read_block()
183 w2(4); w2(0); w2(4); in kbic_read_block()
186 w0(0xa0); w2(4); w2(6); w2(4); w3(0); in kbic_read_block()
187 for (k = 0; k < count / 4; k++) in kbic_read_block()
189 w2(4); w2(0); w2(4); in kbic_read_block()
198 switch (pi->mode) { in kbic_write_block()
202 w0(0x90); w2(4); w2(6); w2(4); in kbic_write_block()
205 w2(0); w2(4); in kbic_write_block()
207 w2(5); w2(4); in kbic_write_block()
211 w0(0xa0); w2(4); w2(6); w2(4); w3(0); in kbic_write_block()
216 w2(4); w2(0); w2(4); in kbic_write_block()
218 case 4: in kbic_write_block()
219 w0(0xa0); w2(4); w2(6); w2(4); w3(0); in kbic_write_block()
222 w2(4); w2(0); w2(4); in kbic_write_block()
225 w0(0xa0); w2(4); w2(6); w2(4); w3(0); in kbic_write_block()
226 for (k = 0; k < count / 4; k++) in kbic_write_block()
229 w2(4); w2(0); w2(4); in kbic_write_block()
236 char *mode[6] = { "4-bit", "5/3", "8-bit", "EPP-8", "EPP_16", "EPP-32"}; in kbic_log_adapter()
238 dev_info(&pi->dev, "KingByte %s at 0x%x, mode %d (%s), delay %d\n", in kbic_log_adapter()
239 chip, pi->port, pi->mode, mode[pi->mode], pi->delay); in kbic_log_adapter()
244 kbic_log_adapter(pi, "KBIC-951A"); in k951_log_adapter()
249 kbic_log_adapter(pi, "KBIC-971A"); in k971_log_adapter()
305 MODULE_DESCRIPTION("KingByte Information Systems KBIC-951A and KBIC-971A "