OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [scsi/] [aic7xxx/] [aic7xxx.reg] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 * Aic7xxx register and scratch ram definitions.
3
 *
4
 * Copyright (c) 1994-1998 Justin Gibbs.
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms, with or without
8
 * modification, are permitted provided that the following conditions
9
 * are met:
10
 * 1. Redistributions of source code must retain the above copyright
11
 *    notice, this list of conditions, and the following disclaimer,
12
 *    without modification, immediately at the beginning of the file.
13
 * 2. The name of the author may not be used to endorse or promote products
14
 *    derived from this software without specific prior written permission.
15
 *
16
 * Where this Software is combined with software released under the terms of
17
 * the GNU Public License ("GPL") and the terms of the GPL would require the
18
 * combined work to also be released under the terms of the GPL, the terms
19
 * and conditions of this License will apply in addition to those of the
20
 * GPL with the exception of any terms or conditions of this License that
21
 * conflict with, or are expressly prohibited by, the GPL.
22
 *
23
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
27
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33
 * SUCH DAMAGE.
34
 *
35
 *      $Id: aic7xxx.reg,v 1.1 2005-12-20 10:18:04 jcastillo Exp $
36
 */
37
 
38
/*
39
 * This file is processed by the aic7xxx_asm utility for use in assembling
40
 * firmware for the aic7xxx family of SCSI host adapters as well as to generate
41
 * a C header file for use in the kernel portion of the Aic7xxx driver.
42
 *
43
 * All page numbers refer to the Adaptec AIC-7770 Data Book available from
44
 * Adaptec's Technical Documents Department 1-800-934-2766
45
 */
46
 
47
/*
48
 * SCSI Sequence Control (p. 3-11).
49
 * Each bit, when set starts a specific SCSI sequence on the bus
50
 */
51
register SCSISEQ {
52
        address                 0x000
53
        access_mode RW
54
        bit     TEMODE          0x80
55
        bit     ENSELO          0x40
56
        bit     ENSELI          0x20
57
        bit     ENRSELI         0x10
58
        bit     ENAUTOATNO      0x08
59
        bit     ENAUTOATNI      0x04
60
        bit     ENAUTOATNP      0x02
61
        bit     SCSIRSTO        0x01
62
}
63
 
64
/*
65
 * SCSI Transfer Control 0 Register (pp. 3-13).
66
 * Controls the SCSI module data path.
67
 */
68
register SXFRCTL0 {
69
        address                 0x001
70
        access_mode RW
71
        bit     DFON            0x80
72
        bit     DFPEXP          0x40
73
        bit     FAST20          0x20
74
        bit     CLRSTCNT        0x10
75
        bit     SPIOEN          0x08
76
        bit     SCAMEN          0x04
77
        bit     CLRCHN          0x02
78
}
79
 
80
/*
81
 * SCSI Transfer Control 1 Register (pp. 3-14,15).
82
 * Controls the SCSI module data path.
83
 */
84
register SXFRCTL1 {
85
        address                 0x002
86
        access_mode RW
87
        bit     BITBUCKET       0x80
88
        bit     SWRAPEN         0x40
89
        bit     ENSPCHK         0x20
90
        mask    STIMESEL        0x18
91
        bit     ENSTIMER        0x04
92
        bit     ACTNEGEN        0x02
93
        bit     STPWEN          0x01    /* Powered Termination */
94
}
95
 
96
/*
97
 * SCSI Control Signal Read Register (p. 3-15).
98
 * Reads the actual state of the SCSI bus pins
99
 */
100
register SCSISIGI {
101
        address                 0x003
102
        access_mode RO
103
        bit     CDI             0x80
104
        bit     IOI             0x40
105
        bit     MSGI            0x20
106
        bit     ATNI            0x10
107
        bit     SELI            0x08
108
        bit     BSYI            0x04
109
        bit     REQI            0x02
110
        bit     ACKI            0x01
111
/*
112
 * Possible phases in SCSISIGI
113
 */
114
        mask    PHASE_MASK      CDI|IOI|MSGI
115
        mask    P_DATAOUT       0x00
116
        mask    P_DATAIN        IOI
117
        mask    P_COMMAND       CDI
118
        mask    P_MESGOUT       CDI|MSGI
119
        mask    P_STATUS        CDI|IOI
120
        mask    P_MESGIN        CDI|IOI|MSGI
121
}
122
 
123
/*
124
 * SCSI Control Signal Write Register (p. 3-16).
125
 * Writing to this register modifies the control signals on the bus.  Only
126
 * those signals that are allowed in the current mode (Initiator/Target) are
127
 * asserted.
128
 */
129
register SCSISIGO {
130
        address                 0x003
131
        access_mode WO
132
        bit     CDO             0x80
133
        bit     IOO             0x40
134
        bit     MSGO            0x20
135
        bit     ATNO            0x10
136
        bit     SELO            0x08
137
        bit     BSYO            0x04
138
        bit     REQO            0x02
139
        bit     ACKO            0x01
140
/*
141
 * Possible phases to write into SCSISIG0
142
 */
143
        mask    PHASE_MASK      CDI|IOI|MSGI
144
        mask    P_DATAOUT       0x00
145
        mask    P_DATAIN        IOI
146
        mask    P_COMMAND       CDI
147
        mask    P_MESGOUT       CDI|MSGI
148
        mask    P_STATUS        CDI|IOI
149
        mask    P_MESGIN        CDI|IOI|MSGI
150
}
151
 
152
/*
153
 * SCSI Rate Control (p. 3-17).
154
 * Contents of this register determine the Synchronous SCSI data transfer
155
 * rate and the maximum synchronous Req/Ack offset.  An offset of 0 in the
156
 * SOFS (3:0) bits disables synchronous data transfers.  Any offset value
157
 * greater than 0 enables synchronous transfers.
158
 */
159
register SCSIRATE {
160
        address                 0x004
161
        access_mode RW
162
        bit     WIDEXFER        0x80            /* Wide transfer control */
163
        mask    SXFR            0x70            /* Sync transfer rate */
164
        mask    SXFR_ULTRA2     0x7f            /* Sync transfer rate */
165
        mask    SOFS            0x0f            /* Sync offset */
166
}
167
 
168
/*
169
 * SCSI ID (p. 3-18).
170
 * Contains the ID of the board and the current target on the
171
 * selected channel.
172
 */
173
register SCSIID {
174
        address                 0x005
175
        access_mode RW
176
        mask    TID             0xf0            /* Target ID mask */
177
        mask    OID             0x0f            /* Our ID mask */
178
        /*
179
         * SCSI Maximum Offset (p. 4-61 aic7890/91 Data Book)
180
         * The aic7890/91 allow an offset of up to 127 transfers in both wide
181
         * and narrow mode.
182
         */
183
        alias   SCSIOFFSET
184
        mask    SOFS_ULTRA2     0x7f            /* Sync offset U2 chips */
185
}
186
 
187
/*
188
 * SCSI Latched Data (p. 3-19).
189
 * Read/Write latches used to transfer data on the SCSI bus during
190
 * Automatic or Manual PIO mode.  SCSIDATH can be used for the
191
 * upper byte of a 16bit wide asynchronouse data phase transfer.
192
 */
193
register SCSIDATL {
194
        address                 0x006
195
        access_mode RW
196
}
197
 
198
register SCSIDATH {
199
        address                 0x007
200
        access_mode RW
201
}
202
 
203
/*
204
 * SCSI Transfer Count (pp. 3-19,20)
205
 * These registers count down the number of bytes transferred
206
 * across the SCSI bus.  The counter is decremented only once
207
 * the data has been safely transferred.  SDONE in SSTAT0 is
208
 * set when STCNT goes to 0
209
 */
210
register STCNT {
211
        address                 0x008
212
        size    3
213
        access_mode RW
214
}
215
 
216
/*
217
 * Clear SCSI Interrupt 0 (p. 3-20)
218
 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
219
 */
220
register CLRSINT0 {
221
        address                 0x00b
222
        access_mode WO
223
        bit     CLRSELDO        0x40
224
        bit     CLRSELDI        0x20
225
        bit     CLRSELINGO      0x10
226
        bit     CLRSWRAP        0x08
227
        bit     CLRSPIORDY      0x02
228
}
229
 
230
/*
231
 * SCSI Status 0 (p. 3-21)
232
 * Contains one set of SCSI Interrupt codes
233
 * These are most likely of interest to the sequencer
234
 */
235
register SSTAT0 {
236
        address                 0x00b
237
        access_mode RO
238
        bit     TARGET          0x80    /* Board acting as target */
239
        bit     SELDO           0x40    /* Selection Done */
240
        bit     SELDI           0x20    /* Board has been selected */
241
        bit     SELINGO         0x10    /* Selection In Progress */
242
        bit     SWRAP           0x08    /* 24bit counter wrap */
243
        bit     IOERR           0x08    /* LVD Tranceiver mode changed */
244
        bit     SDONE           0x04    /* STCNT = 0x000000 */
245
        bit     SPIORDY         0x02    /* SCSI PIO Ready */
246
        bit     DMADONE         0x01    /* DMA transfer completed */
247
}
248
 
249
/*
250
 * Clear SCSI Interrupt 1 (p. 3-23)
251
 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
252
 */
253
register CLRSINT1 {
254
        address                 0x00c
255
        access_mode WO
256
        bit     CLRSELTIMEO     0x80
257
        bit     CLRATNO         0x40
258
        bit     CLRSCSIRSTI     0x20
259
        bit     CLRBUSFREE      0x08
260
        bit     CLRSCSIPERR     0x04
261
        bit     CLRPHASECHG     0x02
262
        bit     CLRREQINIT      0x01
263
}
264
 
265
/*
266
 * SCSI Status 1 (p. 3-24)
267
 */
268
register SSTAT1 {
269
        address                 0x00c
270
        access_mode RO
271
        bit     SELTO           0x80
272
        bit     ATNTARG         0x40
273
        bit     SCSIRSTI        0x20
274
        bit     PHASEMIS        0x10
275
        bit     BUSFREE         0x08
276
        bit     SCSIPERR        0x04
277
        bit     PHASECHG        0x02
278
        bit     REQINIT         0x01
279
}
280
 
281
/*
282
 * SCSI Status 2 (pp. 3-25,26)
283
 */
284
register SSTAT2 {
285
        address                 0x00d
286
        access_mode RO
287
        bit     OVERRUN         0x80
288
        bit     EXP_ACTIVE      0x10    /* SCSI Expander Active */
289
        mask    SFCNT           0x1f
290
}
291
 
292
/*
293
 * SCSI Status 3 (p. 3-26)
294
 */
295
register SSTAT3 {
296
        address                 0x00e
297
        access_mode RO
298
        mask    SCSICNT         0xf0
299
        mask    OFFCNT          0x0f
300
}
301
 
302
/*
303
 * SCSI ID for the aic7890/91 chips
304
 */
305
register SCSIID_ULTRA2 {
306
        address                 0x00f
307
        access_mode RW
308
        mask    TID             0xf0            /* Target ID mask */
309
        mask    OID             0x0f            /* Our ID mask */
310
}
311
 
312
/*
313
 * SCSI Interrupt Mode 1 (p. 3-28)
314
 * Setting any bit will enable the corresponding function
315
 * in SIMODE0 to interrupt via the IRQ pin.
316
 */
317
register SIMODE0 {
318
        address                 0x010
319
        access_mode RW
320
        bit     ENSELDO         0x40
321
        bit     ENSELDI         0x20
322
        bit     ENSELINGO       0x10
323
        bit     ENSWRAP         0x08
324
        bit     ENIOERR         0x08    /* LVD Tranceiver mode changes */
325
        bit     ENSDONE         0x04
326
        bit     ENSPIORDY       0x02
327
        bit     ENDMADONE       0x01
328
}
329
 
330
/*
331
 * SCSI Interrupt Mode 1 (pp. 3-28,29)
332
 * Setting any bit will enable the corresponding function
333
 * in SIMODE1 to interrupt via the IRQ pin.
334
 */
335
register SIMODE1 {
336
        address                 0x011
337
        access_mode RW
338
        bit     ENSELTIMO       0x80
339
        bit     ENATNTARG       0x40
340
        bit     ENSCSIRST       0x20
341
        bit     ENPHASEMIS      0x10
342
        bit     ENBUSFREE       0x08
343
        bit     ENSCSIPERR      0x04
344
        bit     ENPHASECHG      0x02
345
        bit     ENREQINIT       0x01
346
}
347
 
348
/*
349
 * SCSI Data Bus (High) (p. 3-29)
350
 * This register reads data on the SCSI Data bus directly.
351
 */
352
register SCSIBUSL {
353
        address                 0x012
354
        access_mode RO
355
}
356
 
357
register SCSIBUSH {
358
        address                 0x013
359
        access_mode RO
360
}
361
 
362
/*
363
 * SCSI/Host Address (p. 3-30)
364
 * These registers hold the host address for the byte about to be
365
 * transferred on the SCSI bus.  They are counted up in the same
366
 * manner as STCNT is counted down.  SHADDR should always be used
367
 * to determine the address of the last byte transferred since HADDR
368
 * can be skewed by write ahead.
369
 */
370
register SHADDR {
371
        address                 0x014
372
        size    4
373
        access_mode RO
374
}
375
 
376
/*
377
 * Selection Timeout Timer (p. 3-30)
378
 */
379
register SELTIMER {
380
        address                 0x018
381
        access_mode RW
382
        bit     STAGE6          0x20
383
        bit     STAGE5          0x10
384
        bit     STAGE4          0x08
385
        bit     STAGE3          0x04
386
        bit     STAGE2          0x02
387
        bit     STAGE1          0x01
388
}
389
 
390
/*
391
 * Selection/Reselection ID (p. 3-31)
392
 * Upper four bits are the device id.  The ONEBIT is set when the re/selecting
393
 * device did not set its own ID.
394
 */
395
register SELID {
396
        address                 0x019
397
        access_mode RW
398
        mask    SELID_MASK      0xf0
399
        bit     ONEBIT          0x08
400
}
401
 
402
/*
403
 * Serial Port I/O Cabability register (p. 4-95 aic7860 Data Book)
404
 * Indicates if external logic has been attached to the chip to
405
 * perform the tasks of accessing a serial eeprom, testing termination
406
 * strength, and performing cable detection.  On the aic7860, most of
407
 * these features are handled on chip, but on the aic7855 an attached
408
 * aic3800 does the grunt work.
409
 */
410
register SPIOCAP {
411
        address                 0x01b
412
        access_mode RW
413
        bit     SOFT1           0x80
414
        bit     SOFT0           0x40
415
        bit     SOFTCMDEN       0x20
416
        bit     HAS_BRDCTL      0x10    /* External Board control */
417
        bit     SEEPROM         0x08    /* External serial eeprom logic */
418
        bit     EEPROM          0x04    /* Writable external BIOS ROM */
419
        bit     ROM             0x02    /* Logic for accessing external ROM */
420
        bit     SSPIOCPS        0x01    /* Termination and cable detection */
421
}
422
 
423
/*
424
 * SCSI Block Control (p. 3-32)
425
 * Controls Bus type and channel selection.  In a twin channel configuration
426
 * addresses 0x00-0x1e are gated to the appropriate channel based on this
427
 * register.  SELWIDE allows for the coexistence of 8bit and 16bit devices
428
 * on a wide bus.
429
 */
430
register SBLKCTL {
431
        address                 0x01f
432
        access_mode RW
433
        bit     DIAGLEDEN       0x80    /* Aic78X0 only */
434
        bit     DIAGLEDON       0x40    /* Aic78X0 only */
435
        bit     AUTOFLUSHDIS    0x20
436
        bit     SELBUSB         0x08
437
        bit     ENAB40          0x08    /* LVD transceiver active */
438
        bit     ENAB20          0x04    /* SE/HVD transceiver active */
439
        bit     SELWIDE         0x02
440
        bit     XCVR            0x01    /* External transceiver active */
441
}
442
 
443
/*
444
 * Sequencer Control (p. 3-33)
445
 * Error detection mode and speed configuration
446
 */
447
register SEQCTL {
448
        address                 0x060
449
        access_mode RW
450
        bit     PERRORDIS       0x80
451
        bit     PAUSEDIS        0x40
452
        bit     FAILDIS         0x20
453
        bit     FASTMODE        0x10
454
        bit     BRKADRINTEN     0x08
455
        bit     STEP            0x04
456
        bit     SEQRESET        0x02
457
        bit     LOADRAM         0x01
458
}
459
 
460
/*
461
 * Sequencer RAM Data (p. 3-34)
462
 * Single byte window into the Scratch Ram area starting at the address
463
 * specified by SEQADDR0 and SEQADDR1.  To write a full word, simply write
464
 * four bytes in sucessesion.  The SEQADDRs will increment after the most
465
 * significant byte is written
466
 */
467
register SEQRAM {
468
        address                 0x061
469
        access_mode RW
470
}
471
 
472
/*
473
 * Sequencer Address Registers (p. 3-35)
474
 * Only the first bit of SEQADDR1 holds addressing information
475
 */
476
register SEQADDR0 {
477
        address                 0x062
478
        access_mode RW
479
}
480
 
481
register SEQADDR1 {
482
        address                 0x063
483
        access_mode RW
484
        mask    SEQADDR1_MASK   0x01
485
}
486
 
487
/*
488
 * Accumulator
489
 * We cheat by passing arguments in the Accumulator up to the kernel driver
490
 */
491
register ACCUM {
492
        address                 0x064
493
        access_mode RW
494
        accumulator
495
}
496
 
497
register SINDEX {
498
        address                 0x065
499
        access_mode RW
500
        sindex
501
}
502
 
503
register DINDEX {
504
        address                 0x066
505
        access_mode RW
506
}
507
 
508
register ALLONES {
509
        address                 0x069
510
        access_mode RO
511
        allones
512
}
513
 
514
register ALLZEROS {
515
        address                 0x06a
516
        access_mode RO
517
        allzeros
518
}
519
 
520
register NONE {
521
        address                 0x06a
522
        access_mode WO
523
        none
524
}
525
 
526
register FLAGS {
527
        address                 0x06b
528
        access_mode RO
529
        bit     ZERO            0x02
530
        bit     CARRY           0x01
531
}
532
 
533
register SINDIR {
534
        address                 0x06c
535
        access_mode RO
536
}
537
 
538
register DINDIR  {
539
        address                 0x06d
540
        access_mode WO
541
}
542
 
543
register FUNCTION1 {
544
        address                 0x06e
545
        access_mode RW
546
}
547
 
548
register STACK {
549
        address                 0x06f
550
        access_mode RO
551
}
552
 
553
/*
554
 * Board Control (p. 3-43)
555
 */
556
register BCTL {
557
        address                 0x084
558
        access_mode RW
559
        bit     ACE             0x08
560
        bit     ENABLE          0x01
561
}
562
 
563
register DSCOMMAND0 {
564
        address                 0x084
565
        access_mode RW
566
        bit     CACHETHEN       0x80
567
        bit     DPARCKEN        0x40
568
        bit     MPARCKEN        0x20
569
        bit     EXTREQLCK       0x10
570
        bit     INTSCBRAMSEL    0x08
571
        bit     RAMPS           0x04
572
        bit     USCBSIZE32      0x02
573
        bit     CIOPARCKEN      0x01
574
}
575
 
576
/*
577
 * On the aic78X0 chips, Board Control is replaced by the DSCommand
578
 * register (p. 4-64)
579
 */
580
register DSCOMMAND {
581
        address                 0x084
582
        access_mode RW
583
        bit     CACHETHEN       0x80    /* Cache Threshold enable */
584
        bit     DPARCKEN        0x40    /* Data Parity Check Enable */
585
        bit     MPARCKEN        0x20    /* Memory Parity Check Enable */
586
        bit     EXTREQLCK       0x10    /* External Request Lock */
587
}
588
 
589
/*
590
 * Bus On/Off Time (p. 3-44)
591
 */
592
register BUSTIME {
593
        address                 0x085
594
        access_mode RW
595
        mask    BOFF            0xf0
596
        mask    BON             0x0f
597
}
598
 
599
/*
600
 * Bus Speed (p. 3-45)
601
 */
602
register BUSSPD {
603
        address                 0x086
604
        access_mode RW
605
        mask    DFTHRSH         0xc0
606
        mask    STBOFF          0x38
607
        mask    STBON           0x07
608
        mask    DFTHRSH_100     0xc0
609
}
610
 
611
/*
612
 * Host Control (p. 3-47) R/W
613
 * Overall host control of the device.
614
 */
615
register HCNTRL {
616
        address                 0x087
617
        access_mode RW
618
        bit     POWRDN          0x40
619
        bit     SWINT           0x10
620
        bit     IRQMS           0x08
621
        bit     PAUSE           0x04
622
        bit     INTEN           0x02
623
        bit     CHIPRST         0x01
624
        bit     CHIPRSTACK      0x01
625
}
626
 
627
/*
628
 * Host Address (p. 3-48)
629
 * This register contains the address of the byte about
630
 * to be transferred across the host bus.
631
 */
632
register HADDR {
633
        address                 0x088
634
        size    4
635
        access_mode RW
636
}
637
 
638
register HCNT {
639
        address                 0x08c
640
        size    3
641
        access_mode RW
642
}
643
 
644
/*
645
 * SCB Pointer (p. 3-49)
646
 * Gate one of the four SCBs into the SCBARRAY window.
647
 */
648
register SCBPTR {
649
        address                 0x090
650
        access_mode RW
651
}
652
 
653
/*
654
 * Interrupt Status (p. 3-50)
655
 * Status for system interrupts
656
 */
657
register INTSTAT {
658
        address                 0x091
659
        access_mode RW
660
        bit     BRKADRINT 0x08
661
        bit     SCSIINT   0x04
662
        bit     CMDCMPLT  0x02
663
        bit     SEQINT    0x01
664
        mask    BAD_PHASE       SEQINT          /* unknown scsi bus phase */
665
        mask    SEND_REJECT     0x10|SEQINT     /* sending a message reject */
666
        mask    NO_IDENT        0x20|SEQINT     /* no IDENTIFY after reconnect*/
667
        mask    NO_MATCH        0x30|SEQINT     /* no cmd match for reconnect */
668
        mask    EXTENDED_MSG    0x40|SEQINT     /* Extended message received */
669
        mask    ABORT_REQUESTED 0x50|SEQINT     /* Reconect of aborted SCB */
670
        mask    REJECT_MSG      0x60|SEQINT     /* Reject message received */
671
        mask    BAD_STATUS      0x70|SEQINT     /* Bad status from target */
672
        mask    RESIDUAL        0x80|SEQINT     /* Residual byte count != 0 */
673
        mask    AWAITING_MSG    0xa0|SEQINT     /*
674
                                                 * Kernel requested to specify
675
                                                 * a message to this target
676
                                                 * (command was null), so tell
677
                                                 * it that it can fill the
678
                                                 * message buffer.
679
                                                 */
680
        mask    TRACEPOINT      0xb0|SEQINT
681
        mask    TRACEPOINT2     0xc0|SEQINT
682
        mask    MSGIN_PHASEMIS  0xd0|SEQINT     /*
683
                                                 * Target changed phase on us
684
                                                 * when we were expecting
685
                                                 * another msgin byte.
686
                                                 */
687
        mask    DATA_OVERRUN    0xe0|SEQINT     /*
688
                                                 * Target attempted to write
689
                                                 * beyond the bounds of its
690
                                                 * command.
691
                                                 */
692
 
693
        mask    SEQINT_MASK     0xf0|SEQINT     /* SEQINT Status Codes */
694
        mask    INT_PEND  (BRKADRINT|SEQINT|SCSIINT|CMDCMPLT)
695
}
696
 
697
/*
698
 * Hard Error (p. 3-53)
699
 * Reporting of catastrophic errors.  You usually cannot recover from
700
 * these without a full board reset.
701
 */
702
register ERROR {
703
        address                 0x092
704
        access_mode RO
705
        bit     CIOPARERR       0x80    /* Ultra2 only */
706
        bit     PCIERRSTAT      0x40    /* PCI only */
707
        bit     MPARERR         0x20    /* PCI only */
708
        bit     DPARERR         0x10    /* PCI only */
709
        bit     SQPARERR        0x08
710
        bit     ILLOPCODE       0x04
711
        bit     ILLSADDR        0x02
712
        bit     ILLHADDR        0x01
713
}
714
 
715
/*
716
 * Clear Interrupt Status (p. 3-52)
717
 */
718
register CLRINT {
719
        address                 0x092
720
        access_mode WO
721
        bit     CLRPARERR       0x10    /* PCI only */
722
        bit     CLRBRKADRINT    0x08
723
        bit     CLRSCSIINT      0x04
724
        bit     CLRCMDINT       0x02
725
        bit     CLRSEQINT       0x01
726
}
727
 
728
register DFCNTRL {
729
        address                 0x093
730
        access_mode RW
731
        bit     PRELOADEN       0x80    /* aic7890 only */
732
        bit     WIDEODD         0x40
733
        bit     SCSIEN          0x20
734
        bit     SDMAEN          0x10
735
        bit     SDMAENACK       0x10
736
        bit     HDMAEN          0x08
737
        bit     HDMAENACK       0x08
738
        bit     DIRECTION       0x04
739
        bit     FIFOFLUSH       0x02
740
        bit     FIFORESET       0x01
741
}
742
 
743
register DFSTATUS {
744
        address                 0x094
745
        access_mode RO
746
        bit     PRELOAD_AVAIL   0x80
747
        bit     DWORDEMP        0x20
748
        bit     MREQPEND        0x10
749
        bit     HDONE           0x08
750
        bit     DFTHRESH        0x04
751
        bit     FIFOFULL        0x02
752
        bit     FIFOEMP         0x01
753
}
754
 
755
register DFDAT {
756
        address                 0x099
757
        access_mode RW
758
}
759
 
760
/*
761
 * SCB Auto Increment (p. 3-59)
762
 * Byte offset into the SCB Array and an optional bit to allow auto
763
 * incrementing of the address during download and upload operations
764
 */
765
register SCBCNT {
766
        address                 0x09a
767
        access_mode RW
768
        bit     SCBAUTO         0x80
769
        mask    SCBCNT_MASK     0x1f
770
}
771
 
772
/*
773
 * Queue In FIFO (p. 3-60)
774
 * Input queue for queued SCBs (commands that the seqencer has yet to start)
775
 */
776
register QINFIFO {
777
        address                 0x09b
778
        access_mode RW
779
}
780
 
781
/*
782
 * Queue In Count (p. 3-60)
783
 * Number of queued SCBs
784
 */
785
register QINCNT {
786
        address                 0x09c
787
        access_mode RO
788
}
789
 
790
/*
791
 * Queue Out FIFO (p. 3-61)
792
 * Queue of SCBs that have completed and await the host
793
 */
794
register QOUTFIFO {
795
        address                 0x09d
796
        access_mode WO
797
}
798
 
799
/*
800
 * Queue Out Count (p. 3-61)
801
 * Number of queued SCBs in the Out FIFO
802
 */
803
register QOUTCNT {
804
        address                 0x09e
805
        access_mode RO
806
}
807
 
808
/*
809
 * Special Function
810
 */
811
register SFUNCT {
812
        address                 0x09f
813
        access_mode RW
814
}
815
 
816
/*
817
 * SCB Definition (p. 5-4)
818
 */
819
scb {
820
        address                 0x0a0
821
        SCB_CONTROL {
822
                size    1
823
                bit     MK_MESSAGE      0x80
824
                bit     DISCENB         0x40
825
                bit     TAG_ENB         0x20
826
                bit     DISCONNECTED    0x04
827
                mask    SCB_TAG_TYPE    0x03
828
        }
829
        SCB_TCL {
830
                size    1
831
                bit     SELBUSB         0x08
832
                mask    TID             0xf0
833
                mask    LID             0x07
834
        }
835
        SCB_TARGET_STATUS {
836
                size    1
837
        }
838
        SCB_SGCOUNT {
839
                size    1
840
        }
841
        SCB_SGPTR {
842
                size    4
843
        }
844
        SCB_RESID_SGCNT {
845
                size    1
846
        }
847
        SCB_RESID_DCNT  {
848
                size    3
849
        }
850
        SCB_DATAPTR {
851
                size    4
852
        }
853
        SCB_DATACNT {
854
                /*
855
                 * Really only 3 bytes, but padded to make
856
                 * the kernel's job easier.
857
                 */
858
                size    4
859
        }
860
        SCB_CMDPTR {
861
                size    4
862
        }
863
        SCB_CMDLEN {
864
                size    1
865
        }
866
        SCB_TAG {
867
                size    1
868
        }
869
        SCB_NEXT {
870
                size    1
871
        }
872
        SCB_PREV {
873
                size    1
874
        }
875
        SCB_BUSYTARGETS {
876
                size    4
877
        }
878
}
879
 
880
const   SG_SIZEOF       0x08            /* sizeof(struct ahc_dma) */
881
 
882
/* --------------------- AHA-2840-only definitions -------------------- */
883
 
884
register SEECTL_2840 {
885
        address                 0x0c0
886
        access_mode RW
887
        bit     CS_2840         0x04
888
        bit     CK_2840         0x02
889
        bit     DO_2840         0x01
890
}
891
 
892
register STATUS_2840 {
893
        address                 0x0c1
894
        access_mode RW
895
        bit     EEPROM_TF       0x80
896
        mask    BIOS_SEL        0x60
897
        mask    ADSEL           0x1e
898
        bit     DI_2840         0x01
899
}
900
 
901
/* --------------------- AIC-7870-only definitions -------------------- */
902
 
903
register DSPCISTATUS {
904
        address                 0x086
905
        mask    DFTHRSH_100     0xc0
906
}
907
 
908
register CCHADDR {
909
        address                 0x0E0
910
        size 8
911
}
912
 
913
register CCHCNT {
914
        address                 0x0E8
915
}
916
 
917
register CCSGRAM {
918
        address                 0x0E9
919
}
920
 
921
register CCSGADDR {
922
        address                 0x0EA
923
}
924
 
925
register CCSGCTL {
926
        address                 0x0EB
927
        bit     CCSGDONE        0x80
928
        bit     CCSGEN          0x08
929
        bit     FLAG            0x02
930
        bit     CCSGRESET       0x01
931
}
932
 
933
register CCSCBCNT {
934
        address                 0xEF
935
}
936
 
937
register CCSCBCTL {
938
        address                 0x0EE
939
        bit     CCSCBDONE       0x80
940
        bit     ARRDONE         0x40    /* SCB Array prefetch done */
941
        bit     CCARREN         0x10
942
        bit     CCSCBEN         0x08
943
        bit     CCSCBDIR        0x04
944
        bit     CCSCBRESET      0x01
945
}
946
 
947
register CCSCBADDR {
948
        address                 0x0ED
949
}
950
 
951
register CCSCBRAM {
952
        address                 0xEC
953
}
954
 
955
register CCSCBPTR {
956
        address                 0x0F1
957
}
958
 
959
register HNSCB_QOFF {
960
        address                 0x0F4
961
}
962
 
963
register SNSCB_QOFF {
964
        address                 0x0F6
965
}
966
 
967
register SDSCB_QOFF {
968
        address                 0x0F8
969
}
970
 
971
register QOFF_CTLSTA {
972
        address                 0x0FA
973
        bit     SCB_AVAIL       0x40
974
        bit     SNSCB_ROLLOVER  0x20
975
        bit     SDSCB_ROLLOVER  0x10
976
        mask    SCB_QSIZE       0x07
977
        mask    SCB_QSIZE_256   0x06
978
}
979
 
980
register DFF_THRSH {
981
        address                 0x0FB
982
        mask    WR_DFTHRSH      0x70
983
        mask    RD_DFTHRSH      0x07
984
        mask    RD_DFTHRSH_MIN  0x00
985
        mask    RD_DFTHRSH_25   0x01
986
        mask    RD_DFTHRSH_50   0x02
987
        mask    RD_DFTHRSH_63   0x03
988
        mask    RD_DFTHRSH_75   0x04
989
        mask    RD_DFTHRSH_85   0x05
990
        mask    RD_DFTHRSH_90   0x06
991
        mask    RD_DFTHRSH_MAX  0x07
992
        mask    WR_DFTHRSH_MIN  0x00
993
        mask    WR_DFTHRSH_25   0x10
994
        mask    WR_DFTHRSH_50   0x20
995
        mask    WR_DFTHRSH_63   0x30
996
        mask    WR_DFTHRSH_75   0x40
997
        mask    WR_DFTHRSH_85   0x50
998
        mask    WR_DFTHRSH_90   0x60
999
        mask    WR_DFTHRSH_MAX  0x70
1000
}
1001
 
1002
register SG_CACHEPTR {
1003
        access_mode RW
1004
        address                 0x0fc
1005
        mask    SG_USER_DATA    0xfc
1006
        bit     LAST_SEG        0x02
1007
        bit     LAST_SEG_DONE   0x01
1008
}
1009
 
1010
register BRDCTL {
1011
        address                 0x01d
1012
        bit     BRDDAT7         0x80
1013
        bit     BRDDAT6         0x40
1014
        bit     BRDDAT5         0x20
1015
        bit     BRDSTB          0x10
1016
        bit     BRDCS           0x08
1017
        bit     BRDRW           0x04
1018
        bit     BRDCTL1         0x02
1019
        bit     BRDCTL0         0x01
1020
        /* 7890 Definitions */
1021
        bit     BRDDAT4         0x10
1022
        bit     BRDDAT3         0x08
1023
        bit     BRDDAT2         0x04
1024
        bit     BRDRW_ULTRA2    0x02
1025
        bit     BRDSTB_ULTRA2   0x01
1026
}
1027
 
1028
/*
1029
 * Serial EEPROM Control (p. 4-92 in 7870 Databook)
1030
 * Controls the reading and writing of an external serial 1-bit
1031
 * EEPROM Device.  In order to access the serial EEPROM, you must
1032
 * first set the SEEMS bit that generates a request to the memory
1033
 * port for access to the serial EEPROM device.  When the memory
1034
 * port is not busy servicing another request, it reconfigures
1035
 * to allow access to the serial EEPROM.  When this happens, SEERDY
1036
 * gets set high to verify that the memory port access has been
1037
 * granted.
1038
 *
1039
 * After successful arbitration for the memory port, the SEECS bit of
1040
 * the SEECTL register is connected to the chip select.  The SEECK,
1041
 * SEEDO, and SEEDI are connected to the clock, data out, and data in
1042
 * lines respectively.  The SEERDY bit of SEECTL is useful in that it
1043
 * gives us an 800 nsec timer.  After a write to the SEECTL register,
1044
 * the SEERDY goes high 800 nsec later.  The one exception to this is
1045
 * when we first request access to the memory port.  The SEERDY goes
1046
 * high to signify that access has been granted and, for this case, has
1047
 * no implied timing.
1048
 *
1049
 * See 93cx6.c for detailed information on the protocol necessary to
1050
 * read the serial EEPROM.
1051
 */
1052
register SEECTL {
1053
        address                 0x01e
1054
        bit     EXTARBACK       0x80
1055
        bit     EXTARBREQ       0x40
1056
        bit     SEEMS           0x20
1057
        bit     SEERDY          0x10
1058
        bit     SEECS           0x08
1059
        bit     SEECK           0x04
1060
        bit     SEEDO           0x02
1061
        bit     SEEDI           0x01
1062
}
1063
/* ---------------------- Scratch RAM Offsets ------------------------- */
1064
/* These offsets are either to values that are initialized by the board's
1065
 * BIOS or are specified by the sequencer code.
1066
 *
1067
 * The host adapter card (at least the BIOS) uses 20-2f for SCSI
1068
 * device information, 32-33 and 5a-5f as well. As it turns out, the
1069
 * BIOS trashes 20-2f, writing the synchronous negotiation results
1070
 * on top of the BIOS values, so we re-use those for our per-target
1071
 * scratchspace (actually a value that can be copied directly into
1072
 * SCSIRATE).  The kernel driver will enable synchronous negotiation
1073
 * for all targets that have a value other than 0 in the lower four
1074
 * bits of the target scratch space.  This should work regardless of
1075
 * whether the bios has been installed.
1076
 */
1077
 
1078
scratch_ram {
1079
        address                 0x020
1080
 
1081
        /*
1082
         * 1 byte per target starting at this address for configuration values
1083
         */
1084
        TARG_SCSIRATE {
1085
                size            16
1086
        }
1087
        /*
1088
         * Bit vector of targets that have ULTRA enabled.
1089
         */
1090
        ULTRA_ENB {
1091
                size            2
1092
        }
1093
        /*
1094
         * Bit vector of targets that have disconnection disabled.
1095
         */
1096
        DISC_DSB {
1097
                size            2
1098
        }
1099
        /*
1100
         * Single byte buffer used to designate the type or message
1101
         * to send to a target.
1102
         */
1103
        MSG_OUT {
1104
                size            1
1105
        }
1106
        /* Parameters for DMA Logic */
1107
        DMAPARAMS {
1108
                size            1
1109
                bit     PRELOADEN       0x80
1110
                bit     WIDEODD         0x40
1111
                bit     SCSIEN          0x20
1112
                bit     SDMAEN          0x10
1113
                bit     SDMAENACK       0x10
1114
                bit     HDMAEN          0x08
1115
                bit     HDMAENACK       0x08
1116
                bit     DIRECTION       0x04
1117
                bit     FIFOFLUSH       0x02
1118
                bit     FIFORESET       0x01
1119
        }
1120
        SEQ_FLAGS {
1121
                size            1
1122
                bit     IDENTIFY_SEEN   0x80
1123
                bit     SCBPTR_VALID    0x20
1124
                bit     DPHASE          0x10
1125
                bit     AMTARGET        0x08
1126
                bit     WIDE_BUS        0x02
1127
                bit     TWIN_BUS        0x01
1128
        }
1129
        /*
1130
         * Temporary storage for the
1131
         * target/channel/lun of a
1132
         * reconnecting target
1133
         */
1134
        SAVED_TCL {
1135
                size            1
1136
        }
1137
        /* Working value of the number of SG segments left */
1138
        SG_COUNT {
1139
                size            1
1140
        }
1141
        /* Working value of SG pointer */
1142
        SG_NEXT {
1143
                size            4
1144
        }
1145
        /*
1146
         * The last bus phase as seen by the sequencer.
1147
         */
1148
        LASTPHASE {
1149
                size            1
1150
                bit     CDI             0x80
1151
                bit     IOI             0x40
1152
                bit     MSGI            0x20
1153
                mask    PHASE_MASK      CDI|IOI|MSGI
1154
                mask    P_DATAOUT       0x00
1155
                mask    P_DATAIN        IOI
1156
                mask    P_COMMAND       CDI
1157
                mask    P_MESGOUT       CDI|MSGI
1158
                mask    P_STATUS        CDI|IOI
1159
                mask    P_MESGIN        CDI|IOI|MSGI
1160
                mask    P_BUSFREE       0x01
1161
        }
1162
        /*
1163
         * head of list of SCBs awaiting
1164
         * selection
1165
         */
1166
        WAITING_SCBH {
1167
                size            1
1168
        }
1169
        /*
1170
         * head of list of SCBs that are
1171
         * disconnected.  Used for SCB
1172
         * paging.
1173
         */
1174
        DISCONNECTED_SCBH {
1175
                size            1
1176
        }
1177
        /*
1178
         * head of list of SCBs that are
1179
         * not in use.  Used for SCB paging.
1180
         */
1181
        FREE_SCBH {
1182
                size            1
1183
        }
1184
        /*
1185
         * Address of the hardware scb array in the host.
1186
         */
1187
        HSCB_ADDR {
1188
                size            4
1189
        }
1190
        /*
1191
         * Address of the 256 byte array storing the SCBID of outstanding
1192
         * untagged SCBs indexed by TCL.
1193
         */
1194
        SCBID_ADDR {
1195
                size            4
1196
        }
1197
        /*
1198
         * Address of the array of command descriptors used to store
1199
         * information about incoming selections.
1200
         */
1201
        TMODE_CMDADDR {
1202
                size            4
1203
        }
1204
        KERNEL_QINPOS {
1205
                size            1
1206
        }
1207
        QINPOS {
1208
                size            1
1209
        }
1210
        QOUTPOS {
1211
                size            1
1212
        }
1213
        /*
1214
         * Offset into the command descriptor array for the next
1215
         * available desciptor to use.
1216
         */
1217
        TMODE_CMDADDR_NEXT {
1218
                size            1
1219
        }
1220
        ARG_1 {
1221
                size            1
1222
                mask    SEND_MSG        0x80
1223
                mask    SEND_SENSE      0x40
1224
                mask    SEND_REJ        0x20
1225
                mask    MSGOUT_PHASEMIS 0x10
1226
                alias   RETURN_1
1227
        }
1228
        ARG_2 {
1229
                size            1
1230
                alias   RETURN_2
1231
        }
1232
 
1233
        /*
1234
         * Snapshot of MSG_OUT taken after each message is sent.
1235
         */
1236
        LAST_MSG {
1237
                size            1
1238
        }
1239
 
1240
        /*
1241
         * Number of times we have filled the CCSGRAM with prefetched
1242
         * SG elements.
1243
         */
1244
        PREFETCH_CNT {
1245
                size            1
1246
        }
1247
 
1248
 
1249
        /*
1250
         * These are reserved registers in the card's scratch ram.  Some of
1251
         * the values are specified in the AHA2742 technical reference manual
1252
         * and are initialized by the BIOS at boot time.
1253
         */
1254
        SCSICONF {
1255
                address         0x05a
1256
                size            1
1257
                bit     TERM_ENB        0x80
1258
                bit     RESET_SCSI      0x40
1259
                mask    HSCSIID         0x07    /* our SCSI ID */
1260
                mask    HWSCSIID        0x0f    /* our SCSI ID if Wide Bus */
1261
        }
1262
        HOSTCONF {
1263
                address         0x05d
1264
                size            1
1265
        }
1266
        HA_274_BIOSCTRL {
1267
                address         0x05f
1268
                size            1
1269
                mask    BIOSMODE                0x30
1270
                mask    BIOSDISABLED            0x30
1271
                bit     CHANNEL_B_PRIMARY       0x08
1272
        }
1273
        /*
1274
         * Per target SCSI offset values for Ultra2 controllers.
1275
         */
1276
        TARG_OFFSET {
1277
                address         0x070
1278
                size            16
1279
        }
1280
}
1281
 
1282
const SCB_LIST_NULL     0xff
1283
 
1284
const CCSGADDR_MAX      0x80
1285
const CCSGRAM_MAXSEGS   16
1286
 
1287
/* Offsets into the SCBID array where different data is stored */
1288
const UNTAGGEDSCB_OFFSET        0
1289
const QOUTFIFO_OFFSET           1
1290
const QINFIFO_OFFSET            2
1291
 
1292
/* WDTR Message values */
1293
const BUS_8_BIT                 0x00
1294
const BUS_16_BIT                0x01
1295
const BUS_32_BIT                0x02
1296
 
1297
/* Offset maximums */
1298
const MAX_OFFSET_8BIT           0x0f
1299
const MAX_OFFSET_16BIT          0x08
1300
const MAX_OFFSET_ULTRA2         0x7f
1301
const HOST_MSG                  0xff
1302
 
1303
/* Target mode command processing constants */
1304
const CMD_GROUP_CODE_SHIFT      0x05
1305
const CMD_GROUP0_BYTE_DELTA     -4
1306
const CMD_GROUP2_BYTE_DELTA     -6
1307
const CMD_GROUP4_BYTE_DELTA     4
1308
const CMD_GROUP5_BYTE_DELTA     11
1309
 
1310
/*
1311
 * Downloaded (kernel inserted) constants
1312
 */
1313
 
1314
/*
1315
 * Number of command descriptors in the command descriptor array.
1316
 */
1317
const TMODE_NUMCMDS     download

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.