// 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, [email protected] * * 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 ([email protected]) and Eric * Youngdale ([email protected]), 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. */ #include <linux/module.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/pci.h> #include <linux/workqueue.h> #include <scsi/scsicam.h> #include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> #include "fdomain.h" /* * 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 … #define PARITY_MASK … enum chip_type { … }; struct fdomain { … }; static struct scsi_pointer *fdomain_scsi_pointer(struct scsi_cmnd *cmd) { … } static inline void fdomain_make_bus_idle(struct fdomain *fd) { … } static enum chip_type fdomain_identify(int port) { … } static int fdomain_test_loopback(int base) { … } static void fdomain_reset(int base) { … } static int fdomain_select(struct Scsi_Host *sh, int target) { … } static void fdomain_finish_cmd(struct fdomain *fd) { … } static void fdomain_read_data(struct scsi_cmnd *cmd) { … } static void fdomain_write_data(struct scsi_cmnd *cmd) { … } static void fdomain_work(struct work_struct *work) { … } static irqreturn_t fdomain_irq(int irq, void *dev_id) { … } static int fdomain_queue(struct Scsi_Host *sh, struct scsi_cmnd *cmd) { … } static int fdomain_abort(struct scsi_cmnd *cmd) { … } static int fdomain_host_reset(struct scsi_cmnd *cmd) { … } static int fdomain_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[]) { … } static const struct scsi_host_template fdomain_template = …; struct Scsi_Host *fdomain_create(int base, int irq, int this_id, struct device *dev) { … } EXPORT_SYMBOL_GPL(…); int fdomain_destroy(struct Scsi_Host *sh) { … } EXPORT_SYMBOL_GPL(…); #ifdef CONFIG_PM_SLEEP static int fdomain_resume(struct device *dev) { … } static SIMPLE_DEV_PM_OPS(fdomain_pm_ops, NULL, fdomain_resume); #endif /* CONFIG_PM_SLEEP */ MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …;