Annotation of Gnu-Mach/linux/src/drivers/scsi/t128.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Trantor T128/T128F/T228 defines
                      3:  *     Note : architecturally, the T100 and T128 are different and won't work
                      4:  *
                      5:  * Copyright 1993, Drew Eckhardt
                      6:  *     Visionary Computing
                      7:  *     (Unix and Linux consulting and custom programming)
                      8:  *     [email protected]
                      9:  *      +1 (303) 440-4894
                     10:  *
                     11:  * DISTRIBUTION RELEASE 3. 
                     12:  *
                     13:  * For more information, please consult 
                     14:  *
                     15:  * Trantor Systems, Ltd.
                     16:  * T128/T128F/T228 SCSI Host Adapter
                     17:  * Hardware Specifications
                     18:  * 
                     19:  * Trantor Systems, Ltd. 
                     20:  * 5415 Randall Place
                     21:  * Fremont, CA 94538
                     22:  * 1+ (415) 770-1400, FAX 1+ (415) 770-9910
                     23:  * 
                     24:  * and 
                     25:  *
                     26:  * NCR 5380 Family
                     27:  * SCSI Protocol Controller
                     28:  * Databook
                     29:  *
                     30:  * NCR Microelectronics
                     31:  * 1635 Aeroplaza Drive
                     32:  * Colorado Springs, CO 80916
                     33:  * 1+ (719) 578-3400
                     34:  * 1+ (800) 334-5454
                     35:  */
                     36: 
                     37: /*
                     38:  * $Log: t128.h,v $
                     39:  * Revision 1.1  1999/04/26 05:55:09  tb
                     40:  * 1998-11-30  OKUJI Yoshinori  <[email protected]>
                     41:  *
                     42:  *     Clean up linux emulation code to make it architecture-independent
                     43:  *     as much as possible.
                     44:  *
                     45:  *     * linux: Renamed from linuxdev.
                     46:  *     * Makefile.in (objfiles): Add linux.o instead of linuxdev.o.
                     47:  *     (MAKE): New variable. Used for the linux.o target.
                     48:  *     * configure.in: Add AC_CHECK_TOOL(MAKE, make).
                     49:  *     * i386/i386/spl.h: Include <i386/ipl.h>, for compatibility with
                     50:  *     OSF Mach 3.0. Suggested by Elgin Lee <[email protected]>.
                     51:  *     * linux/src: Renamed from linux/linux.
                     52:  *     * linux/dev: Renamed from linux/mach.
                     53:  *     * linux/Drivers.in (AC_INIT): Use dev/include/linux/autoconf.h,
                     54:  *     instead of mach/include/linux/autoconf.h.
                     55:  *     * Makefile.in (all): Target ../linux.o instead of ../linuxdev.o.
                     56:  *     * linux/dev/drivers/block/genhd.c: Include <machine/spl.h> instead
                     57:  *     of <i386/ipl.h>.
                     58:  *     * linux/dev/drivers/net/auto_irq.c: Remove unneeded header files,
                     59:  *     <i386/ipl.h> and <i386/pic.h>.
                     60:  *     * linux/dev/init/main.c: Many i386-dependent codes moved to ...
                     61:  *     * linux/dev/arch/i386/irq.c: ... here.
                     62:  *     * linux/dev/arch/i386/setup.c: New file.
                     63:  *     * linux/dev/arch/i386/linux_emul.h: Likewise.
                     64:  *     * linux/dev/arch/i386/glue/timer.c: Merged into sched.c.
                     65:  *     * linux/dev/arch/i386/glue/sched.c: Include <machine/spl.h> instead
                     66:  *     of <i386/ipl.h>, and moved to ...
                     67:  *     * linux/dev/kernel/sched.c: ... here.
                     68:  *     * linux/dev/arch/i386/glue/block.c: Include <machine/spl.h> and
                     69:  *     <linux_emul.h>, instead of i386-dependent header files, and
                     70:  *     moved to ...
                     71:  *     * linux/dev/glue/blocl.c: ... here.
                     72:  *     * linux/dev/arch/i386/glue/net.c: Include <machine/spl.h> and
                     73:  *     <linux_emul.h>, instead of i386-dependent header files, and
                     74:  *     moved to ...
                     75:  *     * linux/dev/glue/net.c: ... here.
                     76:  *     * linux/dev/arch/i386/glue/misc.c: Remove `x86' and moved to ...
                     77:  *     * linux/dev/glue/misc.c: ... here.
                     78:  *     * linux/dev/arch/i386/glue/kmem.c: Moved to ...
                     79:  *     * linux/dev/glue/kmem.c: ... here.
                     80:  *
                     81:  */
                     82: 
                     83: #ifndef T128_H
                     84: #define T128_H
                     85: 
                     86: #define T128_PUBLIC_RELEASE 3
                     87: 
                     88: #define TDEBUG_INIT    0x1
                     89: #define TDEBUG_TRANSFER 0x2
                     90: 
                     91: /*
                     92:  * The trantor boards are memory mapped. They use an NCR5380 or 
                     93:  * equivalent (my sample board had part second sourced from ZILOG).
                     94:  * NCR's recommended "Pseudo-DMA" architecture is used, where 
                     95:  * a PAL drives the DMA signals on the 5380 allowing fast, blind
                     96:  * transfers with proper handshaking. 
                     97:  */
                     98: 
                     99: /*
                    100:  * Note : a boot switch is provided for the purpose of informing the 
                    101:  * firmware to boot or not boot from attached SCSI devices.  So, I imagine
                    102:  * there are fewer people who've yanked the ROM like they do on the Seagate
                    103:  * to make bootup faster, and I'll probably use this for autodetection.
                    104:  */
                    105: #define T_ROM_OFFSET           0
                    106: 
                    107: /*
                    108:  * Note : my sample board *WAS NOT* populated with the SRAM, so this
                    109:  * can't be used for autodetection without a ROM present.
                    110:  */
                    111: #define T_RAM_OFFSET           0x1800
                    112: 
                    113: /*
                    114:  * All of the registers are allocated 32 bytes of address space, except
                    115:  * for the data register (read/write to/from the 5380 in pseudo-DMA mode)
                    116:  */ 
                    117: #define T_CONTROL_REG_OFFSET   0x1c00  /* rw */
                    118: #define T_CR_INT               0x10    /* Enable interrupts */
                    119: #define T_CR_CT                        0x02    /* Reset watchdog timer */
                    120: 
                    121: #define T_STATUS_REG_OFFSET    0x1c20  /* ro */
                    122: #define T_ST_BOOT              0x80    /* Boot switch */
                    123: #define T_ST_S3                        0x40    /* User settable switches, */
                    124: #define T_ST_S2                        0x20    /* read 0 when switch is on, 1 off */
                    125: #define T_ST_S1                        0x10
                    126: #define T_ST_PS2               0x08    /* Set for Microchannel 228 */
                    127: #define T_ST_RDY               0x04    /* 5380 DRQ */
                    128: #define T_ST_TIM               0x02    /* indicates 40us watchdog timer fired */
                    129: #define T_ST_ZERO              0x01    /* Always zero */
                    130: 
                    131: #define T_5380_OFFSET          0x1d00  /* 8 registers here, see NCR5380.h */
                    132: 
                    133: #define T_DATA_REG_OFFSET      0x1e00  /* rw 512 bytes long */
                    134: 
                    135: #ifndef ASM
                    136: int t128_abort(Scsi_Cmnd *);
                    137: int t128_biosparam(Disk *, kdev_t, int*);
                    138: int t128_detect(Scsi_Host_Template *);
                    139: int t128_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
                    140: int t128_reset(Scsi_Cmnd *, unsigned int reset_flags);
                    141: int t128_proc_info (char *buffer, char **start, off_t offset,
                    142:                   int length, int hostno, int inout);
                    143: 
                    144: #ifndef NULL
                    145: #define NULL 0
                    146: #endif
                    147: 
                    148: #ifndef CMD_PER_LUN
                    149: #define CMD_PER_LUN 2
                    150: #endif
                    151: 
                    152: #ifndef CAN_QUEUE
                    153: #define CAN_QUEUE 32 
                    154: #endif
                    155: 
                    156: /* 
                    157:  * I hadn't thought of this with the earlier drivers - but to prevent
                    158:  * macro definition conflicts, we shouldn't define all of the internal
                    159:  * macros when this is being used solely for the host stub.
                    160:  */
                    161: 
                    162: #if defined(HOSTS_C) || defined(MODULE)
                    163: 
                    164: #define TRANTOR_T128 {NULL, NULL, NULL, NULL, \
                    165:        "Trantor T128/T128F/T228", t128_detect, NULL,  \
                    166:        NULL,                                                   \
                    167:        NULL, t128_queue_command, t128_abort, t128_reset, NULL,         \
                    168:        t128_biosparam,                                                 \
                    169:        /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL,                  \
                    170:        /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
                    171: 
                    172: #endif
                    173: 
                    174: #ifndef HOSTS_C
                    175: 
                    176: #define NCR5380_implementation_fields \
                    177:     volatile unsigned char *base
                    178: 
                    179: #define NCR5380_local_declare() \
                    180:     volatile unsigned char *base
                    181: 
                    182: #define NCR5380_setup(instance) \
                    183:     base = (volatile unsigned char *) (instance)->base
                    184: 
                    185: #define T128_address(reg) (base + T_5380_OFFSET + ((reg) * 0x20))
                    186: 
                    187: #if !(TDEBUG & TDEBUG_TRANSFER) 
                    188: #define NCR5380_read(reg) (*(T128_address(reg)))
                    189: #define NCR5380_write(reg, value) (*(T128_address(reg)) = (value))
                    190: #else
                    191: #define NCR5380_read(reg)                                              \
                    192:     (((unsigned char) printk("scsi%d : read register %d at address %08x\n"\
                    193:     , instance->hostno, (reg), T128_address(reg))), *(T128_address(reg)))
                    194: 
                    195: #define NCR5380_write(reg, value) {                                    \
                    196:     printk("scsi%d : write %02x to register %d at address %08x\n",     \
                    197:            instance->hostno, (value), (reg), T128_address(reg));       \
                    198:     *(T128_address(reg)) = (value);                                    \
                    199: }
                    200: #endif
                    201: 
                    202: #define NCR5380_intr t128_intr
                    203: #define NCR5380_queue_command t128_queue_command
                    204: #define NCR5380_abort t128_abort
                    205: #define NCR5380_reset t128_reset
                    206: #define NCR5380_proc_info t128_proc_info
                    207: 
                    208: /* 15 14 12 10 7 5 3 
                    209:    1101 0100 1010 1000 */
                    210:    
                    211: #define T128_IRQS 0xc4a8 
                    212: 
                    213: #endif /* else def HOSTS_C */
                    214: #endif /* ndef ASM */
                    215: #endif /* T128_H */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.