// SPDX-License-Identifier: GPL-2.0 /* * Driver for Future Domain TMC-16x0 and TMC-3260 SCSI host adapters * Copyright 2019 Ondrej Zary * * Original driver by * Rickard E. Faith, faith@cs.unc.edu * * Future Domain BIOS versions supported for autodetect: * 2.0, 3.0, 3.2, 3.4 (1.0), 3.5 (2.0), 3.6, 3.61 * Chips supported: * TMC-1800, TMC-18C50, TMC-18C30, TMC-36C70 * Boards supported: * Future Domain TMC-1650, TMC-1660, TMC-1670, TMC-1680, TMC-1610M/MER/MEX * Future Domain TMC-3260 (PCI) * Quantum ISA-200S, ISA-250MG * Adaptec AHA-2920A (PCI) [BUT *NOT* AHA-2920C -- use aic7xxx instead] * IBM ? * * NOTE: * * The Adaptec AHA-2920C has an Adaptec AIC-7850 chip on it. * Use the aic7xxx driver for this board. * * The Adaptec AHA-2920A has a Future Domain chip on it, so this is the right * driver for that card. Unfortunately, the boxes will probably just say * "2920", so you'll have to look on the card for a Future Domain logo, or a * letter after the 2920. * * If you have a TMC-8xx or TMC-9xx board, then this is not the driver for * your board. * * DESCRIPTION: * * This is the Linux low-level SCSI driver for Future Domain TMC-1660/1680 * TMC-1650/1670, and TMC-3260 SCSI host adapters. The 1650 and 1670 have a * 25-pin external connector, whereas the 1660 and 1680 have a SCSI-2 50-pin * high-density external connector. The 1670 and 1680 have floppy disk * controllers built in. The TMC-3260 is a PCI bus card. * * Future Domain's older boards are based on the TMC-1800 chip, and this * driver was originally written for a TMC-1680 board with the TMC-1800 chip. * More recently, boards are being produced with the TMC-18C50 and TMC-18C30 * chips. * * Please note that the drive ordering that Future Domain implemented in BIOS * versions 3.4 and 3.5 is the opposite of the order (currently) used by the * rest of the SCSI industry. * * * REFERENCES USED: * * "TMC-1800 SCSI Chip Specification (FDC-1800T)", Future Domain Corporation, * 1990. * * "Technical Reference Manual: 18C50 SCSI Host Adapter Chip", Future Domain * Corporation, January 1992. * * "LXT SCSI Products: Specifications and OEM Technical Manual (Revision * B/September 1991)", Maxtor Corporation, 1991. * * "7213S product Manual (Revision P3)", Maxtor Corporation, 1992. * * "Draft Proposed American National Standard: Small Computer System * Interface - 2 (SCSI-2)", Global Engineering Documents. (X3T9.2/86-109, * revision 10h, October 17, 1991) * * Private communications, Drew Eckhardt (drew@cs.colorado.edu) and Eric * Youngdale (ericy@cais.com), 1992. * * Private communication, Tuong Le (Future Domain Engineering department), * 1994. (Disk geometry computations for Future Domain BIOS version 3.4, and * TMC-18C30 detection.) * * Hogan, Thom. The Programmer's PC Sourcebook. Microsoft Press, 1988. Page * 60 (2.39: Disk Partition Table Layout). * * "18C30 Technical Reference Manual", Future Domain Corporation, 1993, page * 6-1.
*/
/* * FIFO_COUNT: The host adapter has an 8K cache (host adapters based on the * 18C30 chip have a 2k cache). When this many 512 byte blocks are filled by * the SCSI device, an interrupt will be raised. Therefore, this could be as * low as 0, or as high as 16. Note, however, that values which are too high * or too low seem to prevent any interrupts from occurring, and thereby lock * up the machine.
*/ #define FIFO_COUNT 2 /* Number of 512 byte blocks before INTR */ #define PARITY_MASK ACTL_PAREN /* Parity enabled, 0 = disabled */
switch (id) { case 0x6127: return tmc1800; case 0x60e9: /* 18c50 or 18c30 */ break; default: return unknown;
}
/* Try to toggle 32-bit mode. This only works on an 18c30 chip. */
outb(CFG2_32BIT, port + REG_CFG2); if ((inb(port + REG_CFG2) & CFG2_32BIT)) {
outb(0, port + REG_CFG2); if ((inb(port + REG_CFG2) & CFG2_32BIT) == 0) return tmc18c30;
} /* If that failed, we are an 18c50. */ return tmc18c50;
}
staticint fdomain_test_loopback(int base)
{ int i;
for (i = 0; i < 255; i++) {
outb(i, base + REG_LOOPBACK); if (inb(base + REG_LOOPBACK) != i) return 1;
}
return 0;
}
staticvoid fdomain_reset(int base)
{
outb(BCTL_RST, base + REG_BCTL);
mdelay(20);
outb(0, base + REG_BCTL);
mdelay(1150);
outb(0, base + REG_MCTL);
outb(PARITY_MASK, base + REG_ACTL);
}
staticint fdomain_select(struct Scsi_Host *sh, int target)
{ int status; unsignedlong timeout; struct fdomain *fd = shost_priv(sh);
do {
status = inb(fd->base + REG_BSTAT); if (status & BSTAT_BSY) { /* Enable SCSI Bus */ /* (on error, should make bus idle with 0) */
outb(BCTL_BUSEN, fd->base + REG_BCTL); return 0;
}
mdelay(1);
} while (--timeout);
fdomain_make_bus_idle(fd); return 1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.