immio.c (42475) | immio.c (43433) |
---|---|
1/*- 2 * Copyright (c) 1998 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: immio.c,v 1.4 1998/10/31 11:35:21 nsouch Exp $ | 26 * $Id: immio.c,v 1.5 1999/01/10 12:04:54 nsouch Exp $ |
27 * 28 */ 29 30/* 31 * Iomega ZIP+ Matchmaker Parallel Port Interface driver 32 * 33 * Thanks to David Campbell work on the Linux driver and the Iomega specs 34 * Thanks to Thiebault Moeglin for the drive --- 32 unchanged lines hidden (view full) --- 67#define SELECT_TARGET MS_PARAM(6, 1, MS_TYP_CHA) 68 69#define DECLARE_SELECT_MICROSEQUENCE \ 70struct ppb_microseq select_microseq[] = { \ 71 MS_CASS(0xc), \ 72 /* first, check there is nothing holding onto the bus */ \ 73 MS_SET(VP0_SELTMO), \ 74/* _loop: */ \ | 27 * 28 */ 29 30/* 31 * Iomega ZIP+ Matchmaker Parallel Port Interface driver 32 * 33 * Thanks to David Campbell work on the Linux driver and the Iomega specs 34 * Thanks to Thiebault Moeglin for the drive --- 32 unchanged lines hidden (view full) --- 67#define SELECT_TARGET MS_PARAM(6, 1, MS_TYP_CHA) 68 69#define DECLARE_SELECT_MICROSEQUENCE \ 70struct ppb_microseq select_microseq[] = { \ 71 MS_CASS(0xc), \ 72 /* first, check there is nothing holding onto the bus */ \ 73 MS_SET(VP0_SELTMO), \ 74/* _loop: */ \ |
75 MS_BRCLEAR(0x8, 3 /* _ready */), \ 76 MS_DBRA(-1 /* _loop */), \ | 75 MS_BRCLEAR(0x8, 2 /* _ready */), \ 76 MS_DBRA(-2 /* _loop */), \ |
77 MS_RET(2), /* bus busy */ \ 78/* _ready: */ \ 79 MS_CASS(0x4), \ 80 MS_DASS(MS_UNKNOWN /* 0x80 | 1 << target */), \ 81 MS_DELAY(1), \ 82 MS_CASS(0xc), \ 83 MS_CASS(0xd), \ 84 /* now, wait until the drive is ready */ \ 85 MS_SET(VP0_SELTMO), \ 86/* loop: */ \ | 77 MS_RET(2), /* bus busy */ \ 78/* _ready: */ \ 79 MS_CASS(0x4), \ 80 MS_DASS(MS_UNKNOWN /* 0x80 | 1 << target */), \ 81 MS_DELAY(1), \ 82 MS_CASS(0xc), \ 83 MS_CASS(0xd), \ 84 /* now, wait until the drive is ready */ \ 85 MS_SET(VP0_SELTMO), \ 86/* loop: */ \ |
87 MS_BRSET(0x8, 4 /* ready */), \ 88 MS_DBRA(-1 /* loop */), \ | 87 MS_BRSET(0x8, 3 /* ready */), \ 88 MS_DBRA(-2 /* loop */), \ |
89/* error: */ \ 90 MS_CASS(0xc), \ 91 MS_RET(VP0_ESELECT_TIMEOUT), \ 92/* ready: */ \ 93 MS_CASS(0xc), \ 94 MS_RET(0) \ 95} 96 --- 36 unchanged lines hidden (view full) --- 133#define DECLARE_NEGOCIATE_MICROSEQ \ 134static struct ppb_microseq negociate_microseq[] = { \ 135 MS_CASS(0x4), \ 136 MS_DELAY(5), \ 137 MS_DASS(MS_UNKNOWN /* mode */), \ 138 MS_DELAY(100), \ 139 MS_CASS(0x6), \ 140 MS_DELAY(5), \ | 89/* error: */ \ 90 MS_CASS(0xc), \ 91 MS_RET(VP0_ESELECT_TIMEOUT), \ 92/* ready: */ \ 93 MS_CASS(0xc), \ 94 MS_RET(0) \ 95} 96 --- 36 unchanged lines hidden (view full) --- 133#define DECLARE_NEGOCIATE_MICROSEQ \ 134static struct ppb_microseq negociate_microseq[] = { \ 135 MS_CASS(0x4), \ 136 MS_DELAY(5), \ 137 MS_DASS(MS_UNKNOWN /* mode */), \ 138 MS_DELAY(100), \ 139 MS_CASS(0x6), \ 140 MS_DELAY(5), \ |
141 MS_BRSET(0x20, 6 /* continue */), \ | 141 MS_BRSET(0x20, 5 /* continue */), \ |
142 MS_DELAY(5), \ 143 MS_CASS(0x7), \ 144 MS_DELAY(5), \ 145 MS_CASS(0x6), \ 146 MS_RET(VP0_ENEGOCIATE), \ 147/* continue: */ \ 148 MS_DELAY(5), \ 149 MS_CASS(0x7), \ --- 62 unchanged lines hidden (view full) --- 212 MS_CASS(0x5), 213 MS_DELAY(1), 214 MS_RFETCH(MS_REG_STR, MS_FETCH_ALL, MS_UNKNOWN /* high nibble */), 215 MS_CASS(0x4), 216 MS_DELAY(1), 217 218 /* do a C call to format the received nibbles */ 219 MS_C_CALL(MS_UNKNOWN /* C hook */, MS_UNKNOWN /* param */), | 142 MS_DELAY(5), \ 143 MS_CASS(0x7), \ 144 MS_DELAY(5), \ 145 MS_CASS(0x6), \ 146 MS_RET(VP0_ENEGOCIATE), \ 147/* continue: */ \ 148 MS_DELAY(5), \ 149 MS_CASS(0x7), \ --- 62 unchanged lines hidden (view full) --- 212 MS_CASS(0x5), 213 MS_DELAY(1), 214 MS_RFETCH(MS_REG_STR, MS_FETCH_ALL, MS_UNKNOWN /* high nibble */), 215 MS_CASS(0x4), 216 MS_DELAY(1), 217 218 /* do a C call to format the received nibbles */ 219 MS_C_CALL(MS_UNKNOWN /* C hook */, MS_UNKNOWN /* param */), |
220 MS_DBRA(-6 /* loop */), | 220 MS_DBRA(-7 /* loop */), |
221 MS_RET(0) 222}; 223 224/* 225 * This is the sub-microseqence for MS_GET in PS2 mode 226 */ 227static struct ppb_microseq ps2_inbyte_submicroseq[] = { 228 MS_CASS(0x4), 229 230/* loop: */ 231 MS_CASS(PCD | 0x6), 232 MS_RFETCH_P(1, MS_REG_DTR, MS_FETCH_ALL), 233 MS_CASS(PCD | 0x5), | 221 MS_RET(0) 222}; 223 224/* 225 * This is the sub-microseqence for MS_GET in PS2 mode 226 */ 227static struct ppb_microseq ps2_inbyte_submicroseq[] = { 228 MS_CASS(0x4), 229 230/* loop: */ 231 MS_CASS(PCD | 0x6), 232 MS_RFETCH_P(1, MS_REG_DTR, MS_FETCH_ALL), 233 MS_CASS(PCD | 0x5), |
234 MS_DBRA(-3 /* loop */), | 234 MS_DBRA(-4 /* loop */), |
235 236 MS_RET(0) 237}; 238 239/* 240 * This is the sub-microsequence for MS_PUT in both NIBBLE and PS2 modes 241 */ 242static struct ppb_microseq spp_outbyte_submicroseq[] = { 243 MS_CASS(0x4), 244 245/* loop: */ 246 MS_RASSERT_P(1, MS_REG_DTR), 247 MS_CASS(0x5), | 235 236 MS_RET(0) 237}; 238 239/* 240 * This is the sub-microsequence for MS_PUT in both NIBBLE and PS2 modes 241 */ 242static struct ppb_microseq spp_outbyte_submicroseq[] = { 243 MS_CASS(0x4), 244 245/* loop: */ 246 MS_RASSERT_P(1, MS_REG_DTR), 247 MS_CASS(0x5), |
248 MS_DBRA(1), /* decrement counter */ | 248 MS_DBRA(0), /* decrement counter */ |
249 MS_RASSERT_P(1, MS_REG_DTR), 250 MS_CASS(0x0), | 249 MS_RASSERT_P(1, MS_REG_DTR), 250 MS_CASS(0x0), |
251 MS_DBRA(-5 /* loop */), | 251 MS_DBRA(-6 /* loop */), |
252 253 /* return from the put call */ 254 MS_CASS(0x4), 255 MS_RET(0) 256}; 257 258/* EPP 1.7 microsequences, ptr and len set at runtime */ 259static struct ppb_microseq epp17_outstr[] = { 260 MS_CASS(0x4), | 252 253 /* return from the put call */ 254 MS_CASS(0x4), 255 MS_RET(0) 256}; 257 258/* EPP 1.7 microsequences, ptr and len set at runtime */ 259static struct ppb_microseq epp17_outstr[] = { 260 MS_CASS(0x4), |
261 MS_RASSERT_P(MS_ACCUM, MS_REG_EPP), | 261 MS_RASSERT_P(MS_ACCUM, MS_REG_EPP_D), |
262 MS_CASS(0xc), 263 MS_RET(0), 264}; 265 266static struct ppb_microseq epp17_instr[] = { 267 MS_CASS(PCD | 0x4), | 262 MS_CASS(0xc), 263 MS_RET(0), 264}; 265 266static struct ppb_microseq epp17_instr[] = { 267 MS_CASS(PCD | 0x4), |
268 MS_RFETCH_P(MS_ACCUM, MS_REG_EPP, MS_FETCH_ALL), | 268 MS_RFETCH_P(MS_ACCUM, MS_REG_EPP_D, MS_FETCH_ALL), |
269 MS_CASS(PCD | 0xc), 270 MS_RET(0), 271}; 272 273static int 274imm_disconnect(struct vpoio_data *vpo, int *connected, int release_bus) 275{ 276 DECLARE_CPP_MICROSEQ; --- 528 unchanged lines hidden --- | 269 MS_CASS(PCD | 0xc), 270 MS_RET(0), 271}; 272 273static int 274imm_disconnect(struct vpoio_data *vpo, int *connected, int release_bus) 275{ 276 DECLARE_CPP_MICROSEQ; --- 528 unchanged lines hidden --- |